-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about refinement #134
Comments
Hi @ivan-trackman, Many thanks for reporting the issue! Unfortunately, the current refinement algorithm, terminator, requires splitting the segment first before inserting points into triangles. This is essential to prevent adding points outside the mesh. To resolve your issue, I have thought of two solutions:
using var positions = new NativeArray<float2>(..., Allocator.Persistent);
using var constraints = new NativeArray<int>(..., Allocator.Persistent);
using var holes = new NativeArray<float2>(..., Allocator.Persistent); // if required
using var triangulator = new Triangulator(Allocator.Persistent)
{
Input = { Positions = positions, ConstraintEdges = constraints, HoleSeeds = holes },
Settings = { RefineMesh = true, RefinementThresholds = { ... }, RestoreBoundary = true
};
triangulator.Run();
using var filteredPositions = new NativeList<float2>(Allocator.Persistent);
// Filter out positions
filteredPositions.CopyFrom(positions);
for(int i = positions.Length; i < triangulator.Output.Positions.Length; i++)
{
var p = triangulator.Output.Positions[i];
if(i is not constraint)
{
filteredPositions.Add(p);
}
}
triangulator.Settings.RefineMesh = false;
triangulator.Input.Positions = filteredPositions;
triangulator.Run(); Implementing the check "
In about two weeks, I will push development further. I'm going to merge some stuff, implement some enhancements, and probably release a new version. I could make this If you have any questions, let me know. Best, |
PS |
@andywiecko thanks a lot for this blazingly fast reply! We are currently trying the 2nd approach with ability to add some custom lists to store the information that will help us restore the original triangles (or so my teammate said) |
@ivan-trackman Interesting! I'm looking forward to hearing from you about your findings! Best, |
Hi @ivan-trackman, This release includes Best, |
Hi,
I have a question regarding the refinement process, for some reason (and I think this is by design), the refinement process adds points to the constraint edge, but we want to preserve it as is. Is there any way to avoid doing that, and not split the constraint edges in refinement?
We apply catmullrom on the constraint edge later in compute shader and it will be not the same with new points.
P.S. thank you for this amazing project!
The text was updated successfully, but these errors were encountered: