Skip to content

Commit

Permalink
Fixed the bug with writing nonplanar child surfaces
Browse files Browse the repository at this point in the history
Revert changes from
0621e54

@chriswmackey it turns out the original code was the right one. Let me
know if you have a case that doesn't export correctly with the original
code that made you change the code.

Resolved #607
  • Loading branch information
mostaphaRoudsari committed Feb 27, 2017
1 parent c766854 commit 6a88cfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Honeybee_Honeybee.py
Expand Up @@ -2407,7 +2407,7 @@ def getsurfaceStr(self, surface, count, coordinates):
#assign the construction based on type
surface.construction = surface.cnstrSet[surface.type]

srfStr = surface.construction.replace(" ", "_") + " polygon " + surface.name + '_' + `count` + "\n" + \
srfStr = surface.construction.replace(" ", "_") + " polygon " + surface.name.strip() + '_' + `count` + "\n" + \
"0\n" + \
"0\n" + \
`(len(coordinates)*3)` + "\n"
Expand All @@ -2427,7 +2427,7 @@ def getsurfaceStr(self, surface, count, coordinates):
return srfStr + ptStr

def RADSurface(self, surface):
fullStr = ''
fullStr = []
# base surface coordinates
coordinatesList = surface.extractPoints(1, True)

Expand All @@ -2441,21 +2441,21 @@ def RADSurface(self, surface):
glzCoordinateLists = surface.extractGlzPoints(True)
for glzCount, glzCoorList in enumerate(glzCoordinateLists):
# glazingStr
fullStr = fullStr + self.getsurfaceStr(surface.childSrfs[glzCount], glzCount, glzCoorList)
fullStr.append(self.getsurfaceStr(surface.childSrfs[0], glzCount, glzCoorList))

# shift glazing list
glzCoorList = self.shiftList(glzCoorList)
coordinates.extend(glzCoorList)
coordinates.append(glzCoorList[0])
coordinates.extend([endCoordinate, coordinates[0]])
fullStr = fullStr + self.getsurfaceStr(surface, count, coordinates)
return fullStr
fullStr.append(self.getsurfaceStr(surface, count, coordinates))
return ''.join(fullStr)
else:
print "one of the surfaces is not exported correctly"
return ""

def RADNonPlanarSurface(self, surface):
fullStr = ''
fullStr = []

# replace the geometry with the punched geometry
# for planar surfaces with multiple openings
Expand All @@ -2475,12 +2475,12 @@ def RADNonPlanarSurface(self, surface):
coordinatesList = [coordinatesList]
for count, coordinates in enumerate(coordinatesList):
#print count
fullStr = fullStr + self.getsurfaceStr(surface, count, coordinates)
fullStr.append(self.getsurfaceStr(surface, count, coordinates))

return fullStr
return ''.join(fullStr)

def RADNonPlanarChildSurface(self, surface):
fullStr = ''
fullStr = []

# I should test this function before the first release!
# Not sure if it will work for cases generated only by surface
Expand All @@ -2492,9 +2492,9 @@ def RADNonPlanarChildSurface(self, surface):
if type(coordinatesList[0])is not list and type(coordinatesList[0]) is not tuple:
coordinatesList = [coordinatesList]
for glzCount, glzCoorList in enumerate(coordinatesList):
# glazingStr
fullStr = fullStr + self.getsurfaceStr(surface.childSrfs[glzCount], glzCount, glzCoorList)
return fullStr
# glazingStr`
fullStr.append(self.getsurfaceStr(surface.childSrfs[0], glzCount, glzCoorList))
return ''.join(fullStr)

class hb_WriteRADAUX(object):

Expand Down
Binary file modified userObjects/Honeybee_Honeybee.ghuser
Binary file not shown.

0 comments on commit 6a88cfe

Please sign in to comment.