INTERFACE Squared; (* This interface contain procedures to build several faces such as: n-gons, triangles and squares, and complexes : cube, ball, bigcube (3D array of cube) with procedures for the glueing of two such complexes. Created by L. Lozada (see the copyright and authorship futher down). Revisions: 30-08-2000 : Nice version of the "MakeOctahedron" procedure. 19-09-2000 : Added the procedure "MakeDodecahedronTriang". 27-10-2000 : Modified "SetCubePropiertes" procedure. 04-11-2000 : Added the "CubeNegVertices" and "CubeBarycenter" procedures. *) IMPORT Triangulation, LR4; FROM Triangulation IMPORT Pair, Topology, Vertex, Coords; TYPE TriPair = ARRAY OF ARRAY OF ARRAY [0..1] OF Pair; PROCEDURE MakeTriangle(): Pair; (* Make one triangular face and set the three pairs facetedges with the same face component. *) PROCEDURE MakeSquare(): Pair; (* Builds one squared face. The four "pairs" have the same face component. *) PROCEDURE MakeOctahedron(): ARRAY [0..7] OF Pair; (* Builds a Octahedron. *) PROCEDURE MakeOctahedronTriang(Original: BOOLEAN): ARRAY [0..7] OF Pair; (* Builds a triangulated Octahedron. If Original=TRUE the procedure empha- size the original elements. *) PROCEDURE MakeIcosahedronTriang(Original: BOOLEAN): ARRAY [0..19] OF Pair; (* Builds a triangulated Icosahedron. If Original=TRUE the procedure empha- size the original elements. *) PROCEDURE MakeDodecahedronTriang( Original: BOOLEAN; ) : ARRAY[0..11] OF ARRAY [0..4] OF Pair; (* Builds a triangulated Dodecahedron, trough the automatic gluing of tetrahedra. If Original=TRUE the procedure emphasize the original elements. *) PROCEDURE MakeGon(n: CARDINAL): Pair; (* Builds one "n-gon" face. The "n-pairs" have the same face component. *) PROCEDURE MakeGonFull(n: CARDINAL): REF ARRAY OF Pair; (* Builds one "n-gon" face. The "n-pairs" have the same face component and this procedure return one pair facet-edge by side. *) PROCEDURE MakeCube(): ARRAY [0..5] OF Pair; (* Builds a cube from six squared faces. Returns one pair from each face. Face 0 is the bottom, faces 1..4 are the sides, face 5 is the top, as shown below. | +------+ | | | | | | | |5 | | +------+------+------+------+ | | | | | | | | | | | | | |1 |2 |3 |4 | | +------+------+------+------+ | | | | | | | |0 | | +------+ *) PROCEDURE MakeBall() : ARRAY [0..3] OF Pair; (* Buils one polyhedron with American football shape. This polyhedron is the gluing scheme for obtain the "pseudomanifold" complex. *) PROCEDURE MakeTetrahedron() : ARRAY [0..3] OF Pair; (* Builds one tetrahedron such that the facetedges pairs have "Ppos=NIL". Use in Baricentric Subdivision. *) PROCEDURE MakePyramid(n: CARDINAL) : REF ARRAY OF Pair; (* Builds a pyramid with base as a n-gon face. *) PROCEDURE MakeColumnCube(order: CARDINAL) : REF TriPair; (* Build one bidimensional array of cubes of order: "order x order". *) PROCEDURE MakeBigCube(order: CARDINAL) : REF TriPair; (* Build one tridimensional array of cubic cellulas. Return two arrays of pairs of order: "order x order", not eliminated by gluing procedure of columns of cubes. *) PROCEDURE CubeNegVertices(a: Pair): ARRAY [0..7] OF Vertex; (* The vertices of the negative cube of "a" ("PnegP(a)"). *) PROCEDURE CubeBarycenter(a: Pair; READONLY c: Coords): LR4.T; (* The barycenter of the negative cube of pair "a". *) PROCEDURE SetCubeProperties(a: REF TriPair; o: CARDINAL; READONLY tp:Topology); (* Set the propiertes of a tridimensional array of cubic cells, such that it emphasis the elements of the external big cube. *) PROCEDURE GlueCube(a,b : Pair) : Pair; (* Make the glueing of two simples cubes around of one squared face common. The pair "a" and their adjacentes on the same face component is killed. *) PROCEDURE GlueBall(a,b: Pair) : Pair; (* Make the glueing of two simples 2-gon faces around of one common face. The pair "a" and their adjacentes on the same face component is killed. *) PROCEDURE GlueBigCube(a,b : Pair; n: CARDINAL) : Pair; (* Make the glueing of two simples "bigcubes" around of one squared grid common face. The pair "a" and their adjacentes on the same squared grid face component is killed. *) END Squared. (**************************************************************************) (* *) (* Copyright (C) 2000 Universidade Estadual de Campinas (UNICAMP) *) (* *) (* Authors: *) (* L. Lozada & J. Stolfi - UNICAMP *) (* *) (* This file can be freely used, distributed, and modified, provided that *) (* this copyright and authorship notice is included in every copy or *) (* derived version. *) (* *) (* DISCLAIMER: This software is offered ``as is'', without any guarantee *) (* as to fitness for any particular purpose. Neither the copyright *) (* holder nor the authors or their employers can be held responsible *) (* for any damages that may result from its use. *) (* *) (**************************************************************************)