openstudio-extension 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -6
- data/Gemfile +0 -2
- data/Jenkinsfile +1 -1
- data/README.md +12 -1
- data/lib/change_log.rb +147 -0
- data/lib/openstudio/extension/core/CreateResults.rb +1 -178
- data/lib/openstudio/extension/core/os_lib_cofee.rb +259 -0
- data/lib/openstudio/extension/core/os_lib_geometry.rb +77 -255
- data/lib/openstudio/extension/core/os_lib_model_generation.rb +83 -2521
- data/lib/openstudio/extension/core/os_lib_reporting.rb +30 -133
- data/lib/openstudio/extension/runner.rb +3 -4
- data/lib/openstudio/extension/runner_config.rb +0 -13
- data/lib/openstudio/extension/version.rb +1 -1
- data/openstudio-extension.gemspec +18 -12
- metadata +29 -24
@@ -327,8 +327,7 @@ module OsLib_Geometry
|
|
327
327
|
end
|
328
328
|
|
329
329
|
# sort array by floor area, this hash will be altered to reduce floor area for each space type to 0
|
330
|
-
|
331
|
-
space_types_running_count = space_types
|
330
|
+
space_types_running_count = space_types.sort_by { |k, v| v[:floor_area] }
|
332
331
|
|
333
332
|
# array entry for each story
|
334
333
|
footprints = []
|
@@ -355,10 +354,8 @@ module OsLib_Geometry
|
|
355
354
|
|
356
355
|
space_types_running_count.each do |space_type, space_type_hash|
|
357
356
|
# next if floor area is full or space type is empty
|
358
|
-
|
359
|
-
|
360
|
-
next if current_footprint_area + tol_value >= target_footprint_area
|
361
|
-
next if space_type_hash[:floor_area] <= tol_value
|
357
|
+
next if current_footprint_area >= target_footprint_area
|
358
|
+
next if space_type_hash[:floor_area] <= 0.0
|
362
359
|
|
363
360
|
# special test for when total floor area is smaller than valid_bar_area_min, just make bar smaller that valid min and warn user
|
364
361
|
if target_per_space_type[space_type] < valid_bar_area_min
|
@@ -370,18 +367,20 @@ module OsLib_Geometry
|
|
370
367
|
|
371
368
|
# add entry for space type if it doesn't have one yet
|
372
369
|
if !space_types_local_count.key?(space_type)
|
373
|
-
|
374
|
-
space_type = space_type_hash[:children][:default][:space_type] # will re-using space type create issue
|
375
|
-
space_types_local_count[space_type] = { floor_area: 0.0 }
|
376
|
-
space_types_local_count[space_type][:children] = space_type_hash[:children]
|
377
|
-
else
|
378
|
-
space_types_local_count[space_type] = { floor_area: 0.0 }
|
379
|
-
end
|
370
|
+
space_types_local_count[space_type] = { floor_area: 0.0 }
|
380
371
|
end
|
381
372
|
|
382
373
|
# if there is enough of this space type to fill rest of floor area
|
383
374
|
remaining_in_footprint = target_footprint_area - current_footprint_area
|
384
|
-
|
375
|
+
if space_type_hash[:floor_area] > remaining_in_footprint
|
376
|
+
|
377
|
+
# add to local count for story and remove from running count from space type
|
378
|
+
raw_footprint_area_used = remaining_in_footprint
|
379
|
+
|
380
|
+
else
|
381
|
+
# if not then use up the rest of the floor area and move on to next space type
|
382
|
+
raw_footprint_area_used = space_type_hash[:floor_area]
|
383
|
+
end
|
385
384
|
|
386
385
|
# add to local hash
|
387
386
|
space_types_local_count[space_type][:floor_area] = raw_footprint_area_used / v[:multiplier].to_f
|
@@ -390,13 +389,13 @@ module OsLib_Geometry
|
|
390
389
|
current_footprint_area += raw_footprint_area_used
|
391
390
|
space_type_hash[:floor_area] -= raw_footprint_area_used
|
392
391
|
|
393
|
-
# test if think
|
392
|
+
# test if think slice left on current floor.
|
394
393
|
# fix by moving smallest space type to next floor and and the same amount more of the sliver space type to this story
|
395
394
|
raw_footprint_area_used < valid_bar_area_min && sliver_override == false ? (test_a = true) : (test_a = false)
|
396
395
|
|
397
396
|
# test if what would be left of the current space type would result in a sliver on the next story.
|
398
397
|
# fix by removing some of this space type so their is enough left for the next story, and replace the removed amount with the largest space type in the model
|
399
|
-
(space_type_hash[:floor_area] < valid_bar_area_min) && (space_type_hash[:floor_area] >
|
398
|
+
(space_type_hash[:floor_area] < valid_bar_area_min) && (space_type_hash[:floor_area] > 0.0001) ? (test_b = true) : (test_b = false)
|
400
399
|
|
401
400
|
# identify very small slices and re-arrange spaces to different stories to avoid this
|
402
401
|
if test_a
|
@@ -423,10 +422,6 @@ module OsLib_Geometry
|
|
423
422
|
|
424
423
|
# swap size
|
425
424
|
swap_size = valid_bar_area_min * 5 # currently equal to default perimeter zone depth of 15'
|
426
|
-
# this prevents too much area from being swapped resulting in a negative number for floor area
|
427
|
-
if swap_size > space_types_local_count[space_type][:floor_area] * v[:multiplier].to_f
|
428
|
-
swap_size = space_types_local_count[space_type][:floor_area] * v[:multiplier].to_f
|
429
|
-
end
|
430
425
|
|
431
426
|
# adjust running count for current space type
|
432
427
|
space_type_hash[:floor_area] += swap_size
|
@@ -450,18 +445,12 @@ module OsLib_Geometry
|
|
450
445
|
end
|
451
446
|
|
452
447
|
# sliced bar simple creates a single sliced bar for space types passed in
|
453
|
-
# look at length and width to adjust slicing direction
|
448
|
+
# todo - look at length and width to adjust slicing direction
|
454
449
|
def self.make_sliced_bar_simple_polygons(runner, space_types, length, width, footprint_origin = OpenStudio::Point3d.new(0, 0, 0), perimeter_zone_depth = OpenStudio.convert(15, 'ft', 'm').get)
|
455
450
|
hash_of_point_vectors = {} # key is name, value is a hash, one item of which is polygon. Another could be space type
|
456
451
|
|
457
|
-
reverse_slice = false
|
458
|
-
if length < width
|
459
|
-
reverse_slice = true
|
460
|
-
#runner.registerInfo("reverse typical slice direction for bar because of aspect ratio less than 1.0.")
|
461
|
-
end
|
462
|
-
|
463
452
|
# determine if core and perimeter zoning can be used
|
464
|
-
if !(
|
453
|
+
if !(length > perimeter_zone_depth * 2.5 && width > perimeter_zone_depth * 2.5)
|
465
454
|
perimeter_zone_depth = 0 # if any size is to small then just model floor as single zone, issue warning
|
466
455
|
runner.registerWarning('Not modeling core and perimeter zones for some portion of the model.')
|
467
456
|
end
|
@@ -472,7 +461,6 @@ module OsLib_Geometry
|
|
472
461
|
# this represents the entire bar, not individual space type slices
|
473
462
|
nw_point = OpenStudio::Point3d.new(x_delta, y_delta + width, z)
|
474
463
|
sw_point = OpenStudio::Point3d.new(x_delta, y_delta, z)
|
475
|
-
se_point = OpenStudio::Point3d.new(x_delta + length, y_delta, z) # used when length is less than width
|
476
464
|
|
477
465
|
# total building floor area to calculate ratios from space type floor areas
|
478
466
|
total_floor_area = 0.0
|
@@ -482,7 +470,7 @@ module OsLib_Geometry
|
|
482
470
|
|
483
471
|
# sort array by floor area but shift largest object to front
|
484
472
|
space_types = space_types.sort_by { |k, v| v[:floor_area] }
|
485
|
-
space_types.insert(0, space_types.delete_at(space_types.size - 1))
|
473
|
+
space_types.insert(0, space_types.delete_at(space_types.size - 1))
|
486
474
|
|
487
475
|
# min and max bar end values
|
488
476
|
min_bar_end_multiplier = 0.75
|
@@ -496,20 +484,20 @@ module OsLib_Geometry
|
|
496
484
|
start_perimeter_width_deduction = 0.0
|
497
485
|
end_perimeter_width_deduction = 0.0
|
498
486
|
if space_type == space_types.first[0]
|
499
|
-
if
|
487
|
+
if length * space_type_hash[:floor_area] / total_floor_area > max_bar_end_multiplier * perimeter_zone_depth
|
500
488
|
start_perimeter_width_deduction = perimeter_zone_depth
|
501
489
|
end
|
502
490
|
# see if last space type is too small for perimeter. If it is then save some of this space type
|
503
|
-
if
|
491
|
+
if length * space_types.last[1][:floor_area] / total_floor_area < perimeter_zone_depth * min_bar_end_multiplier
|
504
492
|
re_apply_largest_space_type_at_end = true
|
505
493
|
end
|
506
494
|
end
|
507
495
|
if space_type == space_types.last[0]
|
508
|
-
if
|
496
|
+
if length * space_type_hash[:floor_area] / total_floor_area > max_bar_end_multiplier * perimeter_zone_depth
|
509
497
|
end_perimeter_width_deduction = perimeter_zone_depth
|
510
498
|
end
|
511
499
|
end
|
512
|
-
non_end_adjusted_width = (
|
500
|
+
non_end_adjusted_width = (length * space_type_hash[:floor_area] / total_floor_area) - start_perimeter_width_deduction - end_perimeter_width_deduction
|
513
501
|
|
514
502
|
# adjustment of end space type is too small and is replaced with largest space type
|
515
503
|
if (space_type == space_types.first[0]) && re_apply_largest_space_type_at_end
|
@@ -518,223 +506,69 @@ module OsLib_Geometry
|
|
518
506
|
end
|
519
507
|
if (space_type == space_types.last[0]) && re_apply_largest_space_type_at_end
|
520
508
|
end_perimeter_width_deduction = space_types.first[0]
|
521
|
-
end_b_flag = true
|
522
|
-
else
|
523
|
-
end_b_flag = false
|
524
509
|
end
|
525
510
|
|
526
|
-
#
|
511
|
+
# poulate data for core and perimeter of slice
|
527
512
|
section_hash_for_space_type = {}
|
528
513
|
section_hash_for_space_type['end_a'] = start_perimeter_width_deduction
|
529
514
|
section_hash_for_space_type[''] = non_end_adjusted_width
|
530
515
|
section_hash_for_space_type['end_b'] = end_perimeter_width_deduction
|
531
516
|
|
532
|
-
# determine if this space+type is double loaded corridor, and if so what the perimeter zone depth should be based on building width
|
533
|
-
# look at reverse_slice to see if length or width should be used to determine perimeter depth
|
534
|
-
if space_type_hash.has_key?(:children)
|
535
|
-
core_ratio = space_type_hash[:children][:circ][:orig_ratio]
|
536
|
-
perim_ratio = space_type_hash[:children][:default][:orig_ratio]
|
537
|
-
core_ratio_adj = core_ratio / (core_ratio + perim_ratio)
|
538
|
-
perim_ratio_adj = perim_ratio / (core_ratio + perim_ratio)
|
539
|
-
core_space_type = space_type_hash[:children][:circ][:space_type]
|
540
|
-
perim_space_type = space_type_hash[:children][:default][:space_type]
|
541
|
-
if !reverse_slice
|
542
|
-
custom_cor_val = width * core_ratio_adj
|
543
|
-
custom_perim_val = (width - custom_cor_val)/2.0
|
544
|
-
else
|
545
|
-
custom_cor_val = length * core_ratio_adj
|
546
|
-
custom_perim_val = (length - custom_cor_val)/2.0
|
547
|
-
end
|
548
|
-
actual_perim = custom_perim_val
|
549
|
-
double_loaded_corridor = true
|
550
|
-
else
|
551
|
-
actual_perim = perimeter_zone_depth
|
552
|
-
double_loaded_corridor = false
|
553
|
-
end
|
554
|
-
|
555
|
-
# may overwrite
|
556
|
-
first_space_type_hash = space_types.first[1]
|
557
|
-
if end_b_flag && first_space_type_hash.has_key?(:children)
|
558
|
-
end_b_core_ratio = first_space_type_hash[:children][:circ][:orig_ratio]
|
559
|
-
end_b_perim_ratio = first_space_type_hash[:children][:default][:orig_ratio]
|
560
|
-
end_b_core_ratio_adj = end_b_core_ratio / (end_b_core_ratio + end_b_perim_ratio)
|
561
|
-
end_b_perim_ratio_adj = end_b_perim_ratio / (end_b_core_ratio + end_b_perim_ratio)
|
562
|
-
end_b_core_space_type = first_space_type_hash[:children][:circ][:space_type]
|
563
|
-
end_b_perim_space_type = first_space_type_hash[:children][:default][:space_type]
|
564
|
-
if !reverse_slice
|
565
|
-
end_b_custom_cor_val = width * end_b_core_ratio_adj
|
566
|
-
end_b_custom_perim_val = (width - end_b_custom_cor_val)/2.0
|
567
|
-
else
|
568
|
-
end_b_custom_cor_val = length * end_b_core_ratio_adj
|
569
|
-
end_b_custom_perim_val = (length - end_b_custom_cor_val)/2.0
|
570
|
-
end
|
571
|
-
end_b_actual_perim = end_b_custom_perim_val
|
572
|
-
end_b_double_loaded_corridor = true
|
573
|
-
else
|
574
|
-
end_b_actual_perim = perimeter_zone_depth
|
575
|
-
end_b_double_loaded_corridor = false
|
576
|
-
end
|
577
|
-
|
578
517
|
# loop through sections for space type (main and possibly one or two end perimeter sections)
|
579
|
-
section_hash_for_space_type.each do |k,
|
580
|
-
|
581
|
-
|
582
|
-
if end_b_flag && k == "end_b" && space_types.first[1].has_key?(:children)
|
583
|
-
slice = space_types.first[0]
|
584
|
-
actual_perim = end_b_actual_perim
|
585
|
-
double_loaded_corridor = end_b_double_loaded_corridor
|
586
|
-
core_ratio = end_b_core_ratio
|
587
|
-
perim_ratio = end_b_perim_ratio
|
588
|
-
core_ratio_adj = end_b_core_ratio_adj
|
589
|
-
perim_ratio_adj = end_b_perim_ratio_adj
|
590
|
-
core_space_type = end_b_core_space_type
|
591
|
-
perim_space_type = end_b_perim_space_type
|
592
|
-
end
|
593
|
-
|
594
|
-
if slice.class.to_s == 'OpenStudio::Model::SpaceType' || slice.class.to_s == 'OpenStudio::Model::Building'
|
595
|
-
space_type = slice
|
518
|
+
section_hash_for_space_type.each do |k, width|
|
519
|
+
if width.class.to_s == 'OpenStudio::Model::SpaceType' # confirm this
|
520
|
+
space_type = width
|
596
521
|
max_reduction = [perimeter_zone_depth, max_reduction].min
|
597
|
-
|
522
|
+
width = max_reduction
|
598
523
|
end
|
599
|
-
if
|
524
|
+
if width == 0
|
600
525
|
next
|
601
526
|
end
|
602
527
|
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
else
|
634
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"] = {}
|
635
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"][:space_type] = space_type
|
636
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"][:polygon] = polygon_b
|
637
|
-
end
|
638
|
-
|
639
|
-
polygon_c = OpenStudio::Point3dVector.new
|
640
|
-
polygon_c << nw_point + OpenStudio::Vector3d.new(0, - actual_perim, 0)
|
641
|
-
polygon_c << nw_point
|
642
|
-
polygon_c << ne_point
|
643
|
-
polygon_c << ne_point + OpenStudio::Vector3d.new(0, - actual_perim, 0)
|
644
|
-
if double_loaded_corridor
|
645
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"] = {}
|
646
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"][:space_type] = perim_space_type
|
647
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"][:polygon] = polygon_c
|
648
|
-
else
|
649
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"] = {}
|
650
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"][:space_type] = space_type
|
651
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"][:polygon] = polygon_c
|
652
|
-
end
|
653
|
-
else
|
654
|
-
polygon_a = OpenStudio::Point3dVector.new
|
655
|
-
polygon_a << sw_point
|
656
|
-
polygon_a << nw_point
|
657
|
-
polygon_a << ne_point
|
658
|
-
polygon_a << se_point
|
659
|
-
hash_of_point_vectors["#{space_type.name} #{k}"] = {}
|
660
|
-
hash_of_point_vectors["#{space_type.name} #{k}"][:space_type] = space_type
|
661
|
-
hash_of_point_vectors["#{space_type.name} #{k}"][:polygon] = polygon_a
|
662
|
-
end
|
663
|
-
|
664
|
-
# update west points
|
665
|
-
nw_point = ne_point
|
666
|
-
sw_point = se_point
|
667
|
-
|
528
|
+
ne_point = nw_point + OpenStudio::Vector3d.new(width, 0, 0)
|
529
|
+
se_point = sw_point + OpenStudio::Vector3d.new(width, 0, 0)
|
530
|
+
|
531
|
+
if perimeter_zone_depth > 0
|
532
|
+
polygon_a = OpenStudio::Point3dVector.new
|
533
|
+
polygon_a << sw_point
|
534
|
+
polygon_a << sw_point + OpenStudio::Vector3d.new(0, perimeter_zone_depth, 0)
|
535
|
+
polygon_a << se_point + OpenStudio::Vector3d.new(0, perimeter_zone_depth, 0)
|
536
|
+
polygon_a << se_point
|
537
|
+
hash_of_point_vectors["#{space_type.name} A #{k}"] = {}
|
538
|
+
hash_of_point_vectors["#{space_type.name} A #{k}"][:space_type] = space_type
|
539
|
+
hash_of_point_vectors["#{space_type.name} A #{k}"][:polygon] = polygon_a
|
540
|
+
|
541
|
+
polygon_b = OpenStudio::Point3dVector.new
|
542
|
+
polygon_b << sw_point + OpenStudio::Vector3d.new(0, perimeter_zone_depth, 0)
|
543
|
+
polygon_b << nw_point + OpenStudio::Vector3d.new(0, - perimeter_zone_depth, 0)
|
544
|
+
polygon_b << ne_point + OpenStudio::Vector3d.new(0, - perimeter_zone_depth, 0)
|
545
|
+
polygon_b << se_point + OpenStudio::Vector3d.new(0, perimeter_zone_depth, 0)
|
546
|
+
hash_of_point_vectors["#{space_type.name} B #{k}"] = {}
|
547
|
+
hash_of_point_vectors["#{space_type.name} B #{k}"][:space_type] = space_type
|
548
|
+
hash_of_point_vectors["#{space_type.name} B #{k}"][:polygon] = polygon_b
|
549
|
+
|
550
|
+
polygon_c = OpenStudio::Point3dVector.new
|
551
|
+
polygon_c << nw_point + OpenStudio::Vector3d.new(0, - perimeter_zone_depth, 0)
|
552
|
+
polygon_c << nw_point
|
553
|
+
polygon_c << ne_point
|
554
|
+
polygon_c << ne_point + OpenStudio::Vector3d.new(0, - perimeter_zone_depth, 0)
|
555
|
+
hash_of_point_vectors["#{space_type.name} C #{k}"] = {}
|
556
|
+
hash_of_point_vectors["#{space_type.name} C #{k}"][:space_type] = space_type
|
557
|
+
hash_of_point_vectors["#{space_type.name} C #{k}"][:polygon] = polygon_c
|
668
558
|
else
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
if actual_perim > 0 && (actual_perim * 2.0) < length
|
678
|
-
polygon_a = OpenStudio::Point3dVector.new
|
679
|
-
polygon_a << se_point
|
680
|
-
polygon_a << se_point + OpenStudio::Vector3d.new(- actual_perim, 0, 0)
|
681
|
-
polygon_a << ne_point + OpenStudio::Vector3d.new(- actual_perim, 0, 0)
|
682
|
-
polygon_a << ne_point
|
683
|
-
if double_loaded_corridor
|
684
|
-
hash_of_point_vectors["#{perim_space_type.name} A #{k}"] = {}
|
685
|
-
hash_of_point_vectors["#{perim_space_type.name} A #{k}"][:space_type] = perim_space_type
|
686
|
-
hash_of_point_vectors["#{perim_space_type.name} A #{k}"][:polygon] = polygon_a
|
687
|
-
else
|
688
|
-
hash_of_point_vectors["#{space_type.name} A #{k}"] = {}
|
689
|
-
hash_of_point_vectors["#{space_type.name} A #{k}"][:space_type] = space_type
|
690
|
-
hash_of_point_vectors["#{space_type.name} A #{k}"][:polygon] = polygon_a
|
691
|
-
end
|
692
|
-
|
693
|
-
polygon_b = OpenStudio::Point3dVector.new
|
694
|
-
polygon_b << se_point + OpenStudio::Vector3d.new(- actual_perim, 0, 0)
|
695
|
-
polygon_b << sw_point + OpenStudio::Vector3d.new(actual_perim, 0, 0)
|
696
|
-
polygon_b << nw_point + OpenStudio::Vector3d.new(actual_perim, 0, 0)
|
697
|
-
polygon_b << ne_point + OpenStudio::Vector3d.new(- actual_perim, 0, 0)
|
698
|
-
if double_loaded_corridor
|
699
|
-
hash_of_point_vectors["#{core_space_type.name} B #{k}"] = {}
|
700
|
-
hash_of_point_vectors["#{core_space_type.name} B #{k}"][:space_type] = core_space_type
|
701
|
-
hash_of_point_vectors["#{core_space_type.name} B #{k}"][:polygon] = polygon_b
|
702
|
-
else
|
703
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"] = {}
|
704
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"][:space_type] = space_type
|
705
|
-
hash_of_point_vectors["#{space_type.name} B #{k}"][:polygon] = polygon_b
|
706
|
-
end
|
707
|
-
|
708
|
-
polygon_c = OpenStudio::Point3dVector.new
|
709
|
-
polygon_c << sw_point + OpenStudio::Vector3d.new(actual_perim, 0, 0)
|
710
|
-
polygon_c << sw_point
|
711
|
-
polygon_c << nw_point
|
712
|
-
polygon_c << nw_point + OpenStudio::Vector3d.new(actual_perim, 0, 0)
|
713
|
-
if double_loaded_corridor
|
714
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"] = {}
|
715
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"][:space_type] = perim_space_type
|
716
|
-
hash_of_point_vectors["#{perim_space_type.name} C #{k}"][:polygon] = polygon_c
|
717
|
-
else
|
718
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"] = {}
|
719
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"][:space_type] = space_type
|
720
|
-
hash_of_point_vectors["#{space_type.name} C #{k}"][:polygon] = polygon_c
|
721
|
-
end
|
722
|
-
else
|
723
|
-
polygon_a = OpenStudio::Point3dVector.new
|
724
|
-
polygon_a << se_point
|
725
|
-
polygon_a << sw_point
|
726
|
-
polygon_a << nw_point
|
727
|
-
polygon_a << ne_point
|
728
|
-
hash_of_point_vectors["#{space_type.name} #{k}"] = {}
|
729
|
-
hash_of_point_vectors["#{space_type.name} #{k}"][:space_type] = space_type
|
730
|
-
hash_of_point_vectors["#{space_type.name} #{k}"][:polygon] = polygon_a
|
731
|
-
end
|
732
|
-
|
733
|
-
# update west points
|
734
|
-
sw_point = nw_point
|
735
|
-
se_point = ne_point
|
736
|
-
|
559
|
+
polygon_a = OpenStudio::Point3dVector.new
|
560
|
+
polygon_a << sw_point
|
561
|
+
polygon_a << nw_point
|
562
|
+
polygon_a << ne_point
|
563
|
+
polygon_a << se_point
|
564
|
+
hash_of_point_vectors["#{space_type.name} #{k}"] = {}
|
565
|
+
hash_of_point_vectors["#{space_type.name} #{k}"][:space_type] = space_type
|
566
|
+
hash_of_point_vectors["#{space_type.name} #{k}"][:polygon] = polygon_a
|
737
567
|
end
|
568
|
+
|
569
|
+
# update west points
|
570
|
+
nw_point = ne_point
|
571
|
+
sw_point = se_point
|
738
572
|
end
|
739
573
|
end
|
740
574
|
|
@@ -758,24 +592,13 @@ module OsLib_Geometry
|
|
758
592
|
end
|
759
593
|
end
|
760
594
|
|
761
|
-
# hash of new spaces (only change boundary conditions for these)
|
762
|
-
new_spaces = []
|
763
|
-
|
764
595
|
# loop through story_hash and polygons to generate all of the spaces
|
765
596
|
story_hash.each_with_index do |(story_name, story_data), index|
|
766
|
-
# make new story
|
767
|
-
story =
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
end
|
772
|
-
end
|
773
|
-
if story.nil?
|
774
|
-
story = OpenStudio::Model::BuildingStory.new(model)
|
775
|
-
story.setNominalFloortoFloorHeight(story_data[:space_height]) # not used for anything
|
776
|
-
story.setNominalZCoordinate (story_data[:space_origin_z]) # not used for anything
|
777
|
-
story.setName("Story #{story_name}")
|
778
|
-
end
|
597
|
+
# make new story
|
598
|
+
story = OpenStudio::Model::BuildingStory.new(model)
|
599
|
+
story.setNominalFloortoFloorHeight(story_data[:space_height]) # not used for anything
|
600
|
+
story.setNominalZCoordinate (story_data[:space_origin_z]) # not used for anything
|
601
|
+
story.setName("Story #{story_name}")
|
779
602
|
|
780
603
|
# multiplier values for adjacent stories to be altered below as needed
|
781
604
|
multiplier_story_above = 1
|
@@ -824,7 +647,6 @@ module OsLib_Geometry
|
|
824
647
|
|
825
648
|
# make space
|
826
649
|
space = OsLib_Geometry.makeSpaceFromPolygon(model, space_data[:polygon].first, space_data[:polygon], options)
|
827
|
-
new_spaces << space
|
828
650
|
|
829
651
|
# set z origin to proper position
|
830
652
|
space.setZOrigin(story_data[:space_origin_z])
|
@@ -854,7 +676,7 @@ module OsLib_Geometry
|
|
854
676
|
# any changes to wall boundary conditions will be handled by same code that calls this method.
|
855
677
|
# this method doesn't need to know about basements and party walls.
|
856
678
|
|
857
|
-
return
|
679
|
+
return model
|
858
680
|
end
|
859
681
|
|
860
682
|
# add def to create a space from input, optionally take a name, space type, story and thermal zone.
|
@@ -892,7 +714,7 @@ module OsLib_Geometry
|
|
892
714
|
space.setName(options['name'])
|
893
715
|
end
|
894
716
|
|
895
|
-
if !options['spaceType'].nil?
|
717
|
+
if !options['spaceType'].nil?
|
896
718
|
space.setSpaceType(options['spaceType'])
|
897
719
|
end
|
898
720
|
|