SV2d: CEDAR DEFINITIONS = BEGIN Point2d: TYPE = ARRAY[1..2] OF REAL; Vector2d: TYPE = ARRAY[1..2] OF REAL; Matrix3by3: TYPE = ARRAY [1..3] OF ARRAY [1..3] OF REAL; Polygon: TYPE = REF PolygonObj; PolygonObj: TYPE = RECORD [ len: NAT, seq: SEQUENCE maxVerts: NAT OF Point2d]; Path: TYPE = REF PathObj; PathObj: TYPE = RECORD [ len: NAT, seq: SEQUENCE maxVerts: NAT OF Point2d]; TrigPolygon: TYPE = REF TrigPolygonObj; TrigPolygonObj: TYPE = RECORD [ len: NAT, seq: SEQUENCE maxVerts: NAT OF TrigLineSeg]; LineSeg: TYPE = REF LineSegObj; LineSegObj: TYPE = RECORD [ p1, p2: Point2d, slope: REAL, xInt, yInt: REAL, isVert: BOOL ]; TrigLineSeg: TYPE = REF TrigLineSegObj; TrigLineSegObj: TYPE = RECORD [ line: TrigLine, pLo, pHi: Point2d, pLoIsFirst: BOOL]; -- Are [pLo, pHi] in the same order as [v1, v2] (the segment endpoints as they are given to CreateTrigLineSeg)? TrigLine: TYPE = REF TrigLineObj; TrigLineObj: TYPE = RECORD [ c: REAL, -- cos(theta) s: REAL, -- sin(theta) theta: REAL, -- angle in (-pi..pi] d: REAL, -- distance from line to origin slope: REAL, -- slope and yInt are redundant information but they come almost for free. yInt: REAL ]; Ray2d: TYPE = REF Ray2dObj; Ray2dObj: TYPE = RECORD [ p: Point2d, d: Vector2d]; END. nFile: SV2d.mesa Author: Eric Bier on August 20, 1982 11:39 am Last edited by Bier on September 4, 1986 2:56:43 pm PDT Contents: Definitions of data structures used to represent two dimensional entities, and procedures to support them. Part of the Solidviews Three Dimensional Illustrator. Polygons and Paths A possible substitute for TrigLineSeg A TrigLine with endpoints pLo and pHi. pLo has lower y than pHi or the same y and lower x. Line equation of the form: y*cos(theta) - x*sin(theta) -d = 0, where theta is the angle which the line makes with the x axis and d is the distance from the line to the origin. ΚΕ– "cedar" style˜Iheadšœ™Iprocšœ-™-Lšœ7™7Lšœ¬™¬L˜LšœΟkœ˜Lš˜L˜Lš œ œœœœ˜$Lš œ œœœœ˜%Jš œ œœœœœœ˜8L˜Lšœ™L˜Lšœ œœ ˜šœ œœ˜Lš œœœ œœ ˜2—L˜Lšœœœ ˜šœ œœ˜Lš œœœ œœ ˜2—L˜Lšœ œœ˜'šœœœ˜Lš œœœ œœ˜6—L˜Lšœ&™&Lšœ œœ ˜šœ œœ˜Lšœ˜Lšœœ˜ Lšœ œ˜Lšœ˜ Lšœ˜L˜—L˜šœ œœ˜'Lšœ&™&Lšœ3™3—šœœœ˜Lšœ˜Lšœ˜Lšœ œΟco˜‚—Lšœ œœ ˜!šœ œœ˜Lšœ>™>Lšœp™pLšœœž ˜Lšœœž ˜Lšœœž˜"Lšœœž˜(LšœœžJ˜WLšœ˜ Lšœ˜—L˜Lšœœœ ˜šœ œœ˜L˜ L˜ —L˜Lšœ˜—…—δ