lib/openstudio-standards/standards/Standards.SubSurface.rb in openstudio-standards-0.2.16 vs lib/openstudio-standards/standards/Standards.SubSurface.rb in openstudio-standards-0.2.17.rc1
- old
+ new
@@ -78,10 +78,11 @@
#
# @param sub_surface [OpenStudio::Model::SubSurface] sub surface object
# @param percent_reduction [Double] the fractional amount to reduce the area
# @return [Bool] returns true if successful, false if not
def sub_surface_reduce_area_by_percent_by_shrinking_toward_centroid(sub_surface, percent_reduction)
- mult = 1 - percent_reduction
+ # if percent_reduction > 1=> percent increase instead of reduction
+ mult = percent_reduction <= 1 ? 1 - percent_reduction : percent_reduction
scale_factor = mult**0.5
# Get the centroid (Point3d)
g = sub_surface.centroid