ImplicitAdapt.mesa
Copyright Ó 1985, 1990 by Xerox Corporation. All rights reserved.
Bloomenthal, August 11, 1992 4:01 pm PDT
DIRECTORY G3dBasic, G3dOctree, ImplicitDefs, Rope;
ImplicitAdapt: CEDAR DEFINITIONS
~ BEGIN
Triple:   TYPE ~ G3dBasic.Triple;
Cube:    TYPE ~ G3dOctree.Cube;
Octree:   TYPE ~ G3dOctree.Octree;
CrossSequence: TYPE ~ ImplicitDefs.CrossSequence;
MacroPolygons: TYPE ~ ImplicitDefs.MacroPolygons;
NormalProc:  TYPE ~ ImplicitDefs.NormalProc;
StatusProc:  TYPE ~ ImplicitDefs.StatusProc;
ValueProc:  TYPE ~ ImplicitDefs.ValueProc;
ROPE:    TYPE ~ Rope.ROPE;
Part 1: Adaptive Subdivision of an Existing Octree
Subdivide: PROC [
root: Cube,
adaptLimit: NAT,
flatLimit: REAL,
valueProc: ValueProc,
threshold: REAL ¬ 1.0,
normalProc: NormalProc ¬ NIL,
statusProc: StatusProc ¬ NIL,
clientData: REF ANY ¬ NIL]
RETURNS [msg: ROPE];
Adaptively subdivide those terminal nodes of root that meet subdivision criteria.
adaptLimit is the limit on additional subdivision. statusProc called for each subdivided cube.
Part 2: Adaptively Sized Surface Tracking
Track: PROC [
seedSize: REAL,
surfacePoint: Triple,
valueProc: ValueProc,
threshold: REAL ¬ 1.0,
normalProc: NormalProc ¬ NIL,
statusProc: StatusProc ¬ NIL,
clientData: REF ANY ¬ NIL,
adaptLimit: NAT ¬ 0,
flatLimit: REAL ¬ 30.0,
tolerance: REAL ¬ 0.0001]
RETURNS [Octree];
Create an "aggregated" octree by tracking the surface.
Adaptively refine the individual cubes to a max of adaptLimit subdivisions.
cubeProc called for each subdivided cube.
Part 3: Miscellaneous Procedures
Roundness: PROC [
cube: Cube,
valueProc: ValueProc,
threshold: REAL ¬ 1.0,
normalProc: NormalProc,
clientData: REF ANY ¬ NIL]
RETURNS [REAL];
NormalFromCrossSequence: PROC [polygon: CrossSequence] RETURNS [Triple];
LinearDeviation: PROC [cube: Cube] RETURNS [REAL];
Use least squares fit of linear function to cube corners; return deviation.
TooRound: PROC [
polygon: CrossSequence,
cosFlatLimit: REAL,
cosPerpFlatLimit: REAL,
valueProc: ValueProc,
threshold: REAL ¬ 1.0,
normalProc: NormalProc,
cube: Cube,
clientData: REF ANY]
RETURNS [BOOL];
MacroPolygonize: PROC [
cube: Cube,
valueProc: ValueProc,
threshold: REAL ¬ 1.0,
clientData: REF ANY]
RETURNS [macro: MacroPolygons];
END.