DIRECTORY G3dBasic, G3dMatrix, G3dPatch, G3dPlane, G3dSpline, IO, Rope; G3dTriangle: CEDAR DEFINITIONS ~ BEGIN Triple: TYPE ~ G3dBasic.Triple; Patch: TYPE ~ G3dPatch.Patch; MajorPlane: TYPE ~ G3dPlane.MajorPlane; Plane: TYPE ~ G3dPlane.Plane; Segment: TYPE ~ RECORD [p1, p2: Triple, length: REAL, info: ATOM]; Segments: TYPE ~ RECORD [length: INT ฌ 0, s: SEQUENCE maxLength: INT OF Segment]; IntTriple: TYPE ~ RECORD [i, j, k: INT ฌ 0]; IntTriples: TYPE ~ RECORD [length: INT ฌ 0, s: SEQUENCE maxLength: INT OF IntTriple]; Triangle: TYPE ~ RECORD [ p1, p2, p3: Triple ฌ [], l1, l2, l3: Triple ฌ [], -- connect pts 1-2, 2-3, 3-1 in majorPlane plane: Plane ฌ [], -- plane of triangle majorPlane: MajorPlane ฌ xy -- major plane of triangle ]; Triangles: TYPE ~ RECORD [length: INTฌ0, s: SEQUENCE maxLength: INT OF REF Triangle]; TriangleProc: TYPE ~ PROC [p1, p2: Triple, t: REF Triangle] RETURNS [continue: BOOLฌTRUE]; TriIntersection: TYPE ~ RECORD [intersect: BOOL, point: Triple]; DistanceToTriangles: PROC [triangles: REF Triangles, p: Triple] RETURNS [REAL]; TriangleCenter: PROC [t: REF Triangle] RETURNS [c: Triple]; AverageTriangleNormals: PROC [triangles: REF Triangles] RETURNS [Triple]; MaxDeviationFromNormal: PROC [normal: Triple, triangles: REF Triangles] RETURNS [REAL]; ApplyToTrianglesSides: PROC [triangles: REF Triangles, action: TriangleProc]; MakeTriangle: PROC [p1, p2, p3: Triple, scratch: REF Triangle ฌ NIL] RETURNS [REF Triangle]; SetTriangle: PROC [t: REF Triangle]; SetTriangles: PROC [triangles: REF Triangles]; InsideTriangle: PROC [p: Triple, t: REF Triangle] RETURNS [BOOL]; IntersectTriangle: PROC [p1, p2: Triple, t: REF Triangle] RETURNS [TriIntersection]; TrianglesFromPatch: PROC [patch: Patch, sRes, tRes: INT] RETURNS [REF Triangles]; BoundaryFromPatch: PROC [patch: Patch, sRes, tRes: INT, cullColinearPoints: BOOL ฌ FALSE] RETURNS [REF Segments]; Normal: PROC [p1, p2, p3: Triple] RETURNS [Triple]; ObtainTriangles: PROC RETURNS [REF Triangles]; ReleaseTriangles: PROC [scratch: REF Triangles]; AddTriangle: PROC [t: REF Triangle, triangles: REF Triangles] RETURNS [REF Triangles]; CopyTriangles: PROC [triangles: REF Triangles] RETURNS [REF Triangles]; AddIntTriple: PROC [i: IntTriple, intTriples: REF IntTriples] RETURNS [REF IntTriples]; END. า G3dTriangle.mesa Copyright c 1992 by Xerox Corporation. All rights reserved. Bloomenthal, November 21, 1992 3:51 pm PST Types Triangle Operations Return the signed distance to the nearest triangle surface, edge, or vertex. Return the center of the triangle. Return the average of all the triangle normals, which are presumed of unit length. Return the maximum deviation in degrees of the triangle normals from the given normal. normal and triangle plane normals presumed unit length. Call action for each of the triangles and their edges. Return a set triangle from the three vertices. Set the triangle plane, majorPlane, and lines. Set the triangle planes, majorPlanes, and lines. Test if the point on the plane of the triangle is contained by the triangle. Return the intersection of the line segment with the triangle. Return a sequence of set triangles spanning the patch at the given resolution. Make the boundary given the patch and resolutions. Return the normal of the triangle defined by the three points. Obtain a sequence from a scratch pool. Return the scratch sequence to the scratch pool. Add the triangle to the sequence. Return a copy of the input sequence of triangles. Add i to the sequence. ส–•NewlineDelimiter ™™Jšœ ฯmœ1™J™—š ฅœžœžœžœžกœ ˜QJ™NJ™—š ฅœžœžœžœžœ˜YJšžœžœ ˜J™2J™—šฅœžœžœ ˜3J™>J™—šฅœžœžœžœ ˜.J™&J™—šฅœžœ žœ ˜0J™0J™—š ฅ œžœžœžœ žœžœ ˜VJ™!J™—š ฅ œžœ žœ žœžœ ˜GJ™1J™—š ฅ œžœžœ žœžœ ˜WJ™——J™Jšžœ˜J˜—…— *’