manifolds
1.0.0Various manifold mesh algorithms
About Manifolds
This library implements a variety of algorithms for querying and creating triangle meshes.
Since this is a toolkit library, please refer to the symbol index for the available operations and what they do.
Note that the library requires the following format for all mesh data:
Vertices are packed into a single array of a specialised elementtype, either single or doublefloat, with three consecutive elements describing one vertex.
Faces are triangular only and are also packed into a single array specialised on unsignedbyte 32, with three consecutive elements describing one face in counterclockwise winding order. The indices are indices of a vertex. Meaning to reach the first element of the vertex in the corresponding vertex array, it must be multiplied by 3.
This format is compact, efficient, and compatible with graphics APIs, allowing for easy sharing between libraries and making it convenient to display.
System Information
Definition Index

ORG.SHIRAKUMO.FRAF.MANIFOLDS
No documentation provided.
EXTERNAL TYPEDEFINITION F32
Type alias for SINGLEFLOAT. See F32

EXTERNAL TYPEDEFINITION F64
Type alias for DOUBLEFLOAT. See F64

EXTERNAL TYPEDEFINITION FACE
Type for a face index. See FACEARRAY (type)

EXTERNAL TYPEDEFINITION FACEARRAY
Type for a face vertex indices array. Faces are always triangular, meaning a pair of three vertex indices represents a face. The order of the vertices must always be counterclockwise whenever the normal of the face matters. Each vertex index in the face array describes the index of the vertex, NOT the starting index in the corresponding vertexarray. Meaning in order to reach the first element of the described vertex, the index must first be multiplied by 3. This is an alias for: (SIMPLEARRAY (UNSIGNEDBYTE 32) (*))

EXTERNAL TYPEDEFINITION U32
Type alias for (UNSIGNEDBYTE 32) See U32

EXTERNAL TYPEDEFINITION VERTEX
Type for a vertex index. See VERTEXARRAY (type)

EXTERNAL TYPEDEFINITION VERTEXARRAY
Type for a vertex array. Vertices are always a triplet of X Y Z coordinates. The vertices by themselves represent a point cloud. A FACEARRAY is required to build a surface using the vertices. If an elementtype argument is given is an alias for: (SIMPLEARRAY elementtype (*)) Otherwise is an alias for: (OR (SIMPLEARRAY SINGLEFLOAT (*)) (SIMPLEARRAY DOUBLEFLOAT (*)))

EXTERNAL FUNCTION 2MANIFOLDP
 FACES
 &OPTIONAL
 ADJACENCY
Returns true if the face array describes a 2manifold. FACES must be a FACEARRAY. See FACEARRAY (type)

EXTERNAL FUNCTION BOUNDARYLENGTH
 VERTICES
 FACES
Returns the length of the boundary of the mesh. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See BOUNDARYLIST See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION BOUNDARYLIST
 FACES
Returns a vector of edges on the boundary of the faces. Note that this requires that the FACES describe one coherent shape with only one outside edge. It does not consider multiple edge loops on the faces as separate boundaries. FACES must be a FACEARRAY. See FACEARRAY (type)

EXTERNAL FUNCTION BOUNDINGBOX
 VERTICES
Returns the AABB of the point cloud. The AABB is returned as two VEC3s, the first being the center,, and the second being the halfsize. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type)

EXTERNAL FUNCTION CENTROID
 VERTICES
 FACES
Returns the centroid of the mesh. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION CLOSESTPOINTONTRIANGLE
 VERTICES
 FACES
 FACE
 POINT
Returns the closest point to POINT that lies on the FACE. FACE must be a FACE. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACE (type) See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION CONVEXVOLUME
 VERTICES
 FACES
Returns the volume of the mesh. The mesh must be convex. If it is concave, the result will not be accurate and may fail to compute. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION EDGELIST
 FACES
Returns a vector of bidirectional edges for the described faces. Unlike the halfedgelist, this edgelist does not contain any duplicated edges between any two vertices. Each entry in the resulting vector is one edge described by a cons with the CAR and CDR being vertex indices. FACES must be a FACEARRAY. See FACEARRAY (type) See HALFEDGELIST

EXTERNAL FUNCTION ENSUREF32
 A
Ensure the given vector is an F32vector. If it is not, returns a fresh vector that is. See F32 (type)

EXTERNAL FUNCTION ENSUREF64
 A
Ensure the given vector is an F64vector. If it is not, returns a fresh vector that is. See F64 (type)

EXTERNAL FUNCTION ENSUREU32
 A
Ensure the given vector is an U32vector. If it is not, returns a fresh vector that is. See U32 (type)

EXTERNAL FUNCTION F32
 A
Coerce a REAL into a F32. See F32 (type)

EXTERNAL FUNCTION F32*
 &REST
 I
Construct a F32vector from arguments. The arguments are automatically coerced to F32 elements. See F32 (type)

EXTERNAL FUNCTION F64
 A
Coerce a REAL into a F64. See F64 (type)

EXTERNAL FUNCTION F64*
 &REST
 I
Construct a F64vector from arguments. The arguments are automatically coerced to F64 elements. See F64 (type)

EXTERNAL FUNCTION FACEADJACENCYLIST
 FACES
 &OPTIONAL
 ADJACENCY
Returns a vector of adjacent faces for each face. To get the list of adjacent faces for a face, access the element corresponding to the face's index. FACES must be a FACEARRAY. See FACEARRAY (type)

EXTERNAL FUNCTION FACEAREA
 VERTICES
 FACES
 FACE
Returns the area covered by the face. FACE must be a FACE. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACE (type) See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION FACEINVOLUMEP
 VERTICES
 FACES
 FACE
 LOCATION
 BSIZE
Returns true if the FACE is within the AABB described by LOCATION and BSIZE. LOCATION should be the center of the AABB, and BSIZE the halfsize extent of the AABB. FACE must be a FACE. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACESINVOLUME See FACE (type) See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION FACENORMAL
 VERTICES
 FACES
 FACE
Returns the normal vector of the FACE. FACE must be a FACE. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACE (type) See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION FACENORMALS
 VERTICES
 FACES
 &OPTIONAL
 FACENORMALS
Returns an array of the normals of all faces. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION FACESINVOLUME
 VERTICES
 FACES
 LOCATION
 BSIZE
Returns a vector of all faces that are part of the AABB described by LOCATION and BSIZE. LOCATION should be the center of the AABB, and BSIZE the halfsize extent of the AABB. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACEINVOLUMEP See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION HALFEDGELIST
 FACES
Returns a vector of half edges for the described faces. A halfedge is a directed edge from one vertex of a face to another. Each entry in the array represents a halfedge and contains a cons with the CAR and CDR each being vertex indices, with the edge pointing from the CAR to the CDR. FACES must be a FACEARRAY. See FACEARRAY (type) See EDGELIST

EXTERNAL FUNCTION NORMALIZE
 VERTICES
 INDICES
 &KEY
 THRESHOLD
 CENTER
 SCALE
Normalizes the mesh by removing faces with no surface area, and merging vertices that are within a threshold from each other. Returns two values, a fresh VERTICES array and fresh FACES array. The THRESHOLD is the distance threshold below which two vertices are considered the same. You may also optionally pass in a CENTER and SCALE to which the resulting vertices are positioned and scaled prior to normalisation. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION SEPARATEMESHES
 VERTICES
 FACES
Returns a list of disjoint meshes. Each entry in the list is a CONS of a VERTEXARRAY and a FACEARRAY that make up the mesh. Each mesh is also disjoint from every other mesh, meaning they do not share any vertices. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION SURFACEAREA
 VERTICES
 FACES
Returns the total surface area of the mesh. FACES must be a FACEARRAY. VERTICES must be a VERTEXARRAY. See FACEAREA See VERTEXARRAY (type) See FACEARRAY (type)

EXTERNAL FUNCTION U32
 A
Coerce a REAL into a U32. See U32 (type)

EXTERNAL FUNCTION U32*
 &REST
 I
Construct a U32vector from arguments. The arguments are automatically coerced to U32 elements. See U32 (type)

EXTERNAL FUNCTION V
 VERTICES
 I
Access a vertex as a vector. The vector matches the elementtype of the vertices array. VERTICES must be a VERTEXARRAY. See VERTEXARRAY (type)

EXTERNAL FUNCTION (SETF V)
 V
 VERTICES
 I
No documentation provided. 
EXTERNAL FUNCTION VERTEXADJACENCYLIST
 FACES
 &OPTIONAL
 ADJACENCY
Returns a vector of adjacent vertices for each vertex. To get the list of adjacent vertices for a vertex, access the element corresponding to the vertex' index. FACES must be a FACEARRAY. See FACEARRAY (type)

EXTERNAL FUNCTION VERTEXFACES
 FACES
 &OPTIONAL
 VERTEXFACES
Returns a vector of faces bordering each vertex. Each element in the returned array is another vector of face indices for the element's corresponding vector. FACES must be a FACEARRAY. See FACEARRAY (type)

EXTERNAL MACRO DOFACES
 A
 B
 C
 FACES
 &OPTIONAL
 RESULT
 &BODY
 BODY
Iterate over the faces of a FACEARRAY. A B and C are bound to the vertex indices for each face in the FACEARRAY. RESULT is evaluated and returned at the end of iteration. FACES must be of type FACEARRAY. See FACEARRAY (type)
