File: SVFaces.mesa
Last edited by Bier on September 24, 1987 12:17:20 pm PDT
Contents: Definitions of various face types such as Cone, Disk Ring, and Cylinder and procedures which make them from simpler data
DIRECTORY
SV2d, SV3d, SVBasicTypes, SVModelTypes;
SVFaces: CEDAR DEFINITIONS =
BEGIN
BoundBox: TYPE = SVBasicTypes.BoundBox;
Sphere: TYPE = SV3d.Sphere;
BoundHedron: TYPE = SVBasicTypes.BoundHedron;
TrigLineSeg: TYPE = SV2d.TrigLineSeg;
Vector3d: TYPE = SV3d.Vector3d;
The cone described here is revolute around the y-axis. Otherwise it is very general, allowing for an arbitrary apex point (on the y-axis) and an arbitrary spread ratio.
Cone: TYPE = REF ConeObj;
ConeObj: TYPE = RECORD [
h: REAL,-- y at the apex
M: REAL,-- r/|y-h|
yHi, yLo: REAL,
normalPointsOut: BOOL,
noseIsUp: BOOL,
boundHedron: BoundHedron,
boundBox: BoundBox,
boundSphere: Sphere];
The disk ring described here is revolute around the y-axis. Otherwise it is very general. It may be in an arbitrary horizontal plane (y = yPlane), may have any two radii, rIn and rOut subject to rIn, rOut >= 0 AND rOut > rIn, and may have an upward or downward pointing normal.
DiskRing: TYPE = REF DiskRingObj;
DiskRingObj: TYPE = RECORD [
yPlane: REAL,
normal: Vector3d,
rInSquared, rOutSquared: REAL,
boundHedron: BoundHedron,
boundBox: BoundBox,
boundSphere: Sphere];
The cylinder described here is revolute around the y-axis. Otherwise it is very general. It may have its top and bottom in arbitrary horizontal planes (y = yHigh and y = yLow) subject to yHigh > yLow and may have an arbitrary radius r.
Cylinder: TYPE = REF CylinderObj;
CylinderObj: TYPE = RECORD [
yHi, yLo: REAL,
r: REAL,
rSquared: REAL,
normalPointsOut: BOOL,
boundHedron: BoundHedron,
boundBox: BoundBox,
boundSphere: Sphere];
The edge on rectangle has a surface normal parallel to the xy plane. That is, it is edge on when viewed from the z direction.
EdgeOnRect: TYPE = REF EdgeOnRectObj;
EdgeOnRectObj: TYPE = RECORD [
frontZ, backZ: REAL,
A, B, D: REAL,-- plane equation Ax + By + D = 0.
normal: Vector3d,
valHi, valLo: REAL,
valIsY: BOOL, -- valHi and valLo will be y values if the edge on rectangle is more closely verical than horizontal and x values otherwise
boundHedron: BoundHedron,
boundBox: BoundBox,
boundSphere: Sphere
];
ConeFromTrigLineSeg: PROC [seg: TrigLineSeg] RETURNS [cone: Cone];
AttemptToCreateDegenerateCone: ERROR;
DiskRingFromTrigLineSeg: PROC [seg: TrigLineSeg] RETURNS [diskRing: DiskRing];
AttemptToCreateDegenerateDiskRing: ERROR;
CylinderFromTrigLineSeg: PROC [seg: TrigLineSeg] RETURNS [cylinder: Cylinder];
AttemptToCreateDegenerateCylinder: ERROR;
EdgeOnRectFromTrigLineSeg: PROC [seg: TrigLineSeg, frontZ, backZ: REAL] RETURNS [edgeOnRect: EdgeOnRect];
AttemptToCreateDegenerateEdgeOnRect: ERROR;
END.