Action:
|
Checks the data structure, topology, and geometry on a single or list of entities.
|
|
Filename:
|
intr/intr_scm/chk_scm.cxx
|
|
APIs:
|
api_check_entity
|
|
Syntax:
|
(entity:check entity-list [check-level]
|
|
|
[insanity-type] [acis-opts])
|
|
Arg Types:
|
entity-list
|
entity | (entity ... )
|
|
check-level
|
integer
|
|
insanity-type
|
string
|
|
acis-opts
|
acis-options
|
|
Returns:
|
entity | (entity ...)
|
|
Description:
|
This extension performs data structure, topological, and geometric checks on an entity or list of entities. The results are printed to the debug file, which can be set with the
debug:file extension.
|
|
|
If
check-level is specified, the check is done at that level, then returned to its previous value when finished. If the
check-level defined is not a multiple of ten, it is treated as the next lowest valid number. Any number over 70 is equal to 70.
|
|
|
The valid check levels are:
|
|
|
10 = Fast error checks
|
|
20 = Level 10 checks plus slower error checks
|
|
30 = Level 20 checks plus D-Cubed curve and surface checks
|
|
40 = Level 30 checks plus fast warning checks
|
|
50 = Level 40 checks plus slower warning checks
|
|
60 = Level 50 checks plus slow edge convexity change point checks
|
|
70 = Level 60 checks plus face/face intersection checks
|
|
|
If the check_level is not a multiple of ten, it has the same effect as the next lowest valid number. Any number higher than 70 is equal to 70.
|
|
|
With the optional
insanity-type only the specified insanities are printed to the debug file. The option "check_abort" becomes invalid when
insanity-type is specified. The options are "ERROR", "WARNING', or "NOTE".
|
|
|
The specific tests that
entity:check performs include:
|
|
|
Data Structure Checks
|
|
|
-
|
The parent has appropriate child-level entity; e.g., body has lump.
|
|
-
|
Presence (non-NULL) and closure of backptr from child to parent;
|
|
|
e.g., body's lump points to body.
|
|
-
|
The coedge on spline surface has PCURVE.
|
|
-
|
PCURVE indexing (0/+-1/+-2) is appropriate.
|
|
-
|
The PCURVE has non-NULL bs2_curve.
|
|
-
|
If EDGE has non-NULL CURVE, then CURVE must have equation.
|
|
|
Topological Checks
|
|
|
-
|
LOOPS must be closed in both the next and previous directions.
|
|
-
|
Apex edge loops are correct.
|
|
-
|
COEDGE has a partner, except apex COEDGE
|
|
-
|
All COEDGE partners point to same EDGE
|
|
-
|
Sequential COEDGEs share a VERTEX
|
|
-
|
EDGE is in exactly one of start and end VERTEXs edge groups.
|
|
|
For example, EDGE can be reached for 1 value of i
|
|
|
using start()->edge(i)->coedge() and
|
|
|
partner and next (or previous) pointers.
|
|
|
Geometric Checks
|
|
|
-
|
Entities with geometry, must have non-NULL geometry.
|
|
|
For example, a FACE points to a SURFACE.
|
|
-
|
Analytic surfaces have valid definitions
|
|
|
a.
|
plane must have a unit vector normal
|
|
|
b.
|
sphere must have a non-zero radius
|
|
|
c.
|
cone has:
|
|
|
|
1.
|
unit vector normal
|
|
|
|
2.
|
non-zero length major axis
|
|
|
|
3.
|
normal and major axis are perpendicular
|
|
|
|
4.
|
0 < ratio < 1
|
|
|
|
5.
|
sin_angle^2 + cos_angle^2 = 1
|
|
|
d.
|
torus has
|
|
|
|
1.
|
unit vector normal
|
|
|
|
2.
|
major radius not equal to 0
|
|
|
|
3.
|
minor radius not equal to 0
|
|
|
|
4.
|
major radius >= -fabs( minor radius)
|
|
|
-
|
PCURVE surface matches FACE surface (warning only if
|
|
|
not equal since surface could be trimmed).
|
|
-
|
PCURVE form is agrees with CURVE form,
|
|
|
e.g. closed, open, periodic.
|
|
-
|
PCURVE parameter period agrees with curve period.
|
|
-
|
PCURVE at points 0, 1/3, 2/3, and 1 way along curve
|
|
|
must lie on the EDGE and tangent directions at these points
|
|
|
must roughly agree, i.e., have positive dot product.
|
|
|
This also tests the following:
|
|
|
a.
|
PCURVE and EDGE geometry direction agree (up to sense),
|
|
|
b.
|
Start and end parameters of PCURVE
|
|
|
|
match those of COEDGE, and
|
|
|
c.
|
Start and end locations of PCURVE (wrt to surface)
|
|
|
|
match those of COEDGE
|
|
|
-
|
Spline SURFACE form is set correctly,
|
|
|
e.g. SURFACEs closed in u report this.
|
|
|
Checks the underlying bs3 surface at 10 points
|
|
|
along seam to verify form.
|
|
-
|
Checks that COEDGE vertices do not lie on
|
|
|
spline SURFACE singularities.
|
|
-
|
FACE normal is consistent with COEDGE direction, i.e.,
|
|
|
a.
|
Face area is greater than 0, and
|
|
|
b.
|
Multi-LOOP FACEs have LOOPs correctly oriented.
|
|
|
c.
|
Checks that all LOOPs contain the others.
|
|
|
-
|
D3 surface checks (turned on by an option).
|
|
|
Checks for a bad degeneracy - adjacent degenerate boundaries.
|
|
|
The remaining checks are just on spline surfaces:
|
|
|
a.
|
surface irregular
|
|
|
b.
|
self intersection
|
|
|
c.
|
closure wrong
|
|
|
d.
|
no bs3 surface
|
|
|
e.
|
control point coincidence
|
|
|
f.
|
not C1, G0, G1, or G2
|
|
|
-
|
Start and end VERTEXs of COEDGE lie on FACE
|
|
-
|
EDGE lies on FACE. Checks at 10 points along EDGE
|
|
-
|
Start and end VERTEXs lie on EDGE geometry.
|
|
-
|
FACEs are ordered correctly around EDGE, according to sidedness.
|
|
-
|
COEDGES are ordered correctly around EDGE,
|
|
|
according to FACE curvature
|
|
-
|
EDGE has same sense as CURVE (taking reverse bit into account)
|
|
-
|
Checks CURVE has correct form:
|
|
|
a.
|
straight has unit vector direction and param scale > 0
|
|
|
b.
|
ellipse has
|
|
|
|
1.
|
unit vector normal
|
|
|
|
2.
|
axis with length > 0
|
|
|
|
3.
|
normal perpendicular to axis
|
|
|
|
4.
|
radius > 0
|
|
|
|
5.
|
ratio < 1
|
|
|
c.
|
intcurve is correctly labeled open, closed, or periodic
|
|
|
-
|
EDGE parameter range is good and agrees with start and end points.
|
|
-
|
Check EDGE for bad approximation direction
|
|
-
|
D3 checks on intcurve (option that can be turned on)
|
|
|
a.
|
has bs3_curve
|
|
|
b.
|
closure is correctly reported
|
|
|
c.
|
continuity is C0, G1, or G2
|
|
|
d.
|
no coincident control points
|
|
|
e.
|
curve is not irregular
|
|
|
f.
|
no self intersections
|
|
|
g.
|
no degeneracy
|
|
|
h.
|
no untreatable singularity
|
|
-
|
No two VERTEXs have the same location.
|
|
|
-
|
Optional FACE/FACE intersection checking (option check_ff_int)
|
|
|
a.
|
Two valid FACEs have proper intersection
|
|
|
|
1.
|
adjacent faces intersect only in along common edge
|
|
|
|
2.
|
non-adjacent faces do not intersect
|
|
|
b.
|
When a FACE/FACE boolean fails, checks for proper
|
|
|
|
EDGE/EDGE intersections on each FACE
|
|
|
|
1.
|
adjacent EDGEs intersection in common VERTEX only
|
|
|
|
2.
|
non-adjacent EDGEs do not intersect
|
|
|
c.
|
Two valid, non-intersecting SHELLs in the same LUMP have
|
|
|
|
proper containment, i.e., each SHELL contains the other.
|
|
|
|
Note, a SHELL is valid if it contains no improperly
|
|
|
|
intersecting FACEs.
|
|
|
d.
|
Two valid, non-intersecting LUMPs have proper containment,
|
|
|
|
i.e., neither LUMP contains the other.
|
|
|
|
Note, a LUMP is valid when it contains no improperly
|
|
|
|
intersecting FACEs and no SHELLs with improper
|
|
|
|
containment.
|
|
|
When FACE/FACE problems are found, a BODY containing the bad intersections is created. This BODY is named check_error.
|
|
|
The optional argument
acis-opts helps enable journaling and versioning options.
|
|
Example:
|
; entity:check
|
|
; Create solid block 1.
|
|
(define block1 (solid:block (position 0 0 0)
|
|
|
(position 10 10 10)))
|
|
;; block1
|
|
; Determine if the entity passes the checks.
|
|
(entity:check block1)
|
|
; checked:
|
|
;
|
1 lumps
|
|
;
|
1 shells
|
|
;
|
0 wires
|
|
;
|
6 faces
|
|
;
|
6 loops
|
|
;
|
24 coedges
|
|
;
|
12 edges
|
|
;
|
8 vertices
|
|
;; ()
|
|
; Create a circular edge.
|
|
(define edge1
|
|
|
(edge:circular (position 0 0 0) 25 0 185))
|
|
;; edge1
|
|
; Determine if edge1 passes the checks.
|
|
(entity:check edge1)
|
|
; entid 1236816: edge without backptr
|
|
; entid 1231288: vertex has edge 1236816
|
|
; in group 0 times
|
|
; entid 1231312: vertex has edge 1236816
|
|
; in group 0 times
|
|
; checked:
|
|
;
|
0 lumps
|
|
;
|
0 shells
|
|
;
|
0 wires
|
|
;
|
0 faces
|
|
;
|
0 loops
|
|
;
|
0 coedges
|
|
;
|
1 edges
|
|
;
|
2 vertices
|
|
;; (#[entity 3 1])
|
|
|