geometry.py -> only triangulate if optimal=False and oriented=True

should improve performance of optimal=False, oriented=False
This commit is contained in:
jdegenstein 2024-10-10 14:45:24 -05:00 committed by GitHub
parent 8e798f2b57
commit bb810ea665
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -995,10 +995,10 @@ class BoundBox:
else:
BRepBndLib.AddOptimal_s(shape, bbox)
else:
mesh = BRepMesh_IncrementalMesh(shape, tolerance, True)
mesh.Perform()
# this is adds +margin but is faster
if oriented:
mesh = BRepMesh_IncrementalMesh(shape, tolerance, True)
mesh.Perform()
BRepBndLib.AddOBB_s(shape, bbox_obb)
else:
BRepBndLib.Add_s(shape, bbox, True)