api_intro_1
api_intro_1
CIRCLE BCURVE
CYL CONE PLANE SPHERE TORUS
ELLIPSE SPCURVE
BSURF BLENDSF OFFSET SWEPT SPUN
LINE PLINE
MESH ICURVE
Tags
Every entity has a unique tag
Used for input and return arguments to/from
the PK functions
Integer variables
Created and assigned only by Parasolid
Not reused - unique within a session
Special tags: PK_ENTITY_null
Tokens
Used by Parasolid and the application to communicate
information
▪ E.g. to specify optional behaviour during modeling operations
Positive integer values
Declared as constants in the ‘.h include’ file
Should be referred to by their enumerator not their
integer value
Special Tokens: PK_LOGICAL_true, PK_LOGICAL_false
Error codes
Communicates success or failure of a routine
Return value of a PK function
Should not be referred to by their value
Used by the application to specify the behavior of a PK function
Of the form PK_***_o_t
Must be initialized before use to default values
▪ Macros of the form PK_***_o_m provided for this purpose
Fields can subsequently be set to non-default values using dotted
pairs.
First field is the version number (o_t_version)
▪ Should never be set/altered by the application
PK_SESSION_start_o_t sessionOpts;
PK_SESSION_start_o_m(sessionOpts);
sessionOpts.journal_file = “journal”;
PK_SESSION_start(&sessionOpts);
PK_CYL_t cylinder;
PK_CYL_sf_t cyl_sf;
Used by the application &
Parasolid to store the cyl_sf.basis_set.location.coord[0] = 1.0;
standard definition of cyl_sf.basis_set.location.coord[1] = 2.0;
Parasolid entities cyl_sf.basis_set.location.coord[2] = 3.0;
Contain the definition of cyl_sf.basis_set.axis.coord[0] = 1.0;
surfaces, curves etc. cyl_sf.basis_set.axis.coord[1] = 0.0;
Input & output functions cyl_sf.basis_set.axis.coord[2] = 0.0;
take the same standard cyl_sf.basis_set.ref_direction.coord[0] = 0.0;
forms. cyl_sf.basis_set.ref_direction.coord[1] = 1.0;
▪ e.g. PK_CYL_sf_t is used by cyl_sf.basis_set.ref_direction.coord[2] = 0.0;
both PK_CYL_create and cyl_sf.radius = 5;
PK_CYL_ask.
PK_CYL_create(&cyl_sf, &cylinder);
Some PK functions pass information back to
application using return structures.
▪ Indicated by PK…_r_t in declaration
▪ e.g. PK_TOPOL_track_r_t
Most have equivalent functions to free
memory allocated to structure
▪ Indicated by PK_…_r_f
▪ e.g. PK_TOPOL_track_r_f
Used if the length of a returned array is unknown at run-time
The application can register functions to manage this memory
Denoted in the documentation by at least two levels of indirection,
e.g. PK_FACE_t**
▪ two levels may be split
Where indicated the argument is optional
▪ Application can pass NULL
Such memory can be freed using PK_MEMORY_free
PK_BODY_t body;
int n_faces;
PK_FACE_t* faces;
Shell
Face
Face Surface
Groups Edge
Loop
Face
Loop normal
Edge
Curve Vertex
Transform Fin Fins
Vertex Point
Curve
Fin1 Face1
Edge
Edge Face2
Fin2 Face1
Face2 Fin1 Fin2
Tolerant Model
Tolerant edge
Face1 Face2
Fin1 Fin2
SP-curve1 SP-curve2
A part refers to a body or an assembly
Minimal body Wire
‘Zero dimensional’ ‘One dimensional’
A point in space One or more sets of simply-
One void region, shell, loop, vertex connected edges
Created from a point using No more than two edges at
PK_POINT_make_minumum_body any vertex
Acorn One void region, one shell
The same as Minimal bodies except
they can have multiple vertices
▪ Orphan
▪ Not incorporated in a part
▪ Associated with the partition
Connected geometry
Inquiring principle geometry
▪ PK_EDGE_ask_geometry
▪ PK_FIN_ask_geometry
Inquiring construction geometry
▪ PK_PART_ask_construction_<geoms>
▪ Can be surfaces, curves or points
Defining and removing connections
▪ PK_PART_add_geoms
▪ PK_PART_remove_geoms
Orphan geometry
PK_PARTITION_ask_geoms
▪ Enquire orphan geometry
General
Definition depends on other geometry
Examples include intersection curves and SP-
curves
May be incorporated in a part or orphan
Created implicitly as a result of another
modeling operation
Inquiry
PK_GEOM_ask_dependents
▪ Returns geometry referenced by input geometry
PK_GEOM_ask_geom_owners
▪ Returns geometry that references input geometry
Primitive Creation
▪ Code Example “Primitive Forms”
B-Geometry
▪ Code example “BGeometry”, “BGeometry
Creation”, “Create BCurve From Piecewise
Standard Form”
Geometry types
Primitive creation
B-geometry
Geometric connections
Dependent geometry
Further information
Class structure
Data connections
Data relationships
Topological
Geometric
Model analysis
▪ Validity
Further Information
Class Structure
PK_ENTITY_is, PK_ENTITY_is_<object> - is the given argument
an entity? Is it an entity of class <object>?
PK_ENTITY_ask_class - which class does entity belong to?
PK_<OBJECT>_ask_<object> - e.g. PK_FACE_ask_surf
Data Connections
Topological Relationships - PK_BODY_ask_edges,
PK_BODY_ask_vertices
Topological/Geometric Relationships - PK_FACE_ask_surf,
PK_EDGE_ask_curve
Session management relationships - PK_PARTITION_ask_pmarks
Data Relationships
PK_FACE_ask_oriented_surf/ PK_EDGE_ask_oriented_curve
▪ Returns surface/curve and logical flag
Regions Loops
PK_REGION_is_solid PK_LOOP_ask_type
Shells Fins
PK_SHELL_find_sign PK_FIN_ask_type
PK_SHELL_ask_type Vertices
Bodies PK_VERTEX_ask_type
PK_BODY_ask_type
Edges
PK_EDGE_ask_type
▪ Returns information about
vertex, enclosure and fins
Parameter space to 3D vector
PK_CURVE_eval, PK_SURF_eval
▪ Supply curve\surface parameter(s), returns point and
derivatives
PK_CURVE_eval_with_tangent
PK_SURF_eval_with_normal
▪ Additionally return curve tangent/surface normal
PK_CURVE_eval_handed,
PK_CURVE_eval_with_tan_handed..etc…
▪ Additionally takes ‘hand’ direction
3D vector to parameter space
PK_CURVE_parameterise_vector,
PK_SURF_parameterise_vector
Parameterisation
PK_CURVE_ask_interval, PK_SURF_ask_params
Curvature
Curves
▪ PK_CURVE_eval_curvature
▪ Supply curve and curve parameter
▪ Returns
▪ tangent direction, normal direction, binormal direction
▪ curvature
Surfaces
▪ PK_SURF_eval_curvature
▪ Supply surface and surface parameters
▪ Returns
▪ surface normal, principal directions
▪ principal curvatures
Containment
PK_CURVE_find_non_aligned_box,
PK_SURF_find_non_aligned_box
▪ Returns non-axis aligned boxes in the form:
▪ Box centre
▪ Box axis
▪ Box width in each axis direction
▪ Box dimension Equivalence
Equivalence
PK_GEOM_is_coincident
▪ Not guaranteed to detect equivalence, does not
incorrectly claim equivalence
Discrete representation of a
curve
PK_CURVE_output_vectors Angular Tolerance
▪ Enable discrete
representation of curve
▪ Outputs coordinates and
optionally parameterisation
of points on curve Chordal Tolerance
▪ Accuracy of sample points
can be controlled using curve
tolerances
Step Length Tolerance
Topology Containment
PK_TOPOL_find_box
▪ Used on assemblies, bodies, faces,
edges
▪ Box limits defined by two position
vectors
▪ Box is aligned with the axes
▪ Box is guaranteed to contain the entity
Point Containment
PK_BODY_contains_vector/ Inside
PK_FACE_contains_vectors
▪ Determines whether the point lies
▪ Inside/outside/on entity boundary
▪ Point may be vector or parameters
▪ Loops may be specified for faces
▪ Topology is returned
Outside
Closest Approach
Received
PK_TOPOL_range***, PK_GEOM_range*** position
▪ Finds the closest distance between two entities
▪ Can optionally supply
▪ Upper and lower bound, estimate Global Minimum
▪ Returns
▪ Entity and position vector on the entity
▪ Single (global) or all local solutions
▪ Minimum distance(s)
Tolerant Coincidence Received surface
PK_FACE_is_coincident
▪ Receives two faces and tolerance
▪ Returns details on the coincidence, a point where
the faces are not coincident
Clash Detection
PK_TOPOL_clash - Clash topologies
▪ Detects every clash between target and tool lists
▪ Entities can be clashed with their owning bodies
▪ Can find only first or all clashes
▪ The clash can be further classified into :
▪ Containment, contact, interference
Intersections
Can calculate intersections between pairs of
▪ Curves, surfaces, faces or any combination
▪ Of the form PK_XXX_intersect_xxx
Functions can be optimised with options for:
▪ Parametric Box, 3D box, Common surface (curves
only)
Mass Properties - PK_TOPOL_eval_mass_props
Edge Length
Face Perimeter, Area, CofG
Wire Body Length, Mass
Sheet Body Circumference, Surface area, Mass, CofG
Solid Body Surface Area, Mass, CofG, Moments of
Assembly Inertia
General
▪ In general, operations on valid models either produce a valid
model or return a sensible failure code
▪ A part can become invalid:
▪ As a result of a local operation when local checking has been turned off
▪ As a direct result of the inputs to the calling operation
▪ At an intermediate stage of a two step process
▪ After importing data
PK_BODY_check - sequentially checks a body for:
▪ Corrupt data-structure, invalid geometry, consistency between
topology and geometry, invalid topology
Other functions:
▪ PK_FACE_check, PK_EDGE_check, PK_GEOM_check,
PK_TRANSF_check
Topological
▪ Code example “Model Structure”
Geometric
▪ Code example “Evaluation”
Model analysis
▪ Code examples:
▪ “Clashing”
▪ “Mass Props”
▪ “Picking”
▪ “Validity”
Class structure
Data connections
Data relationships
Topological
Geometric
Model analysis
▪ Validity
Further Information
Calling Parasolid
Model Representation
Geometry
Inquiries