Skip to content

Commit 05cc88f

Browse files
committed
fix(gbxml): Use slightly coarser E+ tolerance for DesignBuilder gbXML
1 parent 4291ef8 commit 05cc88f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

honeybee_openstudio/writer.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,14 +1314,25 @@ def model_to_gbxml(
13141314
assert isinstance(model, Model), \
13151315
'Expected Honeybee Model for model_to_gbxml. Got {}.'.format(type(model))
13161316

1317+
# remove degenerate geometry within native DesignBuilder tolerance of 0.02 meters
1318+
original_model = model
1319+
model = model.duplicate() # duplicate to avoid mutating the input
1320+
if model.units != 'Meters':
1321+
model.convert_to_units('Meters')
1322+
try:
1323+
model.remove_degenerate_geometry(0.02)
1324+
except ValueError:
1325+
error = 'Failed to remove degenerate Rooms.\nYour Model units system is: {}. ' \
1326+
'Is this correct?'.format(original_model.units)
1327+
raise ValueError(error)
1328+
13171329
# remove any detailed HVAC or AFN as this will only slow the translation down
13181330
v_control = model.properties.energy.ventilation_simulation_control
13191331
det_hvac_count = 0
13201332
for hvac in model.properties.energy.hvacs:
13211333
if hvac is not None and not isinstance(hvac, IdealAirSystem):
13221334
det_hvac_count += 1
13231335
if v_control.vent_control_type != 'SingleZone' or det_hvac_count != 0:
1324-
model = model.duplicate() # duplicate to avoid mutating the input
13251336
for room in model.rooms:
13261337
room.properties.energy.assign_ideal_air_equivalent()
13271338
v_control.vent_control_type = 'SingleZone'

0 commit comments

Comments
 (0)