Hello,
I am trying to write a C# script that will automate mesh fixing at the end of my grasshopper definition, before exporting. 99% of the time the mesh has 1 or 2 degenerate faces that can be easily fixed using the Rhino CullDegenerateFaces command and then there’s no more problem. However, I am trying to create a small C# component that will automate this for me. Any ideas how this could be done?
I am trying to use
private void RunScript(Mesh M, ref object R)
{
if (M != null) {
M.Faces.CullDegenerateFaces();
M.RebuildNormals();
R = M;
}
}
but the mesh coming out still has degenerate faces. Strangely, they are easily removed with the standard Rhino command. Is there a difference? Maybe Im missing a step somewhere. Any help would be greatly appreciated.
Thanks in advance!
Cool if it works. Seeing the commands I am not sure if unify normals is at the good place or if it is necessary. It is just cosmetics.
If you find mesh that are not heal or better script don’t hesitate to post.