ARCH, export IFC, serializer, workaround for placement problem
This commit is contained in:
@@ -2162,12 +2162,15 @@ def getRepresentation(
|
||||
sh = obj.Shape.copy()
|
||||
sh.Placement = obj.getGlobalPlacement()
|
||||
sh.scale(preferences['SCALE_FACTOR']) # to meters
|
||||
# clean shape and moves placement away from the outer element level
|
||||
# https://forum.freecad.org/viewtopic.php?p=675760#p675760
|
||||
brep_data = sh.removeSplitter().exportBrepToString()
|
||||
try:
|
||||
p = geom.serialise(sh.exportBrepToString())
|
||||
p = geom.serialise(brep_data)
|
||||
except TypeError:
|
||||
# IfcOpenShell v0.6.0
|
||||
# Serialization.cpp:IfcUtil::IfcBaseClass* IfcGeom::serialise(const std::string& schema_name, const TopoDS_Shape& shape, bool advanced)
|
||||
p = geom.serialise(preferences['SCHEMA'],sh.exportBrepToString())
|
||||
p = geom.serialise(preferences['SCHEMA'], brep_data)
|
||||
if p:
|
||||
productdef = ifcfile.add(p)
|
||||
for rep in productdef.Representations:
|
||||
@@ -2176,6 +2179,13 @@ def getRepresentation(
|
||||
shapetype = "advancedbrep"
|
||||
shapes = None
|
||||
serialized = True
|
||||
else:
|
||||
if preferences['DEBUG']:
|
||||
print(
|
||||
"Warning! IfcOS serializer did not return a ifc-geometry for object {}. "
|
||||
"The shape will be exported with triangulation."
|
||||
.format(obj.Label)
|
||||
)
|
||||
|
||||
if not serialized:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user