GGBuiltinShapes.mesa
Copyright Ó 1986, 1992 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;
Slice: TYPE = GGModelTypes.Slice;
Point: TYPE = GGBasicTypes.Point;
PolygonInCircle: PROC [sideCount: NAT, origin: Point, radius: REAL, defaults: DefaultData] RETURNS [outline: Slice];
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: Slice];
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.