Arch: Fixed some bugs in IFC export
This commit is contained in:
parent
066fbfda0a
commit
8d16e0e0a3
|
@ -676,7 +676,7 @@ def getBrepFacesData(obj,scale=1):
|
||||||
sols = []
|
sols = []
|
||||||
for sol in obj.Shape.Solids:
|
for sol in obj.Shape.Solids:
|
||||||
s = []
|
s = []
|
||||||
for face in obj.Shape.Faces:
|
for face in sol.Faces:
|
||||||
f = []
|
f = []
|
||||||
f.append(getTuples(face.OuterWire,scale,normal=face.normalAt(0,0),close=False))
|
f.append(getTuples(face.OuterWire,scale,normal=face.normalAt(0,0),close=False))
|
||||||
for wire in face.Wires:
|
for wire in face.Wires:
|
||||||
|
|
|
@ -158,5 +158,12 @@ class _ViewProviderFrame(ArchComponent.ViewProviderComponent):
|
||||||
import Arch_rc
|
import Arch_rc
|
||||||
return ":/icons/Arch_Frame_Tree.svg"
|
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:
|
if FreeCAD.GuiUp:
|
||||||
FreeCADGui.addCommand('Arch_Frame',_CommandFrame())
|
FreeCADGui.addCommand('Arch_Frame',_CommandFrame())
|
||||||
|
|
|
@ -488,7 +488,7 @@ class IfcDocument(object):
|
||||||
if shapes.is_a("IfcExtrudedAreaSolid"):
|
if shapes.is_a("IfcExtrudedAreaSolid"):
|
||||||
solidType = "SweptSolid"
|
solidType = "SweptSolid"
|
||||||
shapes = [shapes]
|
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
|
return reps
|
||||||
|
|
||||||
def addColor(self,rgb,rep):
|
def addColor(self,rgb,rep):
|
||||||
|
@ -509,7 +509,7 @@ class IfcDocument(object):
|
||||||
|
|
||||||
def addCircle(self,radius):
|
def addCircle(self,radius):
|
||||||
"""addCircle(radius): creates a polyline from the given points"""
|
"""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)])
|
cir = create(self._fileobject,"IfcCircleProfileDef",["AREA",None,lpl,float(radius)])
|
||||||
return cir
|
return cir
|
||||||
|
|
||||||
|
@ -527,6 +527,8 @@ class IfcDocument(object):
|
||||||
"""addExtrudedPolyline(points,extrusion,[placement,color]): makes an extruded polyline
|
"""addExtrudedPolyline(points,extrusion,[placement,color]): makes an extruded polyline
|
||||||
from the given points and the given extrusion vector"""
|
from the given points and the given extrusion vector"""
|
||||||
pol = self.addPolyline(points)
|
pol = self.addPolyline(points)
|
||||||
|
if not placement:
|
||||||
|
placement = self.addPlacement(local=False)
|
||||||
exp = self.addExtrusion(pol,extrusion,placement)
|
exp = self.addExtrusion(pol,extrusion,placement)
|
||||||
if color:
|
if color:
|
||||||
self.addColor(color,exp)
|
self.addColor(color,exp)
|
||||||
|
@ -537,7 +539,7 @@ class IfcDocument(object):
|
||||||
from the given radius and the given extrusion vector"""
|
from the given radius and the given extrusion vector"""
|
||||||
cir = self.addCircle(radius)
|
cir = self.addCircle(radius)
|
||||||
if not placement:
|
if not placement:
|
||||||
placement = self.addPlacement(origin=center)
|
placement = self.addPlacement(origin=center,local=False)
|
||||||
exp = self.addExtrusion(cir,extrusion,placement)
|
exp = self.addExtrusion(cir,extrusion,placement)
|
||||||
if color:
|
if color:
|
||||||
self.addColor(color,exp)
|
self.addColor(color,exp)
|
||||||
|
|
|
@ -44,7 +44,6 @@ supportedIfcTypes = ["IfcSite", "IfcBuilding", "IfcBuildingStorey", "IfcBeam", "
|
||||||
"IfcSlab", "IfcStair", "IfcStairFlight", "IfcWall",
|
"IfcSlab", "IfcStair", "IfcStairFlight", "IfcWall",
|
||||||
"IfcWallStandardCase", "IfcWindow", "IfcWindowStandardCase", "IfcBuildingElementProxy",
|
"IfcWallStandardCase", "IfcWindow", "IfcWindowStandardCase", "IfcBuildingElementProxy",
|
||||||
"IfcPile", "IfcFooting", "IfcReinforcingBar", "IfcTendon"]
|
"IfcPile", "IfcFooting", "IfcReinforcingBar", "IfcTendon"]
|
||||||
|
|
||||||
# TODO : shading device not supported?
|
# TODO : shading device not supported?
|
||||||
|
|
||||||
if open.__module__ == '__builtin__':
|
if open.__module__ == '__builtin__':
|
||||||
|
@ -73,7 +72,7 @@ def insert(filename,docname,skip=None):
|
||||||
|
|
||||||
def getConfig():
|
def getConfig():
|
||||||
"Gets Arch IFC import preferences"
|
"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
|
CREATE_IFC_GROUPS = False
|
||||||
IMPORT_IFC_FURNITURE = False
|
IMPORT_IFC_FURNITURE = False
|
||||||
ASMESH = ["IfcFurnishingElement"]
|
ASMESH = ["IfcFurnishingElement"]
|
||||||
|
@ -96,9 +95,6 @@ def getConfig():
|
||||||
if asmeshlist:
|
if asmeshlist:
|
||||||
ASMESH = asmeshlist.split(",")
|
ASMESH = asmeshlist.split(",")
|
||||||
|
|
||||||
# TODO provisorily skipped objects
|
|
||||||
SKIP.extend(["IfcAnnotation"])
|
|
||||||
|
|
||||||
def getIfcOpenShell():
|
def getIfcOpenShell():
|
||||||
"locates and imports ifcopenshell"
|
"locates and imports ifcopenshell"
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user