Class MeshF
Triangle mesh with float precision vertices.
Inherited Members
Namespace: ZLab.Discrete.Geometry
Assembly: ZLab.Discrete.dll
Syntax
public sealed class MeshF : LicensedBase
Constructors
| Name | Description |
|---|---|
| MeshF() | Creates an empty mesh. (Invalid) |
| MeshF(Vector3[], TriFace[]) | Creates a mesh and automatically checks if it is closed. (slow for large meshes, explicitly specify closeness if possible) |
| MeshF(Vector3[], TriFace[], bool) | Creates a mesh with explicit specified closeness. (no watertight check) |
Properties
| Name | Description |
|---|---|
| Faces | Array of faces, each face is an array of vertex indices. (must be triangles) |
| IsClosed | Indicates if the mesh is closed (watertight). |
| IsValid | Checks if the mesh is valid (at least 3 vertices and 1 face). |
| Vertices | Array of vertex positions. |
Methods
| Name | Description |
|---|---|
| EnumerateTriangleBounds() | Enumerates the axis-aligned bounding boxes (AABB) of each triangle face in the mesh. |
| FromObjFile(string) | Loads a mesh from an OBJ file. Only supports vertices (v) and triangular faces (f). |
| GetBounds() | Gets the axis-aligned bounding box (AABB) of the mesh. |
| RecomputeBounds() | Recomputes the axis-aligned bounding box (AABB) of the mesh. |
| RecomputeWaterTight() | Recomputes whether the mesh is closed (watertight). |
| SwapYz() | Swaps the Y and Z coordinates of all vertices. |
| ToObjFile(string) | Saves the mesh to an OBJ file. Only saves vertices (v) and triangular faces (f). |
| Weld(float) | Welds (merges) vertices that are within the specified tolerance. |