Introducing TriRemesh - high quality triangular and hexagonal remeshing and shrink wrapping

Daniel. If possible i would strongly vote for this feature of meshing to isolated points. I have to do this all the time when generating FEA meshes. If we can just add these points as a feature input and re-mesh to them it would be superb.

So, in your work around it looks like you re mesh the starting Geometry mesh based on user defined isolated points.(I didn’t know the mesh nearest point method!) Then create fictitious lines that have an end point on the new mesh/isolated points and then use these as features.

Steve

Of course, see attached, my rhino model session is in units of mm when using it (Don’t know if tolerances affect anything…)Mesh.gh (93.3 KB)

Daniel,

some question about the code syntax which is new to my c# basic understanding

  1. int fi = m1.Faces[f].IsQuad ? 4 : 3;

What does the ? operator do here? Short cut flag for if true/false?
2) for(int j = 0;j < fi;j++)
m1.Faces.AddFace(m1.Faces[f][j], m1.Faces[f][(j + 1) % fi], v);

What is the % operator doing here for m1.Faces[f][(j + 1) % fi]

Sorry one more thing, what if the isolated point lies on a brep/surface and not a mesh. Is there a solution there?

Daniel

i got it to work by doing as you suggested, splitting the surface with the segments of the poly line, rejoining the surface, sending surface as input geometry and sending segments as features. Its meshing along polylines now, thanks.

Still hope to see isolated point feature!!

1 Like

Yes, the ?a:b is a convenient way of doing inline conditionals:

and I was using
(j + 1) % fi
to make sure the indexing wraps when taking the next point around the boundary (to get the edge between vert 2 and 0 if it is a triangle, or between 3 and 0 when it is a quad).

I’ll make sure isolated point inputs work properly in the next release
(it was working before, and the code is all still in there, I just changed the component at the last moment from having separate inputs for feature points and feature curves, to having one combined input, and forgot to properly update the data types and casting)

I’ll also update the component to allow the setting of isolated feature points which do not already exist in the input Brep or Mesh.

1 Like

brilliant thank you

1 Like

Is there a way to use this in Rhino v6? I tried installing the component but it failed to load

It seems you could use a better Beetle… I’ll PM you one if you like :wink:

2 Likes

Thank you! I’m really very happy that you’ve circled back to remeshing, this has been a sore point for me in Rhino for literally decades, and since Meshmachine we’ve known you have the answer. This seems quite robust, I’m already using it in production. The mesh quality is top-notch, and speed is not bad even for quite big meshes.

In closing, yay! Thanks again.

4 Likes

Thanks Bathsheba!

It makes me really happy to hear this :slight_smile:

1 Like

This kind of thing is my day job https://crystalproteins.com/proof/1783/
and isotropic remeshing is the easiest way to get those pretty point distributions, so this is daily workflow for me. Now I can get rid of some annoying detours into Zbrush and Meshmixer!

5 Likes

Should the TriMesh component be under the Mesh > Triangulation category? If so, I’m not seeing it in there.

This is my Rhino Version…

Version 7
(7.2.21021.7001, 1/21/2021)

It is on 7.3


image

1 Like

What do we do to get 7.3? HELP >> Check for updates >> select Service Release Candidate under Update Frequency?

Yes that’s something like that. The frequent is Service Release Candidate (not the stable one)
https://www2.mcneel.com/updates/78464c2c-9aeb-456e-8c27-865a524f5ca0/release/win64/en-us/releasecandidate/7.3.21026.13001

1 Like

Here’s a case where I think the mesh is good but TriRemesh fails
triremesh bug.gh (2.9 MB)

oh wait it’s got a nonmanifold edge
nm

Yes, it will currently fail if the input has non-manifold edges or is non-orientable.
I’ll see if I can do anything to get it to heal some of these cases.

For now one option with bad meshes is to take a good mesh and wrap it onto the bad one.

The sphere projection technique I was trying here is a bit faster than starting from just the bounding box, though still takes ages to pull all the way in to the concave regions at this density. There are some internal variables for how far it allows a vertex to be projected, and I wonder if exposing these might allow it to reach a tight wrap in reasonable time.

Another option is to start from an isosurface. Here’s a go using Dendro to generate a starting mesh then TriRemesh to improve the triangle quality. It takes a while but gets there in the end.
triremesh_dendro.gh (10.8 KB)

(though whenever it is possible to fix non-manifold edges before remeshing, I think that will be fastest)

3 Likes

Mm interesting roundup. Thank you. Yes, I have a lot of these protein surfaces and they can have very deep pockets. No lie though, Dendro solves a lot of problems!