INTERFACE Heuristics; (* A couple of surface-smoothing heuristics. Created 1994 by Rober M. Rosi and J. Stolfi. *) IMPORT Random; FROM Triang IMPORT Arc, Coords; TYPE BOOLS = ARRAY OF BOOLEAN; PROCEDURE SpreadVertex( a: Arc; VAR c: Coords; READONLY variable: BOOLS; coins: Random.T; ); (* Rotates the neighbors of "v=Org(a)" around the surface normal at "v", so as to equalize the angles between them. Only moves vertices that are marked "variable". *) PROCEDURE FlattenVertex( a: Arc; VAR c: Coords; READONLY variable: BOOLS; coins: Random.T; ); (* Places "v=Org(a)" at the barycenter of its neighbors, displaced along the surface normal by an amount that hopefully minimizes the bending energy between the faces incident to "v" and the faces adjacent to them. A no-op if "v" is not marked variable. *) END Heuristics.