new Geometry(mesh, positions, normalizePositions)
This class represents the geometry of a Mesh. This includes information such
as the position of vertices as well as methods to compute edge lengths, corner
angles, face area, normals, discrete curvatures etc.
Parameters:
Name | Type | Description |
---|---|---|
mesh |
module:Core.Mesh | The mesh this class describes the geometry of. |
positions |
Array.<module:LinearAlgebra.Vector> | An array containing the position of each vertex in a mesh. |
normalizePositions |
boolean | flag to indicate whether positions should be normalized. Default value is true. |
Properties:
Name | Type | Description |
---|---|---|
mesh |
module:Core.Mesh | The mesh this class describes the geometry of. |
positions |
Object | A dictionary mapping each vertex to a normalized position. |
Methods
-
vector(h)
-
Computes the vector along a halfedge.
Parameters:
Name Type Description h
module:Core.Halfedge The halfedge along which the vector needs to be computed.
Returns:
-
length(e)
-
Computes the length of an edge.
Parameters:
Name Type Description e
module:Core.Edge The edge whose length needs to be computed.
Returns:
- Type
- number
-
midpoint(e)
-
Computes the midpoint of an edge.
Parameters:
Name Type Description e
module:Core.Edge The edge whose midpoint needs to be computed.
Returns:
- Type
- number
-
meanEdgeLength()
-
Computes the mean edge length of all the edges in a mesh.
Returns:
- Type
- number
-
area(f)
-
Computes the area of a face.
Parameters:
Name Type Description f
module:Core.Face The face whose area needs to be computed.
Returns:
- Type
- number
-
totalArea()
-
Computes the total surface area of a mesh.
Returns:
- Type
- number
-
faceNormal(f)
-
Computes the normal of a face.
Parameters:
Name Type Description f
module:Core.Face The face whose normal needs to be computed.
Returns:
-
centroid(f)
-
Computes the centroid of a face.
Parameters:
Name Type Description f
module:Core.Face The face whose centroid needs to be computed.
Returns:
-
circumcenter(f)
-
Computes the circumcenter of a face.
Parameters:
Name Type Description f
module:Core.Face The face whose circumcenter needs to be computed.
Returns:
-
orthonormalBases(f)
-
Computes an orthonormal bases for a face.
Parameters:
Name Type Description f
module:Core.Face The face on which the orthonormal bases needs to be computed.
Returns:
An array containing two orthonormal vectors tangent to the face.
- Type
- Array.<module:LinearAlgebra.Vector>
-
angle(c)
-
Computes the angle (in radians) at a corner.
Parameters:
Name Type Description c
module:Core.Corner The corner at which the angle needs to be computed.
Returns:
The angle clamped between 0 and π.
- Type
- number
-
cotan(h)
-
Computes the cotangent of the angle opposite to a halfedge.
Parameters:
Name Type Description h
module:Core.Halfedge The halfedge opposite to the angle whose cotangent needs to be computed.
Returns:
- Type
- number
-
dihedralAngle(h)
-
Computes the signed angle (in radians) between two adjacent faces.
Parameters:
Name Type Description h
module:Core.Halfedge The halfedge (shared by the two adjacent faces) on which
the dihedral angle is computed.Returns:
The dihedral angle.
- Type
- number
-
barycentricDualArea(v)
-
Computes the barycentric dual area of a vertex.
Parameters:
Name Type Description v
module:Core.Vertex The vertex whose barycentric dual area needs to be computed.
Returns:
- Type
- number
-
circumcentricDualArea(v)
-
Computes the circumcentric dual area of a vertex.
Parameters:
Name Type Description v
module:Core.Vertex The vertex whose circumcentric dual area needs to be computed.
Returns:
- Type
- number
-
vertexNormalEquallyWeighted(v)
-
Computes the normal at a vertex using the "equally weighted" method.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
vertexNormalAreaWeighted(v)
-
Computes the normal at a vertex using the "face area weights" method.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
vertexNormalAngleWeighted(v)
-
Computes the normal at a vertex using the "tip angle weights" method.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
vertexNormalGaussCurvature(v)
-
Computes the normal at a vertex using the "gauss curvature" method.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
vertexNormalMeanCurvature(v)
-
Computes the normal at a vertex using the "mean curvature" method (same as the "area gradient" method).
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
vertexNormalSphereInscribed(v)
-
Computes the normal at a vertex using the "inscribed sphere" method.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the normal needs to be computed.
Returns:
-
angleDefect(v)
-
Computes the angle defect at a vertex (= 2π minus the sum of incident angles
at an interior vertex or π minus the sum of incident angles at a boundary vertex).Parameters:
Name Type Description v
module:Core.Vertex The vertex whose angle defect needs to be computed.
Returns:
- Type
- number
-
scalarGaussCurvature(v)
-
Computes the (integrated) scalar gauss curvature at a vertex.
Parameters:
Name Type Description v
module:Core.Vertex The vertex whose gauss curvature needs to be computed.
Returns:
- Type
- number
-
scalarMeanCurvature(v)
-
Computes the (integrated) scalar mean curvature at a vertex.
Parameters:
Name Type Description v
module:Core.Vertex The vertex whose mean curvature needs to be computed.
Returns:
- Type
- number
-
totalAngleDefect()
-
Computes the total angle defect (= 2π times the euler characteristic of the mesh).
Returns:
- Type
- number
-
principalCurvatures(v)
-
Computes the (pointwise) minimum and maximum principal curvature values at a vertex.
Parameters:
Name Type Description v
module:Core.Vertex The vertex on which the principal curvatures need to be computed.
Returns:
An array containing the minimum and maximum principal curvature values at a vertex.
- Type
- Array.<number>
-
laplaceMatrix(vertexIndex)
-
Builds a sparse laplace matrix. The laplace operator is negative semidefinite;
instead we build a positive definite matrix by multiplying the entries of the
laplace matrix by -1 and shifting the diagonal elements by a small constant (e.g. 1e-8).Parameters:
Name Type Description vertexIndex
Object A dictionary mapping each vertex of a mesh to a unique index.
Returns:
-
massMatrix(vertexIndex)
-
Builds a sparse diagonal mass matrix containing the barycentric dual area of each vertex
of a mesh.Parameters:
Name Type Description vertexIndex
Object A dictionary mapping each vertex of a mesh to a unique index.
Returns:
-
complexLaplaceMatrix(vertexIndex)
-
Builds a sparse complex laplace matrix. The laplace operator is negative semidefinite;
instead we build a positive definite matrix by multiplying the entries of the
laplace matrix by -1 and shifting the diagonal elements by a small constant (e.g. 1e-8).Parameters:
Name Type Description vertexIndex
Object A dictionary mapping each vertex of a mesh to a unique index.
Returns: