Arch: Fixed IFC export of Part Extrusions

This commit is contained in:
Yorik van Havre
2020-05-12 11:16:30 +02:00
parent 64619a615a
commit b9fc0fb8d4

View File

@@ -1922,6 +1922,31 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess
shapes.append(shape)
solidType = "SweptSolid"
shapetype = "extrusion"
if (not shapes) and obj.isDerivedFrom("Part::Extrusion"):
import ArchComponent
pstr = str([v.Point for v in obj.Base.Shape.Vertexes])
pr = obj.Base.Shape.copy()
pr.scale(preferences['SCALE_FACTOR'])
profile,pl = ArchComponent.Component.rebase(obj,obj.Base.Shape)
pl.Base = pl.Base.multiply(preferences['SCALE_FACTOR'])
profile = getProfile(ifcfile,pr)
if profile:
profiledefs[pstr] = profile
ev = obj.Dir
l = obj.LengthFwd.Value
if l:
ev.multiply(l)
ev.multiply(preferences['SCALE_FACTOR'])
xvc = ifcbin.createIfcDirection(tuple(pl.Rotation.multVec(FreeCAD.Vector(1,0,0))))
zvc = ifcbin.createIfcDirection(tuple(pl.Rotation.multVec(FreeCAD.Vector(0,0,1))))
ovc = ifcbin.createIfcCartesianPoint(tuple(pl.Base))
lpl = ifcbin.createIfcAxis2Placement3D(ovc,zvc,xvc)
edir = ifcbin.createIfcDirection(tuple(FreeCAD.Vector(ev).normalize()))
shape = ifcfile.createIfcExtrudedAreaSolid(profile,lpl,edir,ev.Length)
shapes.append(shape)
solidType = "SweptSolid"
shapetype = "extrusion"
if (not shapes) and (not skipshape):