TriangleRep:
TYPE ~
RECORD [
p0, p1, p2: Triple ¬ [], -- triangle vertices
a0, a1, a2: Quad ¬ [], -- nearness accelerators
l0, l1, l2: Triple ¬ [], -- planar line equations
plane: Plane ¬ [], -- plane of triangle
majorPlane: MajorPlane ¬ xy, -- major plane of triangle
refAny: REF ANY ¬ NIL -- for client use
];
PolygonRep:
TYPE ~
RECORD [
points: TripleSequence ¬ NIL, -- sequence of points
indices: NatSequence ¬ NIL, -- to points, if nil use points only
normal: Triple ¬ [], -- polygon normal
plane: Plane ¬ [], -- plane of polygon
majorPlane: MajorPlane ¬ unknown, -- major plane of polygon
center: Triple ¬ [], -- center of polygon
area: REAL ¬ 0.0, -- area of polygon
fwdFacing: BOOL ¬ FALSE, -- true if facing towards eyepoint
accs: QuadSequence ¬ NIL, -- nearness accelerators
lines: TripleSequence ¬ NIL, -- planar line equations
neighbors: PolygonSequence ¬ NIL, -- neighbor across edge
convex: BOOL ¬ TRUE, -- if polygon is convex
refAny: REF ANY ¬ NIL -- for client use
];
In general, the edge attributes (accs, lines, neighbors) are indexed such that
polygon.attribute[n] is relative to the edge between vertices [n] and [n+1].