Class TriangleMesh
Represents a triangle mesh defined by a collection of vertices and triangle indices.
public class TriangleMesh
- Inheritance
-
TriangleMesh
- Inherited Members
Constructors
TriangleMesh(IEnumerable<JTriangle>, bool)
Creates a mesh from a "soup" of triangles. Vertices are automatically identified and deduplicated.
public TriangleMesh(IEnumerable<JTriangle> soup, bool ignoreDegenerated = false)
Parameters
soupIEnumerable<JTriangle>ignoreDegeneratedbool
TriangleMesh(ReadOnlySpan<JTriangle>, bool)
Creates a mesh from a "soup" of triangles. Vertices are automatically identified and deduplicated.
public TriangleMesh(ReadOnlySpan<JTriangle> soup, bool ignoreDegenerated = false)
Parameters
soupReadOnlySpan<JTriangle>ignoreDegeneratedbool
TriangleMesh(ReadOnlySpan<JVector>, ReadOnlySpan<int>, bool)
Creates a mesh from existing vertices and indices.
public TriangleMesh(ReadOnlySpan<JVector> vertices, ReadOnlySpan<int> indices, bool ignoreDegenerated = false)
Parameters
verticesReadOnlySpan<JVector>The vertex buffer.
indicesReadOnlySpan<int>The index buffer (must be a multiple of 3).
ignoreDegeneratedbool
Remarks
Vertices with exactly identical positions are canonicalized so adjacency detection also works across duplicated seam vertices in indexed meshes.
TriangleMesh(ReadOnlySpan<JVector>, ReadOnlySpan<ushort>, bool)
Creates a mesh from existing vertices and indices.
public TriangleMesh(ReadOnlySpan<JVector> vertices, ReadOnlySpan<ushort> indices, bool ignoreDegenerated = false)
Parameters
verticesReadOnlySpan<JVector>The vertex buffer.
indicesReadOnlySpan<ushort>The index buffer (must be a multiple of 3).
ignoreDegeneratedbool
Remarks
Vertices with exactly identical positions are canonicalized so adjacency detection also works across duplicated seam vertices in indexed meshes.
TriangleMesh(ReadOnlySpan<JVector>, ReadOnlySpan<uint>, bool)
Creates a mesh from existing vertices and indices.
public TriangleMesh(ReadOnlySpan<JVector> vertices, ReadOnlySpan<uint> indices, bool ignoreDegenerated = false)
Parameters
verticesReadOnlySpan<JVector>The vertex buffer.
indicesReadOnlySpan<uint>The index buffer (must be a multiple of 3).
ignoreDegeneratedbool
Remarks
Vertices with exactly identical positions are canonicalized so adjacency detection also works across duplicated seam vertices in indexed meshes.
Properties
Indices
Gets the triangle indices of the mesh.
public ReadOnlySpan<TriangleMesh.Triangle> Indices { get; }
Property Value
Vertices
Gets the vertices of the mesh.
public ReadOnlySpan<JVector> Vertices { get; }
Property Value
Methods
Create<TVertex>(ReadOnlySpan<TVertex>, ReadOnlySpan<int>, bool)
Creates a mesh from custom vertices (e.g. System.Numerics.Vector3) and indices.
public static TriangleMesh Create<TVertex>(ReadOnlySpan<TVertex> vertices, ReadOnlySpan<int> indices, bool ignoreDegenerated = false) where TVertex : unmanaged
Parameters
verticesReadOnlySpan<TVertex>indicesReadOnlySpan<int>ignoreDegeneratedbool
Returns
Type Parameters
TVertex
Create<TVertex>(ReadOnlySpan<TVertex>, ReadOnlySpan<ushort>, bool)
Creates a mesh from custom vertices (e.g. System.Numerics.Vector3) and indices.
public static TriangleMesh Create<TVertex>(ReadOnlySpan<TVertex> vertices, ReadOnlySpan<ushort> indices, bool ignoreDegenerated = false) where TVertex : unmanaged
Parameters
verticesReadOnlySpan<TVertex>indicesReadOnlySpan<ushort>ignoreDegeneratedbool
Returns
Type Parameters
TVertex
Create<TVertex>(ReadOnlySpan<TVertex>, ReadOnlySpan<uint>, bool)
Creates a mesh from custom vertices (e.g. System.Numerics.Vector3) and indices.
public static TriangleMesh Create<TVertex>(ReadOnlySpan<TVertex> vertices, ReadOnlySpan<uint> indices, bool ignoreDegenerated = false) where TVertex : unmanaged
Parameters
verticesReadOnlySpan<TVertex>indicesReadOnlySpan<uint>ignoreDegeneratedbool
Returns
Type Parameters
TVertex