Open riccardo-runci opened 4 days ago
Hi @riccardo-runci
To enable RestoringBoundary
properly, you need to provide ConstraintEdges
:
using var constraintEdges = new NativeArray<int>(..., Allocator.Persistent);
using var positions = new NativeArray<float2>(..., Allocator.Persistent);
using var triangulator = new Triangulator(Allocator.Persistent)
{
Input = {
Positions = positions,
ConstraintEdges = constraintEdges,
},
Settings = {
RestoreBoundary = true,
}
};
triangulator.Run();
var triangles = triangulator.Output.Triangles;
I guess in your case constraints will have the form $[0, 1, 1, 2, 2, 3, ...]$.
See manual
for more details.
Many thanks for the contribution! I guess I have to add additional Exception
to better inform users about usage (reported on project board).
Best, Andrzej
Hi, i'm using this awesome library to generate mesh at runtime. Basically i have a list of vector3 (points) that i use to generate the mesh, it work perfectly but when i generate a complex mesh i get a convex mesh, what i need is a mesh with some concave parts.
This is a screenshot of what i have:
https://imgur.com/a/xtv2Mu5 the red box are my points in the world and the "white" mesh are what i get with Burst Triangulator,
this is what i'm trying to achieve https://imgur.com/a/zTGwuZq
same screenshot but i need to remove the "yellow" parts
and this is the source code:
Thanks for this awesome library