Skip to content

Commit

Permalink
fix(door): Use correct indentation for Door.to_openstudio_shade
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Nov 10, 2023
1 parent 9aa0b7c commit e075fdd
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions lib/to_openstudio/geometry/door.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,61 +162,61 @@ def to_openstudio(openstudio_model)

return result
end
end # Door

def to_openstudio_shade(openstudio_model, shading_surface_group)
# get the vertices from the door
if @hash[:geometry][:vertices].nil?
hb_verts = @hash[:geometry][:boundary]
else
hb_verts = @hash[:geometry][:vertices]
end
def to_openstudio_shade(openstudio_model, shading_surface_group)
# get the vertices from the door
if @hash[:geometry][:vertices].nil?
hb_verts = @hash[:geometry][:boundary]
else
hb_verts = @hash[:geometry][:vertices]
end

# create the openstudio shading surface
os_vertices = OpenStudio::Point3dVector.new
hb_verts.each do |vertex|
os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
end
# create the openstudio shading surface
os_vertices = OpenStudio::Point3dVector.new
hb_verts.each do |vertex|
os_vertices << OpenStudio::Point3d.new(vertex[0], vertex[1], vertex[2])
end

os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
os_shading_surface.setName(@hash[:identifier])
unless @hash[:display_name].nil?
os_shading_surface.setDisplayName(@hash[:display_name])
end
os_shading_surface = OpenStudio::Model::ShadingSurface.new(os_vertices, openstudio_model)
os_shading_surface.setName(@hash[:identifier])
unless @hash[:display_name].nil?
os_shading_surface.setDisplayName(@hash[:display_name])
end

# get the approriate construction id
construction_id = nil
if @hash[:properties].key?(:energy) && @hash[:properties][:energy][:construction]
construction_id = @hash[:properties][:energy][:construction]
elsif @hash[:is_glass] == true
construction_id = 'Generic Double Pane'
else
construction_id = 'Generic Exterior Door'
end
# get the approriate construction id
construction_id = nil
if @hash[:properties].key?(:energy) && @hash[:properties][:energy][:construction]
construction_id = @hash[:properties][:energy][:construction]
elsif @hash[:is_glass] == true
construction_id = 'Generic Double Pane'
else
construction_id = 'Generic Exterior Door'
end

# assign the construction
unless construction_id.nil?
construction = openstudio_model.getConstructionByName(construction_id)
unless construction.empty?
os_construction = construction.get
os_shading_surface.setConstruction(os_construction)
# assign the construction
unless construction_id.nil?
construction = openstudio_model.getConstructionByName(construction_id)
unless construction.empty?
os_construction = construction.get
os_shading_surface.setConstruction(os_construction)
end
end
end

# add a transmittance schedule if a value is found
if @hash[:transmit]
schedule_identifier = 'Constant ' + @hash[:transmit] + ' Transmittance'
schedule = openstudio_model.getScheduleByName(schedule_identifier)
unless schedule.empty?
os_schedule = schedule.get
os_shading_surface.setTransmittanceSchedule(os_schedule)
# add a transmittance schedule if a value is found
if @hash[:transmit]
schedule_identifier = 'Constant ' + @hash[:transmit] + ' Transmittance'
schedule = openstudio_model.getScheduleByName(schedule_identifier)
unless schedule.empty?
os_schedule = schedule.get
os_shading_surface.setTransmittanceSchedule(os_schedule)
end
end
end

# add the shade to the group
os_shading_surface.setShadingSurfaceGroup(shading_surface_group)
# add the shade to the group
os_shading_surface.setShadingSurfaceGroup(shading_surface_group)

os_shading_surface
end
os_shading_surface
end

end # Door
end # Honeybee

0 comments on commit e075fdd

Please # to comment.