reworked mesh decimation yes
This commit is contained in:
27
LightlessSync/ThirdParty/Nanomesh/Algo/Triangulate.cs
vendored
Normal file
27
LightlessSync/ThirdParty/Nanomesh/Algo/Triangulate.cs
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace Nanomesh
|
||||
{
|
||||
public class TriangulateModifier
|
||||
{
|
||||
public void Run(ConnectedMesh mesh)
|
||||
{
|
||||
for (int i = 0; i < mesh.nodes.Length; i++)
|
||||
{
|
||||
int edgeCount = 0;
|
||||
int relative = i;
|
||||
while ((relative = mesh.nodes[relative].relative) != i) // Circulate around face
|
||||
{
|
||||
edgeCount++;
|
||||
}
|
||||
|
||||
if (edgeCount > 2)
|
||||
{
|
||||
throw new Exception("Mesh has polygons of dimension 4 or greater");
|
||||
}
|
||||
}
|
||||
|
||||
// Todo : Implement
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user