lib/openstudio-standards/geometry/create_shape.rb in openstudio-standards-0.6.0.rc2 vs lib/openstudio-standards/geometry/create_shape.rb in openstudio-standards-0.6.3
- old
+ new
@@ -58,11 +58,11 @@
end
# Loop through the number of floors
building_stories = []
for floor in ((under_ground_storys * -1)..above_ground_storys - 1)
- z = floor_to_floor_height * floor + initial_height
+ z = (floor_to_floor_height * floor) + initial_height
# Create a new story within the building
story = OpenStudio::Model::BuildingStory.new(model)
story.setNominalFloortoFloorHeight(floor_to_floor_height)
story.setName("Story #{floor + 1}")
@@ -280,17 +280,17 @@
if perimeter_zone_depth < 0 || 4 * perimeter_zone_depth >= (shortest_side - 1e-4)
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Geometry.Create.Shape', "Perimeter zone depth must be greater than or equal to 0 and less than #{shortest_side / 4.0}m.")
return nil
end
- if courtyard_length >= (length - 4 * perimeter_zone_depth - 1e-4)
- OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Geometry.Create.Shape', "Courtyard length must be less than #{length - 4.0 * perimeter_zone_depth}m.")
+ if courtyard_length >= (length - (4 * perimeter_zone_depth) - 1e-4)
+ OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Geometry.Create.Shape', "Courtyard length must be less than #{length - (4.0 * perimeter_zone_depth)}m.")
return nil
end
- if courtyard_width >= (width - 4 * perimeter_zone_depth - 1e-4)
- OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Geometry.Create.Shape', "Courtyard width must be less than #{width - 4.0 * perimeter_zone_depth}m.")
+ if courtyard_width >= (width - (4 * perimeter_zone_depth) - 1e-4)
+ OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Geometry.Create.Shape', "Courtyard width must be less than #{width - (4.0 * perimeter_zone_depth)}m.")
return nil
end
# Loop through the number of floors
for floor in (0..num_floors - 1)
@@ -304,12 +304,12 @@
nw_point = OpenStudio::Point3d.new(0.0, width, z)
ne_point = OpenStudio::Point3d.new(length, width, z)
se_point = OpenStudio::Point3d.new(length, 0.0, z)
sw_point = OpenStudio::Point3d.new(0.0, 0.0, z)
- courtyard_nw_point = OpenStudio::Point3d.new((length - courtyard_length) / 2.0, (width - courtyard_width) / 2.0 + courtyard_width, z)
- courtyard_ne_point = OpenStudio::Point3d.new((length - courtyard_length) / 2.0 + courtyard_length, (width - courtyard_width) / 2.0 + courtyard_width, z)
- courtyard_se_point = OpenStudio::Point3d.new((length - courtyard_length) / 2.0 + courtyard_length, (width - courtyard_width) / 2.0, z)
+ courtyard_nw_point = OpenStudio::Point3d.new((length - courtyard_length) / 2.0, ((width - courtyard_width) / 2.0) + courtyard_width, z)
+ courtyard_ne_point = OpenStudio::Point3d.new(((length - courtyard_length) / 2.0) + courtyard_length, ((width - courtyard_width) / 2.0) + courtyard_width, z)
+ courtyard_se_point = OpenStudio::Point3d.new(((length - courtyard_length) / 2.0) + courtyard_length, (width - courtyard_width) / 2.0, z)
courtyard_sw_point = OpenStudio::Point3d.new((length - courtyard_length) / 2.0, (width - courtyard_width) / 2.0, z)
# Identity matrix for setting space origins
m = OpenStudio::Matrix.new(4, 4, 0.0)
m[0, 0] = 1.0