openstudio-common-measures 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (524) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +82 -0
  4. data/Jenkinsfile +2 -1
  5. data/LICENSE.md +1 -1
  6. data/Rakefile +17 -0
  7. data/doc_templates/LICENSE.md +1 -1
  8. data/doc_templates/copyright_erb.txt +1 -1
  9. data/doc_templates/copyright_js.txt +1 -1
  10. data/doc_templates/copyright_ruby.txt +1 -1
  11. data/lib/measures/AddCostPerAreaToConstruction/LICENSE.md +1 -1
  12. data/lib/measures/AddCostPerAreaToConstruction/measure.rb +1 -1
  13. data/lib/measures/AddCostPerAreaToConstruction/measure.xml +8 -7
  14. data/lib/measures/AddCostPerFloorAreaToBuilding/LICENSE.md +1 -1
  15. data/lib/measures/AddCostPerFloorAreaToBuilding/measure.rb +1 -1
  16. data/lib/measures/AddCostPerFloorAreaToBuilding/measure.xml +8 -7
  17. data/lib/measures/AddCostPerFloorAreaToElectricEquipment/LICENSE.md +1 -1
  18. data/lib/measures/AddCostPerFloorAreaToElectricEquipment/measure.rb +1 -1
  19. data/lib/measures/AddCostPerFloorAreaToElectricEquipment/measure.xml +8 -7
  20. data/lib/measures/AddCostPerFloorAreaToLights/LICENSE.md +1 -1
  21. data/lib/measures/AddCostPerFloorAreaToLights/measure.rb +1 -1
  22. data/lib/measures/AddCostPerFloorAreaToLights/measure.xml +8 -7
  23. data/lib/measures/AddCostPerFloorAreaUnusedToLights/LICENSE.md +1 -1
  24. data/lib/measures/AddCostPerFloorAreaUnusedToLights/measure.rb +1 -1
  25. data/lib/measures/AddCostPerFloorAreaUnusedToLights/measure.xml +8 -7
  26. data/lib/measures/AddCostToSupplySideHVACComponentByAirLoop/LICENSE.md +1 -1
  27. data/lib/measures/AddCostToSupplySideHVACComponentByAirLoop/measure.rb +1 -1
  28. data/lib/measures/AddCostToSupplySideHVACComponentByAirLoop/measure.xml +9 -8
  29. data/lib/measures/AddCostperAreatoUnusedConstruction/LICENSE.md +1 -1
  30. data/lib/measures/AddCostperAreatoUnusedConstruction/measure.rb +1 -1
  31. data/lib/measures/AddCostperAreatoUnusedConstruction/measure.xml +8 -7
  32. data/lib/measures/AddExteriorLights/LICENSE.md +1 -1
  33. data/lib/measures/AddExteriorLights/measure.rb +1 -1
  34. data/lib/measures/AddExteriorLights/measure.xml +8 -7
  35. data/lib/measures/AddMeter/LICENSE.md +1 -1
  36. data/lib/measures/AddMeter/measure.rb +1 -1
  37. data/lib/measures/AddMeter/measure.xml +8 -7
  38. data/lib/measures/AddOutputDiagnostics/LICENSE.md +1 -1
  39. data/lib/measures/AddOutputDiagnostics/measure.rb +1 -1
  40. data/lib/measures/AddOutputDiagnostics/measure.xml +8 -7
  41. data/lib/measures/AddOutputVariable/LICENSE.md +1 -1
  42. data/lib/measures/AddOutputVariable/measure.rb +1 -1
  43. data/lib/measures/AddOutputVariable/measure.xml +8 -7
  44. data/lib/measures/AddSimplePvToShadingSurfacesByType/LICENSE.md +1 -1
  45. data/lib/measures/AddSimplePvToShadingSurfacesByType/measure.rb +1 -1
  46. data/lib/measures/AddSimplePvToShadingSurfacesByType/measure.xml +8 -7
  47. data/lib/measures/AdjustSystemEfficiencies/LICENSE.md +1 -1
  48. data/lib/measures/AdjustSystemEfficiencies/measure.rb +1 -1
  49. data/lib/measures/AdjustSystemEfficiencies/measure.xml +7 -6
  50. data/lib/measures/AdjustThermostatSetpointsByDegrees/LICENSE.md +1 -1
  51. data/lib/measures/AdjustThermostatSetpointsByDegrees/measure.rb +1 -1
  52. data/lib/measures/AdjustThermostatSetpointsByDegrees/measure.xml +8 -7
  53. data/lib/measures/ChangeBuildingLocation/LICENSE.md +1 -1
  54. data/lib/measures/ChangeBuildingLocation/measure.rb +3 -3
  55. data/lib/measures/ChangeBuildingLocation/measure.xml +15 -15
  56. data/lib/measures/ChangeBuildingLocation/resources/epw.rb +1 -1
  57. data/lib/measures/ChangeBuildingLocation/resources/stat_file.rb +1 -1
  58. data/lib/measures/EnableIdealAirLoadsForAllZones/LICENSE.md +1 -1
  59. data/lib/measures/EnableIdealAirLoadsForAllZones/measure.rb +1 -1
  60. data/lib/measures/EnableIdealAirLoadsForAllZones/measure.xml +9 -8
  61. data/lib/measures/ExportScheduleCSV/LICENSE.md +1 -1
  62. data/lib/measures/ExportScheduleCSV/measure.rb +2 -2
  63. data/lib/measures/ExportScheduleCSV/measure.xml +13 -12
  64. data/lib/measures/ImportEnvelopeAndInternalLoadsFromIdf/LICENSE.md +1 -1
  65. data/lib/measures/ImportEnvelopeAndInternalLoadsFromIdf/measure.rb +1 -1
  66. data/lib/measures/ImportEnvelopeAndInternalLoadsFromIdf/measure.xml +9 -8
  67. data/lib/measures/MeterFlodPlot/LICENSE.md +1 -1
  68. data/lib/measures/MeterFlodPlot/measure.rb +2 -2
  69. data/lib/measures/MeterFlodPlot/measure.xml +13 -12
  70. data/lib/measures/ModifyEnergyPlusCoilCoolingDXSingleSpeedObjects/LICENSE.md +1 -1
  71. data/lib/measures/ModifyEnergyPlusCoilCoolingDXSingleSpeedObjects/measure.rb +1 -1
  72. data/lib/measures/ModifyEnergyPlusCoilCoolingDXSingleSpeedObjects/measure.xml +8 -7
  73. data/lib/measures/ModifyEnergyPlusFanVariableVolumeObjects/LICENSE.md +1 -1
  74. data/lib/measures/ModifyEnergyPlusFanVariableVolumeObjects/measure.rb +1 -1
  75. data/lib/measures/ModifyEnergyPlusFanVariableVolumeObjects/measure.xml +8 -7
  76. data/lib/measures/PredictedMeanVote/LICENSE.md +1 -1
  77. data/lib/measures/PredictedMeanVote/measure.rb +1 -1
  78. data/lib/measures/PredictedMeanVote/measure.xml +14 -13
  79. data/lib/measures/RemoveInternalLoadsDirectlyAssignedToSpaces/LICENSE.md +1 -1
  80. data/lib/measures/RemoveInternalLoadsDirectlyAssignedToSpaces/measure.rb +1 -1
  81. data/lib/measures/RemoveInternalLoadsDirectlyAssignedToSpaces/measure.xml +9 -8
  82. data/lib/measures/RemoveUnusedDefaultProfiles/LICENSE.md +1 -1
  83. data/lib/measures/RemoveUnusedDefaultProfiles/measure.rb +1 -1
  84. data/lib/measures/RemoveUnusedDefaultProfiles/measure.xml +9 -8
  85. data/lib/measures/ReplaceExteriorWindowConstruction/LICENSE.md +1 -1
  86. data/lib/measures/ReplaceExteriorWindowConstruction/measure.rb +1 -1
  87. data/lib/measures/ReplaceExteriorWindowConstruction/measure.xml +11 -10
  88. data/lib/measures/ReplaceThermostatSchedules/LICENSE.md +1 -1
  89. data/lib/measures/ReplaceThermostatSchedules/measure.rb +1 -1
  90. data/lib/measures/ReplaceThermostatSchedules/measure.xml +12 -11
  91. data/lib/measures/ReportModelChanges/LICENSE.md +1 -1
  92. data/lib/measures/ReportModelChanges/measure.rb +1 -1
  93. data/lib/measures/ReportModelChanges/measure.xml +5 -5
  94. data/lib/measures/RunPeriod/LICENSE.md +1 -1
  95. data/lib/measures/RunPeriod/measure.rb +1 -1
  96. data/lib/measures/RunPeriod/measure.xml +19 -18
  97. data/lib/measures/RunPeriodMultiple/LICENSE.md +1 -1
  98. data/lib/measures/RunPeriodMultiple/measure.rb +1 -1
  99. data/lib/measures/RunPeriodMultiple/measure.xml +12 -11
  100. data/lib/measures/ServerDirectoryCleanup/LICENSE.md +1 -1
  101. data/lib/measures/ServerDirectoryCleanup/README.md +97 -3
  102. data/lib/measures/ServerDirectoryCleanup/measure.rb +2 -2
  103. data/lib/measures/ServerDirectoryCleanup/measure.xml +20 -69
  104. data/lib/measures/SetCOPforSingleSpeedDXCoolingUnits/LICENSE.md +1 -1
  105. data/lib/measures/SetCOPforSingleSpeedDXCoolingUnits/measure.rb +1 -1
  106. data/lib/measures/SetCOPforSingleSpeedDXCoolingUnits/measure.xml +10 -9
  107. data/lib/measures/SetCOPforTwoSpeedDXCoolingUnits/LICENSE.md +1 -1
  108. data/lib/measures/SetCOPforTwoSpeedDXCoolingUnits/measure.rb +1 -1
  109. data/lib/measures/SetCOPforTwoSpeedDXCoolingUnits/measure.xml +10 -9
  110. data/lib/measures/SetEnergyPlusInfiltrationFlowRatePerFloorArea/LICENSE.md +1 -1
  111. data/lib/measures/SetEnergyPlusInfiltrationFlowRatePerFloorArea/measure.rb +1 -1
  112. data/lib/measures/SetEnergyPlusInfiltrationFlowRatePerFloorArea/measure.xml +8 -7
  113. data/lib/measures/SetEnergyPlusLightObjectsLPD/LICENSE.md +1 -1
  114. data/lib/measures/SetEnergyPlusLightObjectsLPD/measure.rb +1 -1
  115. data/lib/measures/SetEnergyPlusLightObjectsLPD/measure.xml +8 -7
  116. data/lib/measures/SetEnergyPlusMinimumOutdoorAirFlowRate/LICENSE.md +1 -1
  117. data/lib/measures/SetEnergyPlusMinimumOutdoorAirFlowRate/measure.rb +1 -1
  118. data/lib/measures/SetEnergyPlusMinimumOutdoorAirFlowRate/measure.xml +8 -7
  119. data/lib/measures/SetGasBurnerEfficiency/LICENSE.md +1 -1
  120. data/lib/measures/SetGasBurnerEfficiency/measure.rb +1 -1
  121. data/lib/measures/SetGasBurnerEfficiency/measure.xml +10 -9
  122. data/lib/measures/SetLifecycleCostParameters/LICENSE.md +1 -1
  123. data/lib/measures/SetLifecycleCostParameters/measure.rb +1 -1
  124. data/lib/measures/SetLifecycleCostParameters/measure.xml +8 -7
  125. data/lib/measures/SetLightingLoadsByLPD/LICENSE.md +1 -1
  126. data/lib/measures/SetLightingLoadsByLPD/measure.rb +1 -1
  127. data/lib/measures/SetLightingLoadsByLPD/measure.xml +10 -9
  128. data/lib/measures/SetSpaceInfiltrationByExteriorSurfaceArea/LICENSE.md +1 -1
  129. data/lib/measures/SetSpaceInfiltrationByExteriorSurfaceArea/measure.rb +1 -1
  130. data/lib/measures/SetSpaceInfiltrationByExteriorSurfaceArea/measure.xml +20 -19
  131. data/lib/measures/SetThermostatSchedules/LICENSE.md +1 -1
  132. data/lib/measures/SetThermostatSchedules/measure.rb +1 -1
  133. data/lib/measures/SetThermostatSchedules/measure.xml +12 -11
  134. data/lib/measures/ShiftScheduleProfileTime/LICENSE.md +1 -1
  135. data/lib/measures/ShiftScheduleProfileTime/measure.rb +1 -1
  136. data/lib/measures/ShiftScheduleProfileTime/measure.xml +10 -9
  137. data/lib/measures/SwapLightsDefinition/LICENSE.md +1 -1
  138. data/lib/measures/SwapLightsDefinition/measure.rb +1 -1
  139. data/lib/measures/SwapLightsDefinition/measure.xml +10 -9
  140. data/lib/measures/UnmetLoadHoursTroubleshooting/LICENSE.md +1 -1
  141. data/lib/measures/UnmetLoadHoursTroubleshooting/README.md +9 -3
  142. data/lib/measures/UnmetLoadHoursTroubleshooting/measure.rb +2 -2
  143. data/lib/measures/UnmetLoadHoursTroubleshooting/measure.xml +72 -23
  144. data/lib/measures/VentilationQAQC/LICENSE.md +1 -1
  145. data/lib/measures/VentilationQAQC/README.md +9 -3
  146. data/lib/measures/VentilationQAQC/measure.rb +53 -46
  147. data/lib/measures/VentilationQAQC/measure.xml +24 -29
  148. data/lib/measures/ZoneReport/LICENSE.md +1 -1
  149. data/lib/measures/ZoneReport/README.md +2 -2
  150. data/lib/measures/ZoneReport/measure.rb +2 -2
  151. data/lib/measures/ZoneReport/measure.xml +16 -17
  152. data/lib/measures/add_ems_to_control_ev_charging/LICENSE.MD.txt +15 -0
  153. data/lib/measures/{AddDaylightSensors → add_ems_to_control_ev_charging}/LICENSE.md +1 -1
  154. data/lib/measures/add_ems_to_control_ev_charging/README.md +29 -0
  155. data/lib/measures/add_ems_to_control_ev_charging/measure.rb +289 -0
  156. data/lib/measures/add_ems_to_control_ev_charging/measure.xml +91 -0
  157. data/lib/measures/add_ev_load/LICENSE.MD.txt +15 -0
  158. data/lib/measures/{EnableEconomizerControl → add_ev_load}/LICENSE.md +1 -1
  159. data/lib/measures/add_ev_load/README.md +34 -0
  160. data/lib/measures/add_ev_load/measure.rb +331 -0
  161. data/lib/measures/add_ev_load/measure.xml +348 -0
  162. data/lib/measures/add_ev_load/resources/PSN_BuildingKey.csv +104 -0
  163. data/lib/measures/add_ev_load/resources/PSN_BuildingKey_v2.csv +104 -0
  164. data/lib/measures/add_ev_load/resources/chg1_dow1_flex1.csv +96 -0
  165. data/lib/measures/add_ev_load/resources/chg1_dow1_flex2.csv +96 -0
  166. data/lib/measures/add_ev_load/resources/chg1_dow1_flex3.csv +96 -0
  167. data/lib/measures/add_ev_load/resources/chg1_dow2_flex1.csv +96 -0
  168. data/lib/measures/add_ev_load/resources/chg1_dow2_flex2.csv +96 -0
  169. data/lib/measures/add_ev_load/resources/chg1_dow2_flex3.csv +96 -0
  170. data/lib/measures/add_ev_load/resources/chg1_dow3_flex1.csv +96 -0
  171. data/lib/measures/add_ev_load/resources/chg1_dow3_flex2.csv +96 -0
  172. data/lib/measures/add_ev_load/resources/chg1_dow3_flex3.csv +96 -0
  173. data/lib/measures/add_ev_load/resources/chg2_dow1_flex1.csv +96 -0
  174. data/lib/measures/add_ev_load/resources/chg2_dow1_flex2.csv +96 -0
  175. data/lib/measures/add_ev_load/resources/chg2_dow1_flex3.csv +96 -0
  176. data/lib/measures/add_ev_load/resources/chg2_dow2_flex1.csv +96 -0
  177. data/lib/measures/add_ev_load/resources/chg2_dow2_flex2.csv +96 -0
  178. data/lib/measures/add_ev_load/resources/chg2_dow2_flex3.csv +96 -0
  179. data/lib/measures/add_ev_load/resources/chg2_dow3_flex1.csv +96 -0
  180. data/lib/measures/add_ev_load/resources/chg2_dow3_flex2.csv +96 -0
  181. data/lib/measures/add_ev_load/resources/chg2_dow3_flex3.csv +96 -0
  182. data/lib/measures/add_ev_load/resources/chg3_dow1_flex1.csv +96 -0
  183. data/lib/measures/add_ev_load/resources/chg3_dow1_flex2.csv +96 -0
  184. data/lib/measures/add_ev_load/resources/chg3_dow1_flex3.csv +96 -0
  185. data/lib/measures/add_ev_load/resources/chg3_dow2_flex1.csv +96 -0
  186. data/lib/measures/add_ev_load/resources/chg3_dow2_flex2.csv +96 -0
  187. data/lib/measures/add_ev_load/resources/chg3_dow2_flex3.csv +96 -0
  188. data/lib/measures/add_ev_load/resources/chg3_dow3_flex1.csv +96 -0
  189. data/lib/measures/add_ev_load/resources/chg3_dow3_flex2.csv +96 -0
  190. data/lib/measures/add_ev_load/resources/chg3_dow3_flex3.csv +96 -0
  191. data/lib/measures/add_ev_load/resources/fast_charge_15min_Saturday.csv +96 -0
  192. data/lib/measures/add_ev_load/resources/fast_charge_15min_Sunday.csv +96 -0
  193. data/lib/measures/add_ev_load/resources/fast_charge_15min_Weekday.csv +96 -0
  194. data/lib/measures/add_rooftop_pv/LICENSE.md +1 -1
  195. data/lib/measures/add_rooftop_pv/measure.rb +1 -1
  196. data/lib/measures/add_rooftop_pv/measure.xml +5 -5
  197. data/lib/measures/add_zone_mixing_object/LICENSE.md +1 -1
  198. data/lib/measures/add_zone_mixing_object/measure.rb +1 -1
  199. data/lib/measures/add_zone_mixing_object/measure.xml +8 -7
  200. data/lib/measures/add_zone_ventilation_design_flow_rate_object/LICENSE.md +1 -1
  201. data/lib/measures/add_zone_ventilation_design_flow_rate_object/measure.rb +1 -1
  202. data/lib/measures/add_zone_ventilation_design_flow_rate_object/measure.xml +8 -7
  203. data/lib/measures/air_wall_zone_mixing/LICENSE.md +1 -1
  204. data/lib/measures/air_wall_zone_mixing/measure.rb +1 -1
  205. data/lib/measures/air_wall_zone_mixing/measure.xml +5 -5
  206. data/lib/measures/envelope_and_internal_load_breakdown/LICENSE.md +1 -1
  207. data/lib/measures/envelope_and_internal_load_breakdown/README.md +4 -3
  208. data/lib/measures/envelope_and_internal_load_breakdown/measure.rb +8 -5
  209. data/lib/measures/envelope_and_internal_load_breakdown/measure.xml +18 -19
  210. data/lib/measures/envelope_and_internal_load_breakdown/resources/os_lib_reporting_envelope_and_internal_loads_breakdown.rb +1 -1
  211. data/lib/measures/envelope_and_internal_load_breakdown/resources/report.html.erb +5 -1
  212. data/lib/measures/example_report/LICENSE.md +1 -1
  213. data/lib/measures/example_report/README.md +27 -5
  214. data/lib/measures/example_report/measure.rb +8 -5
  215. data/lib/measures/example_report/measure.xml +19 -32
  216. data/lib/measures/example_report/resources/os_lib_reporting_example.rb +1 -1
  217. data/lib/measures/example_report/resources/report.html.erb +5 -1
  218. data/lib/measures/gem_env_report/LICENSE.md +1 -1
  219. data/lib/measures/gem_env_report/measure.rb +1 -1
  220. data/lib/measures/gem_env_report/measure.xml +14 -13
  221. data/lib/measures/gem_env_report/resources/gem_env_info.rb +1 -1
  222. data/lib/measures/gem_env_report/resources/openstudio_info.rb +1 -1
  223. data/lib/measures/gem_env_report/resources/run_gem_env_info.rb +1 -1
  224. data/lib/measures/gem_env_report/resources/run_openstudio_info.rb +1 -1
  225. data/lib/measures/generic_qaqc/LICENSE.md +1 -1
  226. data/lib/measures/generic_qaqc/README.md +187 -5
  227. data/lib/measures/generic_qaqc/measure.rb +7 -2
  228. data/lib/measures/generic_qaqc/measure.xml +54 -130
  229. data/lib/measures/generic_qaqc/resources/CreateResults.rb +1 -1
  230. data/lib/measures/generic_qaqc/resources/check_air_sys_temps.rb +1 -1
  231. data/lib/measures/generic_qaqc/resources/check_calibration.rb +1 -1
  232. data/lib/measures/generic_qaqc/resources/check_cond_zns.rb +1 -1
  233. data/lib/measures/generic_qaqc/resources/check_domestic_hot_water.rb +1 -1
  234. data/lib/measures/generic_qaqc/resources/check_envelope_conductance.rb +8 -2
  235. data/lib/measures/generic_qaqc/resources/check_eui_by_end_use.rb +11 -12
  236. data/lib/measures/generic_qaqc/resources/check_eui_reasonableness.rb +1 -1
  237. data/lib/measures/generic_qaqc/resources/check_fan_pwr.rb +1 -1
  238. data/lib/measures/generic_qaqc/resources/check_internal_loads.rb +1 -1
  239. data/lib/measures/generic_qaqc/resources/check_mech_sys_capacity.rb +1 -1
  240. data/lib/measures/generic_qaqc/resources/check_mech_sys_efficiency.rb +1 -1
  241. data/lib/measures/generic_qaqc/resources/check_mech_sys_part_load_eff.rb +1 -1
  242. data/lib/measures/generic_qaqc/resources/check_mech_sys_type.rb +1 -1
  243. data/lib/measures/generic_qaqc/resources/check_part_loads.rb +1 -1
  244. data/lib/measures/generic_qaqc/resources/check_placeholder.rb +1 -1
  245. data/lib/measures/generic_qaqc/resources/check_plant_cap.rb +1 -1
  246. data/lib/measures/generic_qaqc/resources/check_plant_temps.rb +1 -1
  247. data/lib/measures/generic_qaqc/resources/check_plenum_loads.rb +1 -1
  248. data/lib/measures/generic_qaqc/resources/check_pump_pwr.rb +1 -1
  249. data/lib/measures/generic_qaqc/resources/check_sch_coord.rb +1 -1
  250. data/lib/measures/generic_qaqc/resources/check_schedules.rb +1 -1
  251. data/lib/measures/generic_qaqc/resources/check_simultaneous_heating_and_cooling.rb +1 -1
  252. data/lib/measures/generic_qaqc/resources/check_supply_air_and_thermostat_temp_difference.rb +1 -1
  253. data/lib/measures/generic_qaqc/resources/check_weather_files.rb +1 -1
  254. data/lib/measures/generic_qaqc/resources/os_lib_reporting_qaqc.rb +1 -1
  255. data/lib/measures/generic_qaqc/resources/report.html.erb +5 -1
  256. data/lib/measures/get_site_from_building_component_library/LICENSE.md +1 -1
  257. data/lib/measures/get_site_from_building_component_library/measure.rb +1 -1
  258. data/lib/measures/get_site_from_building_component_library/measure.xml +6 -6
  259. data/lib/measures/hvac_psychrometric_chart/LICENSE.md +1 -1
  260. data/lib/measures/hvac_psychrometric_chart/README.md +11 -5
  261. data/lib/measures/hvac_psychrometric_chart/measure.rb +2 -2
  262. data/lib/measures/hvac_psychrometric_chart/measure.xml +13 -19
  263. data/lib/measures/hvac_psychrometric_chart/resources/report.html.erb +5 -1
  264. data/lib/measures/inject_idf_objects/LICENSE.md +1 -1
  265. data/lib/measures/inject_idf_objects/measure.rb +1 -1
  266. data/lib/measures/inject_idf_objects/measure.xml +29 -28
  267. data/lib/measures/openstudio_results/LICENSE.md +1 -1
  268. data/lib/measures/openstudio_results/README.md +200 -6
  269. data/lib/measures/openstudio_results/measure.rb +20 -14
  270. data/lib/measures/openstudio_results/measure.xml +210 -302
  271. data/lib/measures/openstudio_results/resources/Siz.AirConditionerVariableRefrigerantFlow.rb +1 -1
  272. data/lib/measures/openstudio_results/resources/Siz.AirLoopHVAC.rb +1 -1
  273. data/lib/measures/openstudio_results/resources/Siz.AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.rb +1 -1
  274. data/lib/measures/openstudio_results/resources/Siz.AirLoopHVACUnitaryHeatPumpAirToAir.rb +1 -1
  275. data/lib/measures/openstudio_results/resources/Siz.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.rb +1 -1
  276. data/lib/measures/openstudio_results/resources/Siz.AirLoopHVACUnitarySystem.rb +1 -1
  277. data/lib/measures/openstudio_results/resources/Siz.AirTerminalDualDuctVAV.rb +1 -1
  278. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctConstantVolumeCooledBeam.rb +1 -1
  279. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctConstantVolumeFourPipeInduction.rb +1 -1
  280. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctConstantVolumeReheat.rb +1 -1
  281. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctParallelPIUReheat.rb +1 -1
  282. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctSeriesPIUReheat.rb +1 -1
  283. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctUncontrolled.rb +1 -1
  284. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctVAVHeatAndCoolNoReheat.rb +1 -1
  285. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctVAVHeatAndCoolReheat.rb +1 -1
  286. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctVAVNoReheat.rb +1 -1
  287. data/lib/measures/openstudio_results/resources/Siz.AirTerminalSingleDuctVAVReheat.rb +1 -1
  288. data/lib/measures/openstudio_results/resources/Siz.BoilerHotWater.rb +1 -1
  289. data/lib/measures/openstudio_results/resources/Siz.BoilerSteam.rb +1 -1
  290. data/lib/measures/openstudio_results/resources/Siz.ChillerAbsorption.rb +1 -1
  291. data/lib/measures/openstudio_results/resources/Siz.ChillerAbsorptionIndirect.rb +1 -1
  292. data/lib/measures/openstudio_results/resources/Siz.ChillerElectricEIR.rb +1 -1
  293. data/lib/measures/openstudio_results/resources/Siz.ChillerHeaterPerformanceElectricEIR.rb +1 -1
  294. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXMultiSpeed.rb +1 -1
  295. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXMultiSpeedStageData.rb +1 -1
  296. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXSingleSpeed.rb +1 -1
  297. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXTwoSpeed.rb +1 -1
  298. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXTwoStageWithHumidityControlMode.rb +1 -1
  299. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXVariableRefrigerantFlow.rb +1 -1
  300. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXVariableSpeed.rb +1 -1
  301. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingDXVariableSpeedSpeedData.rb +1 -1
  302. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingLowTempRadiantVarFlow.rb +1 -1
  303. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingWater.rb +1 -1
  304. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingWaterToAirHeatPumpEquationFit.rb +1 -1
  305. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.rb +1 -1
  306. data/lib/measures/openstudio_results/resources/Siz.CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData.rb +1 -1
  307. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXMultiSpeed.rb +1 -1
  308. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXMultiSpeedStageData.rb +1 -1
  309. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXSingleSpeed.rb +1 -1
  310. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXVariableRefrigerantFlow.rb +1 -1
  311. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXVariableSpeed.rb +1 -1
  312. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDXVariableSpeedSpeedData.rb +1 -1
  313. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingDesuperheater.rb +1 -1
  314. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingElectric.rb +1 -1
  315. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingGas.rb +1 -1
  316. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingGasMultiStage.rb +1 -1
  317. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingGasMultiStageStageData.rb +1 -1
  318. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingLowTempRadiantVarFlow.rb +1 -1
  319. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWater.rb +1 -1
  320. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWaterBaseboard.rb +1 -1
  321. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWaterBaseboardRadiant.rb +1 -1
  322. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWaterToAirHeatPumpEquationFit.rb +1 -1
  323. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit.rb +1 -1
  324. data/lib/measures/openstudio_results/resources/Siz.CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData.rb +1 -1
  325. data/lib/measures/openstudio_results/resources/Siz.CoilPerformanceDXCooling.rb +1 -1
  326. data/lib/measures/openstudio_results/resources/Siz.CoilSystemCoolingDXHeatExchangerAssisted.rb +1 -1
  327. data/lib/measures/openstudio_results/resources/Siz.CoilSystemCoolingWaterHeatExchangerAssisted.rb +1 -1
  328. data/lib/measures/openstudio_results/resources/Siz.CoilWaterHeatingAirToWaterHeatPump.rb +1 -1
  329. data/lib/measures/openstudio_results/resources/Siz.CoilWaterHeatingAirToWaterHeatPumpWrapped.rb +1 -1
  330. data/lib/measures/openstudio_results/resources/Siz.CoilWaterHeatingDesuperheater.rb +1 -1
  331. data/lib/measures/openstudio_results/resources/Siz.ControllerOutdoorAir.rb +1 -1
  332. data/lib/measures/openstudio_results/resources/Siz.CoolingTowerSingleSpeed.rb +1 -1
  333. data/lib/measures/openstudio_results/resources/Siz.CoolingTowerTwoSpeed.rb +1 -1
  334. data/lib/measures/openstudio_results/resources/Siz.CoolingTowerVariableSpeed.rb +1 -1
  335. data/lib/measures/openstudio_results/resources/Siz.DistrictCooling.rb +1 -1
  336. data/lib/measures/openstudio_results/resources/Siz.DistrictHeating.rb +1 -1
  337. data/lib/measures/openstudio_results/resources/Siz.ElectricLoadCenterInverterLookUpTable.rb +1 -1
  338. data/lib/measures/openstudio_results/resources/Siz.ElectricLoadCenterInverterSimple.rb +1 -1
  339. data/lib/measures/openstudio_results/resources/Siz.ElectricLoadCenterStorageConverter.rb +1 -1
  340. data/lib/measures/openstudio_results/resources/Siz.ElectricLoadCenterStorageSimple.rb +1 -1
  341. data/lib/measures/openstudio_results/resources/Siz.EvaporativeCoolerDirectResearchSpecial.rb +1 -1
  342. data/lib/measures/openstudio_results/resources/Siz.EvaporativeCoolerIndirectResearchSpecial.rb +1 -1
  343. data/lib/measures/openstudio_results/resources/Siz.EvaporativeFluidCoolerSingleSpeed.rb +1 -1
  344. data/lib/measures/openstudio_results/resources/Siz.EvaporativeFluidCoolerTwoSpeed.rb +1 -1
  345. data/lib/measures/openstudio_results/resources/Siz.FanConstantVolume.rb +1 -1
  346. data/lib/measures/openstudio_results/resources/Siz.FanOnOff.rb +1 -1
  347. data/lib/measures/openstudio_results/resources/Siz.FanVariableVolume.rb +1 -1
  348. data/lib/measures/openstudio_results/resources/Siz.FanZoneExhaust.rb +1 -1
  349. data/lib/measures/openstudio_results/resources/Siz.FluidCoolerSingleSpeed.rb +1 -1
  350. data/lib/measures/openstudio_results/resources/Siz.FluidCoolerTwoSpeed.rb +1 -1
  351. data/lib/measures/openstudio_results/resources/Siz.GeneratorFuelCellElectricalStorage.rb +1 -1
  352. data/lib/measures/openstudio_results/resources/Siz.GeneratorFuelCellInverter.rb +1 -1
  353. data/lib/measures/openstudio_results/resources/Siz.GeneratorFuelCellPowerModule.rb +1 -1
  354. data/lib/measures/openstudio_results/resources/Siz.GeneratorMicroTurbine.rb +1 -1
  355. data/lib/measures/openstudio_results/resources/Siz.GeneratorMicroTurbineHeatRecovery.rb +1 -1
  356. data/lib/measures/openstudio_results/resources/Siz.HVACComponent.rb +1 -1
  357. data/lib/measures/openstudio_results/resources/Siz.HeaderedPumpsConstantSpeed.rb +1 -1
  358. data/lib/measures/openstudio_results/resources/Siz.HeaderedPumpsVariableSpeed.rb +1 -1
  359. data/lib/measures/openstudio_results/resources/Siz.HeatExchangerAirToAirSensibleAndLatent.rb +1 -1
  360. data/lib/measures/openstudio_results/resources/Siz.HeatExchangerFluidToFluid.rb +1 -1
  361. data/lib/measures/openstudio_results/resources/Siz.HeatPumpWaterToWaterEquationFitCooling.rb +1 -1
  362. data/lib/measures/openstudio_results/resources/Siz.HeatPumpWaterToWaterEquationFitHeating.rb +1 -1
  363. data/lib/measures/openstudio_results/resources/Siz.HumidifierSteamElectric.rb +1 -1
  364. data/lib/measures/openstudio_results/resources/Siz.Model.rb +1 -1
  365. data/lib/measures/openstudio_results/resources/Siz.ModelObject.rb +1 -1
  366. data/lib/measures/openstudio_results/resources/Siz.PhotovoltaicPerformanceSimple.rb +1 -1
  367. data/lib/measures/openstudio_results/resources/Siz.PlantComponentTemperatureSource.rb +1 -1
  368. data/lib/measures/openstudio_results/resources/Siz.PlantLoop.rb +1 -1
  369. data/lib/measures/openstudio_results/resources/Siz.PumpConstantSpeed.rb +1 -1
  370. data/lib/measures/openstudio_results/resources/Siz.PumpVariableSpeed.rb +1 -1
  371. data/lib/measures/openstudio_results/resources/Siz.RefrigerationSecondarySystem.rb +1 -1
  372. data/lib/measures/openstudio_results/resources/Siz.RefrigerationSystem.rb +1 -1
  373. data/lib/measures/openstudio_results/resources/Siz.RefrigerationTranscriticalSystem.rb +1 -1
  374. data/lib/measures/openstudio_results/resources/Siz.SizingSystem.rb +1 -1
  375. data/lib/measures/openstudio_results/resources/Siz.SolarCollectorFlatPlatePhotovoltaicThermal.rb +1 -1
  376. data/lib/measures/openstudio_results/resources/Siz.SolarCollectorPerformancePhotovoltaicThermalSimple.rb +1 -1
  377. data/lib/measures/openstudio_results/resources/Siz.ThermalStorageChilledWaterStratified.rb +1 -1
  378. data/lib/measures/openstudio_results/resources/Siz.WaterHeaterHeatPump.rb +1 -1
  379. data/lib/measures/openstudio_results/resources/Siz.WaterHeaterHeatPumpWrappedCondenser.rb +1 -1
  380. data/lib/measures/openstudio_results/resources/Siz.WaterHeaterMixed.rb +1 -1
  381. data/lib/measures/openstudio_results/resources/Siz.WaterHeaterStratified.rb +1 -1
  382. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACBaseboardConvectiveElectric.rb +1 -1
  383. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACBaseboardConvectiveWater.rb +1 -1
  384. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACBaseboardRadiantConvectiveElectric.rb +1 -1
  385. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACBaseboardRadiantConvectiveWater.rb +1 -1
  386. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACEnergyRecoveryVentilator.rb +1 -1
  387. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACFourPipeFanCoil.rb +1 -1
  388. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACHighTemperatureRadiant.rb +1 -1
  389. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACIdealLoadsAirSystem.rb +1 -1
  390. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACLowTempRadiantConstFlow.rb +1 -1
  391. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACLowTempRadiantVarFlow.rb +1 -1
  392. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACPackagedTerminalAirConditioner.rb +1 -1
  393. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACPackagedTerminalHeatPump.rb +1 -1
  394. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACTerminalUnitVariableRefrigerantFlow.rb +1 -1
  395. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACUnitHeater.rb +1 -1
  396. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACUnitVentilator.rb +1 -1
  397. data/lib/measures/openstudio_results/resources/Siz.ZoneHVACWaterToAirHeatPump.rb +1 -1
  398. data/lib/measures/openstudio_results/resources/Siz.ZoneVentilationDesignFlowRate.rb +1 -1
  399. data/lib/measures/openstudio_results/resources/os_lib_reporting.rb +117 -39
  400. data/lib/measures/openstudio_results/resources/report.html.erb +5 -1
  401. data/lib/measures/remove_orphan_objects_and_unused_resources/LICENSE.md +1 -1
  402. data/lib/measures/remove_orphan_objects_and_unused_resources/measure.rb +1 -1
  403. data/lib/measures/remove_orphan_objects_and_unused_resources/measure.xml +8 -7
  404. data/lib/measures/set_electric_equipment_loads_by_epd/LICENSE.md +1 -1
  405. data/lib/measures/set_electric_equipment_loads_by_epd/measure.rb +1 -1
  406. data/lib/measures/set_electric_equipment_loads_by_epd/measure.xml +10 -9
  407. data/lib/measures/set_exterior_walls_and_floors_to_adiabatic/LICENSE.md +1 -1
  408. data/lib/measures/set_exterior_walls_and_floors_to_adiabatic/README.md +16 -0
  409. data/lib/measures/set_exterior_walls_and_floors_to_adiabatic/measure.rb +33 -2
  410. data/lib/measures/set_exterior_walls_and_floors_to_adiabatic/measure.xml +33 -8
  411. data/lib/measures/set_run_period/LICENSE.md +1 -1
  412. data/lib/measures/set_run_period/measure.rb +1 -1
  413. data/lib/measures/set_run_period/measure.xml +5 -5
  414. data/lib/measures/set_space_infiltration_per_exterior_area/LICENSE.md +1 -1
  415. data/lib/measures/set_space_infiltration_per_exterior_area/measure.rb +1 -1
  416. data/lib/measures/set_space_infiltration_per_exterior_area/measure.xml +8 -7
  417. data/lib/measures/tariff_selection_block/LICENSE.md +1 -1
  418. data/lib/measures/tariff_selection_block/measure.rb +2 -2
  419. data/lib/measures/tariff_selection_block/measure.xml +5 -5
  420. data/lib/measures/tariff_selection_flat/LICENSE.md +1 -1
  421. data/lib/measures/tariff_selection_flat/measure.rb +2 -2
  422. data/lib/measures/tariff_selection_flat/measure.xml +5 -5
  423. data/lib/measures/tariff_selection_generic/LICENSE.md +1 -1
  424. data/lib/measures/tariff_selection_generic/README.md +2 -2
  425. data/lib/measures/tariff_selection_generic/measure.rb +1 -1
  426. data/lib/measures/tariff_selection_generic/measure.xml +25 -25
  427. data/lib/measures/tariff_selection_generic/resources/FlatEnergyCharge-Gas.idf +3 -3
  428. data/lib/measures/tariff_selection_generic/resources/IN-EIAMonthlyRateGas.idf +1 -1
  429. data/lib/measures/tariff_selection_time_and_date_dependant/LICENSE.md +1 -1
  430. data/lib/measures/tariff_selection_time_and_date_dependant/measure.rb +2 -2
  431. data/lib/measures/tariff_selection_time_and_date_dependant/measure.xml +5 -5
  432. data/lib/measures/{ImproveFanBeltEfficiency → view_data}/LICENSE.md +1 -1
  433. data/lib/measures/view_data/README.md +64 -0
  434. data/lib/measures/{AddDaylightSensors → view_data}/README.md.erb +0 -0
  435. data/lib/measures/view_data/measure.rb +454 -0
  436. data/lib/measures/view_data/measure.xml +159 -0
  437. data/lib/measures/view_data/resources/report.html.in +2881 -0
  438. data/lib/measures/view_data/resources/va3c.rb +1025 -0
  439. data/lib/measures/{EnableDemandControlledVentilation → view_model}/LICENSE.md +1 -1
  440. data/lib/measures/view_model/README.md +26 -0
  441. data/lib/measures/{EnableDemandControlledVentilation → view_model}/README.md.erb +0 -0
  442. data/lib/measures/view_model/measure.rb +146 -0
  443. data/lib/measures/view_model/measure.xml +129 -0
  444. data/lib/measures/view_model/resources/report.html.in +2881 -0
  445. data/lib/measures/view_model/resources/va3c.rb +1025 -0
  446. data/lib/openstudio-common-measures.rb +1 -1
  447. data/lib/openstudio/common_measures.rb +1 -1
  448. data/lib/openstudio/common_measures/extension.rb +1 -1
  449. data/lib/openstudio/common_measures/version.rb +2 -2
  450. data/openstudio-common-measures.gemspec +4 -4
  451. metadata +67 -91
  452. data/lib/measures/AddDaylightSensors/README.md +0 -136
  453. data/lib/measures/AddDaylightSensors/measure.rb +0 -521
  454. data/lib/measures/AddDaylightSensors/measure.xml +0 -233
  455. data/lib/measures/EnableDemandControlledVentilation/README.md +0 -32
  456. data/lib/measures/EnableDemandControlledVentilation/measure.rb +0 -154
  457. data/lib/measures/EnableDemandControlledVentilation/measure.xml +0 -99
  458. data/lib/measures/EnableEconomizerControl/README.md +0 -48
  459. data/lib/measures/EnableEconomizerControl/README.md.erb +0 -42
  460. data/lib/measures/EnableEconomizerControl/measure.rb +0 -172
  461. data/lib/measures/EnableEconomizerControl/measure.xml +0 -124
  462. data/lib/measures/ImproveFanBeltEfficiency/README.md +0 -104
  463. data/lib/measures/ImproveFanBeltEfficiency/README.md.erb +0 -42
  464. data/lib/measures/ImproveFanBeltEfficiency/measure.rb +0 -366
  465. data/lib/measures/ImproveFanBeltEfficiency/measure.xml +0 -185
  466. data/lib/measures/ImproveMotorEfficiency/LICENSE.md +0 -27
  467. data/lib/measures/ImproveMotorEfficiency/README.md +0 -104
  468. data/lib/measures/ImproveMotorEfficiency/README.md.erb +0 -42
  469. data/lib/measures/ImproveMotorEfficiency/measure.rb +0 -365
  470. data/lib/measures/ImproveMotorEfficiency/measure.xml +0 -182
  471. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/LICENSE.md +0 -27
  472. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/README.md +0 -64
  473. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/README.md.erb +0 -42
  474. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.rb +0 -422
  475. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.xml +0 -150
  476. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/LICENSE.md +0 -27
  477. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/README.md +0 -32
  478. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/README.md.erb +0 -42
  479. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/measure.rb +0 -328
  480. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/measure.xml +0 -98
  481. data/lib/measures/IncreaseInsulationRValueForRoofs/LICENSE.md +0 -27
  482. data/lib/measures/IncreaseInsulationRValueForRoofs/README.md +0 -64
  483. data/lib/measures/IncreaseInsulationRValueForRoofs/README.md.erb +0 -42
  484. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.rb +0 -422
  485. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.xml +0 -143
  486. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/LICENSE.md +0 -27
  487. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/README.md +0 -32
  488. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/README.md.erb +0 -42
  489. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/measure.rb +0 -328
  490. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/measure.xml +0 -98
  491. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/LICENSE.md +0 -27
  492. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/README.md +0 -97
  493. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/README.md.erb +0 -42
  494. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.rb +0 -450
  495. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.xml +0 -186
  496. data/lib/measures/ReduceLightingLoadsByPercentage/LICENSE.md +0 -27
  497. data/lib/measures/ReduceLightingLoadsByPercentage/README.md +0 -96
  498. data/lib/measures/ReduceLightingLoadsByPercentage/README.md.erb +0 -42
  499. data/lib/measures/ReduceLightingLoadsByPercentage/measure.rb +0 -513
  500. data/lib/measures/ReduceLightingLoadsByPercentage/measure.xml +0 -191
  501. data/lib/measures/ReduceSpaceInfiltrationByPercentage/LICENSE.md +0 -27
  502. data/lib/measures/ReduceSpaceInfiltrationByPercentage/README.md +0 -104
  503. data/lib/measures/ReduceSpaceInfiltrationByPercentage/README.md.erb +0 -42
  504. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.rb +0 -349
  505. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.xml +0 -181
  506. data/lib/measures/ReduceVentilationByPercentage/LICENSE.md +0 -27
  507. data/lib/measures/ReduceVentilationByPercentage/README.md +0 -40
  508. data/lib/measures/ReduceVentilationByPercentage/README.md.erb +0 -42
  509. data/lib/measures/ReduceVentilationByPercentage/measure.rb +0 -291
  510. data/lib/measures/ReduceVentilationByPercentage/measure.xml +0 -96
  511. data/lib/measures/VentilationQAQC/ExampleModel.osm +0 -28468
  512. data/lib/measures/create_variable_speed_rtu/LICENSE.md +0 -27
  513. data/lib/measures/create_variable_speed_rtu/README.md +0 -120
  514. data/lib/measures/create_variable_speed_rtu/README.md.erb +0 -42
  515. data/lib/measures/create_variable_speed_rtu/measure.rb +0 -539
  516. data/lib/measures/create_variable_speed_rtu/measure.xml +0 -207
  517. data/lib/measures/generic_qaqc/resources/os_lib_helper_methods.rb +0 -399
  518. data/lib/measures/openstudio_results/resources/os_lib_helper_methods.rb +0 -399
  519. data/lib/measures/openstudio_results/resources/os_lib_schedules.rb +0 -960
  520. data/lib/measures/radiant_slab_with_doas/LICENSE.md +0 -27
  521. data/lib/measures/radiant_slab_with_doas/README.md +0 -156
  522. data/lib/measures/radiant_slab_with_doas/README.md.erb +0 -42
  523. data/lib/measures/radiant_slab_with_doas/measure.rb +0 -403
  524. data/lib/measures/radiant_slab_with_doas/measure.xml +0 -345
@@ -0,0 +1,1025 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
24
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
35
+
36
+ require 'openstudio'
37
+
38
+ if /^1\.8/.match(RUBY_VERSION)
39
+ class Struct
40
+ def to_h
41
+ h = {}
42
+ self.class.members.each { |m| h[m.to_sym] = self[m] }
43
+ return h
44
+ end
45
+ end
46
+ end
47
+
48
+ module THREE
49
+ FrontSide = 0
50
+ BackSide = 1
51
+ DoubleSide = 2
52
+ end
53
+
54
+ # Va3c class converts an OpenStudio model to vA3C JSON format for rendering in Three.js
55
+ # using export at http://va3c.github.io/projects/#./osm-data-viewer/latest/index.html# as a guide
56
+ # many thanks to Theo Armour and the vA3C team for figuring out many of the details here
57
+ class VA3C
58
+ Scene = Struct.new(:geometries, :materials, :object)
59
+
60
+ Geometry = Struct.new(:uuid, :type, :data)
61
+ GeometryData = Struct.new(:vertices, :normals, :uvs, :faces, :scale, :visible, :castShadow, :receiveShadow, :doubleSided)
62
+
63
+ Material = Struct.new(:uuid, :type, :color, :ambient, :emissive, :specular, :shininess, :side, :opacity, :transparent, :wireframe)
64
+
65
+ SceneObject = Struct.new(:uuid, :type, :matrix, :children)
66
+ SceneChild = Struct.new(:uuid, :name, :type, :geometry, :material, :matrix, :userData)
67
+ UserData = Struct.new(:handle, :name, :surfaceType, :constructionName, :spaceName, :thermalZoneName, :spaceTypeName, :buildingStoryName,
68
+ :outsideBoundaryCondition, :outsideBoundaryConditionObjectName,
69
+ :outsideBoundaryConditionObjectHandle, :coincidentWithOutsideObject,
70
+ :sunExposure, :windExposure, #:vertices,
71
+ :surfaceTypeMaterialName, :boundaryMaterialName, :constructionMaterialName, :thermalZoneMaterialName,
72
+ :spaceTypeMaterialName, :buildingStoryMaterialName) do
73
+ def initialize(*)
74
+ super
75
+ self.surfaceTypeMaterialName = 'Undefined' if surfaceTypeMaterialName.nil?
76
+ self.boundaryMaterialName = 'Undefined' if boundaryMaterialName.nil?
77
+ self.constructionMaterialName = 'Undefined' if constructionMaterialName.nil?
78
+ self.thermalZoneMaterialName = 'Undefined' if thermalZoneMaterialName.nil?
79
+ self.spaceTypeMaterialName = 'Undefined' if spaceTypeMaterialName.nil?
80
+ self.buildingStoryMaterialName = 'Undefined' if buildingStoryMaterialName.nil?
81
+
82
+ self.constructionName = '' if constructionName.nil?
83
+ self.spaceName = '' if spaceName.nil?
84
+ self.thermalZoneName = '' if thermalZoneName.nil?
85
+ self.spaceTypeName = '' if spaceTypeName.nil?
86
+ self.buildingStoryName = '' if buildingStoryName.nil?
87
+ self.outsideBoundaryCondition = '' if outsideBoundaryCondition.nil?
88
+ self.outsideBoundaryConditionObjectName = '' if outsideBoundaryConditionObjectName.nil?
89
+ end
90
+ end
91
+ Vertex = Struct.new(:x, :y, :z)
92
+
93
+ AmbientLight = Struct.new(:uuid, :type, :color, :matrix)
94
+
95
+ def self.convert_model(model)
96
+ scene = build_scene(model)
97
+
98
+ northAxis = -model.getBuilding.northAxis
99
+
100
+ boundingBox = OpenStudio::BoundingBox.new
101
+ boundingBox.addPoint(OpenStudio::Point3d.new(0, 0, 0))
102
+ boundingBox.addPoint(OpenStudio::Point3d.new(1, 1, 1))
103
+ model.getPlanarSurfaceGroups.each do |group|
104
+ boundingBox.add(group.transformation * group.boundingBox)
105
+ end
106
+
107
+ lookAtX = 0 # (boundingBox.minX.get + boundingBox.maxX.get) / 2.0
108
+ lookAtY = 0 # (boundingBox.minY.get + boundingBox.maxY.get) / 2.0
109
+ lookAtZ = 0 # (boundingBox.minZ.get + boundingBox.maxZ.get) / 2.0
110
+ lookAtR = [Math.sqrt((boundingBox.maxX.get / 2.0)**2 + (boundingBox.maxY.get / 2.0)**2 + (boundingBox.maxZ.get / 2.0)**2),
111
+ Math.sqrt((boundingBox.minX.get / 2.0)**2 + (boundingBox.maxY.get / 2.0)**2 + (boundingBox.maxZ.get / 2.0)**2),
112
+ Math.sqrt((boundingBox.maxX.get / 2.0)**2 + (boundingBox.minY.get / 2.0)**2 + (boundingBox.maxZ.get / 2.0)**2),
113
+ Math.sqrt((boundingBox.maxX.get / 2.0)**2 + (boundingBox.maxY.get / 2.0)**2 + (boundingBox.minZ.get / 2.0)**2),
114
+ Math.sqrt((boundingBox.minX.get / 2.0)**2 + (boundingBox.minY.get / 2.0)**2 + (boundingBox.maxZ.get / 2.0)**2),
115
+ Math.sqrt((boundingBox.minX.get / 2.0)**2 + (boundingBox.maxY.get / 2.0)**2 + (boundingBox.minZ.get / 2.0)**2),
116
+ Math.sqrt((boundingBox.maxX.get / 2.0)**2 + (boundingBox.minY.get / 2.0)**2 + (boundingBox.minZ.get / 2.0)**2),
117
+ Math.sqrt((boundingBox.minX.get / 2.0)**2 + (boundingBox.minY.get / 2.0)**2 + (boundingBox.minZ.get / 2.0)**2)].max
118
+
119
+ boundingBoxHash = { 'minX' => boundingBox.minX.get, 'minY' => boundingBox.minY.get, 'minZ' => boundingBox.minZ.get,
120
+ 'maxX' => boundingBox.maxX.get, 'maxY' => boundingBox.maxY.get, 'maxZ' => boundingBox.maxZ.get,
121
+ 'lookAtX' => lookAtX, 'lookAtY' => lookAtY, 'lookAtZ' => lookAtZ, 'lookAtR' => lookAtR }
122
+
123
+ buildingStoryNames = []
124
+ model.getBuildingStorys.each do |buildingStory|
125
+ buildingStoryNames << buildingStory.name.to_s
126
+ end
127
+ buildingStoryNames.sort! { |x, y| x.upcase <=> y.upcase } # case insensitive sort
128
+
129
+ # build up the json hash
130
+ result = {}
131
+ result['metadata'] = { 'version' => 4.3, 'type' => 'Object', 'generator' => 'OpenStudio',
132
+ 'buildingStoryNames' => buildingStoryNames, 'boundingBox' => boundingBoxHash,
133
+ 'northAxis' => northAxis }
134
+ result['geometries'] = scene.geometries
135
+ result['materials'] = scene.materials
136
+ result['object'] = scene.object
137
+
138
+ return result
139
+ end
140
+
141
+ # format a uuid
142
+ def self.format_uuid(uuid)
143
+ return uuid.to_s.gsub('{', '').gsub('}', '')
144
+ end
145
+
146
+ # format color
147
+ def self.format_color(r, g, b)
148
+ return "0x#{r.to_s(16).rjust(2, '0')}#{g.to_s(16).rjust(2, '0')}#{b.to_s(16).rjust(2, '0')}"
149
+ end
150
+
151
+ # create a material
152
+ def self.make_material(name, color, opacity, side, shininess = 50)
153
+ transparent = false
154
+ if opacity < 1
155
+ transparent = true
156
+ end
157
+
158
+ material = { uuid: format_uuid(OpenStudio.createUUID).to_s,
159
+ name: name,
160
+ type: 'MeshPhongMaterial',
161
+ color: color.to_s.hex,
162
+ ambient: color.to_s.hex,
163
+ emissive: '0x000000'.hex,
164
+ specular: color.to_s.hex,
165
+ shininess: shininess,
166
+ opacity: opacity,
167
+ transparent: transparent,
168
+ wireframe: false,
169
+ side: side }
170
+ return material
171
+ end
172
+
173
+ # create the standard materials
174
+ def self.build_materials(model)
175
+ materials = []
176
+
177
+ # materials << make_material('Undefined', format_color(255, 255, 255), 1, THREE::DoubleSide)
178
+ materials << { uuid: format_uuid(OpenStudio.createUUID).to_s, name: 'Undefined', type: 'MeshBasicMaterial', color: '0xffffff'.hex, side: THREE::DoubleSide }
179
+
180
+ materials << make_material('NormalMaterial', format_color(255, 255, 255), 1, THREE::DoubleSide)
181
+ # materials << make_material('NormalMaterial_Ext', format_color(255, 255, 255), 1, THREE::FrontSide)
182
+ materials << { uuid: format_uuid(OpenStudio.createUUID).to_s, name: 'NormalMaterial_Ext', type: 'MeshBasicMaterial', color: '0xffffff'.hex, side: THREE::FrontSide }
183
+ materials << make_material('NormalMaterial_Int', format_color(255, 0, 0), 1, THREE::BackSide)
184
+
185
+ # materials from 'openstudio\openstudiocore\ruby\openstudio\sketchup_plugin\lib\interfaces\MaterialsInterface.rb'
186
+ materials << make_material('Floor', format_color(128, 128, 128), 1, THREE::DoubleSide)
187
+ materials << make_material('Floor_Ext', format_color(128, 128, 128), 1, THREE::FrontSide)
188
+ materials << make_material('Floor_Int', format_color(191, 191, 191), 1, THREE::BackSide)
189
+
190
+ materials << make_material('Wall', format_color(204, 178, 102), 1, THREE::DoubleSide)
191
+ materials << make_material('Wall_Ext', format_color(204, 178, 102), 1, THREE::FrontSide)
192
+ materials << make_material('Wall_Int', format_color(235, 226, 197), 1, THREE::BackSide)
193
+
194
+ materials << make_material('RoofCeiling', format_color(153, 76, 76), 1, THREE::DoubleSide)
195
+ materials << make_material('RoofCeiling_Ext', format_color(153, 76, 76), 1, THREE::FrontSide)
196
+ materials << make_material('RoofCeiling_Int', format_color(202, 149, 149), 1, THREE::BackSide)
197
+
198
+ materials << make_material('Window', format_color(102, 178, 204), 0.6, THREE::DoubleSide)
199
+ materials << make_material('Window_Ext', format_color(102, 178, 204), 0.6, THREE::FrontSide)
200
+ materials << make_material('Window_Int', format_color(192, 226, 235), 0.6, THREE::BackSide)
201
+
202
+ materials << make_material('Door', format_color(153, 133, 76), 1, THREE::DoubleSide)
203
+ materials << make_material('Door_Ext', format_color(153, 133, 76), 1, THREE::FrontSide)
204
+ materials << make_material('Door_Int', format_color(202, 188, 149), 1, THREE::BackSide)
205
+
206
+ materials << make_material('SiteShading', format_color(75, 124, 149), 1, THREE::DoubleSide)
207
+ materials << make_material('SiteShading_Ext', format_color(75, 124, 149), 1, THREE::FrontSide)
208
+ materials << make_material('SiteShading_Int', format_color(187, 209, 220), 1, THREE::BackSide)
209
+
210
+ materials << make_material('BuildingShading', format_color(113, 76, 153), 1, THREE::DoubleSide)
211
+ materials << make_material('BuildingShading_Ext', format_color(113, 76, 153), 1, THREE::FrontSide)
212
+ materials << make_material('BuildingShading_Int', format_color(216, 203, 229), 1, THREE::BackSide)
213
+
214
+ materials << make_material('SpaceShading', format_color(76, 110, 178), 1, THREE::DoubleSide)
215
+ materials << make_material('SpaceShading_Ext', format_color(76, 110, 178), 1, THREE::FrontSide)
216
+ materials << make_material('SpaceShading_Int', format_color(183, 197, 224), 1, THREE::BackSide)
217
+
218
+ materials << make_material('InteriorPartitionSurface', format_color(158, 188, 143), 1, THREE::DoubleSide)
219
+ materials << make_material('InteriorPartitionSurface_Ext', format_color(158, 188, 143), 1, THREE::FrontSide)
220
+ materials << make_material('InteriorPartitionSurface_Int', format_color(213, 226, 207), 1, THREE::BackSide)
221
+
222
+ # start textures for boundary conditions
223
+ materials << make_material('Boundary_Surface', format_color(0, 153, 0), 1, THREE::DoubleSide)
224
+ materials << make_material('Boundary_Adiabatic', format_color(255, 101, 178), 1, THREE::DoubleSide)
225
+ materials << make_material('Boundary_Space', format_color(255, 0, 0), 1, THREE::DoubleSide)
226
+ materials << make_material('Boundary_Outdoors', format_color(163, 204, 204), 1, THREE::DoubleSide)
227
+ materials << make_material('Boundary_Outdoors_Sun', format_color(40, 204, 204), 1, THREE::DoubleSide)
228
+ materials << make_material('Boundary_Outdoors_Wind', format_color(9, 159, 162), 1, THREE::DoubleSide)
229
+ materials << make_material('Boundary_Outdoors_SunWind', format_color(68, 119, 161), 1, THREE::DoubleSide)
230
+ materials << make_material('Boundary_Ground', format_color(204, 183, 122), 1, THREE::DoubleSide)
231
+ materials << make_material('Boundary_Groundfcfactormethod', format_color(153, 122, 30), 1, THREE::DoubleSide)
232
+ materials << make_material('Boundary_Groundslabpreprocessoraverage', format_color(255, 191, 0), 1, THREE::DoubleSide)
233
+ materials << make_material('Boundary_Groundslabpreprocessorcore', format_color(255, 182, 50), 1, THREE::DoubleSide)
234
+ materials << make_material('Boundary_Groundslabpreprocessorperimeter', format_color(255, 178, 101), 1, THREE::DoubleSide)
235
+ materials << make_material('Boundary_Groundbasementpreprocessoraveragewall', format_color(204, 51, 0), 1, THREE::DoubleSide)
236
+ materials << make_material('Boundary_Groundbasementpreprocessoraveragefloor', format_color(204, 81, 40), 1, THREE::DoubleSide)
237
+ materials << make_material('Boundary_Groundbasementpreprocessorupperwall', format_color(204, 112, 81), 1, THREE::DoubleSide)
238
+ materials << make_material('Boundary_Groundbasementpreprocessorlowerwall', format_color(204, 173, 163), 1, THREE::DoubleSide)
239
+ materials << make_material('Boundary_Othersidecoefficients', format_color(63, 63, 63), 1, THREE::DoubleSide)
240
+ materials << make_material('Boundary_Othersideconditionsmodel', format_color(153, 0, 76), 1, THREE::DoubleSide)
241
+
242
+ # make construction materials
243
+ model.getConstructionBases.each do |construction|
244
+ color = construction.renderingColor
245
+ if color.empty?
246
+ color = OpenStudio::Model::RenderingColor.new(model)
247
+ construction.setRenderingColor(color)
248
+ else
249
+ color = color.get
250
+ end
251
+ name = "Construction_#{construction.name}"
252
+ materials << make_material(name, format_color(color.renderingRedValue, color.renderingGreenValue, color.renderingBlueValue), color.renderingAlphaValue / 255.to_f, THREE::DoubleSide)
253
+ end
254
+
255
+ # make thermal zone materials
256
+ model.getThermalZones.each do |zone|
257
+ color = zone.renderingColor
258
+ if color.empty?
259
+ color = OpenStudio::Model::RenderingColor.new(model)
260
+ zone.setRenderingColor(color)
261
+ else
262
+ color = color.get
263
+ end
264
+ name = "ThermalZone_#{zone.name}"
265
+ materials << make_material(name, format_color(color.renderingRedValue, color.renderingGreenValue, color.renderingBlueValue), color.renderingAlphaValue / 255.to_f, THREE::DoubleSide)
266
+ end
267
+
268
+ # make space type materials
269
+ model.getSpaceTypes.each do |spaceType|
270
+ color = spaceType.renderingColor
271
+ if color.empty?
272
+ color = OpenStudio::Model::RenderingColor.new(model)
273
+ spaceType.setRenderingColor(color)
274
+ else
275
+ color = color.get
276
+ end
277
+ name = "SpaceType_#{spaceType.name}"
278
+ materials << make_material(name, format_color(color.renderingRedValue, color.renderingGreenValue, color.renderingBlueValue), color.renderingAlphaValue / 255.to_f, THREE::DoubleSide)
279
+ end
280
+
281
+ # make building story materials
282
+ model.getBuildingStorys.each do |buildingStory|
283
+ color = buildingStory.renderingColor
284
+ if color.empty?
285
+ color = OpenStudio::Model::RenderingColor.new(model)
286
+ buildingStory.setRenderingColor(color)
287
+ else
288
+ color = color.get
289
+ end
290
+ name = "BuildingStory_#{buildingStory.name}"
291
+ materials << make_material(name, format_color(color.renderingRedValue, color.renderingGreenValue, color.renderingBlueValue), color.renderingAlphaValue / 255.to_f, THREE::DoubleSide)
292
+ end
293
+
294
+ return materials
295
+ end
296
+
297
+ # get the index of a vertex out of a list
298
+ def self.get_vertex_index(vertex, vertices, tol = 0.001)
299
+ vertices.each_index do |i|
300
+ if OpenStudio.getDistance(vertex, vertices[i]) < tol
301
+ return i
302
+ end
303
+ end
304
+ vertices << vertex
305
+ return (vertices.length - 1)
306
+ end
307
+
308
+ # flatten array of vertices into a single array
309
+ def self.flatten_vertices(vertices)
310
+ result = []
311
+ vertices.each do |vertex|
312
+ # result << vertex.x
313
+ # result << vertex.y
314
+ # result << vertex.z
315
+
316
+ result << vertex.x.round(3)
317
+ result << vertex.z.round(3)
318
+ result << -vertex.y.round(3)
319
+ end
320
+ return result
321
+ end
322
+
323
+ # turn a surface into geometries, the first one is the surface, remaining are sub surfaces
324
+ def self.make_geometries(surface)
325
+ geometries = []
326
+ user_datas = []
327
+
328
+ # get the transformation to site coordinates
329
+ site_transformation = OpenStudio::Transformation.new
330
+ building = surface.model.getBuilding
331
+
332
+ space = surface.space
333
+ if space.is_initialized
334
+ site_transformation = building.transformation * space.get.transformation
335
+ else
336
+ site_transformation = building.transformation
337
+ end
338
+
339
+ # get the vertices
340
+ surface_vertices = surface.vertices
341
+ t = OpenStudio::Transformation.alignFace(surface_vertices)
342
+ r = t.rotationMatrix
343
+ tInv = t.inverse
344
+ surface_vertices = OpenStudio.reverse(tInv * surface_vertices)
345
+
346
+ # get vertices of all sub surfaces
347
+ sub_surface_vertices = OpenStudio::Point3dVectorVector.new
348
+ sub_surfaces = surface.subSurfaces
349
+ sub_surfaces.each do |sub_surface|
350
+ sub_surface_vertices << OpenStudio.reverse(tInv * sub_surface.vertices)
351
+ end
352
+
353
+ # triangulate surface
354
+ triangles = OpenStudio.computeTriangulation(surface_vertices, sub_surface_vertices)
355
+ if triangles.empty?
356
+ puts "Failed to triangulate surface #{surface.name} with #{sub_surfaces.size} sub surfaces"
357
+ return geometries
358
+ end
359
+
360
+ all_vertices = []
361
+ face_indices = []
362
+ triangles.each do |vertices|
363
+ vertices = site_transformation * t * vertices
364
+ # normal = site_transformation.rotationMatrix*r*z
365
+
366
+ # https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3
367
+ # 0 indicates triangle
368
+ # 16 indicates triangle with normals
369
+ face_indices << 0
370
+ vertices.reverse_each do |vertex|
371
+ face_indices << get_vertex_index(vertex, all_vertices)
372
+ end
373
+
374
+ # convert to 1 based indices
375
+ # face_indices.each_index {|i| face_indices[i] = face_indices[i] + 1}
376
+ end
377
+
378
+ data = GeometryData.new
379
+ data.vertices = flatten_vertices(all_vertices)
380
+ data.normals = []
381
+ data.uvs = []
382
+ data.faces = face_indices
383
+ data.scale = 1
384
+ data.visible = true
385
+ data.castShadow = true
386
+ data.receiveShadow = false
387
+ data.doubleSided = true
388
+
389
+ geometry = Geometry.new
390
+ geometry.uuid = format_uuid(surface.handle)
391
+ geometry.type = 'Geometry'
392
+ geometry.data = data.to_h
393
+ geometries << geometry.to_h
394
+
395
+ surface_user_data = UserData.new
396
+ surface_user_data.handle = format_uuid(surface.handle)
397
+ surface_user_data.name = surface.name.to_s
398
+ surface_user_data.coincidentWithOutsideObject = false
399
+ surface_user_data.surfaceType = surface.surfaceType
400
+ surface_user_data.surfaceTypeMaterialName = surface.surfaceType
401
+
402
+ surface_user_data.outsideBoundaryCondition = surface.outsideBoundaryCondition
403
+ adjacent_surface = surface.adjacentSurface
404
+ if adjacent_surface.is_initialized
405
+ surface_user_data.outsideBoundaryConditionObjectName = adjacent_surface.get.name.to_s
406
+ surface_user_data.outsideBoundaryConditionObjectHandle = format_uuid(adjacent_surface.get.handle)
407
+
408
+ other_site_transformation = OpenStudio::Transformation.new
409
+ other_space = adjacent_surface.get.space
410
+ if !other_space.empty?
411
+ other_site_transformation = building.transformation * other_space.get.transformation
412
+ else
413
+ other_site_transformation = building.transformation
414
+ end
415
+
416
+ other_vertices = other_site_transformation * adjacent_surface.get.vertices
417
+ if OpenStudio.circularEqual(site_transformation * surface.vertices, OpenStudio.reverse(other_vertices))
418
+ # puts "adjacent surfaces are coincident"
419
+ surface_user_data.coincidentWithOutsideObject = true # controls display only, not energy model
420
+ else
421
+ # puts "adjacent surfaces are not coincident"
422
+ surface_user_data.coincidentWithOutsideObject = false # controls display only, not energy model
423
+ end
424
+
425
+ end
426
+ surface_user_data.sunExposure = surface.sunExposure
427
+ surface_user_data.windExposure = surface.windExposure
428
+
429
+ if surface.outsideBoundaryCondition == 'Outdoors'
430
+ if surface.sunExposure == 'SunExposed' && surface.windExposure == 'WindExposed'
431
+ surface_user_data.boundaryMaterialName = 'Boundary_Outdoors_SunWind'
432
+ elsif surface.sunExposure == 'SunExposed'
433
+ surface_user_data.boundaryMaterialName = 'Boundary_Outdoors_Sun'
434
+ elsif surface.sunExposure == 'WindExposed'
435
+ surface_user_data.boundaryMaterialName = 'Boundary_Outdoors_Wind'
436
+ else
437
+ surface_user_data.boundaryMaterialName = 'Boundary_Outdoors'
438
+ end
439
+ else
440
+ surface_user_data.boundaryMaterialName = 'Boundary_' + surface.outsideBoundaryCondition
441
+ end
442
+
443
+ construction = surface.construction
444
+ if construction.is_initialized
445
+ surface_user_data.constructionName = construction.get.name.to_s
446
+ surface_user_data.constructionMaterialName = 'Construction_' + construction.get.name.to_s
447
+ end
448
+
449
+ space = surface.space
450
+ if space.is_initialized
451
+ space = space.get
452
+ surface_user_data.spaceName = space.name.to_s
453
+
454
+ thermal_zone = space.thermalZone
455
+ if thermal_zone.is_initialized
456
+ surface_user_data.thermalZoneName = thermal_zone.get.name.to_s
457
+ surface_user_data.thermalZoneMaterialName = 'ThermalZone_' + thermal_zone.get.name.to_s
458
+ end
459
+
460
+ space_type = space.spaceType
461
+ if space_type.is_initialized
462
+ surface_user_data.spaceTypeName = space_type.get.name.to_s
463
+ surface_user_data.spaceTypeMaterialName = 'SpaceType_' + space_type.get.name.to_s
464
+ end
465
+
466
+ building_story = space.buildingStory
467
+ if building_story.is_initialized
468
+ surface_user_data.buildingStoryName = building_story.get.name.to_s
469
+ surface_user_data.buildingStoryMaterialName = 'BuildingStory_' + building_story.get.name.to_s
470
+ end
471
+ end
472
+
473
+ # vertices = []
474
+ # surface.vertices.each do |v|
475
+ # vertex = Vertex.new
476
+ # vertex.x = v.x
477
+ # vertex.y = v.y
478
+ # vertex.z = v.z
479
+ # vertices << vertex.to_h
480
+ # end
481
+ # surface_user_data.vertices = vertices
482
+ user_datas << surface_user_data.to_h
483
+
484
+ # now add geometry for each sub surface
485
+ sub_surfaces.each do |sub_surface|
486
+ # triangulate sub surface
487
+ sub_surface_vertices = OpenStudio.reverse(tInv * sub_surface.vertices)
488
+ triangles = OpenStudio.computeTriangulation(sub_surface_vertices, OpenStudio::Point3dVectorVector.new)
489
+
490
+ all_vertices = []
491
+ face_indices = []
492
+ triangles.each do |vertices|
493
+ vertices = site_transformation * t * vertices
494
+ # normal = site_transformation.rotationMatrix*r*z
495
+
496
+ # https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3
497
+ # 0 indicates triangle
498
+ # 16 indicates triangle with normals
499
+ face_indices << 0
500
+ vertices.reverse_each do |vertex|
501
+ face_indices << get_vertex_index(vertex, all_vertices)
502
+ end
503
+
504
+ # convert to 1 based indices
505
+ # face_indices.each_index {|i| face_indices[i] = face_indices[i] + 1}
506
+ end
507
+
508
+ data = GeometryData.new
509
+ data.vertices = flatten_vertices(all_vertices)
510
+ data.normals = []
511
+ data.uvs = []
512
+ data.faces = face_indices
513
+ data.scale = 1
514
+ data.visible = true
515
+ data.castShadow = true
516
+ data.receiveShadow = false
517
+ data.doubleSided = true
518
+
519
+ geometry = Geometry.new
520
+ geometry.uuid = format_uuid(sub_surface.handle)
521
+ geometry.type = 'Geometry'
522
+ geometry.data = data.to_h
523
+ geometries << geometry.to_h
524
+
525
+ sub_surface_user_data = UserData.new
526
+ sub_surface_user_data.handle = format_uuid(sub_surface.handle)
527
+ sub_surface_user_data.name = sub_surface.name.to_s
528
+ sub_surface_user_data.coincidentWithOutsideObject = false
529
+
530
+ sub_surface_user_data.surfaceType = sub_surface.subSurfaceType
531
+ if /Window/.match(sub_surface.subSurfaceType) || /Glass/.match(sub_surface.subSurfaceType) ||
532
+ /Skylight/.match(sub_surface.subSurfaceType) || /TubularDaylight/.match(sub_surface.subSurfaceType)
533
+ sub_surface_user_data.surfaceTypeMaterialName = 'Window'
534
+ else
535
+ sub_surface_user_data.surfaceTypeMaterialName = 'Door'
536
+ end
537
+
538
+ sub_surface_user_data.outsideBoundaryCondition = surface_user_data.outsideBoundaryCondition
539
+ adjacent_sub_surface = sub_surface.adjacentSubSurface
540
+ if adjacent_sub_surface.is_initialized
541
+ sub_surface_user_data.outsideBoundaryConditionObjectName = adjacent_sub_surface.get.name.to_s
542
+ sub_surface_user_data.outsideBoundaryConditionObjectHandle = format_uuid(adjacent_sub_surface.get.handle)
543
+
544
+ other_site_transformation = OpenStudio::Transformation.new
545
+ other_space = adjacent_sub_surface.get.space
546
+ if !other_space.empty?
547
+ other_site_transformation = building.transformation * other_space.get.transformation
548
+ else
549
+ other_site_transformation = building.transformation
550
+ end
551
+
552
+ other_vertices = other_site_transformation * adjacent_sub_surface.get.vertices
553
+ if OpenStudio.circularEqual(site_transformation * sub_surface.vertices, OpenStudio.reverse(other_vertices))
554
+ # puts "adjacent sub surfaces are coincident"
555
+ surface_user_data.coincidentWithOutsideObject = true # controls display only, not energy model
556
+ else
557
+ # puts "adjacent sub surfaces are not coincident"
558
+ surface_user_data.coincidentWithOutsideObject = false # controls display only, not energy model
559
+ end
560
+
561
+ sub_surface_user_data.boundaryMaterialName = 'Boundary_Surface'
562
+ else
563
+ if surface_user_data.boundaryMaterialName == 'Boundary_Surface'
564
+ sub_surface_user_data.boundaryMaterialName = 'Undefined'
565
+ else
566
+ sub_surface_user_data.boundaryMaterialName = surface_user_data.boundaryMaterialName
567
+ end
568
+ end
569
+ sub_surface_user_data.sunExposure = surface_user_data.sunExposure
570
+ sub_surface_user_data.windExposure = surface_user_data.windExposure
571
+
572
+ construction = sub_surface.construction
573
+ if construction.is_initialized
574
+ sub_surface_user_data.constructionName = construction.get.name.to_s
575
+ sub_surface_user_data.constructionMaterialName = 'Construction_' + construction.get.name.to_s
576
+ end
577
+ sub_surface_user_data.spaceName = surface_user_data.spaceName
578
+ sub_surface_user_data.thermalZoneName = surface_user_data.thermalZoneName
579
+ sub_surface_user_data.thermalZoneMaterialName = surface_user_data.thermalZoneMaterialName
580
+ sub_surface_user_data.spaceTypeName = surface_user_data.spaceTypeName
581
+ sub_surface_user_data.spaceTypeMaterialName = surface_user_data.spaceTypeMaterialName
582
+ sub_surface_user_data.buildingStoryName = surface_user_data.buildingStoryName
583
+ sub_surface_user_data.buildingStoryMaterialName = surface_user_data.buildingStoryMaterialName
584
+
585
+ # vertices = []
586
+ # surface.vertices.each do |v|
587
+ # vertex = Vertex.new
588
+ # vertex.x = v.x
589
+ # vertex.y = v.y
590
+ # vertex.z = v.z
591
+ # vertices << vertex.to_h
592
+ # end
593
+ # sub_surface_user_data.vertices = vertices
594
+ user_datas << sub_surface_user_data.to_h
595
+ end
596
+
597
+ return [geometries, user_datas]
598
+ end
599
+
600
+ # turn a shading surface into geometries
601
+ def self.make_shade_geometries(surface)
602
+ geometries = []
603
+ user_datas = []
604
+
605
+ # get the transformation to site coordinates
606
+ site_transformation = OpenStudio::Transformation.new
607
+ building = surface.model.getBuilding
608
+
609
+ shading_surface_group = surface.shadingSurfaceGroup
610
+ shading_surface_type = 'Building'
611
+ space_name = nil
612
+ thermal_zone_name = nil
613
+ space_type_name = nil
614
+ building_story_name = nil
615
+ if !shading_surface_group.empty?
616
+ shading_surface_type = shading_surface_group.get.shadingSurfaceType
617
+
618
+ space = shading_surface_group.get.space
619
+ if space.is_initialized
620
+ space = space.get
621
+ space_name = space.name.to_s
622
+
623
+ thermal_zone = space.thermalZone
624
+ if thermal_zone.is_initialized
625
+ thermal_zone_name = thermal_zone.get.name.to_s
626
+ end
627
+
628
+ space_type = space.spaceType
629
+ if space_type.is_initialized
630
+ space_type_name = space_type.get.name.to_s
631
+ end
632
+
633
+ building_story = space.buildingStory
634
+ if building_story.is_initialized
635
+ building_story_name = building_story.get.name.to_s
636
+ end
637
+
638
+ site_transformation = building.transformation * space.transformation * shading_surface_group.get.transformation
639
+ elsif /Site/i.match(shading_surface_type)
640
+ site_transformation = shading_surface_group.get.transformation
641
+ else
642
+ site_transformation = building.transformation * shading_surface_group.get.transformation
643
+ end
644
+
645
+ end
646
+
647
+ # get the vertices
648
+ surface_vertices = surface.vertices
649
+ t = OpenStudio::Transformation.alignFace(surface_vertices)
650
+ r = t.rotationMatrix
651
+ tInv = t.inverse
652
+ surface_vertices = OpenStudio.reverse(tInv * surface_vertices)
653
+
654
+ # triangulate surface
655
+ triangles = OpenStudio.computeTriangulation(surface_vertices, OpenStudio::Point3dVectorVector.new)
656
+ if triangles.empty?
657
+ puts "Failed to triangulate shading surface #{surface.name}"
658
+ return geometries
659
+ end
660
+
661
+ all_vertices = []
662
+ face_indices = []
663
+ triangles.each do |vertices|
664
+ vertices = site_transformation * t * vertices
665
+ # normal = site_transformation.rotationMatrix*r*z
666
+
667
+ # https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3
668
+ # 0 indicates triangle
669
+ # 16 indicates triangle with normals
670
+ face_indices << 0
671
+ vertices.reverse_each do |vertex|
672
+ face_indices << get_vertex_index(vertex, all_vertices)
673
+ end
674
+
675
+ # convert to 1 based indices
676
+ # face_indices.each_index {|i| face_indices[i] = face_indices[i] + 1}
677
+ end
678
+
679
+ data = GeometryData.new
680
+ data.vertices = flatten_vertices(all_vertices)
681
+ data.normals = []
682
+ data.uvs = []
683
+ data.faces = face_indices
684
+ data.scale = 1
685
+ data.visible = true
686
+ data.castShadow = true
687
+ data.receiveShadow = false
688
+ data.doubleSided = true
689
+
690
+ geometry = Geometry.new
691
+ geometry.uuid = format_uuid(surface.handle)
692
+ geometry.type = 'Geometry'
693
+ geometry.data = data.to_h
694
+ geometries << geometry.to_h
695
+
696
+ surface_user_data = UserData.new
697
+ surface_user_data.handle = format_uuid(surface.handle)
698
+ surface_user_data.name = surface.name.to_s
699
+ surface_user_data.coincidentWithOutsideObject = false
700
+
701
+ surface_user_data.surfaceType = shading_surface_type + 'Shading'
702
+ surface_user_data.surfaceTypeMaterialName = shading_surface_type + 'Shading'
703
+
704
+ # surface_user_data.outsideBoundaryCondition = nil
705
+ # surface_user_data.outsideBoundaryConditionObjectName = nil
706
+ # surface_user_data.outsideBoundaryConditionObjectHandle = nil
707
+ surface_user_data.sunExposure = 'SunExposed'
708
+ surface_user_data.windExposure = 'WindExposed'
709
+
710
+ construction = surface.construction
711
+ if construction.is_initialized
712
+ surface_user_data.constructionName = construction.get.name.to_s
713
+ surface_user_data.constructionMaterialName = 'Construction_' + construction.get.name.to_s
714
+ end
715
+
716
+ if space_name
717
+ surface_user_data.spaceName = space_name
718
+ end
719
+ if thermal_zone_name
720
+ surface_user_data.thermalZoneName = thermal_zone_name
721
+ surface_user_data.thermalZoneMaterialName = 'ThermalZone_' + thermal_zone_name
722
+ end
723
+ if space_type_name
724
+ surface_user_data.spaceTypeName = space_type_name
725
+ surface_user_data.spaceTypeMaterialName = 'SpaceType_' + space_type_name
726
+ end
727
+ if building_story_name
728
+ surface_user_data.buildingStoryName = building_story_name
729
+ surface_user_data.buildingStoryMaterialName = 'BuildingStory_' + building_story_name
730
+ end
731
+
732
+ # vertices = []
733
+ # surface.vertices.each do |v|
734
+ # vertex = Vertex.new
735
+ # vertex.x = v.x
736
+ # vertex.y = v.y
737
+ # vertex.z = v.z
738
+ # vertices << vertex.to_h
739
+ # end
740
+ # surface_user_data.vertices = vertices
741
+ user_datas << surface_user_data.to_h
742
+
743
+ return [geometries, user_datas]
744
+ end
745
+
746
+ # turn an interior partition surface into geometries
747
+ def self.make_interior_partition_geometries(surface)
748
+ geometries = []
749
+ user_datas = []
750
+
751
+ # get the transformation to site coordinates
752
+ site_transformation = OpenStudio::Transformation.new
753
+ building = surface.model.getBuilding
754
+ interior_partition_surface_group = surface.interiorPartitionSurfaceGroup
755
+
756
+ space_name = nil
757
+ thermal_zone_name = nil
758
+ space_type_name = nil
759
+ building_story_name = nil
760
+ if !interior_partition_surface_group.empty?
761
+
762
+ space = interior_partition_surface_group.get.space
763
+ if space.is_initialized
764
+ space = space.get
765
+ space_name = space.name.to_s
766
+
767
+ thermal_zone = space.thermalZone
768
+ if thermal_zone.is_initialized
769
+ thermal_zone_name = thermal_zone.get.name.to_s
770
+ end
771
+
772
+ space_type = space.spaceType
773
+ if space_type.is_initialized
774
+ space_type_name = space_type.get.name.to_s
775
+ end
776
+
777
+ building_story = space.buildingStory
778
+ if building_story.is_initialized
779
+ building_story_name = building_story.get.name.to_s
780
+ end
781
+
782
+ site_transformation = building.transformation * space.transformation * interior_partition_surface_group.get.transformation
783
+ else
784
+ site_transformation = building.transformation * interior_partition_surface_group.get.transformation
785
+ end
786
+ end
787
+
788
+ # get the vertices
789
+ surface_vertices = surface.vertices
790
+ t = OpenStudio::Transformation.alignFace(surface_vertices)
791
+ r = t.rotationMatrix
792
+ tInv = t.inverse
793
+ surface_vertices = OpenStudio.reverse(tInv * surface_vertices)
794
+
795
+ # triangulate surface
796
+ triangles = OpenStudio.computeTriangulation(surface_vertices, OpenStudio::Point3dVectorVector.new)
797
+ if triangles.empty?
798
+ puts "Failed to triangulate interior partition surface #{surface.name}"
799
+ return geometries
800
+ end
801
+
802
+ all_vertices = []
803
+ face_indices = []
804
+ triangles.each do |vertices|
805
+ vertices = site_transformation * t * vertices
806
+ # normal = site_transformation.rotationMatrix*r*z
807
+
808
+ # https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3
809
+ # 0 indicates triangle
810
+ # 16 indicates triangle with normals
811
+ face_indices << 0
812
+ vertices.reverse_each do |vertex|
813
+ face_indices << get_vertex_index(vertex, all_vertices)
814
+ end
815
+
816
+ # convert to 1 based indices
817
+ # face_indices.each_index {|i| face_indices[i] = face_indices[i] + 1}
818
+ end
819
+
820
+ data = GeometryData.new
821
+ data.vertices = flatten_vertices(all_vertices)
822
+ data.normals = []
823
+ data.uvs = []
824
+ data.faces = face_indices
825
+ data.scale = 1
826
+ data.visible = true
827
+ data.castShadow = true
828
+ data.receiveShadow = false
829
+ data.doubleSided = true
830
+
831
+ geometry = Geometry.new
832
+ geometry.uuid = format_uuid(surface.handle)
833
+ geometry.type = 'Geometry'
834
+ geometry.data = data.to_h
835
+ geometries << geometry.to_h
836
+
837
+ surface_user_data = UserData.new
838
+ surface_user_data.handle = format_uuid(surface.handle)
839
+ surface_user_data.name = surface.name.to_s
840
+ surface_user_data.coincidentWithOutsideObject = false
841
+
842
+ surface_user_data.surfaceType = 'InteriorPartitionSurface'
843
+ surface_user_data.surfaceTypeMaterialName = 'InteriorPartitionSurface'
844
+
845
+ # surface_user_data.outsideBoundaryCondition = nil
846
+ # surface_user_data.outsideBoundaryConditionObjectName = nil
847
+ # surface_user_data.outsideBoundaryConditionObjectHandle = nil
848
+ surface_user_data.sunExposure = 'NoSun'
849
+ surface_user_data.windExposure = 'NoWind'
850
+
851
+ construction = surface.construction
852
+ if construction.is_initialized
853
+ surface_user_data.constructionName = construction.get.name.to_s
854
+ surface_user_data.constructionMaterialName = 'Construction_' + construction.get.name.to_s
855
+ end
856
+
857
+ if space_name
858
+ surface_user_data.spaceName = space_name
859
+ end
860
+ if thermal_zone_name
861
+ surface_user_data.thermalZoneName = thermal_zone_name
862
+ surface_user_data.thermalZoneMaterialName = 'ThermalZone_' + thermal_zone_name
863
+ end
864
+ if space_type_name
865
+ surface_user_data.spaceTypeName = space_type_name
866
+ surface_user_data.spaceTypeMaterialName = 'SpaceType_' + space_type_name
867
+ end
868
+ if building_story_name
869
+ surface_user_data.buildingStoryName = building_story_name
870
+ surface_user_data.buildingStoryMaterialName = 'BuildingStory_' + building_story_name
871
+ end
872
+
873
+ # vertices = []
874
+ # surface.vertices.each do |v|
875
+ # vertex = Vertex.new
876
+ # vertex.x = v.x
877
+ # vertex.y = v.y
878
+ # vertex.z = v.z
879
+ # vertices << vertex.to_h
880
+ # end
881
+ # surface_user_data.vertices = vertices
882
+ user_datas << surface_user_data.to_h
883
+
884
+ return [geometries, user_datas]
885
+ end
886
+
887
+ def self.identity_matrix
888
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
889
+ end
890
+
891
+ def self.build_scene(model)
892
+ materials = build_materials(model)
893
+
894
+ object = {}
895
+ object[:uuid] = format_uuid(OpenStudio.createUUID)
896
+ object[:type] = 'Scene'
897
+ object[:matrix] = identity_matrix
898
+ object[:children] = []
899
+
900
+ floor_material = materials.find { |m| m[:name] == 'Floor' }
901
+ wall_material = materials.find { |m| m[:name] == 'Wall' }
902
+ roof_material = materials.find { |m| m[:name] == 'RoofCeiling' }
903
+ window_material = materials.find { |m| m[:name] == 'Window' }
904
+ door_material = materials.find { |m| m[:name] == 'Door' }
905
+ site_shading_material = materials.find { |m| m[:name] == 'SiteShading' }
906
+ building_shading_material = materials.find { |m| m[:name] == 'BuildingShading' }
907
+ space_shading_material = materials.find { |m| m[:name] == 'SpaceShading' }
908
+ interior_partition_surface_material = materials.find { |m| m[:name] == 'InteriorPartitionSurface' }
909
+
910
+ # loop over all surfaces
911
+ all_geometries = []
912
+ model.getSurfaces.each do |surface|
913
+ material = nil
914
+ surfaceType = surface.surfaceType.upcase
915
+ if surfaceType == 'FLOOR'
916
+ material = floor_material
917
+ elsif surfaceType == 'WALL'
918
+ material = wall_material
919
+ elsif surfaceType == 'ROOFCEILING'
920
+ material = roof_material
921
+ end
922
+
923
+ geometries, user_datas = make_geometries(surface)
924
+ if geometries
925
+ geometries.each_index do |i|
926
+ geometry = geometries[i]
927
+ user_data = user_datas[i]
928
+
929
+ all_geometries << geometry
930
+
931
+ scene_child = SceneChild.new
932
+ scene_child.uuid = format_uuid(OpenStudio.createUUID)
933
+ scene_child.name = user_data[:name]
934
+ scene_child.type = 'Mesh'
935
+ scene_child.geometry = geometry[:uuid]
936
+
937
+ if i == 0
938
+ # first geometry is base surface
939
+ scene_child.material = material[:uuid]
940
+ else
941
+ # sub surface
942
+ if /Window/.match(user_data[:surfaceType]) || /Glass/.match(user_data[:surfaceType])
943
+ scene_child.material = window_material[:uuid]
944
+ else
945
+ scene_child.material = door_material[:uuid]
946
+ end
947
+ end
948
+
949
+ scene_child.matrix = identity_matrix
950
+ scene_child.userData = user_data
951
+ object[:children] << scene_child.to_h
952
+ end
953
+ end
954
+ end
955
+
956
+ # loop over all shading surfaces
957
+ model.getShadingSurfaces.each do |surface|
958
+ geometries, user_datas = make_shade_geometries(surface)
959
+ if geometries
960
+ geometries.each_index do |i|
961
+ geometry = geometries[i]
962
+ user_data = user_datas[i]
963
+
964
+ material = nil
965
+ if /Site/.match(user_data[:surfaceType])
966
+ material = site_shading_material
967
+ elsif /Building/.match(user_data[:surfaceType])
968
+ material = building_shading_material
969
+ elsif /Space/.match(user_data[:surfaceType])
970
+ material = space_shading_material
971
+ end
972
+
973
+ all_geometries << geometry
974
+
975
+ scene_child = SceneChild.new
976
+ scene_child.uuid = format_uuid(OpenStudio.createUUID)
977
+ scene_child.name = user_data[:name]
978
+ scene_child.type = 'Mesh'
979
+ scene_child.geometry = geometry[:uuid]
980
+ scene_child.material = material[:uuid]
981
+ scene_child.matrix = identity_matrix
982
+ scene_child.userData = user_data
983
+ object[:children] << scene_child.to_h
984
+ end
985
+ end
986
+ end
987
+
988
+ # loop over all interior partition surfaces
989
+ model.getInteriorPartitionSurfaces.each do |surface|
990
+ geometries, user_datas = make_interior_partition_geometries(surface)
991
+ geometries.each_index do |i|
992
+ geometry = geometries[i]
993
+ user_data = user_datas[i]
994
+
995
+ material = interior_partition_surface_material
996
+
997
+ all_geometries << geometry
998
+
999
+ scene_child = SceneChild.new
1000
+ scene_child.uuid = format_uuid(OpenStudio.createUUID)
1001
+ scene_child.name = user_data[:name]
1002
+ scene_child.type = 'Mesh'
1003
+ scene_child.geometry = geometry[:uuid]
1004
+ scene_child.material = material[:uuid]
1005
+ scene_child.matrix = identity_matrix
1006
+ scene_child.userData = user_data
1007
+ object[:children] << scene_child.to_h
1008
+ end
1009
+ end
1010
+
1011
+ # light = AmbientLight.new
1012
+ # light.uuid = "#{format_uuid(OpenStudio::createUUID)}"
1013
+ # light.type = "AmbientLight"
1014
+ # light.color = "0xFFFFFF".hex
1015
+ # light.matrix = identity_matrix
1016
+ # object[:children] << light.to_h
1017
+
1018
+ scene = Scene.new
1019
+ scene.geometries = all_geometries
1020
+ scene.materials = materials
1021
+ scene.object = object
1022
+
1023
+ return scene
1024
+ end
1025
+ end