DIRECTORY G3dBasic, G3dMatrix, IO, Rope; G3dTetrahedron: CEDAR DEFINITIONS ~ BEGIN Error: ERROR [reason: Rope.ROPE]; TetrahedronRep: TYPE ~ RECORD [ from3d: G3dMatrix.Matrix ¬ NIL, fromBary: G3dMatrix.Matrix ¬ NIL ]; Tetrahedron: TYPE ~ REF TetrahedronRep; Create: PROC [p0, p1,p2,p3: G3dBasic.Triple] RETURNS [Tetrahedron]; Copy: PROC [Tetrahedron] RETURNS [Tetrahedron]; MapFromBarycentric: PROC [t: Tetrahedron, pt: G3dBasic.Quad] RETURNS [G3dBasic.Quad]; MapFrom3D: PROC [t: Tetrahedron, pt: G3dBasic.Quad] RETURNS [G3dBasic.Quad]; IsInside: PROC [t: Tetrahedron, pt: G3dBasic.Quad, tol: REAL ¬ 0.001] RETURNS [BOOL]; BoundingBox: PROC [t: Tetrahedron] RETURNS [G3dBasic.Box]; Read: PROC[IO.STREAM] RETURNS [Tetrahedron]; Write: PROC[Tetrahedron, IO.STREAM]; Debug: PROC [dbg: IO.STREAM]; END. F G3dPlane.mesa Copyright Σ 1991, 1992 by Xerox Corporation. All rights reserved. Ken Fishkin, August 20, 1992 4:08 pm PDT Jules Bloomenthal July 14, 1992 2:03 pm PDT Errors Type Declarations A tetrahedron simply consists of transformations which map to and from barycentric coordinates Creation Return the Tetrahedron with the four given vertices. Return the Tetrahedron with the four given vertices. Operation Given 4-tuple barycentric coords of a point inside the tetrahedron, return that point. The inverse: MapFromBarycentric[Mapfrom3D[p]] = p. Is a given point within the given tetrahedron? Requires a full matrix multiply: use only if cutting planes are not available/desirable. tol is the tolerance to reduce precision error. I/O Debug Sets module debugging. debugging is turned off (the default) by setting dbg to NIL. Κλ•NewlineDelimiter –"cedarcode" style™™ Jšœ Οeœ6™BJ™(J™+J˜JšΟk œžœ˜(J˜—JšΡblnœžœž ˜!Jšœž˜headšΟl™JšΟnœžœžœ˜!—š ™™^J™—šœžœžœ˜Jšœžœ˜#Jšœ ž˜#J˜—Jšœžœžœ˜(—š ™š‘œžœ!žœ˜CJ™4—š‘œžœžœ˜/J™4——š  ™ š‘œžœ%žœ˜UJ™V—J™š‘ œžœ%žœ˜LJ™2J™—š ‘œžœ*žœ žœžœ˜UJ™[J™[—J˜Jš‘ œžœžœ˜:—š ™Jš ‘œžœžœžœžœ˜,Jš‘œžœžœžœ˜$—™š‘œžœžœžœ˜J™SJ˜——Jšžœ˜J˜—…—,]