Minimal Polygonizer
Triple: TYPE ~ G3dBasic.Triple;
CubeProc: TYPE ~ ImplicitCubeTet.CubeProc;
Tetrahedron: TYPE ~ ImplicitCubeTet.Tetrahedron;
IDs: TYPE ~ ImplicitStorage.IDs;
Edges: TYPE ~ ImplicitStorage.Edges;
Vertices: TYPE ~ ImplicitStorage.Vertices;
Function: TYPE ~ PROC [point: Triple, clientData: REF ANY] RETURNS [value: REAL ¬ 0.0];
TriangleProc:
TYPE
~
PROC
[i1,
i2,
i3:
INT,
vertices: Vertices]
RETURNS [continue: BOOL ¬ TRUE];
Error:
ERROR [reason: Rope.
ROPE];
Propagate:
PROC [
function: Function,
level, size: REAL,
clientData: REF ANY ¬ NIL,
start: Triple ¬ [],
action: CubeProc]
RETURNS [centers: REF ImplicitStorage.Centers];
Propagate cubes across the implicit function.
ProcessTet:
PROC [
function: Function,
clientData: REF ANY,
level: REAL,
tet: REF Tetrahedron,
tetID: INT,
ids: REF IDs,
edges: REF Edges,
vertices: Vertices,
epsilon: REAL,
action: TriangleProc]
RETURNS [Vertices];
Call action for each triangle produced from the tetrahedron.
If ids = NIL, do not tha tests if tetrahedral corner is negligibly close to surface.
Triangulate:
PROC [
function: Function, -- the implicit function
level: REAL, -- contour level
size: REAL, -- size of cubic partitioning
clientData: REF ANY ¬ NIL, -- passed back to function
start: Triple ¬ [], -- if [], randomly search
triangleAction: TriangleProc] -- called per generated triangle
RETURNS [error: Rope.ROPE];
Generate points and polygons for the given function at the given contour level.
ShapeFromFunction:
PROC [
function: Function,
level, size: REAL, -- level, cube size
clientData: REF ANY ¬ NIL, -- passed back to function
start: Triple ¬ [], -- if [], randomly search
statusAction: TriangleProc ¬ NIL] -- progress report, usually graphical
RETURNS [G3dShape.Shape];
Utility for G3d clients. ! Error.
Converge:
PROC
[pos,
neg:
Triple, val, level:
REAL, function: Function, clientData:
REF
ANY]
RETURNS [Triple];
Converge to a point on the surface.
Normal:
PROC [point: Triple, function: Function, delta:
REAL, clientData:
REF
ANY]
RETURNS [Triple];
Return the normal at the given point.
FindStart:
PROC [
ballpark: Triple,
function: Function,
size, level: REAL,
clientData: REF ANY ¬ NIL]
RETURNS [Triple];
Attempt to find a starting point. ! Error["can't find starting point"}.