Enquiry and Output Functions   

<<< Wire Modeling Chapters Modeling Support >>>

Contents

[back to top]


38.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]


38.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 "Geometric output", "General enquiries" and "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]


38.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 "General enquiries", in this chapter and "Standard representations" in Chapter 39, "Modeling Support".

 

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 initialize any of its fields.

PK_BCURVE_ask_piecewise

PK_BCURVE_ask_splinewise

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_TORUS_ask

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?

[back to top]


38.4 Mass properties

Information about Mass and related properties.

 

Function Description

PK_TOPOL_eval_mass_props

Evaluates mass properties of topological entities

This function calculates the following geometric properties of relevant topological entities or list of entities:

The entities can be:

If a list is given, all the entities must be of the same type. However, bodies can have a different mass density.

When a list of faces or sheet bodies is given, the function treats them as a single solid entity, but the mass is not returned. No checking is done on whether the faces or sheet bodies form a solid boundary, if they do not, the returned results are likely to be meaningless.

An accuracy parameter is provided which can be used to speed up the operation when maximum accuracy is not essential.

A token can also be provided to instruct Parasolid to estimate the degree of inaccuracy of the values returned.

This function contains an option for an alternative method of calculating mass properties of dimension 2 and 3. These are calculated by generating a facet mesh for each face referenced and then combining the contributions for each facet, this provides verification of the main parameter algorithm. A chordal tolerance, the equivalent to the curve_chord_tol and surface_plane_tol as used by PK_TOPOL_facet can be applied.

[back to top]


38.5 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 "Topological enquiries", "Geometric output", and "General enquiries", also in this chapter.

[back to top]

38.5.1 Data structure enquiries

 

Function Description

PK_BODY_ask_edges

Functions that return connectivity data between the given entity and its associated 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_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 connectivity data between the given entity and its associated 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 connectivity data between the given entity and its associated 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

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 connectivity data between the given entity and its associated face.

PK_FACE_ask_edges

PK_FACE_ask_first_loop

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_FIN_ask_body

Functions that return connectivity data between the given entity and its associated 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_LOOP_ask_body

Functions that return connectivity data between the given entity and its associated loop.

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

PK_PART_ask_all_attdefs

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

PK_PART_ask_construction_curves

Find the owner of the construction geometry

PK_PART_ask_construction_points

PK_PART_ask_construction_surfs

PK_PART_ask_groups

Which set of groups is contained within the given entity?

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 connectivity data between the given entity and its associated partition.

PK_PARTITION_ask_bodies

PK_PARTITION_ask_geoms

PK_PARTITION_ask_ki_lists

PK_PARTITION_ask_pmark

PK_PARTITION_ask_pmark_size

PK_PARTITION_ask_transfs

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_SHELL_ask_acorn_vertex

Functions that return connectivity data between the given entity and its associated shell.

PK_SHELL_ask_body

PK_SHELL_ask_oriented_faces

PK_SHELL_ask_region

PK_SHELL_ask_type

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 connectivity data between the given entity and its associated vertex.

PK_VERTEX_ask_faces

PK_VERTEX_ask_isolated_loops

PK_VERTEX_ask_oriented_edges

PK_VERTEX_ask_point

PK_VERTEX_ask_shells

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 anticlockwise 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 anticlockwise 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]


38.6 Parametric enquiries

Parasolid offers facilities to perform parameter space enquiries on general curves and surfaces. This section describes the parametrisation for surfaces and curves, and lists those functions which use the parametric information.

Curves have a representation of the form R(t), where R is a vector valued function of a parameter t. Surfaces have a representation of the form R(u, v), where R is a vector valued function of parameters u and v. All curves and surfaces which can exist in a model are representable in this form, with the exception of SP-curves. The parameters t, u, and v may take a range of values, which varies according to the type of curve or surface.

The parameter ranges, and other properties of the parametrisation, can be found from two PK functions, PK_CURVE_ask_interval and PK_SURF_ask_uvbox. The vector valued functions R(t), R(u, v) can be considered as mappings from the parameter space, to three-space. PK_CURVE_eval (PK_CURVE_eval_with_tangent) and PK_SURF_eval (PK_SURF_eval_with_normal) perform these mappings and the inverse mappings are performed by PK_CURVE_parameterise_vector and PK_SURF_parameterise_vector.

The parametrisation of a curve or surface is invariant under translation and rotation, but not under reflection or a scaling transformation. For instance a curve is represented by F(t) is transformed by T. The parametrisation of the resulting curve is G(t). If the transformation T is a translation or rotation then

In this chapter, the following conventions apply:

[back to top]

38.6.1 Curve parametrisations

 

Function Description

PK_CURVE_ask_interval

Returns interval indicating the parametric bounds of the given curve

PK_CURVE_ask_param

Returns parameterisation of the curve

Straight Line

A straight line has a parametric representation of the form:

The range for t is (-infinity, +infinity).

 

Figure 38-1 Curve parametrisation - straight line

The reference point P and direction D can be obtained from PK_LINE_ask. The parameter t represents the signed distance of the point R(t) on the line from the reference point P.

Circle

A circle has a parametric representation of the form:

where C is the center of the circle, r is the circle radius, X and Y are axes in the circle plane.

 

Figure 38-2 Curve parametrisation - circle

The range for t is [0, 2pi). The parametrisation is periodic, so that PK_CURVE_eval can take any value of t and returns a point on the circle.

The circle center C, the axis A, the ref_direction X, and radius r can be obtained from PK_CIRCLE_ask.

The Y axis is given by the vector cross product of A and X.

Alternatively, the Y axis can be obtained by evaluating R(pi/2) using PK_CURVE_eval, and applying the formula

The parameter t represents the angle around the circle, measured in radians from the X axis. It runs clockwise when viewed along the axis A.

Ellipse

An ellipse has a parametric representation of the form:

C is the center of the ellipse, a is the major radius, X is the major axis, b is the minor radius, Y is the minor axis.

 

Figure 38-3 Curve parametrisation - ellipse

The range for t is [0, 2pi); the parametrisation is periodic, so PK_CURVE_eval works for any value of t, but PK_CURVE_parameterise_vector always returns a value in the above range.

The ellipse center C, the axis A, the ref_direction X and the radii a and b can be obtained from PK_ELLIPSE_ask. The ellipse parametrisation is equivalent to the parametrisation of a circle with radius a, and the same center as the ellipse. The point R(t) on the ellipse can be projected onto the circle by projecting it parallel to the Y axis and away from the X axis. The parameter t represents the angle around the circle, measured from the X axis, made by the projection of R(t). The following diagram illustrates this.

 

Figure 38-4 Curve parametrisation - curve compared with an ellipse

B-curve

B-curves (including B-splines which are represented internally as Bezier) have their own parametrisation.

For details, see Chapter 26, "The Mathematical Form of B-Geometry".

Intersection curve

An intersection curve does not have an explicit parametric form. A parametrisation is supported for it, however, which is based on a polyline approximation of the curve.

The parametrisation has the following properties:

[back to top]

38.6.2 Surface parametrisation

 

Function Description

PK_SURF_ask_uvbox

Returns a uvbox indicating the bounds of the given surface

PK_SURF_ask_params

Returns parameterisation in the U and V directions

Plane

A plane has a parametric representation of the form:

 

Figure 38-5 Surface parametrisation - plane

where P is a point on the plane. X and Y are axes in the plane.

The range for u is (-infinity, +infinity). The range for v is (-infinity, +infinity).

The reference point P, reference direction X and plane normal N can be obtained from PK_PLANE_ask.

The Y axis is the vector product of the plane normal N and the X axis: Y = N X X

Alternatively, the Y axis can be obtained by evaluating R(0, 1) using PK_SURF_eval, and applying the formula

The parameters u and v both represent distances: the distance of the point R(u, v) from the reference point P projected onto the X and Y axes respectively.

Cylinder

A cylinder has a parametric representation of the form:

 

Figure 38-6 Surface parametrisation - cylinder

The range for u is [0, 2pi); the parametrisation is periodic, so PK_SURF_eval works for any value of u, but PK_SURF_parameterise_vector always returns a value in the above range. The range for v is (-infinity, +infinity).

The reference point P, cylinder axis A, reference direction X and radius r can be obtained from PK_CYL_ask.

The Y axis is the vector cross product of the cylinder axis A and the X axis: Y = A X X.

Alternatively, the Y axis can be obtained by evaluating R(pi/2, 0) using PK_SURF_eval, and applying the formula

The parameter u represents the angle around the cylinder, measured in radians, from the X axis. It runs clockwise when viewed along the A axis. The parameter v represents the distance from R(u, v) to the reference point P, projected onto the axis.

Cone

A cone in Parasolid is only half of a mathematical cone. By convention, the cone axis points in the direction of increasing radius. A cone has a parametric representation of the form:

P is a point on the cone axis, r is the cone radius at the point P. A is the cone axis (unit vector). X and Y are unit vectors such that A, X and Y form an orthonormal set, i.e. Y = A x X. 'a' is the cone half angle.

 

Figure 38-7 Surface parametrisation - cone

The range for u is [0,2pi); the parametrisation is periodic, so PK_SURF_eval works for any value of u, but PK_SURF_parameterise_vector always returns a value in the above range.

The range for v is [-r cot(a), +infinity).

The reference point P, cone axis A, reference direction X and radius r at P and half angle a can be obtained from PK_CONE_ask.

The Y axis is the vector product of the X axis and the cone axis A: Y = X X A.

Alternatively, the Y axis can be obtained by evaluating R(pi/2,1) using PK_SURF_eval, and applying the formula

The parameter u represents the angle around the cone, measured from the X axis. It runs clockwise when viewed along the A axis. The parameter v represents the distance from R(u, v) to the reference point P, projected onto the axis. It runs away from the cone apex.

Torus

A torus has a parametric representation of the form:

 

Figure 38-8 Surface parametrisation - torus

C is center of the torus. A is the torus axis (unit vector), a is the major radius, b is the minor radius.

X and Y are unit vectors such that A, X and Y form an orthonormal set.

In Parasolid, there are three types of torus:

The limiting case a=b is allowed; it is called an 'osculating apple', but there is no 'lemon' surface corresponding to this case.

The limiting case a=0 cannot be represented as a torus; this is a sphere.

The range for u is [0, 2pi); the parametrisation is periodic, so PK_SURF_eval works for any value of u, but PK_SURF_parameterise_vector always returns a value in the above range.

The range for v varies according to the type of torus:

 

Torus type V range

Doughnut

The range is [-pi, pi); the parametrisation is periodic, so PK_SURF_eval works for any value of v, but PK_SURF_parameterise_vector always return a value in the above range.

Apple

The range is [-q, +q], where q = pi - arccos(a / b).

Lemon

The range is [-q, +q], where q = arccos(|a| / b)

The v parametrisation for the doughnut is periodic, for the lemon and apple it is not.

The torus center C, axis A, reference direction X, major radius a and minor radius b can be obtained from PK_TORUS_ask.

The Y axis is the vector product of the torus axis A and the X axis: Y = A X X. Alternatively, the Y axis can be obtained by evaluating R(p/2, 0) using PK_SURF_eval, and applying the formula

The parameter u represents the angle around the A axis, measured from the X axis. It runs clockwise when viewed along the A axis. The parameter v represents the angle around the torus spine, measured from the circle with center C, axis A and radius a + b. It runs clockwise when viewed along the spine.

Sphere

A sphere has a parametric representation of the form:

C is center of the sphere, r is the sphere radius. A, X and Y form an orthonormal axis set.

The range for u is [0,2pi); the parametrisation is periodic, so PK_SURF_eval works for any value of u, but PK_SURF_parameterise_vector always returns a value in the above range. The range for v is [-pi/2,+pi/2].

The sphere center C, axis A, ref_direction X and radius r can be obtained from PK_SPHERE_ask. The Y axis is the vector product of the sphere axis A and the X axis: Y = A X X. Alternatively, the Y axis can be obtained by evaluating R(pi/2, 0) using PK_SURF_eval and applying the formula.

 

Figure 38-9 Surface parametrisation - sphere

The parameter u represents longitude; i.e. the angle around the axis, measured from the X axis. It runs clockwise when viewed along the axis. The parameter v represents the latitude; i.e. the angle subtended at the equatorial plane.

Rolling ball blend

A rolling ball blend has a parametric representation of the form:

C( u ) is the spine curve, r is the blend radius. X(u) and Y( u ) are unit vectors such that dC(u)/du, X( u ) and Y( u ) form an orthogonal set. a( u ) is the angle subtended by points on the boundary curves at the spine. X, Y and a are expressed as functions of u, as their values change with u.

The spine of the rolling ball blend is the center line of the blend; i.e. the path along which the center of the ball moves. The range for u is the range for the spine curve and can be output through the PK_BLENDSF_ask function. The range for v is [0,1]. The parameter u represents the progress along the length of the blend. The parameter v runs along a circular arc, with its center on the spine. It takes the value 0 on one boundary, 1 on the other. It is proportional to the angle around the circular arc. If the spine curve is extended by a modeling operation, the parametrisation may also be extended.

 

Figure 38-10 Surface parametrisation - rolling ball blend

Swept surface

A swept surface has a parametric representation of the form:

C(u) is the section curve, D is the sweep direction (unit vector).

The range for u is the range for the section curve.

The range for v is (-infinity, +infinity).

The section curve and the sweep direction are obtained from PK_SWEPT_ask. The u parameter corresponds to the section curve parameter.

The v parameter represents distance: the distance of the current point from the corresponding point on the section curve.

 

Figure 38-11 Surface parametrisation - swept surface

Spun surface

A spun surface has a parametric representation of the form:

C(u) is the profile curve, Z(u) is the projection of C(u) onto the spin axis. A is the spin axis direction (unit vector)

 

Note: Z(u) = P + ( ( C( u ) - P ) . A ) A where P is a reference point on the axis.

The range for u is the range for the profile curve.

The range for v is [0, 2pi).

The profile curve C, axis direction A and a reference point P on the axis can be obtained from PK_SPUN_ask

 

Figure 38-12 Surface parametrisation - spun surface

The u parameter corresponds to the profile curve parameter.

The v parameter represents the angle about the axis, measured from the initial position of the profile curve.

The parameter runs clockwise when viewed along the A axis.

B-surface

B-surfaces (including B-splines which are represented internally as Bezier) have their own parametrisation.

For details, see Chapter 26, "The Mathematical Form of B-Geometry".

[back to top]

38.6.3 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:

[back to top]

38.6.4 Handed evaluation of parametric geometry

The following functions are handed versions of the functions described in "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 38-13.

 

Figure 38-13 Handed evaluation of parameter pairs on a surface

[back to top]

38.6.5 Enquire 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_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

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.

[back to top]


38.7 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 "Geometric output" and "Parametric enquiries" in this chapter, and "Standard representations" in Chapter 39, "Modeling Support".

[back to top]

38.7.1 Finding bounds

 

Function Description

PK_TOPOL_find_box

The box that surrounds the topological entity

PK_CURVE_find_non_aligned_box

To complete a non-axis aligned box bounding a portion of the curve/surface

PK_SURF_find_non_aligned_box

Two functions that compute non-axis aligned boxes for curves and surfaces. Figure 38-14 illustrates the non-aligned boxing of a B-curve (shown in bold). In this computation there are three non-aligned boxes shown; boxing the whole curve; one third of the curve; then one ninth of the curve. This demonstrates how the non-aligned boxes rapidly diminish in size as the curve is subdivided.

 

Note: Both these functions allow an application to specify a parameter range within the curve/surface to be boxed, this facility enables an algorithm to work with defined sub-regions rather than whole curves/surfaces.

 

Figure 38-14 Non-aligned boxing vs. aligned boxing

 

Function Description

PK_FACE_is_uvbox

Is the face parametrically rectangular?

This function 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.

 

Function Description

PK_FACE_find_uvbox

To find the 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 38-15 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.

 

Function Description

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

 

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

PK_FACE_find_extreme

[back to top]

38.7.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.

[back to top]

38.7.3 Vector comparison

 

Function Description

PK_VECTOR_is_equal

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

[back to top]

38.7.4 Determining periodicity of faces

The method you should use to determine whether a face is periodic or not is as follows:

  1. Return the surface of the face using PK_FACE_ask_surf.
  2. Find out if the surface is periodic using PK_SURF_ask_params.
  3. Use PK_ENTITY_ask_class to determine the type of surface.
  4. Given the above information, classify the loops of the face using PK_FACE_ask_loops and PK_LOOP_ask_type.
  5. For cylindrical surfaces (or cylindrical like swept surfaces, spun surfaces, or b-surfaces) the face is periodic if there is at least one winding loop (PK_LOOP_ask_type returns PK_LOOP_type_winding_c).

    For spherical and toroidal surfaces (or similar spun surfaces or b-surfaces), the face is periodic if there are either no loops, or no loops are outer loops (PK_LOOP_ask_type returns PK_LOOP_type_outer_c).

    For conical surfaces (or similar spun surfaces or b-surfaces) the face is periodic if either of the following is true:

    [back to top]

    38.7.5 Determining coincidence of faces

    You can use PK_FACE_is_coincident to determine whether or not two faces are coincident within a given tolerance. This function receives and returns 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

    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.

    Restrictions

    For face1 and face2 to be considered coincident, both the 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 38-16, 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 38-16 Faces with dissimilar loops are not considered coincident

    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.

    [back to top]

    <<< Wire Modeling Chapters Modeling Support >>>