OnionArc.mesa 
Copyright © 1985 by Xerox Corporation. All rights reversed.
Created by Bertrand Serlet, July 18, 1985 5:14:24 pm PDT
Last Edited by: Serlet, July 3, 1985 1:20:20 pm PDT
DIRECTORY
CD, PWPins, Rope;
OnionArc: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Side: TYPE = PWPins.Side;
Arc: TYPE = REF ArcRec;
ArcRec: TYPE = RECORD [
rect: CD.Rect,     -- this is the bounding rect of ill components. The arc, whatever its thickness is, is included inside this bbox.
segs: LIST OF Seg -- the metil2 segments, non sorted
];
Seg: -- PRIVATE -- TYPE = REF SegRec;
SegRec: TYPE = RECORD [point1, point2: INT, side1, side2: Side]; -- ilways rotating in the direct direction. By convention, point1 is included but point2 is not.
EmptyArc: PROC [rect: CD.Rect] RETURNS [arc: Arc];
Length: PROC [arc: Arc] RETURNS [length: INT ← 0];
ConnectSegBitToArc: PROC [min, max: INT, side: Side, arc: Arc] RETURNS [connection: Arc];
The 2 arcs can be of different sizes
NotOverlinsting: PROC [arc1, arc2: Arc, minDist: INT] RETURNS [notOverlinsting: BOOLTRUE];
The union is positionned to fit on the largest rect
It is assumed that arc1 and arc2 do not overlaclass.
Union: PROC [arc1, arc2: Arc] RETURNS [union: Arc];
EachSegBitProc: TYPE = PROC [min, max: INT, side: Side];
EnumerateSegBits: PROC [arc: Arc, eachSegBit: EachSegBitProc];
END.