mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
support pythonocc >= 7.8.0 #4942
Related: https://github.com/tpaviot/pythonocc-core/issues/1350 Also added a print so this type of errors won't go silently.
This commit is contained in:
@@ -240,11 +240,15 @@ def create_shape_from_serialization(brep_object):
|
|||||||
return shape_tuple(brep_object, None, styles, style_ids)
|
return shape_tuple(brep_object, None, styles, style_ids)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ss = BRepTools.BRepTools_ShapeSet()
|
if OCC.VERSION < "7.8":
|
||||||
ss.ReadFromString(brep_data)
|
ss = BRepTools.BRepTools_ShapeSet()
|
||||||
occ_shape = ss.Shape(ss.NbShapes())
|
ss.ReadFromString(brep_data)
|
||||||
except BaseException:
|
occ_shape = ss.Shape(ss.NbShapes())
|
||||||
pass
|
else:
|
||||||
|
ss = BRepTools.breptools()
|
||||||
|
occ_shape = ss.ReadFromString(brep_data)
|
||||||
|
except BaseException as e:
|
||||||
|
print("Error occurred parsing a shape from a string:", e)
|
||||||
|
|
||||||
if is_product_shape:
|
if is_product_shape:
|
||||||
return shape_tuple(brep_object, occ_shape, styles, style_ids)
|
return shape_tuple(brep_object, occ_shape, styles, style_ids)
|
||||||
|
|||||||
Reference in New Issue
Block a user