GGBuiltinShapes.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on June 23, 1986
Contents: The regular polygons and other commonly requested shapes.
DIRECTORY
GGBasicTypes, GGModelTypes;
GGBuiltinShapes: CEDAR DEFINITIONS = BEGIN
DefaultData: TYPE = GGModelTypes.DefaultData;
Outline: TYPE = GGModelTypes.Outline;
Point: TYPE = GGBasicTypes.Point;
Slice: TYPE = GGModelTypes.Slice;
PolygonInCircle: PROC [sideCount: NAT, origin: Point, radius: REAL, defaults: DefaultData] RETURNS [outline: Outline];
The bottom-most edge of the returned polygon will be horizontal. The polygon will be inscribed inside the circle with radius "radius" centered at "origin".
Circle: PROC [origin: Point, radius: REAL, defaults: DefaultData] RETURNS [slice: Slice];
Box: PROC [origin: Point, sideLength: REAL, defaults: DefaultData] RETURNS [slice: Slice];
KnotchedLine: PROC [p0, p1: Point, segmentCount: NAT] RETURNS [outline: Outline];
Returns a trajectory with "segmentCount" straight line segments, all of the same length. The entire trajectory is a single straight line, from point p0 to p1. All of its segments are collinear. Knotched lines are useful as rulers.
END.