@@ -133,8 +133,8 @@ def bounding_box(self) -> list[list[float]]:
133
133
"""Returns the bounding box coordinates."""
134
134
if len (self .contents ) > 0 :
135
135
min_list , max_list = zip (* [p .bounding_box for p in self .contents ])
136
- min_x , min_y , min_z = map (min , list ( zip (* min_list ) ))
137
- max_x , max_y , max_z = map (max , list ( zip (* max_list ) ))
136
+ min_x , min_y , min_z = map (min , zip (* min_list ))
137
+ max_x , max_y , max_z = map (max , zip (* max_list ))
138
138
139
139
return [[min_x , min_y , min_z ], [max_x , max_y , max_z ]]
140
140
else :
@@ -511,7 +511,15 @@ def key(self):
511
511
return f"arrow_{ self .color } _{ self .radius } _{ self .headLength } _{ self .headWidth } _{ self .reference } "
512
512
513
513
@classmethod
514
- def merge (cls , arrow_list ):
514
+ def merge (cls , arrow_list : list [Arrows ]) -> Arrows :
515
+ """Merge a list of arrows into a new Arrows instance.
516
+
517
+ Args:
518
+ arrow_list (list[Arrows]): Arrows to merge
519
+
520
+ Returns:
521
+ Arrows: Merged arrows
522
+ """
515
523
new_positionPairs = list (
516
524
chain .from_iterable ([arrow .positionPairs for arrow in arrow_list ])
517
525
)
@@ -527,7 +535,7 @@ def merge(cls, arrow_list):
527
535
@property
528
536
def bounding_box (self ) -> list [list [float ]]:
529
537
x , y , z = zip (* chain .from_iterable (self .positionPairs ))
530
- return [[min (x ), min (y ), min (z )], [min (x ), min (y ), min (z )]]
538
+ return [[min (x ), min (y ), min (z )], [max (x ), max (y ), max (z )]]
531
539
532
540
533
541
@dataclass
0 commit comments