utils: handle infinite face

This commit is contained in:
Zheng, Lei 2019-05-08 19:56:06 +08:00
parent 17a26e52f0
commit 28fb7a8b0c

View File

@ -293,6 +293,8 @@ def getElementPos(obj):
if face: if face:
surface = face.Surface surface = face.Surface
if str(surface) == '<Plane object>': if str(surface) == '<Plane object>':
if not face.countElement('Edge'):
return face.Placement.Base
return face.BoundBox.Center return face.BoundBox.Center
# pos = surface.Position # pos = surface.Position
elif all( hasattr(surface,a) for a in ['Axis','Center','Radius'] ): elif all( hasattr(surface,a) for a in ['Axis','Center','Radius'] ):