From b9fc0fb8d4f05f0b9f13ba7065028261c12ea748 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 12 May 2020 11:16:30 +0200 Subject: [PATCH] Arch: Fixed IFC export of Part Extrusions --- src/Mod/Arch/exportIFC.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index 2aea1be3b6..711776a20e 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -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):