Click or drag to resize
Ab4d.SharpEngine logo

MeshUtilsSplitMeshByIndexesOfTriangles Method

SplitMeshByIndexesOfTriangles splits the originalMesh into mesh1 and mesh2 based on the list of triangle indexes defined in indexesOfTriangles (can be get by GetIntersectingTriangles(BoundingBox, StandardMesh, Transform) method). When the triangle index is present in the indexesOfTriangles, then the triangle is added to mesh1, otherwise triangle is added to mesh2. Note that mesh1 can be null (when indexesOfTriangles is null or empty). mesh2 can be null when indexesOfTriangles contains the same number of triangles as the originalMesh.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public static void SplitMeshByIndexesOfTriangles(
	StandardMesh originalMesh,
	List<int> indexesOfTriangles,
	bool preserveOriginalVerticesArray,
	out StandardMesh?? mesh1,
	out StandardMesh?? mesh2
)

Parameters

originalMesh  StandardMesh
StandardMesh that will be split into mesh1 and mesh2
indexesOfTriangles  ListInt32
list of integers that define the triangle indexes that will be added to mesh1
preserveOriginalVerticesArray  Boolean
when true, then the mesh1 and mesh2 use the original Vertices array. When false, new Vertices array is created for both meshes.
mesh1  StandardMesh
out: created StandardMesh with triangles that are specified in the indexesOfTriangles
mesh2  StandardMesh
out: created StandardMesh with triangles that are NOT specified in the indexesOfTriangles
See Also