Move data in and out of the Manifold class. More...
Classes | |
struct | MeshGL |
struct | Mesh |
struct | Smoothness |
struct | Properties |
struct | Box |
struct | Rect |
struct | SVDSet |
Typedefs | |
using | SimplePolygon = std::vector< glm::vec2 > |
using | Polygons = std::vector< SimplePolygon > |
Functions | |
float | sind (float x) |
float | cosd (float x) |
glm::mat4x3 | RotateUp (glm::vec3 up) |
int | CCW (glm::vec2 p0, glm::vec2 p1, glm::vec2 p2, float tol) |
SVDSet | SVD (glm::mat3 A) |
float | SpectralNorm (glm::mat3 A) |
std::vector< glm::ivec3 > | Triangulate (const Polygons &polygons, float precision) |
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions. | |
ExecutionParams & | PolygonParams () |
Move data in and out of the Manifold class.
struct manifold::Mesh |
The triangle-mesh input and output of this library.
Class Members | ||
---|---|---|
vector< vec3 > | vertPos | Required: The X-Y-Z positions of all vertices. |
vector< ivec3 > | triVerts |
Required: The vertex indices of the three triangle corners in CCW (from the outside) order, for each triangle. |
vector< vec3 > | vertNormal |
Optional: The X-Y-Z normal vectors of each vertex. If non-empty, must have the same length as vertPos. If empty, these will be calculated automatically. |
vector< vec4 > | halfedgeTangent |
Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If non-empty, must be exactly three times as long as Mesh.triVerts. Indexed as 3 * tri + i, representing the tangent from Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted. |
float | precision = 0 |
The absolute precision of the vertex positions, based on accrued rounding errors. When creating a Manifold, the precision used will be the maximum of this and a baseline precision from the size of the bounding box. Any edge shorter than precision may be collapsed. |
struct manifold::Smoothness |
Defines which edges to sharpen and how much for the Manifold.Smooth() constructor.
Class Members | ||
---|---|---|
int | halfedge | The halfedge index = 3 * tri + i, referring to Mesh.triVerts[tri][i]. |
float | smoothness |
A value between 0 and 1, where 0 is sharp and 1 is the default and the curvature is interpolated between these values. The two paired halfedges can have different values while maintaining C-1 continuity (except for 0). |
struct manifold::Properties |
Geometric properties of the manifold, created with Manifold.GetProperties().
Class Members | ||
---|---|---|
float | surfaceArea | |
float | volume |
struct manifold::SVDSet |
using SimplePolygon = std::vector<glm::vec2> |
Single polygon contour, wound CCW. First and last point are implicitly connected. Should ensure all input is ε-valid.
using Polygons = std::vector<SimplePolygon> |
Set of polygons with holes. Order of contours is arbitrary. Can contain any depth of nested holes and any number of separate polygons. Should ensure all input is ε-valid.
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap, but will always return a manifold result that matches the input edge directions.
polygons | The set of polygons, wound CCW and representing multiple polygons and/or holes. |
precision | The value of ε, bounding the uncertainty of the input. |
Sine function where multiples of 90 degrees come out exact.
x | Angle in degrees. |
Cosine function where multiples of 90 degrees come out exact.
x | Angle in degrees. |
|
inline |
This 4x3 matrix can be used as an input to Manifold.Transform() to turn an object. Turns along the shortest path from given up-vector to (0, 0, 1).
up | The vector to be turned to point upwards. Length does not matter. |
Determines if the three points are wound counter-clockwise, clockwise, or colinear within the specified tolerance.
p0 | First point |
p1 | Second point |
p2 | Third point |
tol | Tolerance value for colinearity |
|
inline |
Returns the Singular Value Decomposition of A: A = U * S * glm::transpose(V).
A | The matrix to decompose. |
|
inline |
Returns the largest singular value of A.
A | The matrix to measure. |