Good day, I have a solid mesh when I import it from a *.stl file. It’s solid but the direction is reversed. I can use _Flip or _FillHoles Command to make it right easily. But I can’t get the right result in my C# project. mesh.Flip(True,True,True) or mesh.Fillholes() don’t work. Does anyone meet this question before?
Rhino.Geometry.Mesh.UnifyNormals() is probably what you are looking for.
Thank you, diff-arch. but it still didn’t work out. Even I used Mesh.Normals.ComputeNormals()also.
it works here.
Did you understand that Grasshopper is working on a copy of the Rhino object? So if you make modification on the object you’ll have to bake it in Rhino to have it modified. So you’ll have 2 objects in Rhino.
It’s weird. mesh.flip() works in grasshopper but it didn’t work in RhinoCommon.
Pls, see my code in RhinoCommon. it doesn’t work.
What do you call Rhinocommon. Inside Grasshopper it is Rhinocommon.
Do you you mean working with RhinoCommon inside Visual Studio ?
Does item.Mesh() return a reference or a new mesh.
How can you know the mesh is not flipped ?
It is very hard to decipher your problem with limited informations.
If you are writing a plug-in command, then this will work:
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
var go = new GetObject();
go.SetCommandPrompt("Select solid mesh");
go.GeometryFilter = ObjectType.Mesh;
go.GeometryAttributeFilter = GeometryAttributeFilter.ClosedMesh;
if (go.CommandResult() != Result.Success)
var objref = go.Object(0);
var mesh = objref.Mesh();
if (null == mesh)
if (mesh.SolidOrientation() < 0)
var mesh_copy = mesh.DuplicateMesh();
mesh_copy.Flip(true, true, true);
Thank you, Dale. I got right result now!