When i call the function RemoveZeroAreaFaces() on a mesh, all faces are deleted.
Here is an example:
import clr
import Rhino
import scriptcontext
import System.Guid
from Rhino import *
from Rhino.Geometry import *
from Rhino.DocObjects import *
from Rhino.Commands import *
from scriptcontext import doc
import System.Guid
def RunCommand():
boundingBox = BoundingBox(0, 0, 0, 10, 10, 10)
brep = boundingBox.ToBrep();
qualityRenderMesh = MeshingParameters.QualityRenderMesh
meshes = Mesh.CreateFromBrep(brep, qualityRenderMesh)
brep_mesh = Mesh();
for mesh in meshes:
brep_mesh.Append(mesh)
brep_mesh.Faces.ConvertQuadsToTriangles()
print "brep_mesh has {0} faces.".format(str(brep_mesh.Faces.Count))
doc.Objects.AddMesh(brep_mesh);
doc.Views.Redraw();
fixedPartially = clr.Reference[System.Int32]()
fixedWholly = brep_mesh.Faces.RemoveZeroAreaFaces(fixedPartially)
print "After RemoveZeroAreaFaces faceCount={0}, fidexPartially={1}, fixedWholly={2}".format(str(brep_mesh.Faces.Count), str(fixedPartially), str(fixedWholly))
return Result.Success
if __name__ == "__main__":
RunCommand()
The ouput looks like this:
brep_mesh has 12 faces.
After RemoveZeroAreaFaces faceCount=0, fidexPartially=0, fixedWholly=0
Does anyone have any idea what’s going wrong?