Skip to content

Commit

Permalink
Arch: Using 2D coordinates for polylines in IFC export
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed May 17, 2014
1 parent 44e354b commit 293930b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -631,8 +631,8 @@ def getTuples(data,scale=1,placement=None,normal=None,close=True):
print "Arch.getTuples(): Wrong profile data"
return t

def getExtrusionData(obj,scale=1):
"""getExtrusionData(obj,[scale]): returns a closed path (a list of tuples), a tuple expressing an extrusion
def getIfcExtrusionData(obj,scale=1):
"""getIfcExtrusionData(obj,[scale]): returns a closed path (a list of tuples), a tuple expressing an extrusion
vector, and a list of 3 tuples for base position, x axis and z axis. Or returns None, if a base loop and
an extrusion direction cannot be extracted. Scale can indicate a scale factor."""
if hasattr(obj,"Additions"):
Expand Down Expand Up @@ -664,8 +664,8 @@ def getExtrusionData(obj,scale=1):
return "polyline", getTuples(p,scale), getTuples(v,scale), d
return None

def getBrepFacesData(obj,scale=1):
"""getBrepFacesData(obj,[scale]): returns a list(0) of lists(1) of lists(2) of lists(3),
def getIfcBrepFacesData(obj,scale=1):
"""getIfcBrepFacesData(obj,[scale]): returns a list(0) of lists(1) of lists(2) of lists(3),
list(3) being a list of vertices defining a loop, list(2) describing a face from one or
more loops, list(1) being the whole solid made of several faces, list(0) being the list
of solids inside the object. Scale can indicate a scaling factor"""
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Arch/ifcWriter.py
Expand Up @@ -508,7 +508,7 @@ def addColor(self,rgb,rep):

def addPolyline(self,points):
"""addPolyline(points): creates a polyline from the given points"""
pts = [create(self._fileobject,"IfcCartesianPoint",getTuple(p)) for p in points]
pts = [create(self._fileobject,"IfcCartesianPoint",getTuple(p)[:2]) for p in points]
pol = create(self._fileobject,"IfcPolyline",[pts])
area = create(self._fileobject,"IfcArbitraryClosedProfileDef",["AREA",None,pol])
return area
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/importIFC.py
Expand Up @@ -1025,10 +1025,10 @@ def export(exportList,filename):

# get representation
if not forcebrep:
gdata = Arch.getExtrusionData(obj,scaling)
gdata = Arch.getIfcExtrusionData(obj,scaling)
#if DEBUG: print " extrusion data for ",obj.Label," : ",gdata
if not gdata:
fdata = Arch.getBrepFacesData(obj,scaling)
fdata = Arch.getIfcBrepFacesData(obj,scaling)
#if DEBUG: print " brep data for ",obj.Label," : ",fdata
if not fdata:
if obj.isDerivedFrom("Part::Feature"):
Expand Down

0 comments on commit 293930b

Please sign in to comment.