10  Reading a Solid: The Block

One hundred and fifty records, read from the bottom of the ladder up: points and vertices, lines and edges, loops, faces, shell, solid. Then the orientation flags, composed by hand, and the count that checks the shell.

The block’s eight corners, labelled with their vertex records:

            #40 (0,20,10) ──────────────────── #80 (60,20,10)
           / │                                 / │
          /  │                                /  │
#24 (0,0,10) ───────────────────── #64 (60,0,10) │
 │           │                      │            │
 │           #32 (0,20,0) ──────────│────────── #72 (60,20,0)
 │          /                       │           /
 │         /                        │          /
#22 (0,0,0) ─────────────────────── #62 (60,0,0)

X runs to the right (0 to 60), Y into the page (0 to 20), Z up (0 to 10). The solid is #15, its shell is #16, and the shell’s six faces are #17, #57, #97, #119, #141 and #153. The chapter reads it from the bottom up.

10.1 Vertices

#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(0.,0.,0.));

A VERTEX_POINT is a topological vertex with one attribute beyond its name: vertex_geometry, a point. The CARTESIAN_POINT carries a list of coordinates, here three (a 2D point would have two). Two records per corner; sixteen for the block. The other seven vertices are #24, #32, #40, #62, #64, #72 and #80, each with its own point.

Nothing in a vertex record says which edges meet there. That is in the edges.

10.2 Edges

#21 = EDGE_CURVE('',#22,#24,#26,.T.);
#26 = LINE('',#27,#28);
#27 = CARTESIAN_POINT('',(0.,0.,0.));
#28 = VECTOR('',#29,1.);
#29 = DIRECTION('',(0.,0.,1.));
Referred to above: 4 records from block.step
#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(0.,0.,0.));
#24 = VERTEX_POINT('',#25);
#25 = CARTESIAN_POINT('',(0.,0.,10.));

The complete file

EDGE_CURVE has four attributes beyond its name: edge_start and edge_end (two vertices), edge_geometry (a curve), and same_sense (whether the edge runs along the curve’s direction). #21 runs from #22 at the origin to #24 at (0, 0, 10), along the line #26, in the line’s own direction.

The line is a point and a vector. LINE('',#27,#28): through #27, in direction #28. The VECTOR is a DIRECTION and a magnitude — (0,0,1) scaled by 1. — which is more structure than a line needs and exactly what the schema requires. Note that #27 duplicates the coordinates of #23: the exporter has written the line’s base point as a separate record rather than reusing the vertex’s point. It could have shared; it chose not to. Real files are full of such duplicated points, and a reader that de-duplicates by coordinate will find the 27 CARTESIAN_POINTs in this file collapse to just 8 distinct locations — the eight corners, which is where every line base and every plane origin sits too.

The twelve edges of the block, from the file:

Edge From To Direction Where
#21 #22 #24 +Z x = 0, y = 0
#31 #22 #32 +Y x = 0, z = 0
#39 #32 #40 +Z x = 0, y = 20
#47 #24 #40 +Y x = 0, z = 10
#61 #62 #64 +Z x = 60, y = 0
#71 #62 #72 +Y x = 60, z = 0
#79 #72 #80 +Z x = 60, y = 20
#87 #64 #80 +Y x = 60, z = 10
#101 #22 #62 +X y = 0, z = 0
#108 #24 #64 +X y = 0, z = 10
#123 #32 #72 +X y = 20, z = 0
#130 #40 #80 +X y = 20, z = 10

Every edge’s curve runs in a positive axis direction and every same_sense is .T., because the exporter chose its lines to match its edges. Nothing requires this; an edge whose same_sense is .F. runs from its start vertex to its end vertex against the curve, and you will see plenty.

Each EDGE_CURVE costs five records: itself, a line, a point, a vector and a direction. Sixty records for twelve edges.

10.3 Loops

#19 = EDGE_LOOP('',(#20,#30,#38,#46));
#20 = ORIENTED_EDGE('',*,*,#21,.F.);
#30 = ORIENTED_EDGE('',*,*,#31,.T.);
#38 = ORIENTED_EDGE('',*,*,#39,.T.);
#46 = ORIENTED_EDGE('',*,*,#47,.F.);
Referred to above: 28 records from block.step
#21 = EDGE_CURVE('',#22,#24,#26,.T.);
#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(0.,0.,0.));
#24 = VERTEX_POINT('',#25);
#25 = CARTESIAN_POINT('',(0.,0.,10.));
#26 = LINE('',#27,#28);
#27 = CARTESIAN_POINT('',(0.,0.,0.));
#28 = VECTOR('',#29,1.);
#29 = DIRECTION('',(0.,0.,1.));
#31 = EDGE_CURVE('',#22,#32,#34,.T.);
#32 = VERTEX_POINT('',#33);
#33 = CARTESIAN_POINT('',(0.,20.,0.));
#34 = LINE('',#35,#36);
#35 = CARTESIAN_POINT('',(0.,0.,0.));
#36 = VECTOR('',#37,1.);
#37 = DIRECTION('',(0.,1.,0.));
#39 = EDGE_CURVE('',#32,#40,#42,.T.);
#40 = VERTEX_POINT('',#41);
#41 = CARTESIAN_POINT('',(0.,20.,10.));
#42 = LINE('',#43,#44);
#43 = CARTESIAN_POINT('',(0.,20.,0.));
#44 = VECTOR('',#45,1.);
#45 = DIRECTION('',(0.,0.,1.));
#47 = EDGE_CURVE('',#24,#40,#48,.T.);
#48 = LINE('',#49,#50);
#49 = CARTESIAN_POINT('',(0.,0.,10.));
#50 = VECTOR('',#51,1.);
#51 = DIRECTION('',(0.,1.,0.));

The complete file

An EDGE_LOOP is an ordered list of oriented edges forming a closed cycle. Each ORIENTED_EDGE points at an EDGE_CURVE and adds an orientation: .T. to traverse it from start to end, .F. from end to start. The two * are derived attributes — the oriented edge’s own start and end vertices, which follow from the edge and the flag — and are written as * because the schema says to compute them.

Follow loop #19:

  • #20: edge #21 reversed — from #24 (0, 0, 10) to #22 (0, 0, 0).
  • #30: edge #31 forwards — from #22 to #32 (0, 20, 0).
  • #38: edge #39 forwards — from #32 to #40 (0, 20, 10).
  • #46: edge #47 reversed — from #40 to #24.

Each edge ends where the next begins, and the last ends where the first began. Four corners of the face at x = 0, visited in order. A well-formed loop always chains like this, and checking that it does is the second thing a validator does after counting.

The block has six loops and twenty-four oriented edges. Each of the twelve edges appears in exactly two loops. Look at #21: it is in loop #19 via #20 (orientation .F.) and in loop #99 via #106 (orientation .T.). Every shared edge appears once forwards and once backwards — almost. The full rule needs the next level.

10.4 Faces

#17 = ADVANCED_FACE('',(#18),#52,.F.);
#18 = FACE_BOUND('',#19,.F.);
#52 = PLANE('',#53);
#53 = AXIS2_PLACEMENT_3D('',#54,#55,#56);
#54 = CARTESIAN_POINT('',(0.,0.,0.));
#55 = DIRECTION('',(1.,0.,0.));
#56 = DIRECTION('',(0.,0.,1.));
Referred to above: 33 records from block.step
#19 = EDGE_LOOP('',(#20,#30,#38,#46));
#20 = ORIENTED_EDGE('',*,*,#21,.F.);
#21 = EDGE_CURVE('',#22,#24,#26,.T.);
#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(0.,0.,0.));
#24 = VERTEX_POINT('',#25);
#25 = CARTESIAN_POINT('',(0.,0.,10.));
#26 = LINE('',#27,#28);
#27 = CARTESIAN_POINT('',(0.,0.,0.));
#28 = VECTOR('',#29,1.);
#29 = DIRECTION('',(0.,0.,1.));
#30 = ORIENTED_EDGE('',*,*,#31,.T.);
#31 = EDGE_CURVE('',#22,#32,#34,.T.);
#32 = VERTEX_POINT('',#33);
#33 = CARTESIAN_POINT('',(0.,20.,0.));
#34 = LINE('',#35,#36);
#35 = CARTESIAN_POINT('',(0.,0.,0.));
#36 = VECTOR('',#37,1.);
#37 = DIRECTION('',(0.,1.,0.));
#38 = ORIENTED_EDGE('',*,*,#39,.T.);
#39 = EDGE_CURVE('',#32,#40,#42,.T.);
#40 = VERTEX_POINT('',#41);
#41 = CARTESIAN_POINT('',(0.,20.,10.));
#42 = LINE('',#43,#44);
#43 = CARTESIAN_POINT('',(0.,20.,0.));
#44 = VECTOR('',#45,1.);
#45 = DIRECTION('',(0.,0.,1.));
#46 = ORIENTED_EDGE('',*,*,#47,.F.);
#47 = EDGE_CURVE('',#24,#40,#48,.T.);
#48 = LINE('',#49,#50);
#49 = CARTESIAN_POINT('',(0.,0.,10.));
#50 = VECTOR('',#51,1.);
#51 = DIRECTION('',(0.,1.,0.));

The complete file

An ADVANCED_FACE has, as Chapter 4 laid out, bounds (a set of face bounds), face_geometry (a surface) and same_sense. #17 has one bound, lies on plane #52, and its same_sense is .F..

The bound wraps the loop and adds another orientation flag: FACE_BOUND('',#19,.F.) is loop #19, reversed. A face with a hole has two bounds; the standard provides FACE_OUTER_BOUND to mark the outer one, and this exporter does not use it — both bounds are plain FACE_BOUND, and which is outer must be worked out from the geometry. Chapter 11 has the example.

The plane is positioned by an axis placement: origin #54 at (0, 0, 0), normal #55 along +X, and a reference direction #56 along +Z that fixes the plane’s own in-plane X axis. The plane’s positive side is +X.

But this face is the one at x = 0 — the left end of the block — and its outside is toward −X. Hence same_sense = .F.: the face’s outward normal is the reverse of the plane’s normal. The face on the opposite end, #57, lies on plane #92 whose normal is also +X, positioned at (60, 0, 0); there the plane normal is already outward and same_sense is .T..

The six faces:

Face Plane origin Plane normal same_sense Outward normal Which side
#17 (0, 0, 0) +X .F. −X left end
#57 (60, 0, 0) +X .T. +X right end
#97 (0, 0, 0) +Y .F. −Y front
#119 (0, 20, 0) +Y .T. +Y back
#141 (0, 0, 0) +Z .F. −Z bottom
#153 (0, 0, 10) +Z .T. +Z top

Each face costs eight records: the face, its bound, its loop, the plane, the plane’s placement, and the placement’s point and two directions. Forty-eight for six faces.

10.5 Composing the orientation

Now the flags together. The rule is: after applying the edge orientations and the bound orientation, an outer loop runs counter-clockwise when viewed from outside — with the outward normal pointing at the viewer. An inner loop, around a hole, runs the other way.

Take #17 again. The plane’s normal is +X and same_sense is .F., so the outward normal is −X. Loop #19, after its edge flags, visits (0, 0, 10) → (0, 0, 0) → (0, 20, 0) → (0, 20, 10). In the (y, z) plane that sequence is (0, 10) → (0, 0) → (20, 0) → (20, 10), which is counter-clockwise about +X — the wrong way for a face whose outside is −X. The bound #18 has orientation .F., which reverses the loop, making it clockwise about +X, which is counter-clockwise about −X. Consistent.

Now #57, the right end. Its loop #59 visits the same (y, z) sequence, counter-clockwise about +X. The face’s outward normal is +X. The bound #58 has orientation .T.: no reversal needed. Consistent again.

The exporter has a habit visible in every face: FACE_BOUND.orientation equals ADVANCED_FACE.same_sense. That is a property of how OCCT builds its loops, not a rule, and other exporters will hand you a bound of .T. on a face of .F. with edge flags arranged to compensate.

The shared-edge rule, fully: for each EDGE_CURVE shared by two faces, the effective orientation in each face — the ORIENTED_EDGE flag combined with the FACE_BOUND flag — must be opposite. Edge #21 in face #17: oriented edge .F., bound .F., effective forwards. In face #97: oriented edge #106 is .T., bound #98 is .F., effective backwards. Opposite. This is the condition that makes the two faces’ normals agree about which side is out; break it on one edge and the shell has a crease where inside becomes outside.

10.6 Shell and solid

#16 = CLOSED_SHELL('',(#17,#57,#97,#119,#141,#153));
#15 = MANIFOLD_SOLID_BREP('',#16);
Referred to above: 148 records from block.step
#17 = ADVANCED_FACE('',(#18),#52,.F.);
#18 = FACE_BOUND('',#19,.F.);
#19 = EDGE_LOOP('',(#20,#30,#38,#46));
#20 = ORIENTED_EDGE('',*,*,#21,.F.);
#21 = EDGE_CURVE('',#22,#24,#26,.T.);
#22 = VERTEX_POINT('',#23);
#23 = CARTESIAN_POINT('',(0.,0.,0.));
#24 = VERTEX_POINT('',#25);
#25 = CARTESIAN_POINT('',(0.,0.,10.));
#26 = LINE('',#27,#28);
#27 = CARTESIAN_POINT('',(0.,0.,0.));
#28 = VECTOR('',#29,1.);
#29 = DIRECTION('',(0.,0.,1.));
#30 = ORIENTED_EDGE('',*,*,#31,.T.);
#31 = EDGE_CURVE('',#22,#32,#34,.T.);
#32 = VERTEX_POINT('',#33);
#33 = CARTESIAN_POINT('',(0.,20.,0.));
#34 = LINE('',#35,#36);
#35 = CARTESIAN_POINT('',(0.,0.,0.));
#36 = VECTOR('',#37,1.);
#37 = DIRECTION('',(0.,1.,0.));
#38 = ORIENTED_EDGE('',*,*,#39,.T.);
#39 = EDGE_CURVE('',#32,#40,#42,.T.);
#40 = VERTEX_POINT('',#41);
#41 = CARTESIAN_POINT('',(0.,20.,10.));
#42 = LINE('',#43,#44);
#43 = CARTESIAN_POINT('',(0.,20.,0.));
#44 = VECTOR('',#45,1.);
#45 = DIRECTION('',(0.,0.,1.));
#46 = ORIENTED_EDGE('',*,*,#47,.F.);
#47 = EDGE_CURVE('',#24,#40,#48,.T.);
#48 = LINE('',#49,#50);
#49 = CARTESIAN_POINT('',(0.,0.,10.));
#50 = VECTOR('',#51,1.);
#51 = DIRECTION('',(0.,1.,0.));
#52 = PLANE('',#53);
#53 = AXIS2_PLACEMENT_3D('',#54,#55,#56);
#54 = CARTESIAN_POINT('',(0.,0.,0.));
#55 = DIRECTION('',(1.,0.,0.));
#56 = DIRECTION('',(0.,0.,1.));
#57 = ADVANCED_FACE('',(#58),#92,.T.);
#58 = FACE_BOUND('',#59,.T.);
#59 = EDGE_LOOP('',(#60,#70,#78,#86));
#60 = ORIENTED_EDGE('',*,*,#61,.F.);
#61 = EDGE_CURVE('',#62,#64,#66,.T.);
#62 = VERTEX_POINT('',#63);
#63 = CARTESIAN_POINT('',(60.,0.,0.));
#64 = VERTEX_POINT('',#65);
#65 = CARTESIAN_POINT('',(60.,0.,10.));
#66 = LINE('',#67,#68);
#67 = CARTESIAN_POINT('',(60.,0.,0.));
#68 = VECTOR('',#69,1.);
#69 = DIRECTION('',(0.,0.,1.));
#70 = ORIENTED_EDGE('',*,*,#71,.T.);
#71 = EDGE_CURVE('',#62,#72,#74,.T.);
#72 = VERTEX_POINT('',#73);
#73 = CARTESIAN_POINT('',(60.,20.,0.));
#74 = LINE('',#75,#76);
#75 = CARTESIAN_POINT('',(60.,0.,0.));
#76 = VECTOR('',#77,1.);
#77 = DIRECTION('',(0.,1.,0.));
#78 = ORIENTED_EDGE('',*,*,#79,.T.);
#79 = EDGE_CURVE('',#72,#80,#82,.T.);
#80 = VERTEX_POINT('',#81);
#81 = CARTESIAN_POINT('',(60.,20.,10.));
#82 = LINE('',#83,#84);
#83 = CARTESIAN_POINT('',(60.,20.,0.));
#84 = VECTOR('',#85,1.);
#85 = DIRECTION('',(0.,0.,1.));
#86 = ORIENTED_EDGE('',*,*,#87,.F.);
#87 = EDGE_CURVE('',#64,#80,#88,.T.);
#88 = LINE('',#89,#90);
#89 = CARTESIAN_POINT('',(60.,0.,10.));
#90 = VECTOR('',#91,1.);
#91 = DIRECTION('',(0.,1.,0.));
#92 = PLANE('',#93);
#93 = AXIS2_PLACEMENT_3D('',#94,#95,#96);
#94 = CARTESIAN_POINT('',(60.,0.,0.));
#95 = DIRECTION('',(1.,0.,0.));
#96 = DIRECTION('',(0.,0.,1.));
#97 = ADVANCED_FACE('',(#98),#114,.F.);
#98 = FACE_BOUND('',#99,.F.);
#99 = EDGE_LOOP('',(#100,#106,#107,#113));
#100 = ORIENTED_EDGE('',*,*,#101,.F.);
#101 = EDGE_CURVE('',#22,#62,#102,.T.);
#102 = LINE('',#103,#104);
#103 = CARTESIAN_POINT('',(0.,0.,0.));
#104 = VECTOR('',#105,1.);
#105 = DIRECTION('',(1.,0.,0.));
#106 = ORIENTED_EDGE('',*,*,#21,.T.);
#107 = ORIENTED_EDGE('',*,*,#108,.T.);
#108 = EDGE_CURVE('',#24,#64,#109,.T.);
#109 = LINE('',#110,#111);
#110 = CARTESIAN_POINT('',(0.,0.,10.));
#111 = VECTOR('',#112,1.);
#112 = DIRECTION('',(1.,0.,0.));
#113 = ORIENTED_EDGE('',*,*,#61,.F.);
#114 = PLANE('',#115);
#115 = AXIS2_PLACEMENT_3D('',#116,#117,#118);
#116 = CARTESIAN_POINT('',(0.,0.,0.));
#117 = DIRECTION('',(0.,1.,0.));
#118 = DIRECTION('',(0.,0.,1.));
#119 = ADVANCED_FACE('',(#120),#136,.T.);
#120 = FACE_BOUND('',#121,.T.);
#121 = EDGE_LOOP('',(#122,#128,#129,#135));
#122 = ORIENTED_EDGE('',*,*,#123,.F.);
#123 = EDGE_CURVE('',#32,#72,#124,.T.);
#124 = LINE('',#125,#126);
#125 = CARTESIAN_POINT('',(0.,20.,0.));
#126 = VECTOR('',#127,1.);
#127 = DIRECTION('',(1.,0.,0.));
#128 = ORIENTED_EDGE('',*,*,#39,.T.);
#129 = ORIENTED_EDGE('',*,*,#130,.T.);
#130 = EDGE_CURVE('',#40,#80,#131,.T.);
#131 = LINE('',#132,#133);
#132 = CARTESIAN_POINT('',(0.,20.,10.));
#133 = VECTOR('',#134,1.);
#134 = DIRECTION('',(1.,0.,0.));
#135 = ORIENTED_EDGE('',*,*,#79,.F.);
#136 = PLANE('',#137);
#137 = AXIS2_PLACEMENT_3D('',#138,#139,#140);
#138 = CARTESIAN_POINT('',(0.,20.,0.));
#139 = DIRECTION('',(0.,1.,0.));
#140 = DIRECTION('',(0.,0.,1.));
#141 = ADVANCED_FACE('',(#142),#148,.F.);
#142 = FACE_BOUND('',#143,.F.);
#143 = EDGE_LOOP('',(#144,#145,#146,#147));
#144 = ORIENTED_EDGE('',*,*,#31,.F.);
#145 = ORIENTED_EDGE('',*,*,#101,.T.);
#146 = ORIENTED_EDGE('',*,*,#71,.T.);
#147 = ORIENTED_EDGE('',*,*,#123,.F.);
#148 = PLANE('',#149);
#149 = AXIS2_PLACEMENT_3D('',#150,#151,#152);
#150 = CARTESIAN_POINT('',(0.,0.,0.));
#151 = DIRECTION('',(0.,0.,1.));
#152 = DIRECTION('',(1.,0.,0.));
#153 = ADVANCED_FACE('',(#154),#160,.T.);
#154 = FACE_BOUND('',#155,.T.);
#155 = EDGE_LOOP('',(#156,#157,#158,#159));
#156 = ORIENTED_EDGE('',*,*,#47,.F.);
#157 = ORIENTED_EDGE('',*,*,#108,.T.);
#158 = ORIENTED_EDGE('',*,*,#87,.T.);
#159 = ORIENTED_EDGE('',*,*,#130,.F.);
#160 = PLANE('',#161);
#161 = AXIS2_PLACEMENT_3D('',#162,#163,#164);
#162 = CARTESIAN_POINT('',(0.,0.,10.));
#163 = DIRECTION('',(0.,0.,1.));
#164 = DIRECTION('',(1.,0.,0.));

The complete file

The shell is a set of faces, unordered. The solid is a shell. MANIFOLD_SOLID_BREP has one attribute, outer; a subtype, BREP_WITH_VOIDS, adds a set of inner shells for cavities. There is nothing else at this level: no bounding box, no volume, no centroid. Those, if present, are properties attached from outside, in Chapter 15.

10.7 The count

Records Kind Count
VERTEX_POINT + CARTESIAN_POINT 8 vertices × 2 16
EDGE_CURVE + LINE + point + VECTOR + DIRECTION 12 edges × 5 60
ORIENTED_EDGE 12 edges × 2 faces 24
face + bound + loop + PLANE + placement + point + 2 directions 6 faces × 8 48
CLOSED_SHELL + MANIFOLD_SOLID_BREP 2
Total 150

And the Euler check: V − E + F = 8 − 12 + 6 = 2. The shell is closed and has no through-holes, and the count of records is exactly what the structure predicts. When a file’s record counts do not match a pattern like this — 13 edges for a box, say — an edge or a face has been split, which is legal and common after Boolean operations; it is the connectivity, not the count, that decides whether the shell is sound.

WarningIn the wild: What varies between exporters

The structure above is universal; the habits are not. Other writers use FACE_OUTER_BOUND for the outer loop (the standard’s intent), share CARTESIAN_POINTs between a vertex and the lines that start there, write same_sense = .F. on edges rather than choosing curve directions to avoid it, and put the plane’s origin at a face corner rather than the part origin. Some CATIA exports write every face’s same_sense as .T. and flip the plane’s normal instead. All of these describe the same box; a reader has to compose the flags and not pattern-match the habits.

ImportantIn brief

Vertex = point. Edge = two vertices + curve + sense. Oriented edge = edge + direction. Loop = cycle of oriented edges. Bound = loop + orientation. Face = bounds + surface + sense. Shell = faces; solid = shell. Outward normal is the surface normal flipped by same_sense; an outer loop, after edge flags and bound flag, runs counter-clockwise around it and an inner loop clockwise; each edge is traversed twice, once in each direction. Eight, twelve, six: V − E + F = 2.