mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Geometry serialization (#71)
Serialize geometry to IFC instances directly from a TopoDS_Shape
This commit is contained in:
@@ -180,7 +180,12 @@ def get_bounding_box_center(bbox):
|
||||
bbmin[0], bbmin[1], bbmin[2], bbmax[0], bbmax[1], bbmax[2] = bbox.Get()
|
||||
return OCC.gp.gp_Pnt(*map(lambda xy: (xy[0]+xy[1])/2., zip(bbmin, bbmax)))
|
||||
|
||||
|
||||
|
||||
def serialize_shape(shape):
|
||||
shapes = OCC.BRepTools.BRepTools_ShapeSet()
|
||||
shapes.Add(shape)
|
||||
return shapes.WriteToString()
|
||||
|
||||
def create_shape_from_serialization(brep_object):
|
||||
import OCC.BRepTools
|
||||
|
||||
|
||||
Reference in New Issue
Block a user