DIRECTORY GGModelTypes, CubicSplines; GGSegment: CEDAR DEFINITIONS = BEGIN Point: TYPE = GGModelTypes.Point; Segment: TYPE = GGModelTypes.Segment; SegmentClass: TYPE = GGModelTypes.SegmentClass; MakeLine: PROC [p0, p1: Point] RETURNS [seg: Segment]; MakeBezier: PROC [p0, p1, p2, p3: Point] RETURNS [seg: Segment]; MakeConic: PROC [p0, p1, p2: Point, r: REAL] RETURNS [seg: Segment]; MakeArc: PROC [p0, p1, p2: Point] RETURNS [seg: Segment]; MakeCubicSpline: PROC [cps: CubicSplines.KnotSequence, type: CubicSplines.SplineType] RETURNS[Segment]; CopySegment: PROC [seg: Segment] RETURNS [copy: Segment]; ReverseSegment: PROC [seg: Segment]; FetchSegmentClass: PROC [type: ATOM] RETURNS [class: SegmentClass]; NotFound: SIGNAL; END. GGSegment.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Last edited by Bier on July 10, 1985 4:23:05 pm PDT Contents: Procedures which implement the Gargoyle segment classes. Stone, August 5, 1985 3:25:55 pm PDT Making Segments (much like the Imager interface) Create a straight line segment between the two points. Create a Bezier segment which passed thru p0 and p3, guided by p1 and p2. Let m be the midpoint of [p0, p2]. Let p be the point on [m, p1] such that Length[m, p]/Length[m, p1] = r. The curve starts at p0, passes through p, and ends at p2. It is a line if r=0; an ellipse if 0