SV3d: DEFINITIONS = BEGIN Point3d: TYPE = ARRAY [1..3] OF REAL; Vector3d: TYPE = ARRAY [1..3] OF REAL; Matrix4by4: TYPE = ARRAY [1..3] OF ARRAY [1..4] OF REAL; Line3d: TYPE = REF Line3dObj; Line3dObj: TYPE = RECORD [ base: Point3d, direction: Vector3d, mat: Matrix4by4 -- the z axis of this mat is on line, the origin is base. mat is orthonormal. ]; Edge3d: TYPE = REF Edge3dObj; Edge3dObj: TYPE = RECORD [ line: Line3d, start, end: Point3d ]; Poly3d: TYPE = REF Poly3dObj; Poly3dObj: TYPE = RECORD [ len: NAT, seq: SEQUENCE maxVerts: NAT OF Point3d]; PolyDatabase: TYPE = LIST OF Poly3d; Plane: TYPE = REF PlaneObj; PlaneObj: TYPE = RECORD [ A, B, C, D: REAL]; END. ’File: SV3d.mesa Author: Eric Bier on August 12, 1983 7:27 pm Last edited by: Bier March 29, 1987 2:45:06 pm PST Contents: Definitions for three-dimensional types. base is the closest point on the line to the origin. direction is the set of direction cosines of the line. Parametrically, the line is base + t * direction, for all Real t. Plane equation: Ax + By + Cz + D = 0; The normal vector is [A, B, C]; The y = 0 plane for instance has A = C = D = 0; If B = 1 THEN normal is [0, 1, 0] pointing up. Plug in point (4, 5, 6) = 5 (pos, normal side, up). If B = -1 THEN normal is [0, -1, 0] pointing down. Plug in point (4, 5, 6) = -5 (neg, not normal side, up). Κ«˜Ihead™J™,J™2J™3JšœΟk œ˜Jšœ˜Jš œ œœœœ˜%Jš œ œœœœ˜&Jš œ œœœœœœ˜8J˜Jšœœœ ˜šœ œœ˜Icode™―J˜J˜JšœΟcN˜^J˜J˜—Jšœœœ ˜šœ œœ˜Jšœ ˜ J˜J˜J˜—Jšœœœ ˜procšœ œœ˜Mš œœœ œœ ˜3—Jšœœœœ˜$J˜Jšœœœ ˜šœ œœ˜šœ œ˜Mšœ%™%Mšœ™Mšœ/™/Mšœ œV™cMšœl™l——J˜Jšœ˜—…—¦σ