DIRECTORY G2dBasic, G3dBasic, G3dShape, G3dPlane; G3dPolyNet: CEDAR DEFINITIONS ~ BEGIN NatSequence: TYPE ~ G2dBasic.NatSequence; Plane: TYPE ~ G3dPlane.Plane; Shape: TYPE ~ G3dShape.Shape; Triple: TYPE ~ G3dBasic.Triple; Vertex: TYPE ~ G3dShape.Vertex; Validity: TYPE ~ G3dShape.Validity; Poly: TYPE ~ REF PolyRep; PolyRep: TYPE ~ RECORD [ visible: BOOL ¬ TRUE, -- is this polygon valid in this shape? vertices: NatSequence ¬ NIL, -- ccw list of vertices neighbors: NatSequence ¬ NIL, -- unordered list of edge-sharing polys plane: Plane, -- the plane of this poly clientData: REF ANY ¬ NIL -- the conventional escape hatch ]; Vert: TYPE ~ REF VertRep; VertRep: TYPE ~ RECORD [ visible: BOOL ¬ TRUE, -- is this polygon valid in this shape? polyRing: NatSequence ¬ NIL, -- ordered list of polys around this vertex vertex: Vertex ¬ NIL, -- standard vertex info clientData: REF ANY ¬ NIL -- the conventional escape hatch ]; PolyNet: TYPE ~ REF PolyNetRep; PolyNetRep: TYPE ~ RECORD [ vertices: VertSequence ¬ NIL, -- the vertices that make up the shape polygons: PolySequence ¬ NIL, -- the polygons that make up the shape clientData: REF ANY ¬ NIL -- the conventional escape hatch ]; VertSequence: TYPE ~ REF VertSequenceRep; VertSequenceRep: TYPE ~ RECORD [ valid: ARRAY Validity OF BOOL ¬ ALL[FALSE], length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Vert ]; PolySequence: TYPE ~ REF PolySequenceRep; PolySequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Poly ]; PolyNetProc: TYPE ~ PROC [polyNet: PolyNet, p0, p1: INT, clientData: REF ANY] RETURNS [continue: BOOL ¬ TRUE]; PolyNetFromShape: PROC [shape: Shape] RETURNS [PolyNet]; ShapeFromPolyNet: PROC [polyNet: PolyNet] RETURNS [Shape]; FindVisibleNeighborsOfPoly: PROC [polyNet: PolyNet, poly: INT] RETURNS [NatSequence]; RelinkEdge: PROC [polyNet: PolyNet, v0, v1, oldPoly, newPoly: INT]; VisitPolyNet: PROC [polyNet: PolyNet, proc: PolyNetProc, clientData: REF ANY ¬ NIL]; RemovePolyFromNet: PROC [polyNet: PolyNet, poly: INT]; RebuildPolyNet: PROC [polyNet: PolyNet]; UpdateAllPolygonInformation: PROC [polyNet: PolyNet]; UpdatePolygonInformation: PROC [polyNet: PolyNet, polyID: INT]; UpdateVertexInformation: PROC [polyNet: PolyNet, vertexID: INT]; GetPolygonNeighbors: PROC [polyNet: PolyNet, polyID: INT] RETURNS [NatSequence]; IsGenus0: PROC [polyNet: PolyNet] RETURNS [BOOL]; ConcaveEdge: PROC [polyNet: PolyNet, poly0, poly1: INT] RETURNS [BOOL]; CoPlanar: PROC [polyNet: PolyNet, poly0, poly1: INT] RETURNS [BOOL]; CoPlanarFlipped: PROC [polyNet: PolyNet, poly0, poly1: INT] RETURNS [BOOL]; GetNormal: PUBLIC PROC [polyNet: PolyNet, polyID: INT] RETURNS [Triple]; GetOffset: PUBLIC PROC [polyNet: PolyNet, polyID: INT] RETURNS [REAL]; CopyPolyNet: PROC [polyNet: PolyNet, copyVertices: BOOL ¬ FALSE] RETURNS [PolyNet]; CopyPolySequence: PROC [polys: PolySequence] RETURNS [PolySequence]; AddToPolySequence:PROC [polys: PolySequence, poly: Poly] RETURNS [PolySequence]; LengthenPolySequence: PROC [polys: PolySequence, amount: REAL ¬ 1.3] RETURNS [new: PolySequence]; CopyVertSequence: PROC [verts: VertSequence, copyData: BOOL ¬ FALSE] RETURNS [VertSequence]; AddToVertSequence: PROC [verts: VertSequence, vert: Vert] RETURNS [VertSequence]; LengthenVertSequence: PROC [verts: VertSequence, amount: REAL ¬ 1.3] RETURNS [new: VertSequence]; END. Œ G3dPolyNet.mesa Copyright Σ 1984, 1992 by Xerox Corporation. All rights reserved. Glassner, February 18, 1991 2:29 pm PST Jules Bloomenthal July 15, 1992 5:11 pm PDT Basic Types Local Types The PolyNet data structure is intended as a lightweight, compact description for the critical topological and geometric information of a 3D shape. Every polygon is represented by an instance of the Poly data structure, which provides a list of vertex indices, a list of neighbor indices (these are indices in the polyNet for each polygon that shares an edge with this polygon), the plane information, a visibility flag, and a clientData ref. The vertices themselves contain a pointer to the standard vertex info, and a list of the polygons around that vertex (in order, but the cw/ccw direction is not consistent across vertices). Because of the explicit connectivity information represented by the neighbors and polyRing fields, one can make topology changes to the polyNet and easily verify the resulting topology. Note that you can capture all the edges by visiting the net for all neighbor pairs, and only processing those where p0J™—š € œžœ"žœžœžœ˜GJ™ŒJ˜—š €œžœ"žœžœžœ˜DJ™zJ™—š €œžœ"žœžœžœ˜KJ™L——š ™š € œžœžœžœžœ ˜HJ™@J™—š € œžœžœžœžœžœ˜FJ™:J™—š € œžœ"žœžœžœ ˜SJ™ϊ——š ™™ J™—Jš€œžœžœ˜DJš€œžœ#žœ˜Pš€œžœžœžœ˜aJ˜—Jš €œžœ!žœžœžœ˜\Jš€œžœ#žœ˜QJš€œžœžœžœ˜aJ˜—Jšžœ˜J˜—…— Ί ι