Triangulation doesn't respect points I wish to preserve

I’m uploading a file to McNeel where I would like clarification on why the preserve features input doesn’t seem to work:

I originally had 16 points which I realized were closer spaced than the edge length, but even though I removed most of them and reduce the edge length, I can’t get the feature preservation to seem to do anything.

Why is this and how can I get the triangulation to always, always, always place a vertex on my points, regardless of edge length?

EDIT: The uploaded definition has a noise node, but it’s not necessary to see the issue. I just forgot to remove it for the example!

Hi @eobet
The key word here is feature preservation
The remeshing can only keep the specified points if they exist as mesh vertices in the input mesh.
If they don’t exist you’ll need to insert them. The best way to do this depends on the input (I’m not seeing a link to your file - where did you upload it?).
Here’s a script I made for inserting vertices that can be used for this

(that still assumes the points being added lie somewhere on the mesh. If you want to pull the mesh to new feature vertices which are off the surface, it would need a little addition for that)

I used this link, since this is a file for a customer project which I can’t publicly share even though it’s early in the process.

However, the input in my example wasn’t a mesh. It was a SubD/surface, and the points I fed into it were all located on that surface.

I’m going to check your example, but is there another mesh-node I should use before the triangulation that can ensure a vertex is placed on the surface points?

Thanks - got your file and just sent you an example of 2 ways of solving this.

The triangular remesher always starts remeshing from a mesh. If it is given something else such as a surface or subd as input, it will mesh it first.
Sometimes it is useful though to do this initial meshing upstream of the remesher component, such as in this case in order to ensure certain vertices are included.

1 Like

and here the same applied to a generic example surface for anyone else looking for this:
remesh_insertverts.gh (11.6 KB)

3 Likes

Srf and Pt params are not internalized. Is there any way to do this without C#?

Oops, here’s a version with internalised inputs:
remesh_insertverts (1).gh (12.0 KB)

The file shows 2 approaches - one where the input is a surface that doesn’t use scripting, and one where it’s a mesh and it does.

Yes, it’s probably possible to achieve the same thing for meshes without scripting.
Of the top of my head, I’d say an approach like this could work:
for each point - find the closest mesh face, remove it, then add a triangle connecting each edge of the removed face to the point.

1 Like

Interesting, thanks. Showing mesh edges, the results are different.

Using C#:

Using Iso Curve and Surface Split:

I’ll try the third method you describe, though would think three new faces must be added to replace each one deleted?

yes

so 3 new faces if it was a triangle, or 4 if it was a quad.
Also, if the point to add lies exactly on an edge or vertex of the input mesh, you’ll need special cases to handle those if you want to avoid creating degenerate zero area faces.

1 Like

Ugh! Too bad the TriRemesh ‘Features’ input doesn’t do this magic… :wink:

The script I posted above does though. I felt it’s best to keep things like vertex insertion conceptually separate from remeshing (which can preserve sharp feature vertices but not add them), or things can get a bit messy with tolerances.