Enquiry And Output Functions   

<<< Introduction To Model Interrogation Chapters Mass Properties >>>

Contents

[back to top]


26.1 Introduction

The object of this chapter is to list and where necessary explain briefly what each enquiry and output function does so that you can decide which are most appropriate in a particular situation.

For a full description of each function, refer to the relevant Parasolid Programming Reference Manual.

[back to top]


26.2 Topological enquiries

These functions either classify entities into various types where they are concerned with classifying topological entities, without regard to the geometry associated with them, or they make generalized enquiries of topological entities. Other sections in this chapter of relevance are Section 26.3, “Geometric output”, Section 26.6, “General enquiries” and Section 26.4, “Connections between entities”.

 

Function

Description

PK_BODY_ask_type

These functions classify the given topological entity

PK_EDGE_ask_type

PK_FIN_ask_type

PK_SHELL_ask_type

PK_VERTEX_ask_type

PK_LOOP_ask_type

PK_FIN_is_positive

Is the given fin travelling in the same direction as its owning edge?

PK_LOOP_is_isolated

Is the given loop isolated?

PK_REGION_is_solid

Is the given region solid?

PK_SHELL_find_sign

Does the given shell close off a finite/infinite volume?

[back to top]


26.3 Geometric output

Geometric Output Functions produce information on Geometric Entities. The data which is returned is often little more than outputting the information which is stored with the entity. Other relevant sections include Section 26.6, “General enquiries”, in this chapter and Chapter 91.1, “Standard representations”.

 

Function

Description

PK_BCURVE_ask

These functions write the standard form of the given geometric entity at the given address.

The application is responsible for allocating the standard form but need not initialise any of its fields.

PK_BCURVE_ask_piecewise

PK_BCURVE_ask_splinewise

PK_BCURVE_ask_knots

PK_BSURF_ask_knots

PK_BSURF_ask

PK_BSURF_ask_piecewise

PK_BSURF_ask_splinewise

PK_CIRCLE_ask

PK_CONE_ask

PK_CYL_ask

PK_ELLIPSE_ask

PK_FCURVE_ask

PK_FSURF_ask

PK_LINE_ask

PK_OFFSET_ask

PK_PLANE_ask

PK_POINT_ask

PK_SPCURVE_ask

PK_SPHERE_ask

PK_SPUN_ask

PK_SWEPT_ask

PK_TOPOL_categorise_geom

Determines what geometric category is attached to a topology.

PK_TORUS_ask

These functions write the standard form of the given geometric entity at the given address.

The application is responsible for allocating the standard form but need not initialise any of its field.

PK_TRANSF_ask

PK_TRCURVE_ask

PK_EDGE_ask_geometry

Returns the geometry of the edge

PK_FIN_ask_geometry

Returns the geometry of the fin

PK_GEOM_ask_dependents

Who are the geometric dependents of the given geometric entity?

PK_GEOM_ask_geom_owners

Who are the geometric owners of the given geometric entity?

PK_GEOM_ask_geom_category

Returns the category of a geometry entity.

[back to top]


26.4 Connections between entities

The functions in this section are concerned with the connections between entities within the data structure. Some give information on what those connections are. For information about functions which return information about individual entities, see the sections on Section 26.2, “Topological enquiries”, Section 26.3, “Geometric output”, and Section 26.6, “General enquiries”, also in this chapter.

26.4.1 Data structure enquiries

To return all the topology for a body in a single call, use PK_BODY_ask_topology. If you want to retrieve specific topological entities, then you should use the appropriate function from the following table.

 

Function

Description

PK_BODY_ask_components

Returns the enveloping shell of each component in the body. See Section 14.2.12, “Component”, for more information.

PK_BODY_ask_edges

Functions that return the entities of the requested class that are connected to the given body. For each of these functions, the data is not returned in any predictable order with the exception of PK_BODY_ask_faces, which returns the faces in a standard order, only for solids that were created using the primitive creation functions.

PK_BODY_ask_faces

PK_BODY_ask_fins

PK_BODY_ask_first_edge

PK_BODY_ask_first_face

PK_BODY_ask_loops

PK_BODY_ask_regions

PK_BODY_ask_shells

PK_BODY_ask_vertices

PK_BODY_ask_config

Functions to enquire properties of compound bodies. See Section 15.12.2, “Enquiring properties of compound bodies”, for more information.

PK_BODY_ask_children

PK_BODY_ask_parent

PK_BODY_find_laminar_edges

Laminar edges are those edges which bound a single face, i.e. they have exactly one fin.

PK_CLASS_ask_superclass

What is the class to which the given class belongs?

PK_CLASS_is_subclass

Is the first class a subclass of the second?

PK_CURVE_ask_edges

Functions that return the entities of the requested class that are connected to the given curve.

PK_CURVE_ask_fin

PK_CURVE_ask_part

PK_CURVE_find_surfs_common

Finds pair of surfaces that have the given curve in common.

PK_EDGE_ask_body

Functions that return the entities of the requested class that are connected to the given edge.

PK_EDGE_ask_curve

PK_EDGE_ask_faces

PK_EDGE_ask_fins

PK_EDGE_ask_first_fin

PK_EDGE_ask_next_in_body

PK_EDGE_ask_oriented_curve

PK_EDGE_ask_shells

PK_EDGE_ask_vertices

PK_ENTITY_ask_class

Which class does the entity belong to?

PK_ENTITY_ask_identifier

Output the identifier of an entity

PK_ENTITY_ask_owning_groups_2

Returns the set of groups of which the given entity is a member

PK_ENTITY_ask_partition

Which partition contains the given entity?

PK_ENTITY_is

Is it an entity?

PK_ENTITY_is_curve

Is the entity a curve?

PK_ENTITY_is_geom

Is the entity a curve, surface or point?

PK_ENTITY_is_part

Is the entity a body or assembly?

PK_ENTITY_is_surf

Is the entity a surface?

PK_ENTITY_is_topol

Is the entity any of the topological types?

PK_FACE_ask_body

Functions that return the entities of the requested class that are connected to the given face.

PK_FACE_ask_edges

PK_FACE_ask_faces_adjacent

Returns a list of all faces that are immediately adjacent to a given array of input faces

PK_FACE_ask_first_loop

Functions that return the entities of the requested class that are connected to the given face

PK_FACE_ask_loops

PK_FACE_ask_next_in_body

PK_FACE_ask_oriented_surf

PK_FACE_ask_shells

PK_FACE_ask_surf

PK_FACE_ask_vertices

PK_FACE_find_edges_common

Finds edges that are common to two faces.

PK_FACE_find_interior_vec

Returns a vector representing a position within the face and a set of uv parameters that represent the location of the position in the surface of the face, The returned vector always lies in the interior of the given face.

PK_FACE_find_outer_loop

Finds the outer loop of the given face. This function returns the outer loop of the face in the context of the parameter space of the underlying surface, rather than the outer loop in model space as described in Section 14.2.5, “Loop”. In some cases (cones, for example), this function may fail, even though PK_FACE_ask_loops returns a loop of type PK_LOOP_type_outer_c.

PK_FIN_ask_body

Functions that return the entities of the requested class that are connected to the given fin.

PK_FIN_ask_curve

PK_FIN_ask_edge

PK_FIN_ask_face

PK_FIN_ask_loop

PK_FIN_ask_next_in_loop

PK_FIN_ask_next_of_edge

PK_FIN_ask_oriented_curve

PK_FIN_ask_previous_in_loop

PK_FIN_ask_previous_of_edge

PK_GROUP_ask_part

Which part contains the given group?

PK_LATTICE_ask_part

Which part owns the given lattice?

PK_LOOP_ask_body

Functions that return the entities of the requested class that are connected to the given loop.

PK_LOOP_ask_edges

PK_LOOP_ask_face

PK_LOOP_ask_fins

PK_LOOP_ask_first_fin

PK_LOOP_ask_next_in_face

PK_LOOP_ask_vertices

PK_PART_ask_geoms

Returns the set of geometric entities in the part which are not attached to the parts topology; i.e. all the part’s construction geometry.

PK_PART_ask_all_attdefs

What attdefs are attached to any entity in the given part?

PK_PART_ask_con_lattices

Returns the given part’s construction lattices, curves, points, or surfaces.

PK_PART_ask_construction_curves

PK_PART_ask_construction_points

PK_PART_ask_construction_surfs

PK_PART_ask_groups_2

Returns all groups in the given part.

PK_PART_find_entity_by_ident

Identify entity by identifier within a part

PK_PART_remove_geoms

Removes geometric entities from a parts construction geometry

PK_PARTITION_ask_assemblies

Functions that return the entities of the requested class that are connected to the given partition.

Categorises the parts and geometry of a partition. See Section 82.2.2, “Enquiring if facet geometry is present” for more information.

PK_PARTITION_ask_bodies

PK_PARTITION_ask_facet_geom

PK_PARTITION_ask_geoms

Functions that return the entities of the requested class that are connected to the given partition.

Note: PK_PARTITION_ask_geoms returns the given partition’s orphan geometry.

PK_PARTITION_ask_ki_lists

PK_PARTITION_ask_transfs

PK_PMARK_ask_entities

Returns the entities that would be created, deleted, or modified if a partition were rolled to the given pmark. Does not actually change the session.

PK_POINT_ask_part

Which part owns the given point?

PK_POINT_ask_vertex

Find the vertex connected to the given point

PK_REGION_ask_body

Which body contains the given region?

PK_REGION_ask_shells

Find the set of shells bounding the given region

PK_SESSION_ask_parts

What parts are loaded in the session?

PK_SESSION_ask_partitions

What partitions are there in the session?

PK_SESSION_ask_attdefs

Return details of the user-defined attribute definitions in the session.

PK_SHELL_ask_acorn_vertex

Functions that return the entities of the requested class that are connected to the given shell.

PK_SHELL_ask_body

PK_SHELL_ask_oriented_faces

PK_SHELL_ask_region

PK_SHELL_ask_wireframe_edges

PK_SURF_ask_faces

Which set of faces is the given surface attached to?

PK_SURF_ask_part

Which part owns the given surface?

PK_SURF_find_curves_common

Finds curves which are common to two surfaces

PK_VERTEX_ask_body

Functions that return the entities of the requested class that are connected to the given vertex.

PK_VERTEX_ask_faces

PK_VERTEX_ask_isolated_loops

PK_VERTEX_ask_oriented_edges

PK_VERTEX_ask_point

PK_VERTEX_ask_shells

26.4.1.1 The returned order of faces of primitive solid bodies

For solids which were created using the primitive creation functions:

the ordering of these faces is always the same. For these solids it is as follows:

Spheres and Tori

These only have a single face.

Cones

The ordering of the faces in cones depends on whether either of the radii is zero. If the lower radius is non-zero, the planar face containing the point supplied (to PK_BODY_create_solid_cone) is the base face. If the upper radius is non-zero, the other planar face is the top face.

The faces are ordered as follows:

Cylinders

Are ordered as follows:

Blocks

The ordering of the block faces is related to the base face, and the first side face. The side faces are counted anti-clockwise around the axis direction and are named first, second, third and fourth side faces,

When the axis is along the Z axis the first side face is the face in the -Y direction. At other orientations, one of the side faces is chosen to be first.

If the axis is along the Z axis, the ordering becomes:

Where -Y indicates the face which is parallel to X-Z plane, and extreme in the -Y direction.

Prism

The ordering of the prism faces is related to the base face, and the first side face. The side faces counting anti-clockwise along the axis direction are named the first side face, second side face, etc.

The ordering for an n-sided prism is as follows:

[back to top]


26.5 Parametric enquiries

26.5.1 Evaluation of parametric geometry

 

Function

Description

PK_CURVE_eval

Evaluates a point and its derivatives at a given parameter on the curve.

PK_CURVE_eval_curvature

Calculates the normal, principal directions and curvature of a curve.

PK_CURVE_eval_with_tangent

As above for which the returned tangent is normalized to be a unit vector.

PK_SURF_eval

Evaluates a point and its derivatives at a given parameter pair on the surface.

PK_SURF_eval_curvature

Calculates the normal, principal directions and curvature of a surface.

PK_SURF_eval_with_normal

As above for which the returned surface normal is parallel to the cross product of the derivative with respect to v.

With these parametric geometry evaluation functions it is not necessary for the given parameter to lie within the range specified:

26.5.2 Handed evaluation of parametric geometry

The following functions are handed versions of the functions described in Section 26.5.1, “Evaluation of parametric geometry”. These functions give the application control over the direction in which the evaluations are calculated.

 

Function

Handed version of

PK_CURVE_eval_handed

PK_CURVE_eval

PK_CURVE_eval_curvature_handed

PK_CURVE_eval_curvature

PK_CURVE_eval_with_tan_handed

PK_CURVE_eval_with_tangent

PK_SURF_eval_handed

PK_SURF_eval

PK_SURF_eval_curvature_handed

PK_SURF_eval_curvature

PK_SURF_eval_with_normal_handed

PK_SURF_eval_with_normal

These functions behave identically to their non-handed equivalents, except at a discontinuity or periodic seam, where the evaluation is approached from the direction indicated by extra handed arguments. Each of these extra arguments can take the following values:

 

Value

Description

PK_HAND_left_c

A left-handed evaluation is approached from below the parameter value

PK_HAND_right_c

A right-handed evaluation is approached from above the parameter value

The three PK_CURVE functions each take a single additional argument, hand_direction , which controls whether evaluation is approached from below (left) or from above (right).

The three PK_SURF functions each take two additional arguments, u_hand_dir and v_hand_dir . The combination of values for these two arguments, together with the position of the parameter pair, determines the direction from which evaluation is approached, as shown in Figure 26-1.

 

Figure 26-1 Handed evaluation of parameter pairs on a surface

26.5.3 Enquiring geometric properties

 

Function

Description

PK_CURVE_find_vector_interval

Finds the parameter interval of a curve bounded by two position vectors lying on the curve

PK_CURVE_find_min_radius

To find the minimum radius of curvature of a curve and surface

PK_SURF_find_min_radii

PK_EDGE_is_planar

Does the edge lie in a plane?

PK_EDGE_is_smooth

Is the edge smooth?

PK_GEOM_is_coincident

Are two geometries equivalent?

PK_BCURVE_find_g1_discontinuity

Finds G1 discontinuities on a B-curve/B-surface

PK_BSURF_find_g1_discontinuity

PK_FIN_find_curve_parameter

Computes the fin curve/surface parameter(s) corresponding to the given surface/curve parameters

PK_FIN_find_surf_parameters

PK_FACE_is_uvbox

Detects whether a face is parametrically rectangular. See Section 26.6.1.2, “Parameter boxes” for more information.

PK_FACE_is_periodic

Detects whether a face is periodic in a particular parameter. See Section 26.6.5, “Determining periodicity of faces” for more information.

PK_CURVE_find_vector_interval calculates a parametric interval, given a curve and pair of points lying on it. This is useful when converting Parasolid applications from the old KI interface into the PK interface.PK_GEOM_is_coincident compares two geometric entities to see if they occupy the same positions in space. Curves running in opposite directions are considered coincident, and so are analytic curves (such as circles) and b-curve if they are identical. The function detects whether the entire surface or curve is coincident with another surface or curve; it does not detect overlaps. If the two geometries are of mixed dimension (e.g. a curve and a surface), then the entirety of the geometry of lower dimension must be coincident with the geometry of higher dimension (e.g. a curve must be entirely coincident with a surface).

[back to top]


26.6 General enquiries

Enquiry functions provide information about entities. They typically have to perform some calculations, and do more than simply output the information which is stored with the entity. Other sections which should be read on this subject are Section 26.3, “Geometric output” and Section 26.5, “Parametric enquiries”, and Section 91.1, “Standard representations”.

26.6.1 Finding bounds

Parasolid provides a range of functionality for finding the bounds of objects, in the form of:

This section briefly describes the functionality available. Refer to the documentation of each function in the PK Interface Programming Reference Manual for full details.

26.6.1.1 Axis-aligned and non axis-aligned boxes

A box (PK_BOX_t) is a set of six coordinates that describes a notional box surrounding an entity.

All boxes have a dimension, and an amount.

Figure 26-2 illustrates aligned and non-aligned boxes around a B-curve (shown in bold). In this example there are three non-aligned boxes shown; boxing the whole curve (blue); one third of the curve (green); then one ninth of the curve (black). This demonstrates how both aligned and non-aligned boxes rapidly diminish in size as the curve is subdivided.

 

Figure 26-2 Non-aligned boxing vs. aligned boxing

Parasolid provides the following functions for finding boxes:

 

Function

Description

PK_CURVE_find_box

Returns an axis-aligned bounding box for a given curve.

PK_CURVE_find_non_aligned_box

Returns a suitable non-axis aligned box that surrounds a portion of a curve.

PK_LATTICE_find_box

Returns an axis-aligned bounding box for a given lattice.

PK_LATTICE_find_nabox

Returns a non axis-aligned box that surrounds a given lattice.

You can optionally pass in an axis to align the box to using one of the following combination of options:

  • have_axis1 and axis1 or
  • have_axis2 and axis2

If both have_axis1 and have_axis2 are set to PK_LOGICAL_false, Parasolid calculates a suitable axis.

PK_LTOPOL_ask_box

Returns the bounding box of the given ltopols.

PK_MTOPOL_ask_box

Returns the bounding box of the given mtopol.

PK_TOPOL_find_box_2

Returns a suitable axis-aligned box that surrounds either the received topologies themselves or the transformations of the topologies. Transformations can be supplied via transfs . If this argument is set to null, the topologies are not transformed.

You can optionally choose to return an array of individual axis-aligned boxes for each topology received using the want_topol_boxes option.

See the PK Interface Programming Reference Manual for more information on this function.

PK_TOPOL_find_nabox

Returns a suitable non axis-aligned box that surrounds the received topologies.

You can optionally pass in an axis to align the box to, using one of the following combination of options:

  • have_axis1 and axis1 or
  • have_axis2 and axis2

If both have_axis1 and have_axis2 are set to PK_LOGICAL_false, Parasolid calculates a suitable axis.

Note: Except in cases where your application needs to support legacy behaviour, or where axis information is supplied, we typically recommend setting the quality option to PK_NABOX_quality_improved_c. See PK_TOPOL_find_nabox_o_t for more information.

If Parasolid calculates the axis, PK_TOPOL_find_nabox will not return a box whose dimensionality or amount is greater than the equivalent axis-aligned box. In addition, the returned ref_direction always contains the longest dimension of the box.

 

Note: PK_CURVE_find_non_aligned_box, PK_SURF_find_non_aligned_box,PK_CURVE_find_box and PK_SURF_find_box let you specify a parameter range within the curve or surface to be boxed. This lets you work with defined sub-regions rather than whole curves or surfaces, as illustrated in Figure 26-2.

26.6.1.2 Parameter boxes

Parasolid has two functions that can be used to find the parameter box (or uvbox) of a face:

 

Note: If you require consistent results from repeated calls to PK_FACE_find_uvbox on the same face, we recommend you call PK_FACE_is_uvbox before every call to PK_FACE_find_uvbox.

PK_FACE_is_uvbox determines whether a given face is parametrically rectangular. If the face is rectangular the u and v parameters returned lie in the parameter range of the surface given by PK_SURF_ask_uvbox unless the corresponding parameter is periodic. When the parameter is periodic the first parameter of the face lies in the range and the difference between the two parameters does not exceed the period, i.e. the face straddles the boundary of a periodic parameter.

PK_FACE_find_uvbox can locate a uvbox which bounds the given face in the parameter space of the face’s surface. Calling PK_SURF_ask_uvbox returns information about the range of values that the parameters u and v can have. A particular face on a surface may be restricted to a smaller range of values. PK_FACE_find_uvbox returns ranges in u and v such that for every point on the face, there is a u, v pair in this range which maps to that point.

 

Figure 26-3 Parameter boxes

The shaded lines represent two possible parameter boxes. The larger box is the one that would include the u,v pairs as returned by PK_SURF_parameterise_vector. The smaller box is the one which is actually returned by PK_FACE_find_uvbox.

In addition, you can use PK_FIN_find_uvbox to find a uvbox which bounds the given fin in the parameter space of the fin’s owning face’s surface.

26.6.1.3 Intervals and extremes

 

Function

Description

PK_EDGE_find_interval

To compute the parameter interval of the curve, to which the edge/fin corresponds

PK_FIN_find_interval

PK_EDGE_find_extreme

Finds the extreme point on the edge/face/body.

PK_FACE_find_extreme

PK_BODY_find_extreme

PK_BODY_find_extreme receives a body and three directions, specified as vectors. The function looks for the furthest point on the body in the first direction specified. If there are several points that are furthest in this direction, then the second, and subsequently (if necessary) the third direction, is used to reduce the number of extreme points until only one remains, which is returned by the function.

This process is illustrated in Figure 26-4, which shows how Parasolid finds the extreme point on a cube when the X, -Y, and Z directions are passed to PK_BODY_find_extreme respectively.

 

Figure 26-4 Finding the extreme point in a body

26.6.2 Spatial containment

 

Function

Description

PK_BODY_contains_vector

Do the points represented by the given vectors or parameters lie inside, outside or on the boundary of the given entity?

PK_FACE_contains_vectors

PK_FACE_set_approx

Creates an approximation of the edges of the supplied faces and stores the data. This reduces the performance of re-calculating the data every time that it is required by the PK contains_vector functions.

PK_FACE_unset_approx

In addition, these functions return the unique topological entity of lowest dimensionality belonging to the entity which coincides or contains the point.

26.6.3 Vector comparison

 

Function

Description

PK_VECTOR_is_equal

Tests whether two vectors are equal within the current session precision.

PK_VECTOR_is_zero

Tests whether a vector is zero within the current session precision.

PK_VECTOR_is_parallel

Tests whether two vectors are parallel within the current session angle precision.

 

Note: Sometimes, a valid derivative vector that combines a direction with a magnitude (such as a first derivative near a singularity) may be considered zero by PK_VECTOR_is_zero. In such cases, you should create a unit vector from the derivative vector using PK_VECTOR_normalise.

26.6.4 Transformation comparison

 

Function

Description

PK_TRANSF_is_equal

Tests whether two transformations are equal.

 

Note: Transformations can only be compared if they do not contain non-uniform scaling or perspective terms.

26.6.5 Determining periodicity of faces

You can determine whether a face is periodic in a particular parameter direction using the function PK_FACE_is_periodic. This function receives a face, and returns two values that describe the periodicity of the face in the u and v parameters, respectively.

26.6.6 Determining coincidence of faces

You can use PK_FACE_is_coincident to determine whether or not two faces, either of which may optionally have been transformed, are coincident within a given tolerance. This function receives the following arguments:

 

Received

Description

face1, face2

Two faces that you want to compare

tol

A tolerance within which the faces should be considered coincident

options

An options structure containing the following options:

  • transf1 : a transform to apply to face1 .
  • transf2 : a transform to apply to face2 .

And returns the following arguments:

 

Returned

Description

result

Information about whether face1 and face2 are coincident

point

A point at which face1 and face2 were found not to be coincident, when appropriate.

26.6.6.1 Restrictions

For face1 and face2 to be considered coincident, both of the following must be true:

If either of these is not true, then the two faces are not coincident.

These restrictions can sometimes mean that faces will not be considered coincident, even when you might expect that they would. For example, consider Figure 26-5, which shows two very similar faces, labeled A and B. The only difference between these faces is that B contains a gap that is smaller than the specified tolerance. However, despite its small size, this gap means that the loops in A and B no longer correspond, and so PK_FACE_is_coincident would not find these faces to be coincident.

PK_FACE_is_coincident may not detect coincidence between faces whose edges are all shorter than the specified tolerance.

Although PK_FACE_is_coincident may fail to find coincidence, it is guaranteed not to find coincidence where there is none.

 

Figure 26-5 Faces with dissimilar loops are not considered coincident

26.6.6.2 Returned information

The information returned in result can be one of the following:

 

Token

Description

PK_FACE_coi_yes_c

The faces are coincident to the specified tolerance.

PK_FACE_coi_yes_reversed_c

The faces are coincident to the specified tolerance, but their normals are reversed.

PK_FACE_coi_no_topol_c

The two faces are not coincident because the number of holes in the two faces is different.

Note: Isolated loops and wire edges are ignored.

PK_FACE_coi_no_bound_1_c

The two faces are not coincident. At least one point on the boundary of face1 is not coincident with the boundary of face2 . That point is returned in point .

PK_FACE_coi_no_bound_2_c

The two faces are not coincident. At least one point on the boundary of face2 is not coincident with the boundary of face1 . That point is returned in point .

PK_FACE_coi_no_face_1_c

The two faces are not coincident. At least one point on face1 is not coincident with face2 . That point is returned in point .

PK_FACE_coi_no_face_2_c

The two faces are not coincident. At least one point on face2 is not coincident with face1 . That point is returned in point .

PK_FACE_coi_no_rubber_c

At least one of the faces does not have a surface attached.

26.6.7 Finding discontinuities

If a curve or surface has any discontinuities, you can find details of those discontinuities using the functions PK_CURVE_find_discontinuity and PK_SURF_find_discontinuity. These functions can identify analytic or geometric discontinuities of levels 1 through 3.

Both functions contain options to let you specify:

 

Note: PK_continuity_g3_c cannot be used in the level option of PK_CURVE_find_discontinuity or PK_SURF_find_discontinuity. If a value for this is set, PK_ERROR_not_implemented will be returned.

26.6.8 Finding self-intersecting geometry

If a curve or surface is self-intersecting, you can find details about each self-intersection using the functions PK_CURVE_find_self_int and PK_SURF_find_self_int. These functions receive a curve or surface as appropriate, and return a structure that contains the number of self-intersections found, together with details about each self-intersection.

For each self-intersection found, the following information is returned:

This information can then be passed directly to PK_CURVE_fix_self_int or PK_SURF_fix_self_int (as appropriate), for repairing. See Section 90.4.6, “Repairing the data”, for more information.

Parasolid can distinguish between three different types of self-intersection:

 

Note: Self-intersections in curves are always classified as general.

26.6.9 Finding degenerate surfaces and curves

If a surface or a curve contains degeneracies, you can find details about each degeneracy using the functions PK_SURF_find_degens and PK_CURVE_find_degens. These functions receive a surface or a curve respectively, and return a structure that contains the number of degeneracies found, together with details about each degeneracy.

 

Note: This functionality does not support facet geometry.

For an example of this functionality, see the code example in the C++\Code Examples\Inquiries\Model Analysis\FindAndFixDegeneracies folder, located in example_applications in your Parasolid installation folder.

For each surface degeneracy found, the following information is returned:

For each curve degeneracy found, the following information is returned:

This information can then be passed directly to PK_SURF_fix_degens and PK_CURVE_fix_degens for repairing. See Section 90.4.6, “Repairing the data”, for more information.

Parasolid can distinguish between five different types of surface degeneracy:

Parasolid can distinguish between three different types of curve degeneracy:

26.6.10 Finding characteristics that cause a body to be general

PK_BODY_identify_general can identify any characteristics of a body that cause it to be general. This can help you to clean up any non-manifold, cellular, or mixed-dimension entities in a general body, prior to making it manifold. See Section 15.10, “Identifying general characteristics of a body”, for more information.

26.6.11 Finding the convexity of an edge

You can use PK_EDGE_ask_convexity to return the convexity of an edge. The function takes an edge, and an options structure, and returns a convexity value (PK_EDGE_convexity_t).

This function can identify the following convexities (in each example, the edge whose convexity is returned is shown in red, and the face normals are shown in blue):

 

Convexity

Value of PK_EDGE_convexity_t

Example

convex

PK_EDGE_convexity_convex_c

 

concave

PK_EDGE_convexity_concave_c

 

variable
the convexity varies along the edge

PK_EDGE_convexity_variable_c

 

smooth flat
parallel surface normals, both faces have zero face curvature

PK_EDGE_convexity_smooth_flat_c

 

smooth convex
edge convexity is smooth, both faces have positive curvature (or one has zero, one has positive)

PK_EDGE_convexity_smooth_cvx_c

 

smooth concave
edge convexity is smooth, both faces have negative curvature (or one has zero, one has negative)

PK_EDGE_convexity_smooth_ccv_c

 

smooth inflection
edge convexity is smooth, faces have opposite curvature

PK_EDGE_convexity_smooth_inf_c

 

smooth variable

edge convexity is smooth, some parts are smooth convex, some parts are smooth concave

PK_EDGE_convexity_smooth_var_c

 

knife convex
surface normals are anti-parallel and the sum of the curvatures is non-negative

PK_EDGE_convexity_knife_cvx_c

 

knife concave
surface normals are anti-parallel and the sum of the curvatures is non-positive

PK_EDGE_convexity_knife_ccv_c

 

You can set an angular tolerance to use when identifying convexities using the have_angular_tolerance and angular_tolerance options in the options structure.

26.6.12 Finding position vectors along a curve

You can find position vectors along a curve subject to measurements in 3-space using PK_CURVE_find_vectors. This function receives a curve and a parameter interval to return an array of positions and corresponding parameters on the curve defined by a choice of measuring methods that are based on either a distance or ratio. These measuring methods can be controlled using the measurement_method option which takes the following values:

 

Measurement method

Result

PK_measure_distance_c

A position vector corresponding to the distance along the curve. See “Finding vectors using distance along the curve” for more information.

PK_measure_chord_c

All position vectors that lie at the intersections of the curve and a plane orthogonal to the chord. See “Finding vectors using distance along the chord” for more information.

PK_measure_distance_ratio_c

A position vector that corresponds to the ratio of distances along the curve. See “Finding vectors using the ratio of distances along the curve” for more information.

PK_measure_chord_ratio_c

All position vectors that lie at the intersections of the curve and a plane orthogonal to the chord as measured using a ratio. See “Finding vectors using ratio of distances along chord length” for more information.

PK_measure_2_chords_ratio_c

All position vectors on the curve that satisfies the supplied two chords ratio measurement. See “Finding vectors using ratios of two chords” for more information.

26.6.12.1 Finding vectors using distance along the curve

 

Figure 26-6 Finding vectors using distance along the curve

Using the distance A along the curve as an input measurement, one position vector is returned as shown in Figure 26-6. This position vector corresponds to the given distance of the curve.

26.6.12.2 Finding vectors using distance along the chord

 

Figure 26-7 Finding vectors using distance along the chord

As shown in Figure 26-7, when a distance A is used as an input measurement, multiple position vectors are returned once they lie on the curve between the start and end points and lie in the plane which is orthogonal to the chord that is located at the given distance A from the start point.

26.6.12.3 Finding vectors using the ratio of distances along the curve

 

Figure 26-8 Finding vectors using the ratio of distances along the curve

When the ratio of total distances along the curve is used as an input measurement, one position vector is returned as shown in Figure 26-8. The ratio is calculated as the length A divided by the bounded length B of the curve. For example, to return a vector halfway along the curve measurements need to be given a value of 0.5.

26.6.12.4 Finding vectors using ratio of distances along chord length

 

Figure 26-9 Finding vectors using ratio of distances along chord length

Using the ratio of the total chord length B as an input measurement, multiple position vectors are returned once they lie on the curve between the start and end points and lie in the plane which is orthogonal to the chord that is located at the given distance from the start point. This is shown in Figure 26-9 where the ratio is calculated as the length A divided by the bounded length of the chord B. For example, to return a vector halfway along the chord measurements need to be given a value of 0.5.

26.6.12.5 Finding vectors using ratios of two chords

 

Figure 26-10 Finding vectors using ratio of two chords

Using the ratio of two chords as an input measurement, all position vectors that lie on the curve between the start and end points and satisfy the two chord ratio condition A/(A+B), where A is the length of the first chord and B is the length of the second chord, are returned. The ratio measurement is calculated as A/(A+B). This is illustrated in Figure 26-10.

 

Note: A single two chord ratio measurement may yield multiple solutions.

 

    Performance issue: Methods that use chord length or ratios of chord lengths are in general computationally faster than those involving computing true arc length or ratios of true arc lengths.

26.6.13 Finding position vectors along a surface

You can find the position vectors on a given surface using PK_SURF_find_vectors. This function receives a surface and two pairs of uv parameters ( uv_start , uv_end ) that mark the start and end of the path curve respectively. A path curve is a bounded curve that lies on surface between uv_start , uv_end on which all returned position vectors lie. This is shown in Figure 26-11.

 

Figure 26-11 Finding position vectors along a curved surface

PK_SURF_find_vectors take the following options:

 

Value

Description

measurements

Distance or ratios of distances measured in 3-dimensional space.

measurement_method

Indicates what the values in measurements represent. For more information, see Section 26.6.12, “Finding position vectors along a curve”. Default: PK_measure_chord_ratio_c.

curve_type

The type of curve used to define the path curve. See Section 26.6.13.1, “Defining the path curve” for more information.

Default: PK_SURF_vec_proj_c.

have_help_point

Whether a position vector is supplied to help find the path curve. See Section 26.6.13.1, “Defining the path curve” for more information.

Default: PK_LOGICAL_false.

help_point

A position vector to help find the path curve.

Note: This option is only available if curve_type is PK_SURF_curve_linear_sp_c.

have_proj_direction

Whether a projection direction vector is supplied. See Section 26.6.13.1, “Defining the path curve” for more information.

Default: PK_LOGICAL_false.

proj_direction

A vector indicating the direction of the projection.

Note: This option is only available if curve_type is PK_SURF_curve_vec_proj_c.

error_on_failure

When an error indicating failure should be returned.

Default: PK_ERROR_on_fail_no_c.

26.6.13.1 Defining the path curve

You can choose the type of curve used to define the path curve using the curve_type option. This takes the following values:

 

Value

Description

PK_SURF_vec_proj_c

The path curve is a projected image of the chord between uv_start and uv_end . Default.

PK_SURF_curve_linear_sp_c

The path curve is a linear SP-curve.

If curve_type is set to PK_SURF_curve_vec_proj_c and have_proj_direction is:

If curve_type is set to PK_SURF_curve_linear_sp_c, and there is ambiguity on the definition of the path curve (for example periodic surfaces) you can set the have_help_point option to PK_LOGICAL_true, thereby allowing PK_SURF_find_vectors to use the nearest path curve to the help point. Otherwise, the path curve will be the curve segment with shortest bounded length.

 

[back to top]

<<< Introduction To Model Interrogation Chapters Mass Properties >>>