DIRECTORY G3dBasic, G3dShape; G3dBox: CEDAR DEFINITIONS ~ BEGIN Box: TYPE ~ G3dBasic.Box; NatSequence: TYPE ~ G3dBasic.NatSequence; Surface: TYPE ~ G3dBasic.Surface; Triple: TYPE ~ G3dBasic.Triple; TripleSequence: TYPE ~ G3dBasic.TripleSequence; VertexSequence: TYPE ~ G3dShape.VertexSequence; BoxFromPoints: PROC [p0, p1: Triple] RETURNS [Box]; BoxFromSurface: PROC [surf: Surface, verts: VertexSequence] RETURNS [Box]; BoxFromVertices: PROC [nats: NatSequence, verts: VertexSequence] RETURNS [Box]; BoxFromTripleSequence: PROC [ts: TripleSequence] RETURNS [Box]; Intersect: PROC [box1, box2: Box] RETURNS [has: BOOL, intersection: Box]; PointInBox: PROC [box: Box, pt: Triple] RETURNS [BOOL]; BoxUnionBox: PROC [b1, b2: Box] RETURNS [Box]; BoxUnionPoint: PROC [box: Box, point: Triple] RETURNS [Box]; BoxMap: PROC [rel, abs: Box] RETURNS [Box]; BoxCenter: PROC [box: Box] RETURNS [Triple]; BoxEdges: PROC [box: Box] RETURNS [Triple]; Lerp: PROC [alpha, low, high: REAL] RETURNS [REAL]; Min3d: PROC [p0, p1: Triple] RETURNS [Triple]; Max3d: PROC [p0, p1: Triple] RETURNS [Triple]; END. Β G3dBox.mesa Copyright Σ 1985, 1992 by Xerox Corporation. All rights reserved. Glassner, February 14, 1991 10:13 am PST Jules Bloomenthal July 14, 1992 1:51 pm PDT Ken Fishkin, August 25, 1992 1:16 pm PDT Imported Types Creation Return a box which contains the two points. Return the box which contains the surface. Return the smallest box which contains the vertices indicated in the sequence. Return the smallest box which contains all points in the TripleSequence. Tests If the two boxes intersect, (has) is TRUE, and (intersection) is their intersection. If they do not intersect, (has) is FALSE, and (intersection) is undefined. Return TRUE iff the given point is inside the given box. Combination Return the smallest box which contains both input boxes Return the smallest box which contiains the input box and the point Modification Return the box defined by considering 'rel' as relative coordinates in 'abs'. Derived Data Return the center of the box. Return the magnitudes of the lengths of the three edges. Utility Procs Linear interpolation. When alpha=0, return low, when alpha=1, return high. Return the component-wise minimum of two points. Return the component-wise maximum of two points. Κe–"cedarcode" style•NewlineDelimiter ™™ Jšœ Οeœ6™BJ™(J™+J™(J˜JšΟk œ˜J˜—šΡblnœžœž ˜J˜—Jšœž˜headšΟl™Jšœ žœ˜Jšœžœ˜+Jšœ žœ˜$Jšœ žœ˜"Jšœžœ˜0Jšœžœ˜0—š ™šΟn œžœžœ˜3J™+J™—š‘œžœ(žœ˜JJ™*—J˜š‘œžœ,žœ˜OJ™N—J˜š‘œžœžœ˜?J™H——š ™š‘ œžœžœžœ˜IJ™Ÿ—š‘ œžœžœžœ˜7J™8——š  ™ š‘ œžœžœ˜.J™7J™—š‘ œžœžœ˜