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


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?


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