Arch: Fixed some bugs in IFC export

This commit is contained in:
Yorik van Havre 2014-05-12 19:52:25 -03:00
parent 066fbfda0a
commit 8d16e0e0a3
4 changed files with 14 additions and 9 deletions

View File

@ -676,7 +676,7 @@ def getBrepFacesData(obj,scale=1):
sols = []
for sol in obj.Shape.Solids:
s = []
for face in obj.Shape.Faces:
for face in sol.Faces:
f = []
f.append(getTuples(face.OuterWire,scale,normal=face.normalAt(0,0),close=False))
for wire in face.Wires:

View File

@ -157,6 +157,13 @@ class _ViewProviderFrame(ArchComponent.ViewProviderComponent):
def getIcon(self):
import Arch_rc
return ":/icons/Arch_Frame_Tree.svg"
def claimChildren(self):
p = []
if hasattr(self,"Object"):
if self.Object.Profile:
p = [self.Object.Profile]
return ArchComponent.ViewProviderComponent.claimChildren(self)+p
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Arch_Frame',_CommandFrame())

View File

@ -488,7 +488,7 @@ class IfcDocument(object):
if shapes.is_a("IfcExtrudedAreaSolid"):
solidType = "SweptSolid"
shapes = [shapes]
reps = [create(self._fileobject,"IfcShapeRepresentation",[self._repcontext,'Body',solidType,[shape]]) for shape in shapes]
reps = [create(self._fileobject,"IfcShapeRepresentation",[self._repcontext,'Body',solidType,[shape for shape in shapes]])]
return reps
def addColor(self,rgb,rep):
@ -509,7 +509,7 @@ class IfcDocument(object):
def addCircle(self,radius):
"""addCircle(radius): creates a polyline from the given points"""
lpl = self.addPlacement(flat=True)
lpl = self.addPlacement(local=False,flat=True)
cir = create(self._fileobject,"IfcCircleProfileDef",["AREA",None,lpl,float(radius)])
return cir
@ -527,6 +527,8 @@ class IfcDocument(object):
"""addExtrudedPolyline(points,extrusion,[placement,color]): makes an extruded polyline
from the given points and the given extrusion vector"""
pol = self.addPolyline(points)
if not placement:
placement = self.addPlacement(local=False)
exp = self.addExtrusion(pol,extrusion,placement)
if color:
self.addColor(color,exp)
@ -537,7 +539,7 @@ class IfcDocument(object):
from the given radius and the given extrusion vector"""
cir = self.addCircle(radius)
if not placement:
placement = self.addPlacement(origin=center)
placement = self.addPlacement(origin=center,local=False)
exp = self.addExtrusion(cir,extrusion,placement)
if color:
self.addColor(color,exp)

View File

@ -44,7 +44,6 @@ supportedIfcTypes = ["IfcSite", "IfcBuilding", "IfcBuildingStorey", "IfcBeam", "
"IfcSlab", "IfcStair", "IfcStairFlight", "IfcWall",
"IfcWallStandardCase", "IfcWindow", "IfcWindowStandardCase", "IfcBuildingElementProxy",
"IfcPile", "IfcFooting", "IfcReinforcingBar", "IfcTendon"]
# TODO : shading device not supported?
if open.__module__ == '__builtin__':
@ -73,7 +72,7 @@ def insert(filename,docname,skip=None):
def getConfig():
"Gets Arch IFC import preferences"
global CREATE_IFC_GROUPS, ASMESH, PREFIX_NUMBERS, FORCE_PYTHON_PARSER, SEPARATE_OPENINGS, SEPARATE_PLACEMENTS, JOINSOLIDS, AGGREGATE_WINDOWS
global SKIP, CREATE_IFC_GROUPS, ASMESH, PREFIX_NUMBERS, FORCE_PYTHON_PARSER, SEPARATE_OPENINGS, SEPARATE_PLACEMENTS, JOINSOLIDS, AGGREGATE_WINDOWS
CREATE_IFC_GROUPS = False
IMPORT_IFC_FURNITURE = False
ASMESH = ["IfcFurnishingElement"]
@ -96,9 +95,6 @@ def getConfig():
if asmeshlist:
ASMESH = asmeshlist.split(",")
# TODO provisorily skipped objects
SKIP.extend(["IfcAnnotation"])
def getIfcOpenShell():
"locates and imports ifcopenshell"
try: