I need to find a way to evaluate the complexity of a file.
This will be part of a script that I am running from cmd.
I was thinking to check the polycount of the render mesh at first, but I can-t find an easy way to do it in python.
Thanls in advance
Have you tried using Rhino’s
Hi @dale , yes I solved it in that way.
But… I had to extract the Number from the string, not exactly elegant
By the way this is how I solved it:
Import rhinoscriptsyntax as rs
start = ‘be’
end = ’ total’
polycount = CH[CH.find(start)+len(start):CH.rfind(end)]
total = int(re.sub("[^0-9]", “”,polycount))
mesh.Faces you can also find QuadCount and TriangleCount ( MeshFaceList Class )
Instead of asking per brep face you could also just do loop over all RhinoObjects and use RhinoObject.GetMeshes instead:
import scriptcontext as sc
tris = 0
quads = 0
for o in sc.doc.Objects:
meshes = o.GetMeshes(Rhino.Geometry.MeshType.Render)
for m in meshes:
tris += m.Faces.TriangleCount
quads += m.Faces.QuadCount
I will test which one is faster…