@@ -407,14 +407,14 @@ def category(self, category: str):
407407 def groups (self ) -> list [Group ]:
408408 """Get list of groups containing this DAGMC set."""
409409 return [group for group in self .model .groups if self in group ]
410-
410+
411411 def _metadata_group (self , prefix : str ) -> list [Group ]:
412412 """Get single group containing this DAGMC set, with matching prefix."""
413413 for group in self .model .groups :
414414 if self in group and prefix in group .name :
415- return group
415+ return group
416416 return None
417-
417+
418418 def _metadata_group_name (self , prefix : str ) -> Optional [str ]:
419419 group = self ._metadata_group (prefix )
420420 if group is not None :
@@ -479,6 +479,20 @@ def triangle_coords(self):
479479
480480 return self .model .mb .get_coords (conn .flatten ()).reshape (- 1 , 3 )
481481
482+ @property
483+ def bounds (self ):
484+ """Returns the axis-aligned bounding box for all triangles under this set.
485+
486+ Returns
487+ -------
488+ tuple(float, float, float, float, float, float)
489+ (xmin, xmax, ymin, ymax, zmin, zmax)
490+ """
491+ coords = self .triangle_coords
492+ min_coord = np .min (coords , axis = 0 )
493+ max_coord = np .max (coords , axis = 0 )
494+ return min_coord , max_coord
495+
482496 def get_triangle_conn_and_coords (self , compress = False ):
483497 """Returns the triangle connectivity and coordinates for all triangles under this set.
484498
@@ -623,7 +637,7 @@ def boundary_group(self) -> Optional[Group]:
623637 def boundary (self ) -> Optional [str ]:
624638 """Name of the boundary assigned to this surface."""
625639 return self ._metadata_group_name (self ._boundary_prefix )
626-
640+
627641 @boundary .setter
628642 def boundary (self , name : Optional [str ]):
629643 self ._set_metadata_group (self ._boundary_prefix , name )
0 commit comments