Checking   

<<< Clash Detection Of Bodies Chapters Introduction To Manipulating Topology >>>

Contents

[back to top]


30.1 Introduction

Parasolid assumes that any bodies you are working with are valid. Most functions do not check the bodies you pass to them, and do not work properly if you hand them an invalid body. Therefore it is necessary to have the ability to test the validity of a body, for which Parasolid uses either the appropriate checking function or local checking which is available via an argument that is part of specific functions. Both these methods are explained in more detail later in this chapter.

For an example of explicit validity-checking, see the code example in the C++\Code Examples\Inquiries\Model Analysis\Validity folder, located in example_applications in your Parasolid installation folder.

The Parasolid checker is intended to:

Checking is a time-consuming operation and can be much slower than local checking. If you turn local checking OFF to save time when you are performing a sequence of local operations, or you want one of the intermediate operations to create an invalid body, you can call PK_BODY_check to check the final body. If PK_BODY_check indicates that the body is invalid then roll back to a point before the local operations, and try a different approach.

Local checking is a time-saving tool because, in contrast to a full body check, it only checks the features of the model that were changed by that particular operation.

 

Related Topics:

[back to top]


30.2 How checking works

By default, the checking functions make all the checks appropriate to the supplied entity, but the caller may control which checks are applied by supplying options to the relevant checking function. The checking functions available are listed below.

 

Function

Description

PK_ASSEMBLY_check

check an assembly

PK_BODY_check

check a body

PK_EDGE_check

check an edge

PK_FACE_check

check a face

PK_FACE_check_pair

do face-face checks on a pair of faces

PK_GEOM_check

check a point, curve, surface, or lattice

PK_TRANSF_check

check a transformation

The different types of checks are performed in groups in a certain sequence, where each group of checks only proceeds if the previous checks have all passed; therefore, checks which rely on the results of previous checks are omitted if these have failed. This means that the checking functionality does not guarantee to find all the faults if there is more than one.

An option structure, specific to each checking function, allows you to set which checks are to be performed and how many faults are to be returned:

 

Option

Description

max_faults

Sets an upper limit on the number of faults found. See Section 30.2.1, “The number of faults to be returned”, for more information.

geom

Which if any geometry validity checks are to be performed.

bgeom

Check B-geometry continuity, yes/no.

mesh

Check mesh data. See Section 86.4, “Checking meshes”, for more information.

top_geo

Which if any topology geometry consistent checks are to be performed.

size_box

Check for size box violations, yes/no.

fa_x

Check for face self-intersections, yes/no.

loops

Check for loop consistency of faces, yes/no.

fa_fa

Check for face-face inconsistencies, yes/no.

sh

Check for inside out or inconsistent shells, yes/no.

corrupt

Check for corrupt data structure and identifiers, yes/no.

nmnl_geom

Check for nominal geometry errors, yes/no.

returns

Control the level of information returned. See Section 30.2.2, “Enhancing the faults returned”, for more information.

extra_faults

Return additional information about bodies that are found to have a corrupt data structure. See Section 30.2.2, “Enhancing the faults returned”, for more information.

attribs

Check for validity of system attributes.

The following table summarizes which options are available in which checking functions:

 

Option

ASSEMBLY

BODY

EDGE

FACE

FACE_check_pair

GEOM

TRANSF

max_faults

*

*

*

*

*

*

*

geom

*

*

*

*

 

*

 

bgeom

 

*

*

*

 

 

 

mesh

*

*

 

*

 

 

 

top_geo

 

*

*

*

 

 

 

size_box

 

*

*

*

 

 

 

fa_x

 

*

 

*

 

 

 

loops

 

*

 

*

 

 

 

fa_fa

 

*

 

 

 

 

 

sh

 

*

 

 

 

 

 

corrupt

*

*

 

 

 

 

 

nmnl_geom

 

*

*

*

 

 

 

returns

 

*

*

*

 

 

 

extra_faults

 

*

 

 

 

*

 

attribs

*

*

*

*

 

*

 

For more information on all the available options, see the documentation for PK_BODY_check in the PK Interface Programming Reference Manual.

 

Note: For assemblies, geometry (including mesh) and attribute checks only apply to the assembly and its instances and not to any sub-component bodies or assemblies.

30.2.1 The number of faults to be returned

These checking functions never return more than max_faults faults. If max_faults is set to zero and any fault is found, the function fails with the error PK_ERROR_check_error. The application may thereby force all check faults to cause errors. The entity in error is returned in the error standard form.

If max_faults is set greater than zero then up to max_faults check faults may be returned. It is not guaranteed that all faults will be found even if max_faults should be large enough. To acquire as many faults as possible, the application should set max_faults to a large number, e.g. 1000.

 

Note: It is generally the case that only the most serious fault may be returned for each geometrical entity. Therefore if a surface has two or more faults (e.g., PK_GEOM_state_self_int_c and PK_BCURVE_state_close_knots_c), only one will be returned (in this case, PK_BCURVE_state_close_knots_c). For topological entities, at most one fault may be returned for each underlying geometrical entity and then an unlimited amount of faults relating to the topology itself (such as PK_EDGE_state_bad_vertex_c) provided that the total number does not exceed max_faults .

30.2.2 Enhancing the faults returned

You can use the returns option in PK_BODY_check, PK_FACE_check, and PK_EDGE_check, to enhance the fault information that is returned. This option can take the following values:

 

Value

Description

PK_check_returns_latest_c

Ensures that the information returned includes all possible enhancements. In Parasolid V30.1 and above, setting this value is the same as setting PK_check_returns_5_c.

PK_check_returns_0_c

Returns basic fault information. (Default)

PK_check_returns_1_c
PK_check_returns_2_c
PK_check_returns_3_c
PK_check_returns_4_c
PK_check_returns_5_c

These values return enhanced fault information in addition to the fault information for PK_check_returns_0_c.

For more details on the specific information returned for each value, see PK_BODY_check_o_t in the PK Interface Programming Reference Manual.

In addition, you can use the extra_faults option in PK_BODY_check and PK_GEOM_check to return additional information about bodies that are found to have a corrupt data structure. This can take the following values:

 

Value

Description

PK_check_extra_faults_latest_c

Ensures that the information returned includes all possible enhancements. In Parasolid V23.0 and above, setting this value is the same as setting PK_check_extra_faults_1_c.

PK_check_extra_faults_1_c

Return additional information when a corrupt data structure is detected. If this value is used, a wide range of return tokens may be used instead of PK_BODY_state_corrupt_c (PK_BODY_check) and PK_ENTITY_state_invalid_c (PK_GEOM_check).

See the documentation for PK_BODY_check_o_t and PK_GEOM_check_o_t in the PK Interface Programming Reference Manual for complete details on the additional faults that may be returned.

PK_check_extra_faults_0_c

Do not return additional information about corrupt bodies. This is the default.

See the documentation for PK_BODY_check_o_t and PK_GEOM_check_o_t in the PK Interface Programming Reference Manual for complete details on the additional faults that may be returned.

See Section 30.3, “What the return tokens mean”, for more information on the tokens returned.

30.2.3 Checking system attributes

System attributes can be checked for validity in one of the following ways:

This section explains what checks are performed in these situations, and describes how you can control system attribute checking to suit your needs.

See Chapter 94, “Attribute Definitions”, and Chapter 95, “Attributes”, to learn more about how to use attributes. See Appendix A, “System Attribute Definitions”, for a description of the standard system-wide attributes that are provided by Parasolid.

30.2.3.1 What checks are performed

When checking system attributes, the following checks can be performed. Parasolid automatically performs the relevant checks according to the information being checked.

 

Check

Description

Validity of string fields.

Checks that all string fields of system attributes are valid (such that they contain no characters that cannot be exported as part of a text format XT transmit file).

Validity of numerical values.

Checks that all numerical data fields of system attributes are valid, in cases where that field has a definable range of valid values. For example, this check ensures that the real numerical field of the SDL/TYSA_DENSITY attribute is not negative.

Validity of length of supplied data arrays.

Checks that the correct amount of data is supplied for each data array in a system attribute. For example:

  • The real field of SDL/TYSA_DENSITY should have one value.
  • The real field of SDL/TYSA_HATCHING should have four values.
  • The real field of SDL/TYSA_PLANAR_HATCHING should have any multiple of seven values.

This also checks that required fields are not empty.

30.2.3.2 Checking system attributes during general checks

If you are performing a general check on one or more entities, using one of the functions PK_ASSEMBLY_check, PK_BODY_check, PK_EDGE_check, PK_FACE_check, or PK_GEOM_check, you can use the attribs option to check the validity of system attributes attached to those entities. This option takes the following values:

 

Value

Description

PK_check_attribs_no_c

Do not check system attributes. This is the default.

PK_check_attribs_yes_c

Perform checks on any system attributes attached to any of the entities being checked.

See Section 30.3.2, “Faults associated with checking system attributes”, for a list of the faults that may be returned when attribs is PK_check_attribs_yes_c.

30.2.3.3 Checking only system attributes

You can also check the system attributes attached to a group of entities, without performing other types of checks. To do this use PK_ENTITY_check_attribs. This function receives the following arguments:

 

Argument

Description

entity

The entity whose system attributes you want to check.

attdef

Use this argument to check only a specific type of system attribute.

  • To check all system attributes attached to the given entity , set this to PK_ENTITY_null.
  • To check a specific type of system attribute, set this to the attribute definition of the system attribute you want to check.

Use PK_ATTDEF_find to find the attribute definition for a system attribute. All system attributes have names that start with “SDL/TY”. See Appendix A, “System Attribute Definitions”, for more information.

options

A set of options.

If the check_sub option is PK_LOGICAL_true, then any sub-entities of the given entity are also checked, according to the hierarchy shown in Figure 30-1. For example if entity is a loop, then when check_sub is PK_LOGICAL_true, Parasolid checks the loop, its fins, edges, and vertices, any curves attached to the fins or edges, and any points attached to the vertices.

 

Figure 30-1 Entity hierarchy used when checking system attributes on sub-entities

Like other checking functions, PK_ENTITY_check_attribs returns a structure containing return tokens that describe any faults found. See Section 30.3.2, “Faults associated with checking system attributes”, for a list of the faults that may be returned .

30.2.3.4 Checking system attributes when setting specific fields

System attributes are automatically checked when you set the information in the attributes themselves. Checks are made when setting system attribute values using any of the following functions: PK_ATTRIB_set_ints, PK_ATTRIB_set_named_ints, PK_ATTRIB_set_doubles, PK_ATTRIB_set_named_doubles, PK_ATTRIB_set_string, PK_ATTRIB_set_named_string, PK_ATTRIB_set_ustring, PK_ATTRIB_set_named_ustring, PK_ATTRIB_set_vectors, PK_ATTRIB_set_named_vectors, PK_ATTRIB_set_axes, PK_ATTRIB_set_named_axes, PK_ATTRIB_set_pointers, PK_ATTRIB_set_named_pointers,

In these cases, only the checks relevant to the type of field being set are called. For example a call to PK_ATTRIB_set_doubles does not perform checks for the validity of string fields.

[back to top]


30.3 What the return tokens mean

Entities may fail the checker for a number of reasons; not all of these mean that the entity is completely corrupt and no longer suitable for modeling. This section provides additional detail on each of the fault types, except for those that get returned when the expand option is used, and suggestions on what should be done in each case.

Most modeling operations continue to work on a body that has failed the check in a local fashion (e.g. with one invalid face, edge, or piece of geometry) so long as the offending area is not directly involved in the operation. Often the best way to salvage such a body is to remove the offending entities altogether with a local operation or boolean.

Similarly, many modeling operations work on a body which has failed the face-face inconsistency check (for instance, if regions interpenetrate), although the hidden-line algorithm may fail; and mass properties calculations may give misleading answers.

 

Note: As mentioned in Section 30.2.2, “Enhancing the faults returned”, if you set the extra_faults option in PK_BODY_check or PK_GEOM_check to anything other than PK_check_extra_faults_0_c (Default), then other more specific tokens may be returned instead of PK_BODY_state_corrupt_c (PK_BODY_check) and PK_ENTITY_state_invalid_c (PK_GEOM_check).

See Section 30.3.1, “Additional information for bodies with corrupt data structures”, for details of the tokens that may be returned when using this option in PK_BODY_check.

See the PK Interface Programming Reference Manual for more information on the tokens that may be returned when using this option in PK_GEOM_check.

 

Fault state

Notes

Corrupt data structures

PK_ASSEMBLY_state_corrupt_c
PK_BB_state_corrupt_c
PK_BODY_state_corrupt_c
PK_GEOM_state_corrupt_c
PK_PARTITION_state_corrupt_c
PK_SESSION_state_corrupt_c
PK_TRANSF_state_corrupt_c

The returned entity is corrupt. This can happen if the caller does not roll back after a modeling error (e.g. a boolean failure); otherwise it usually means a serious bug in Parasolid, which should be reported, although occasionally it may be caused by an invalid sequence of calls to the PK interface. The caller must roll back or restart the modeler (PK_ENTITY_delete sometimes fails on corrupt parts).

Cyclic references

PK_ASSEMBLY_state_cyclic_ref_c

The assembly is self-referencing.This can happen if the assembly has at least one instance with a child part that is ultimately a parent, making the assembly graph cyclical.

If this fault occurs in assemblies created in Parasolid, it should be reported as a serious bug in Parasolid.

Invalid or duplicate identifiers

PK_BODY_state_invalid_ident_c

PK_ASSEMBLY_state_invalid_id_c

This fault can be corrected by calling PK_PART_rectify_identifiers.

If this fault occurs in bodies or assemblies created wholly in later versions of Parasolid, or after PK_PART_rectify_identifiers has been called on any body, it should be reported as a serious bug in Parasolid. However, it should not cause problems unless the application is using identifiers and relying on their uniqueness.

Missing geometry

PK_TOPOL_state_no_geom_c

This can arise naturally after local operations, or if geometry has been explicitly deleted or detached; there are several ways to remedy the situation (e.g. PK_EDGE_attach_curves_2, PK_FACE_attach_surf_fitting).

Bodies that are invalid because of missing geometry are identified as such by the checker. You create a body like this in the process of making a sheet by scribing lines on a wire body. When the wire is closed you have a sheet with edge geometry. PK_BODY_check detects this, and the problem can be rectified using PK_FACE_attach_surf_fitting to create a surface for one of the faces.

A body with missing geometry can be manipulated by most local operations (see Chapter 62, “Overview of Editing Models”), provided the parts of the body which are changed have geometry attached. Boolean operations cannot be performed on bodies with missing geometry, and in general, care is needed in their manipulation.

Invalid geometry

PK_ENTITY_state_invalid_c

This can happen if geometry is constructed incorrectly with parameter checking switched off (see PK_SESSION_set_check_arguments). It is usually possible to rescue the model by deleting the offending geometry and replacing it with valid geometry.

Self-intersecting geometry or degenerate geometry

PK_GEOM_state_self_int_c, PK_GEOM_state_degenerate_c

These can happen if geometry is created with self-intersection checking switched off (see PK_SESSION_set_check_self_int); again, it is best to replace the offending geometry.

Geometry not G1-continuous, or fails other composite geometry checks

PK_TOPOL_state_not_G1_c

This can happen if the composite geometry checks are switched off (see PK_SESSION_set_check_continuity) when the geometry is attached to topology; some modeling operations may work with the offending geometry, but it is best to replace it if possible.

Geometry is closed but not periodic

PK_TOPOL_state_bad_closed_c

Like PK_TOPOL_state_not_G1_c, this can happen if the composite geometry checks are switched off (see PK_SESSION_set_check_continuity) when the geometry is attached to topology; some modeling operations may work with the offending geometry, but it is best to replace it if possible. It is returned only when enhanced fault reporting is switched on using the returns option as described in Section 30.2.2.

Topology’s geometry has an invalid degeneracy

PK_TOPOL_state_u_parm_degen_c
PK_TOPOL_state_v_parm_degen_c
PK_TOPOL_state_parm_degen_c
PK_TOPOL_state_u_phys_degen_c
PK_TOPOL_state_v_phys_degen_c
PK_TOPOL_state_phys_degen_c

The geometry attached to the topology contains an invalid degeneracy. Parasolid can identify both parametric and physical degeneracies, in either the u, v or both parameters, returning the appropriate token as listed above. These tokens are returned only when enhanced fault reporting is switched on using the returns option as described in Section 30.2.2.

Open or non-periodic curve attached to ring edge

PK_EDGE_state_open_c

The related edge has been turned into a ring edge by the large tolerances, leaving an open curve as the geometry. This token should not arise under normal circumstances. It indicates an internal failure which could arise, for example, if the tolerances on the edge become so large as to consume features incorrectly.

Open or non-periodic nominal geometry attached to ring edge

PK_EDGE_state_open_nmnl_c

The related edge has been turned into a ring edge by the large tolerances, leaving an open curve as the nominal geometry. This token should not arise under normal circumstances. It is similar to PK_EDGE_state_open_c, except that the problem is indicated by the nominal curve on the edge, rather than the edge itself.

Vertex not on curve of edge

PK_EDGE_state_bad_vertex_c

This could arise as a result of a tolerance mismatch, or incorrect use of PK_EDGE_attach_curves_2. Resetting tolerances or re-positioning the geometry should resolve the fault.

Vertex not on nominal geometry

PK_EDGE_state_bad_vertex_nmnl_c

This token should not arise under normal circumstances, because the functions for attaching nominal geometry perform enough checks to prevent it. It indicates an internal failure in which the tolerances on the nominal geometry have become too large, and a body exhibiting this would probably have other failures. To resolve this problem, either reset the tolerances on the nominal geometry or, failing this, detach the nominal geometry from the body.

Edge reversed

PK_EDGE_state_reversed_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2. Detaching the curve, negating it, and re-attaching it would solve the problem.

Nominal geometry in wrong direction

PK_EDGE_state_reversed_nmnl_c

This token should not arise under normal circumstances, because the functions for attaching nominal geometry perform enough checks to prevent it. It indicates an internal failure in which the tolerances on the nominal geometry have become too large, and a body exhibiting this would probably have other failures. To resolve this problem, either reset the tolerances on the nominal geometry or, failing this, detach the nominal geometry from the body.

SP-curves of edge not within tolerance

PK_EDGE_state_bad_spcurve_c

This could happen as a result of invalid SP-curve data, or more likely an unsuitable tolerance value on the edge, which could be resolved using PK_EDGE_set_precision_2 or PK_VERTEX_attach_points.

SP-curves not within edge’s tolerance of nominal geometry

PK_EDGE_state_bad_sp_nmnl_c

This token should not arise under normal circumstances, because the functions for attaching nominal geometry perform enough checks to prevent it. It indicates an internal failure in which the tolerances on the nominal geometry have become too large, and a body exhibiting this would probably have other failures. To resolve this problem, either reset the tolerances on the nominal geometry or, failing this, detach the nominal geometry from the body.

Vertices of edge touch

PK_EDGE_state_vertices_touch_c

Again, this could be a tolerance problem or the result of incorrect use of PK_EDGE_attach_curves_2. Resetting tolerances or replacing the geometry of the edge or vertices should resolve the fault.

Faces incorrectly ordered at edge

PK_EDGE_state_bad_face_order_c

This can only happen on a non-manifold edge. It means that the order of the faces around an edge in the topological data structure does not agree with the order of the surfaces attached to those faces.

Polyline not valid for edge

PK_EDGE_state_bad_polyline_c

This token is returned when the set of polylines associated with an edge is inconsistent. This could be due to the polylines not being watertight or having incompatible directions.

Vertex not on surface of face

PK_FACE_state_bad_vertex_c

This could arise as a result of a tolerance mismatch, or incorrect use of PK_FACE_attach_surfs or PK_VERTEX_attach_points. Resetting tolerances or re-positioning the geometry should resolve the fault.

Edge not on surface of face

PK_FACE_state_bad_edge_c

This could arise as a result of a tolerance mismatch, or incorrect use of PK_EDGE_attach_curves_2 or PK_FACE_attach_surfs. Resetting tolerances or re-positioning the geometry should resolve the fault.

Self-intersecting face (i.e. edge/edge inconsistency)

PK_FACE_state_self_int_c

This could arise as a result of a local operation which produces a self-intersecting body. Further local operations to remove the self-intersection, or a subsequent modeling operation which destroys the offending face, should resolve the fault.

Edges incorrectly ordered at vertex

PK_FACE_state_bad_edge_order_c
PK_EDGE_state_bad_order_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2. Re-attaching the curves so that their edges are correctly ordered around the vertex should resolve the fault.

Loops inconsistent

PK_FACE_state_bad_loops_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2 or PK_SURF_make_sheet_trimmed. It means either that the directions of the loops in the face are wrong, or that the number and types of loops in the face are inconsistent with the surface type.

Face redundant

PK_FACE_state_redundant_c

The face created is redundant with respect to tolerances. This could arise as a result of incorrect use of PK_SURF_make_sheet_trimmed. No entities are returned with this token.

Direction of loop inconsistent

PK_CURVE_state_inconsistent_c

The direction of the curves supplied for a loop are inconsistent. This could arise as a result of incorrect use of PK_SURF_make_sheet_trimmed. No entities are returned with this token.

Invalid loop

PK_LOOP_state_invalid_c

The combination of loops formed by the curves does not form a valid face on the supplied surface. This could arise as a result of incorrect use of PK_SURF_make_sheet_trimmed. No entities are returned with this token.

Missing vertex at surface singularity

PK_FACE_state_no_vtx_at_sing_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2. The problem could be avoided by introducing the surface into the model in a different way (e.g. PK_SURF_make_sheet_body).

Wire-frame edge/face inconsistency

PK_FACE_state_bad_wire_fa_ed_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2 or PK_FACE_imprint_curves_2 on a general body. It means that a wire-frame edge intersects a face other than at a vertex.

Wire-frame edge/wire-frame edge inconsistency

PK_EDGE_state_bad_wire_ed_ed_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2 or PK_FACE_imprint_curves_2 (with local checking turned off) on a wire or general body. It means that two wire-frame edges intersect other than at a vertex.

Touching edges inconsistency

PK_EDGE_state_touch_edge_c

This could arise if two edges that share common vertices touch at a position other than at those vertices.

Size-box violation

PK_TOPOL_state_size_box_c

This fault should be avoided, but does not mean that modeling operations will necessarily fail. Modeling with entities outside the size-box may often work, but is not recommended, as resolution problems are more likely to occur.

Face-face inconsistency

PK_FACE_state_bad_face_face_c

This could arise as a result of a local operation which produces a self-intersecting body. Further local operations to remove the self-intersection, or a subsequent modeling operation which destroys the offending region, should resolve the fault.

Body is inside out

PK_BODY_state_inside_out_c

This could arise as a result of incorrect use of PK_EDGE_attach_curves_2. Negating the body with PK_BODY_reverse_orientation resolves the problem.

Item referenced by two partitions

PK_PARTITION_state_xref_c

Two partitions reference a single item.

Shells of region are inconsistent

PK_REGION_state_bad_shells_c

The checker returns this when a region itself is invalid. This could arise as a result of incorrect use of PK_FACE_attach_surfs (e.g. making a body with two positive shells). It is possible that the problem could be resolved with a local operation (deleting or tweaking the faces of one of the shells, for example).

Regions of body are inconsistent

PK_BODY_state_bad_regions_c

The checker returns this when there is an inconsistency between regions. This could arise as a result of incorrect use of PK_FACE_attach_surfs. It means that either the body contains more than one infinite region, or that the infinite region is not the first region. In some cases the problem may be solved using PK_BODY_reverse_orientation or by PK_FACE_attach_surfs.

Geometry/topology inconsistency in shell

PK_SHELL_state_bad_topol_geom_c

This could arise as a result of incorrect use of PK_FACE_attach_surfs, it can only occur for general bodies. It means that a wire-frame edge or a face in a shell is not geometrically inside that shell.

Acorn shell/shell inconsistency

PK_SHELL_state_bad_sh_sh_c

This could arise as incorrect use of PK_FACE_attach_surfs, it can only occur for general bodies. It means that an acorn shell is coincident with another shell.

Unspecified checker failure or checker failure during face-face check

PK_TOPOL_state_check_fail_c, PK_FACE_state_check_fail_c

These fault types are used to distinguish cases where the checker itself has failed, due to an internal numerical problem. They should not be taken to mean that the body itself is invalid.

Unattached item

PK_ITEM_state_unattached_c

The returned item is not attached to any owner.

Non-printing character used in name of attribute definition

PK_ATTDEF_state_bad_name_c

This could arise if a non-printing character (such as a line feed or carriage return) is used in an attribute definition name. See Chapter 94, “Attribute Definitions” for a description of attribute definitions.

Non-printing character used in string field of attribute

PK_ATTRIB_state_bad_string_c

The string field of the returned attribute is not capable of being transmitted in text XT format. This could arise if a non-printing character (such as a line feed or carriage return) is used in the string field of an attribute. See Chapter 95, “Attributes”, for a description of attributes.

B-geometry has knots closer than the allowed session angular precision

PK_BCURVE_state_close_knots_c, PK_BSURF_state_close_u_knots_c, PK_BSURF_state_close_v_knots_c

This happens when B-geometry has been created by PK_BCURVE_create or PK_BCURVE_create with knots that are closer than the session angular precision; see Section 18.4.1, “B-spline data” for more details.

Note: If B-geometry has knots that are closer than the session angular precision, this will be reported in preference to any purely geometric problems (e.g., PK_GEOM_state_self_int_c) but not before any serious data-structure faults (such as PK_BODY_state_corrupt_c).

30.3.1 Additional information for bodies with corrupt data structures

Unless the extra_faults option is PK_check_extra_faults_0_c (as described in Section 30.2.2, “Enhancing the faults returned”), the following tokens may be returned instead of PK_BODY_state_corrupt_c when using this option in PK_BODY_check. If extra_faults is PK_check_extra_faults_0_c, then PK_BODY_state_corrupt_c is returned instead. All tokens are returned in the state field, and all entities are returned in the entity_1 field, unless otherwise specified.

 

Fault state

Notes

Body of wrong type

PK_BODY_state_bad_type_c

The returned body is of the wrong type.

Body has no regions

PK_BODY_state_no_region_c

The returned body has no regions.

Body has no shell

PK_BODY_state_no_shell_c

The returned body has no shell.

Solid body has no regions

PK_BODY_state_no_solid_reg_c

The returned body is solid but has no regions.

First region not void

PK_BODY_state_region_1_solid_c

The returned body’s first region ( entity_2 ) is not void. The first region of a body should always be the void region.

First shell returned is not first shell of solid region

PK_BODY_state_shell_not_first_c

The first shell of the returned body is not the first shell of the body’s (solid) region ( entity_2 ).

Wrong region returned

PK_BODY_state_wrong_ext_reg_c

The returned manifold solid body has the wrong external region. In a valid body, the region of the first shell of a face in the first shell of the body ( entity_2 ) should coincide with the first region of the body. However, this state indicates that this is not the case.

Body has wrong number of regions

PK_BODY_state_wrong_num_regs_c

The returned body has the wrong number of regions.

Fault with fins on laminar edge

PK_EDGE_state_bad_fins_c

The returned laminar edge contains faults on its attached fins.

Edge tolerance too small

PK_EDGE_state_bad_tol_c

The returned edge has tolerance, but it is smaller than the working precision.

Rind edge has incorrect fins

PK_EDGE_state_fin_bad_ring_c

The returned edge is a ring edge (i.e. has no vertex) but the returned fin ( entity_2 ) has a next or previous fin of the edge which is not a fin of this ring edge.

Next edge has incorrect fin

PK_EDGE_state_fin_ed_next_pos_c

The next fin of the returned edge has the same sense as the returned fin ( entity_2 ).

Incorrect fin owner

PK_EDGE_state_fin_ed_not_ed_c

The returned edge has a fin ( entity_2 ) whose owner is not the edge itself.

Incorrect sense of first fin

PK_EDGE_state_fin_not_pos_c

The first fin ( entity_2 ) of the returned edge does not have positive sense, which it must.

Incorrect vertices on fins

PK_EDGE_state_single_vertex_c

The returned edge has one fin with a vertex and one fin without a vertex.

Wire edge is corrupt

PK_EDGE_state_wire_corrupt_c

A wire edge must have two loops. If this fault is raised, the fins in these two loops are corrupt, leading to an invalid data structure. The returned edge indicates which fins are corrupt.

Entity has wrong owner

PK_ENTITY_state_bad_owner_c

The returned entity has the wrong owner. It should be the returned entity_2 .

Incorrect group or attribute information for entity

PK_ENTITY_state_has_att_group_c

The returned entity has an attribute or group ( entity_2 ) but is not an owner of an attribute or group.

Incorrect group for entity

PK_ENTITY_state_in_group_c

The returned entity is a member of a group of which it is not allowed to be a member.

Entity has several owners

PK_ENTITY_state_shared_c

The returned entity wrongly has more than one owner.

Shells in same region

PK_FACE_state_diff_sh_same_rg_c

The returned face has two distinct shells which incorrectly belong to the same region.

Moebius face

PK_FACE_state_edge_moebius_c

The returned face is a Moebius strip: the orientation of the fins of the returned edge ( entity_2 ) are the same when the face meets them.

Badly defined sense

PK_FACE_state_wrong_sense_c

The sense of the returned face is undefined.

Bad fin

PK_FIN_state_bad_c

The returned fin does not belong to any of the following:

  • An isolated vertex.
  • A ring edge.
  • An ordinary edge.

Problem with fin order

PK_FIN_state_bad_ed_fins_c

Repeatedly asking for the next fin of the edge never yields the returned fin itself.

Corrupt fin

PK_FIN_state_corrupt_c

The data structure of the returned fin is corrupt.

Problem with fin order

PK_FIN_state_ed_next_is_fin_c

The next fin ( entity_2 ) of the edge is the returned fin itself.

Fins have different vertices

PK_FIN_state_edge_diff_vertex_c

The two returned fins have the same sense and belong to the same edge but point to different vertices.

Missing expected next fin of edge

PK_FIN_state_no_ed_next_in_sh_c

There is no next fin of the edge, even though both fins are known to lie in the same shell.

Fin has identifier

PK_FIN_state_non_zero_ident_c

The returned fin must not have an identifier. Fins should never have an identifier.

Incorrect fin order in edge

PK_FIN_state_not_ed_next_prev_c

The previous fin of the next fin of the edge ( entity_2 ) is not the returned fin itself. This fault can only be raised if the body is a solid or a sheet.

Incorrect fin order in loop

PK_FIN_state_not_lp_next_prev_c

The previous fin of the next fin of the loop ( entity_2 ) is not the returned fin itself.

Fin does not point to vertex

PK_FIN_state_vx_not_vx_c

The returned positive fin of edge terminating at the vertex ( entity_2 ) does not point to that vertex.

Fin does not point to vertex

PK_FIN_state_wrong_vertex_c

The returned fin should be pointing to the returned vertex ( entity_2 ).

Geometry dependent on non-geometry

PK_GEOM_state_bad_dep_type_c

The returned geometry has a dependant ( entity_2 ) that is not geometry.

Geometry has incorrect owner

PK_GEOM_state_bad_geom_owner_c

The returned geometry has a geometric owner ( entity_2 ) that is not a curve or a surface.

Geometry has incorrect owner

PK_GEOM_state_bad_owner_c

The returned geometry has wrong owner. The required owner is returned in entity_2 .

Geometry’s owner of wrong type

PK_GEOM_state_bad_topol_owner_c

The returned geometry has the wrong type of topological owner ( entity_2 ).

Geometry has duplicate owner

PK_GEOM_state_dup_geom_owner_c

The returned geometry’s owner ( entity_2 ) appears more than once as owner of the returned geometry.

Not geometric dependant of owner

PK_GEOM_state_not_owners_dep_c

The returned geometry is not a geometric dependant of the returned owner ( entity_2 ).

Geometry not owner of dependant

PK_GEOM_state_not_owning_dep_c

The returned geometry is not a geometric owner of its geometric dependant ( entity_2 ).

Bad group state

PK_GROUP_state_bad_c

The returned group owns a node it should not, based on the class of that group. For example, if the entity class of the group is PK_CLASS_face, and the group owns an edge, then this fault could be returned.

Curve belongs to an isolated vertex

PK_LOOP_state_isolated_has_cu_c

There is a curve ( entity_2 ) attached to the fin of an isolated vertex loop.

Faulty attribute

PK_PART_state_bad_attrib_c

The returned part has a faulty attribute ( entity_2 ).

Faulty attribute list

PK_PART_state_bad_attrib_list_c

The returned part has a faulty attribute list ( entity_2 ).

Badly defined state

PK_PART_state_bad_state_c

The “state” field in the XT data structure of the returned part is undefined. See the Parasolid XT Format Manual for more details.

Corrupt part

PK_PART_state_corrupt_c

The returned part is corrupt. This fault is raised if the “state” field in the XT data structure of the returned part is set to SCH_unloaded_part but still refers to a region. See the Parasolid XT Format Manual for more details.

Part has key

PK_PART_state_has_key_c

The returned part wrongly has a key.

Part has no key

PK_PART_state_no_key_c

The returned part wrongly has no key.

Region has no shell

PK_REGION_state_no_shell_c

The returned region has no shell and it is not the unique region of an infinite void body.

Incorrect solid region

PK_REGION_state_wrongly_solid_c

The returned solid region is in a sheet or wire body.

Inconsistent face in shell

PK_SHELL_state_bad_fa_orient_c

The returned shell has a face whose orientation is inconsistent with the shell itself. This fault is only returned for solid bodies.

Shell contains entities of wrong dimension

PK_SHELL_state_bad_wf_acorn_c

The returned shell of a solid or sheet body contains a wire frame edge and/or acorn vertex (one of which is returned in entity_2) .

Wire shell contains entities of wrong dimension

PK_SHELL_state_bad_wf_c

The returned shell of a wire body either contains an inconsistent face, or contains no vertex or edge.

Inconsistent faces in closed shell

PK_SHELL_state_closed_bad_fa_c

The returned shell has invalid face fields for a closed sheet body.

Acorn shell contains entities of wrong dimensions

PK_SHELL_state_ed_fa_in_acorn_c

The returned shell contains a vertex and should be an acorn shell. However, the shell also has faces and or edges (one of which is returned in entity_2 ).

Fragmented edges in shell

PK_SHELL_state_eds_fragmented_c

The returned shell has a wire frame edge ( entity_2 ) that does not belong to the set of connected faces and wire frame edges of the shell.

Fragmented faces in shell

PK_SHELL_state_fas_fragmented_c

The returned shell has a face ( entity_2 ) that does not belong to the set of connected faces and wire frame edges of the shell.

Shell has no vertices, edges, or faces

PK_SHELL_state_no_vx_ed_fa_c

The returned shell has no vertices, edges, or faces.

Bad owner in acorn shell

PK_SHELL_state_not_owning_vx_c

The returned acorn shell contain a vertex ( entity_2 ), but the owner of the vertex is not the shell.

Inconsistent faces in open shell

PK_SHELL_state_open_bad_fa_c

The returned shell has invalid face fields for an open sheet body.

Two shells in region meet at edge

PK_SHELL_state_reg_meet_at_ed_c

Two shells of the same region (one of which is returned in entity_1 ) meet at an edge ( entity_2 ).

Two shells in region meet at vertex

PK_SHELL_state_reg_meet_at_vx_c

Two shells of the same region (one of which is returned in entity_1 ) meet at a vertex ( entity_2 ).

Sheet shell has no face

PK_SHELL_state_sheet_no_fa_c

The returned shell belongs to a sheet body but has no face.

Wire shell has face

PK_SHELL_state_too_many_fas_c

The returned shell belongs to a wire body but has a face.

Closed but non-periodic topology

PK_TOPOL_state_bad_box_c

The topology has an invalid box. The box is defined using a high and a low co-ordinate. In this case, one of the high co-ordinate values is lower than its corresponding low co-ordinate.

Inconsistent order in shared geometry

PK_TOPOL_state_bad_geom_share_c

Faces that share a surface are ordered on that surface. Similarly, edges that share a curve are ordered along that curve. If this fault is returned, then two edges or two faces (returned in entity_1 and entity_2 ) share the same geometry, but this order is inconsistent.

Owner of topology has bad type

PK_TOPOL_state_bad_owner_type_c

The returned topology has an owner ( entity_2 ) that has a bad type.

Missing shared geometry

PK_TOPOL_state_share_no_geom_c

The returned edge or face has no attached geometry, but is defined as sharing geometry with at least one other edge or face ( entity_2 ).

Inconsistent fins

PK_VERTEX_state_bad_fin_c

An edge at the returned vertex has a fin ( entity_2 ), that is not correctly linked. This fault is not returned for solid bodies.

Vertex not isolated

PK_VERTEX_state_bad_isolated_c

The returned vertex, which has been declared isolated from a solid body, is not isolated.

Bad vertex tolerance

PK_VERTEX_state_bad_tol_c

The returned vertex has tolerance that is smaller than the working tolerance.

Inconsistent fins entering vertex

PK_VERTEX_state_fin_chains_c

Traversing the chain of fins entering the returned vertex gives inconsistent results.

Non-manifold vertex

PK_VERTEX_state_non_manifold_c

The returned vertex is non-manifold: typically the fins at edges around the vertex are inconsistently defined. This fault is not returned for solid bodies.

Acorn vertex not in shell

PK_VERTEX_state_not_dep_of_sh_c

The returned acorn vertex is not owned by its owning shell ( entity_2 ).

Acorn vertex not owned by shell

PK_VERTEX_state_owner_not_sh_c

The returned acorn vertex has an owner ( entity_2 ) that is not a shell.

Corrupt data structure in sheet body vertex

PK_VERTEX_state_sheet_corrupt_c

The returned vertex has a corrupt data structure.

Too many edges in wire vertex

PK_VERTEX_state_too_many_eds_c

The returned vertex is from a wire body. but has more than two edges.

Wireframe edge at vertex not in shell

PK_VERTEX_state_wf_ed_bad_sh_c

There is a wireframe edge at the returned vertex that should belong to the returned shell ( entity_2 ).

30.3.2 Faults associated with checking system attributes

If the attribs option in PK_ASSEMBLY_check, PK_BODY_check, PK_EDGE_check, PK_FACE_check, or PK_GEOM_check is PK_check_attribs_yes_c, then the following return tokens may be returned. For all of these tokens:

Use PK_ENTITY_check_attribs to find further information about the faults.

 

Fault state

Notes

Invalid data in field

PK_ATTRIB_state_bad_data_len_c

A field of a system attribute has an invalid amount of data filled.

Invalid Unicode string

PK_ATTRIB_state_bad_ustring_c

A Unicode string in a system attribute is invalid.

Byte field out of range

PK_ATTRIB_state_byte_oor_c

A byte field of a system attribute is out of (valid) range.

Empty field

PK_ATTRIB_state_empty_field_c

A required field in a system attribute has no data filled.

Integer field out of range

PK_ATTRIB_state_int_oor_c

An integer field of a system attribute is out of (valid) range.

Invalid data

PK_ATTRIB_state_invalid_att_c

A system attribute has invalid data .

Non-unit-length vector field

PK_ATTRIB_state_non_unit_vec_c

A vector field required to be of unit length is not.

Real field out of range

PK_ATTRIB_state_real_oor_c

A real field of a system attribute is out of (valid) range.

Short field out of range

PK_ATTRIB_state_short_oor_c

A short field of a system attribute is out of (valid) range.

Position vector field out of range

PK_ATTRIB_state_p_vector_oor_c

A position vector field is out of range (usually outside size box).

[back to top]


30.4 Local checking

Local checking only tests whether the body has been invalidated by the operation performed. If a body is invalid before a local operation, in a region not affected by the operation, local checking is not guaranteed to identify the body as invalid.

Local checking is activated through an argument of the relevant function. Functions that use the local checking switch are:

When local checking is turned ON then the state return argument of each local operation function is set to one of the following values:

 

Figure 30-2 Face normal senses on a valid body

Because of the direction of the face normal of the face from which the pyramid was created, the resulting face normal senses of the pyramid point into the body.

 

Figure 30-3 Face normal senses of a negative body

The local operations can succeed (return PK_ERROR_no “state” argument after calling a local operation.

The checks that are performed by Parasolid when local checking is turned ON are completed in three stages:

Providing that the body passes the initial stage PK_ERROR_no_errors are returned.

When Parasolid performs local operations with checking OFF, only very simple checks are made on the integrity of the body after the operation and the result returned is PK_local_check_no_c. This is desirable if the resulting body is an intermediate stage which you expect to be invalid.

For general bodies the result PK_local_check_negated_c is never returned since this has no meaning for general bodies.

30.4.1 Face-face checks

Other modeling functions, though they don't have the local_check option, do have an argument to activate face-face checking. They include the following:

These functions all return further information about faults via the PK_ERROR standard form structure.

[back to top]


30.5 When to use checking

Checking is a time-consuming operation. If you turn local checking OFF to save time when you are performing a sequence of local operations, or you want one of the intermediate operations to create an invalid body, you can call PK_BODY_check to check the final body. If the check indicates that the body is invalid then roll back to a point before the local operation, and try a different approach.

Local checking only tests whether the body has been invalidated by the operation performed. If a body is invalid before a local operation, in a region not affected by the operation, local checking is not guaranteed to identify the body as invalid.

When Parasolid performs local operations with checking ON, each affected face is checked to ensure it is consistent with itself and a subset of nearby faces. The checking can return a number of results.

Local operation checking is more efficient than checking the whole body especially if the local operation affects a small proportion of the body's entities. However, if Parasolid is performing a number of local operations, you may prefer to check the entire body when all the operations are complete rather than performing local checking at each operation.

 

Note: When fixing blends, local checking is performed as part of the PK_BODY_fix_blends operation.

30.5.1 Sweeping and spinning

When spinning bodies you must take care with the positioning of the axis. For example you are not permitted to spin a wire body through 2pi if an internal vertex rests on the axis as this would result in a non-manifold sheet body. Also it is easy to create self-intersecting bodies by sweeping or swinging. Always make sure to check the results, either by having local checking on, or using PK_BODY_check on the resulting bodies. For more information about these restrictions see the description of PK_BODY_spin.

30.5.2 Blending vertices on sheet and wire bodies

If the local checking is ON the body is checked after the blending has been carried out. In the case of a planar body the altered body is valid, but for a non-planar body local checking may return that the altered body is invalid.

30.5.3 Creating curves and surfaces

When creating curves and surfaces in Parasolid there are a few restrictions placed on the resulting curves and surfaces. These restrictions are to ensure that the curve or surface does not self-intersect or have a cusp. Any function that requires a surface which has been checked performs these checks. These checks shall only be performed once, with the result being stored in the data structure.

The PK_GEOM_check function can be used to test if the surface is acceptable to Parasolid for modeling purposes.

Full details of the restrictions on parametric curves and surfaces are given in Chapter 18, “B-Curves And B-Surfaces”.

30.5.4 How applications should use checking

Applications should provide users with control over local checking, and should provide the option to check bodies whenever they like it: it is suggested that two levels of body checking be provided, both with and without the face-face inconsistency check. The face-face inconsistency check is by far the most time-consuming for all but the simplest models, and should only be used when self-intersection is suspected.

With experience you will be able to judge when to use local checking and how often to use the checking functionality in the kind of modeling you typically do. To begin with, you will want to rely on it more, but with experience you will be able to work faster by skipping checks when they are not really needed.

[back to top]


30.6 Other checking options

The following checking options can be set by their relevant functions.

30.6.1 Argument checking

Parasolid performs simple checking of all arguments, but much more rigorous checking can be applied through PK_SESSION_set_check_arguments. This additional checking is ON by default, and has performance penalties but identifies problems as soon as possible. If this optional checking is not applied, a function argument error might not become apparent until it causes an error much later in the session.

Argument checking can be turned ON or OFF in a session; the current setting is returned by PK_SESSION_ask_check_arguments. It is expected that argument checking is switched ON in the vast majority of sessions since, in general, the improvement in error detection far outweighs the effects on performance. However, if you have tested a piece of code rigorously and performance is of prime importance, this balance may change.

30.6.2 Geometric self-intersection checking

Self-intersection checking is optional and can be switched ON or OFF in a session using PK_SESSION_set_check_self_int.

To prevent the creation of invalid bodies Parasolid requires that for a curve or surface to be attached to an edge or face it must be valid. Attaching a self-intersecting curve or surface, which is therefore invalid, to an edge or face would create an invalid body.

The checking of a B-curve, B-surface, or an offset of a B-surface for self-intersection is an expensive operation. This facility allows curves and surfaces to be used in modeling operations without the self-intersection check being made. It is not intended for this facility to provide a method of modeling with self-intersecting geometry but to be used when there is confidence that the geometry does not self-intersect.

With self-intersection checking switched OFF B-curve/surface geometry is still checked against the usual restriction on these entities, e.g. chord length, continuity, etc. The current setting is returned by PK_SESSION_ask_check_self_int.

For further information see Chapter 18, “B-Curves And B-Surfaces”.

PK_BODY_check only insists that the geometry does not self-intersect if the self-intersecting checking facility is switched ON.

30.6.2.1 Geometric self-intersection checking of offset surfaces

Self-intersection checking of offset surfaces is approached as follows:

30.6.3 Composite geometry checks for B-curves and B-surfaces

Composite geometry checks that are performed on B-curves and B-surfaces, when determining whether the geometry can be modeled as a single topological entity, can be turned ON or OFF using PK_SESSION_set_check_continuity. The current setting is returned by PK_SESSION_ask_check_continuity.

[back to top]

<<< Clash Detection Of Bodies Chapters Introduction To Manipulating Topology >>>