PK_ERROR_code_t PK_BODY_check ( --- received arguments --- PK_BODY_t body, --- body to be checked const PK_BODY_check_o_t *options, --- options structure --- returned arguments --- int *const n_faults, --- number of faults PK_check_fault_t **const faults --- faults ) This function checks the given body. Specific Errors: PK_ERROR_check_error a fault has been found when max_faults = 0 PK_ERROR_check_failure checker failure PK_ERROR_bad_option_data max_faults < 0 This function performs a series of checks on a body, and returns information about the faults found, if any. option structure ------ --------- The option structure allows the caller to control which checks are performed; if no options are supplied, all checks appropriate to the body will be made max_faults ---------- The caller may set an upper limit on the number of faults found, in the option max_faults; if 'max_faults' is zero, the first fault found is returned as a PK error: PK_ERROR_check_error, with the entity at fault returned in the PK_ERROR_sf_t structure. geom ---- This can be set to one of: PK_check_geom_no_c don't do any geometry validity checks PK_check_geom_basic_c check for invalid or degenerate geometry PK_check_geom_lazy_c check for invalid, self-intersecting or degenerate geometry PK_check_geom_full_c check for invalid, self-intersecting or degenerate geometry, ignore results of pre-V5 checks PK_check_geom_yes_c check for invalid, self-intersecting or degenerate geometry, ignore previous checks Geometry which passes these tests is marked so that the cost of these tests need only be incurred once. Geometry which fails is also marked for the same reason. The option PK_check_geom_full_c behaves just like PK_check_geom_lazy_c, except that it forces a re-check of geometry marked as valid by pre-V5 versions of Parasolid. The option PK_check_geom_yes_c behaves just like PK_check_geom_lazy_c, except that it always forces a full check of the geometry, overriding the interface parameter, even if the geometry has been marked as valid by a previous check. The check faults associated with these checks are as follows state | entity_1 | position ------------------------------------------------------------------------------- PK_ENTITY_state_invalid_c | invalid geometric | null | entity | | | PK_GEOM_state_self_int_c | self-intersecting | point on the | geometric entity | self-intersection | | PK_GEOM_state_degenerate_c | geometric entity | point from | | degenerate region | | PK_TOPOL_state_no_geom_c | topological entity | null | with no geometry | | | bgeom ----- This can be set to one of: PK_check_bgeom_no_c don't do any B-geometry validity checks PK_check_bgeom_yes_c do all B-geometry continuity checks Special checks on B-curves and B-surfaces: There are special checks performed on B-curves and B-surfaces. curves: The restrictions on B-curves are: i) A B-curve cannot have any first derivative of zero length. ii) A B-curve cannot self-intersect. iii) A B-curve cannot have a cusp interior to a segment. iv) A B-curve must be at least position (G0) continuous. surfaces: The restrictions on B-surfaces are: i) A B-surface cannot contain any first derivative of zero length, except at a legal degeneracy (defined below). ii) A B-surface cannot self-intersect. iii) A B-surface cannot have a ridge or a cusp interior to a patch. iv) A B-surface must be at least position (G0) continuous. v) A B-surface may meet itself in either the u or the v direction or both to form a closed surface. If it does meet itself, it must do so all along the boundary. It is illegal for for the surface to meet itself at a single point. vi) A legal degeneracy is one which occurs only on a boundary of the surface, and which reduces all the boundary between two or more knot values to a single point. vii) A corner of a B-surface cannot be degenerate in both parameters. Special checks on offsets of B-surfaces: Offset surfaces whose underlying surfaces are B-surfaces are also checked for self intersection. The check_fault associated with this check is as follows `state` | entity_1 | position ------------------------------------------------------------------------------- PK_TOPOL_state_not_G1_c | face or edge | null | | top_geo ------- This can be set to one of: PK_check_top_geo_no_c don't do any topology geometry consistency checks PK_check_top_geo_edge_c check for inconsistencies between topology and geometry of edges PK_check_top_geo_face_c check for inconsistencies between topology and geometry of faces PK_check_top_geo_yes_c both edge and face checks Special checks on geometry attached to topology: If any option but PK_check_top_geo_no_c is selected, then additional checks on the geometry attached to the body are performed. The checks performed on curves attached to edges are: i) The curve must be G1 continuous. ii) If the curve is closed then it must have a periodic parameterisation. The checks performed on surfaces attached to faces are: iii) The surface must be G1 continuous. iv) The constant parameter lines of the surface must be G1 continuous. v) If the surface is closed in either direction then it must have a periodic parameterisation in that direction. vi) The surface may only contain degeneracies along one of its boundaries if all of that boundary is degenerate. Failure to pass these any of these checks will result in an PK_TOPOL_state_not_G1_c code. Checks i), iii), iv) and vi) are only performed if bgeom is set to PK_check_bgeom_yes_c The check faults associated with these checks are as follows state |entity_1|entity_2| position ------------------------------------------------------------------- PK_EDGE_state_open_c | edge | | null | | | PK_EDGE_state_bad_vertex_c | edge | vertex | null | | | PK_EDGE_state_reversed_c | edge | | null | | | PK_EDGE_state_vertices_touch_c | edge | | null | | | PK_EDGE_state_bad_face_order_c | edge | | null | | | PK_FACE_state_bad_vertex_c | face | vertex | null | | | PK_FACE_state_bad_edge_c | face | edge | null | | | PK_FACE_state_bad_edge_order_c | face | | null | | | PK_FACE_state_no_vtx_at_sing_c | face | | point at singularity | | | size_box -------- This can be set to one of: PK_check_size_box_no_c don't do size box checks PK_check_size_box_yes_c check for size box violations The check fault associated with this check is as follows state | entity_1 | position ------------------------------------------------------------------------------- PK_TOPOL_state_size_box_c | face or edge | null | | fa_X ---- This can be set to one of: PK_check_fa_X_no_c don't do face self-intersection checks PK_check_fa_X_yes_c check for face self-intersections The check faults associated with this check are as follows state |entity_1|entity_2| position ------------------------------------------------------------------------------- PK_FACE_state_self_int_c | face | | point in region of | | | inconsistency | | | PK_FACE_state_bad_wire_fa_ed_c | face | edge | point in region of | | | inconsistency | | | PK_EDGE_state_bad_wire_ed_ed_c | edge | edge | point in region of | | inconsistency | | loops ----- This can be set to one of: PK_check_loops_no_c don't do loop checks PK_check_loops_yes_c check for loop consistency of faces The check fault associated with this check is as follows state | entity_1 | position ------------------------------------------------------------------------------- PK_FACE_state_bad_loops_c | face | null | | fa_fa ----- This can be set to one of: PK_check_fa_fa_no_c don't do face-face checks PK_check_fa_fa_yes_c check for face-face inconsistencies The check fault associated with this check is as follows 'state' |entity_1|entity_2| 'position' ------------------------------------------------------------------------------- PK_FACE_state_bad_face_face_c | face | face | point in region of | | | inconsistency | | | sh -- This can be set to one of: PK_check_sh_no_c don't do shell checks PK_check_sh_yes_c check for inside-out or inconsistent shells The check faults associated with this check are as follows 'state' |entity_1|entity_2| 'position' ------------------------------------------------------------------------------- PK_BODY_state_inside_out_c | body | | null | | | PK_REGION_state_bad_shells_c | region | | null | | | PK_BODY_state_bad_regions_c | body | | null | | | PK_SHELL_state_bad_topol_geom_c| shell | | null | | | PK_SHELL_state_bad_sh_sh_c | shell | shell | point in region of | | | inconsistency | | | corrupt ------- This can be set to one of: PK_check_corrupt_no_c don't do data structure checks PK_check_corrupt_yes_c check for corrupt data structure and check identifiers The check faults associated with this check are as follows state | entity_1 | position ------------------------------------------------------------------------------- PK_BODY_state_corrupt_c | body | null | | PK_BODY_state_invalid_ident_c | body | null | | Faults are returned in an array of PK_check_fault_t structures. If there are no faults found, then n_faults is returned as zero. If there is more than one fault in the body then the function does not guarantee to return all the faults. When some types of check are omitted, a body which would fail them may produce misleading results or checker failures when other checks are applied. Very occasionally, checker failures are caused by difficult geometric configurations or the unexpected failure of an internal numerical algorithm; such failures should not be taken to indicate that the body is invalid. This will lead to the function failing with the error PK_ERROR_check_fail and the faulty entity being returned in the PK_ERROR_sf_t structure. Note that the tokens : PK_FACE_state_bad_wire_fa_ed_c, PK_EDGE_state_bad_face_order_c, PK_SHELL_state_bad_topol_geom_c and PK_SHELL_state_bad_sh_sh_c can only occur for general bodies. For more details on fault types and how they may arise, see the chapter on 'Checking' in the Functional Description.