<<< Assemblies and Instances | Chapters | Groups >>> |
A model can only be successfully imported if its topology can be expressed as valid Parasolid topology, and its geometry corresponds to valid Parasolid geometric types.
There are two routes for importing external model data. These are:
Which one to use in a given situation is dependent on whether the application knows the BREP topology of the model. When this is known use the BREP route. When the topology isn't known the data must be supplied in the form of trimmed surfaces (that is, as surfaces bounded by loops of surface parameter (SP) curves) in order to make use of the Trimmed Surface route.
To model successfully in Parasolid with externally created models, there are some requirements that the imported data must satisfy. This section explains these requirements.
To create an SP-curve from surface and uv-space B-spline data call PK_SPCURVE_create. The surface given to PK_SPCURVE_create can be any Parasolid surface provided that it is an orphan. It is permissible for this surface to contain parametric singularities.
You can simplify geometry using PK_BODY_simplify_geom or PK_FACE_simplify_geom. See Section 40.1, "Simplifying geometry", for more information.
Note: All SP-curves generated by Parasolid for its own use, e.g. during a PK_EDGE_set_precision operation, are non-rational quadratic curves. |
Figure 44-1 SP-curve in 3-space
Figure 44-2 SP-curve is G1 in 3-space, but not in uv-space
Figure 44-3 SP-curve with small hook
Figure 44-4 SP-curve with high curvature S-bend in the middle
It is extremely difficult to specify exact figures for the minimum radius of curvature which imported SP-curves should meet in order that Parasolid models with the part reliably. Therefore these previous examples are guidelines as to which configurations are likely to be problematic.
To create a sheet body, with a single face, from given surface geometry for the face and curve geometry for the edges, use PK_SURF_make_sheet_trimmed. Using this method of creation the topology of the resulting sheet is inferred from the geometry.
Faces in Parasolid obey a rule for determining on which side of a boundary the face lies. Namely:
"With the face normal upward and the tangent direction of the boundary curve forward, the area of surface within the face is on the left."
If the data supplied to PK_SURF_make_sheet_trimmed implies the area of the surface within the face is on the right then the face sense is automatically set such that the outward side of the face is the reverse side of the surface. This then restores the 'on the left' rule.
The front side of the sheet can, in any case, easily be switched using PK_BODY_reverse_orientation.
As PK_SURF_make_sheet_trimmed is designed for importing geometric data from other solid modelers which work to coarser accuracies than Parasolid, the geometry that is supplied need not conform to Parasolid's strict tolerances.
Figure 44-5 Trimmed curves part of whole loop
From this data Parasolid computes vertex point and tolerance:
Figure 44-6 Trimmed curves part of whole loop plus computed vertex and tolerance
P is the average centroid point computed using end of C1 and start of C2. The tolerance is the maximum distance of C1 or C2 away from P.
Note: If C1 and C2 do not follow on to within specified tolerances (as in the case in Figure 44-5) PK_SURF_make_sheet_trimmed does NOT attempt corrective action in the case where C2 is reversed accidentally with respect to C1. |
Figure 44-7 SP-curves within edge tolerance of sum of others with no common vertex
Where SP-curves do share a common vertex, the curves should not come within the appropriate edge tolerance sum of one another after separating at the vertex.
Figure 44-8 SP-curves within edge tolerance of sum of others with no common vertex
Figure 44-9 Edge E2 is wholly within E1 tolerance + E2 tolerance of E1
Note: All the configurations in Figs. 8, 9 and 10 can be detected by the means of the checking option
check_self_int
. |
Figure 44-10 Examples of SP-curves and their vertices
PK_SURF_make_sheet_trimmed has several levels of optional checking, which pick up the majority of the problems explained in this section when used. These are as follows:
check_wires
.
Note: Opposing and coincident (within tolerance) SP-curves should be supplied wherever wires are required. |
check_self_int
.
check_loops
. Some limited corrective action is taken to reverse loops going in the wrong direction, though this is NOT guaranteed to produce a valid sheet.If all input sheet bodies pass these checks, your application can do one of the following:
For details on both of these techniques, see Chapter 36, "Sheet Sewing".
Topology in the Parasolid form is created using one of the functions:
All of these functions take the same arguments which define the topological entities and the relations between them. The topological entities are defined by an array of classes. The allowed classes are:
The body is made up of all defined shells, the first of which must be the exterior shell.
In relations each topological entity is referred to by its index in the array of classes. Each relation is defined by a parent, a child and a sense. Sense is only meaningful when the parent is of PK_CLASS_loop and the child is of PK_CLASS_edge. Note that every shell defined should be closed, and that this means that open wire and sheet bodies should have additional back faces to form a closed shell. When creating the topology for a wire, PK_BODY_create_wire_topology requires 1 or 2 faces, but these are deleted in the result. However, when creating an open sheet the extra back faces are retained in the result and should be removed using PK_FACE_delete_from_sheet_body.
For further details of the permitted classes and numbers of children and parents for the various body types see the description of the appropriate PK_BODY_create_<body_type>_topology function in the Parasolid PK Programming Reference manual.
The arguments are checked to determine whether they define valid Parasolid topology:
The entities and relations specified in the arguments need to correspond to the model in the external system, although in some cases it may be necessary and possible to add or delete some items; for example, faces without an attached surface on sheets or isolated vertex-loops.
There is an extensive range of primary geometry functions. The majority of these have names of the form PK_<GEOM>_create, for example:
B-geometry can also be created from spline data or piecewise data using:
As well as these there is a wide range of functions of the form PK_ <GEOM>_make_ <something> which make geometry from other geometry.
You can simplify geometry using PK_BODY_simplify_geom or PK_FACE_simplify_geom. See Section 40.1, "Simplifying geometry", for more information.
To create a valid body, geometry of the correct class must be attached to all of its vertices, edges and faces; these entities having been returned by the appropriate PK_BODY_create_<body_type>_topology function. It is recommended that all geometry be made construction geometry of the body using PK_PART_add_geoms before being attached to particular topological entities.
The geometry should be attached to topology as follows (the order is arbitrary):
Care must be taken to ensure that curve directions and surface normal directions are correct. Parasolid conventions regarding curve directions and surface normal directions are described in Chapter 3, "Model Structure". Curve direction may be determined by calling PK_CURVE_eval and reversed by calling PK_CURVE_make_curve_reversed if necessary. Surface normal direction may be determined by calling PK_SURF_eval_with_normal. When a surface is attached to a face using PK_FACE_attach_surfs the application must indicate whether the surface normal is in the same or opposite direction to that of the face normal.
To minimize storage requirements and ensure that SPCurves refer to surfaces attached to faces it is recommended that PK_BODY_share_geom is called once all geometry has been attached.
After the geometry has been attached, the part may need to be repaired to ensure that Parasolid tolerances are met as follows:
If desired, PK_EDGE_reset_precision may be called on the edges. This attempts to compute accurate edge curves for non-tangent edges by intersecting the adjacent surfaces. Alternatively, the edges may be left with local tolerances.
To construct the topology of a box
A box can be split into 33 topological entities, these are:
The
classes
argument to PK_BODY_create_solid_topology is an array of 33 tokens of type PK_class_t.
There are 60 relations, these are:
index | value | index | value |
---|---|---|---|
Note: Since in this case each face only has a single loop, the loop index is just shown with each face. |
The full set of relations is as follows
parents | children | senses | relation |
---|---|---|---|
The above information may be passed to either PK_BODY_create_solid_topology or PK_BODY_create_sheet_topology to create either a solid or a closed sheet respectively.
To construct the topology of a cylindrical body
A solid cylinder consists of 10 topological entities. These are:
The
classes
argument to PK_BODY_create_solid_topology is an array of 10 tokens of type PK_CLASS_t.
There are 11 relations. These are:
index | value | index | value |
---|---|---|---|
The full set of relations is as follows:
parents | children | senses | relation |
---|---|---|---|
The above information may be passed to either PK_BODY_create_solid_topology or PK_BODY_create_sheet_topology to create either a solid or a closed sheet respectively.
In KID form, the complete creation of a solid cylinder may be written as:
To construct the topology of a conical body
A complete cone with zero radius at one end has different topology to a truncated cone with non-zero radii at each end. The latter has the same topology as a cylinder; in the former there are only two faces, one planar and one conical. One of the loops bounding the conical face is degenerate, containing no edges but just a single vertex.
A complete solid cone consists of 8 topological entities. These are:
The
classes
argument to PK_BODY_create_solid_topology is an array of 8 tokens of type PK_CLASS_t.
There are 8 relations. These are:
index | value | index | value |
---|---|---|---|
The full set of relations is as follows:
parents | children | senses | relation |
---|---|---|---|
The above information may be passed to either PK_BODY_create_solid_topology or PK_BODY_create_sheet_topology to create either a solid or a closed sheet respectively.
In KID form, the complete creation of a solid cone may be written as:
To construct the topology of a spherical or toroidal body.
A spherical and toroidal body have the same topology, consisting of only a shell and a face
A spherical or toroidal body contains 2 topological entities. These are:
The
classes
argument to PK_BODY_create_solid_topology is an array of 2 tokens of type PK_CLASS_t.
index | value |
---|---|
parents | children | senses | relation |
---|---|---|---|
The above information may be passed to either PK_BODY_create_solid_topology or PK_BODY_create_sheet_topology to create either a solid or a closed sheet respectively.
To complete the body a sphere or torus must be attached to the single face.
To construct the topology of a circular sheet
Sheet bodies must be defined with faces on both sides although the unused faces must be deleted before geometry is attached.
A circular sheet contains 6 topological entities. These are:
The
classes
argument to PK_BODY_create_sheet_topology is an array of 6 tokens of type PK_CLASS_t.
index | value |
---|---|
parents | children | senses | relation |
---|---|---|---|
Before any geometry is attached to the body, the unused face must be removed using PK_FACE_delete_from_sheet_body.
In KID form, the complete creation of a circular sheet may be written as:
To construct the topology of a circular wire
Wire topology is defined with a single face. If the wire is closed then the face has two loops which run in opposite directions around the wire.
A circular wire contains 5 topological entities. These are:
The
classes
argument to PK_BODY_create_wire_topology is an array of 5
index | value |
---|---|
parents | children | senses | relation |
---|---|---|---|
The body created by PK_BODY_create_wire_topology has no face or loops. The returned
topols
corresponding to these
classes
are set to PK_ENTITY_null.
In KID form, the complete creation of a circular sheet may be written as:
To construct the topology of a linear wire
Wire topology is defined with a single face. If the wire is open then there is a single loop which runs from one end of the loop to the other and back again.
A linear wire contains 6 topological entities. These are:
The
classes
argument to PK_BODY_create_wire_topology is an array of 6 tokens of type PK_CLASS_t.
index | value | index | value |
---|---|---|---|
parents | children | senses | relation |
---|---|---|---|
The body created by PK_BODY_create_wire_topology has no face or loop. The returned
topols
corresponding to these
classes
are set to PK_ENTITY_null.
To construct the topology of a tetrahedron
A tetrahedron has 19 topological entities. These are:
The
classes
argument to PK_BODY_create_solid_topology is an array of 19 tokens of type PK_CLASS_t.
There are 32 relations. These are:
index | value | index | value |
---|---|---|---|
Note: Since in this case each face only has a single loop, the loop index is just shown with each face. |
The full set of relations is as follows:
parents | children | senses | relation |
---|---|---|---|
The above information may be passed to either PK_BODY_create_solid_topology or PK_BODY_create_sheet_topology to create either a solid or a closed sheet respectively.
In KID form, the complete creation of a solid tetrahedron may be written as:
( setq create_result ( pk_body_create_solid_topology ´( PK_CLASS_shell PK_CLASS_face PK_CLASS_face PK_CLASS_face PK_CLASS_face PK_CLASS_loop PK_CLASS_loop PK_CLASS_loop PK_CLASS_loop PK_CLASS_edge PK_CLASS_edge PK_CLASS_edge PK_CLASS_edge PK_CLASS_edge PK_CLASS_edge PK_CLASS_vertex PK_CLASS_vertex PK_CLASS_vertex PK_CLASS_vertex) ´( 0 0 0 0 1 2 3 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 10 10 11 11 12 12 13 13 14 14) ´( 1 2 3 4 5 6 7 8 9 10 11 9 14 12 10 12 13 11 13 14 15 16 16 17 17 15 16 18 17 18 15 18) ´( PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_positive_c PK_TOPOL_sense_negative_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c PK_TOPOL_sense_none_c)))
( setq topols ( element 2 create_result ) ) ( setq face_1 ( element 2 topols ) ) ( setq face_2 ( element 3 topols ) ) ( setq face_3 ( element 4 topols ) ) ( setq face_4 ( element 5 topols ) ) ( setq edge_9 ( element 10 topols ) ) ( setq edge_10 ( element 11 topols ) ) ( setq edge_11 ( element 12 topols ) ) ( setq edge_12 ( element 13 topols ) ) ( setq edge_13 ( element 14 topols ) ) ( setq edge_14 ( element 15 topols ) ) ( setq vertex_15 ( element 16 topols ) ) ( setq vertex_16 ( element 17 topols ) ) ( setq vertex_17 ( element 18 topols ) ) ( setq vertex_18 ( element 19 topols ) ) ( setq line_9 ( pk_line_create ´( ( (0 0 0) (1 0 0) ) ) ) )
( setq line_10 ( pk_line_create ´( ( (1 0 0) (-0.707106781187 0.707106781187 0) ))))
( setq line_11 ( pk_line_create ´( ( (0 1 0) (0 -1 0) ) ) ) ) ( setq line_12 ( pk_line_create ´( ( (1 0 0) (-0.707106781187 0 0.707106781187) ))))
( setq line_13 ( pk_line_create ´( ( (0 1 0) (0 -0.707106781187 0.707106781187) ))))
( setq line_14 ( pk_line_create ´( ( (0 0 0) (0 0 1) ) ) ) ) ( setq point_15 ( pk_point_create ´( (0 0 0) ) ) ) ( setq point_16 ( pk_point_create ´( (1 0 0) ) ) ) ( setq point_17 ( pk_point_create ´( (0 1 0) ) ) ) ( setq point_18 ( pk_point_create ´( (0 0 1) ) ) )
( pk_vertex_attach_points ( list vertex_15 vertex_16 vertex_17 vertex_18 ) ( list point_15 point_16 point_17 point_18 )
( pk_edge_attach_curves ( list edge_9 edge_10 edge_11 edge_12 edge_13 edge_14 ) ( list line_9 line_10 line_11 line_12 line_13 line_14 )
( pk_face_attach_surf_fitting face_1 nil ) ( pk_face_attach_surf_fitting face_2 nil ) ( pk_face_attach_surf_fitting face_3 nil ) ( pk_face_attach_surf_fitting face_4 nil )
By convention, in Parasolid all face normals point out of the material of the body, for faces bounding voids this means into the void. Face normals are determined by:
The sense of a face is set by the
senses
argument to PK_FACE_attach_surfs:
In Parasolid, the face of a loop is on its left, when looking from outside the material of the body and moving in the loop direction.
If the modeler from which a body is being imported has the opposite convention, all loop directions need to be reversed. This is done by either:
All Parasolid bodies that are created in a session where PK_SESSION_set_general_topology has not been run must be manifold, objects such as T-sheets or solid regions meeting at a point are not permitted.
For further information on manifold bodies and generalized topology, see Chapter 6, "Manifold Bodies" and Chapter 7, "General Bodies".
The B-curve of an edge must be G1 continuous. It can have multi-segments so long as it is G1 continuous. If a B-curve is not G1 continuous it needs to be split at the G1 discontinuities, each of which can be attached to a separate edge.
Note: The following method for mending imported data has been retained as backup to the method previously explained in this chapter and for clarity/compatibility with the v4.0 documentation and is only available through the Kernel Interface (KI) routine MENDEN. |
Models that have been imported into Parasolid may not satisfy Parasolid's requirements for accuracy and consistency between topology and geometry. Such models may be mended to Parasolid precision using the KI routine MENDEN.
MENDEN accepts imported bodies and attempt to recalculate edge and vertex geometries to Parasolid tolerance. In doing so, use is made of the user-specified geometry originally attached to the model, so success depends to some extent on the accuracy of the initial data. It is also assumed that during construction of the imported model, surfaces have been attached to faces with the correct sense, and that curves have been attached to edges or fins in the correct direction.
If the recalculation of edge and vertex geometry is successful, MENDEN negates shells of the body if this is necessary.
MENDEN returns a token to indicate whether or not all edge and vertex geometry has been successfully recalculated. If it has, this means only that the body is accurate to Parasolid tolerance; not that it is a valid body. A successful call to MENDEN should therefore always be followed by a call to PK_BODY_check.
If MENDEN does not succeed in recalculating all the edges and vertex geometry, lists containing the tags of the faulty edges and vertices together with lists of tokens indicating the reason for failure are returned. Using this information a second attempt at mending the model can be made by replacing geometry in the vicinity of the faulty edges and vertices. The complete body, or just an appropriate list of edges can then be supplied to MENDEN again. If the latter is supplied, care must be taken to include:
If MENDEN does not successfully recalculate all edge and vertex geometry, the body remains user-specified and only limited functionality is available to it.
The mending process is designed to tighten up models to Parasolid tolerance so that full Parasolid functionality is available to them. Success however is not guaranteed, and there are certain conditions under which the mending process is likely or certain to fail.
The limitations on sheet bodies arise due to problems projecting curves onto surfaces. This occurs in other situations as well, for example, if the surfaces adjacent to an edge of the body are coincident. Near tangencies are problematic for different reasons, as described in the following examples.
A model consisting of a cylinder topped by a hemisphere of approximately equal radius.
Figure 44-11 Cylinder topped by a hemisphere
If the sphere is slightly too small, the spherical and cylindrical surfaces may not intersect within Parasolid tolerance, so that no replacement curve can be calculated for the edge adjacent to these surfaces. This edge consequently appears in the list of faulty edges returned by MENDEN.
Two cylinders with approximately parallel axes and equal radii joined end to end, with a circular ring edge at the join.
Figure 44-12 Two cylinders end to end with approximately parallel axes
If the axes of the cylinders are not sufficiently in alignment to be considered by Parasolid as parallel, the intersection of the two cylindrical surfaces produces a set of semi-ellipses rather than a circle. The supplied topology is then inadequate and again the edge fails to mend.
There are also limitations on the amount of missing geometry that MENDEN allows. If there is insufficient geometry on a model, the mending process does not begin and MENDEN simply returns an error. The following rules apply:
These restrictions apply whether the whole body or just a list of edges from a body are supplied to MENDEN.
A further limitation of the mending process is that it assumes that the direction of curves and surface senses are correct. If any curves or surfaces have been attached wrongly, so that edge directions and face normals are inconsistent, mending proceeds regardless. However, even if the mend is successful, the resulting body is invalid and fails the checks imposed by PK_BODY_check.
<<< Assemblies and Instances | Chapters | Groups >>> |