More consistent handling of BoundaryBox tolerance (#490)
This commit is contained in:
@ -764,7 +764,7 @@ class BoundBox(object):
|
||||
def add(
|
||||
self,
|
||||
obj: Union[Tuple[float, float, float], Vector, "BoundBox"],
|
||||
tol: float = 1e-8,
|
||||
tol: Optional[float] = None,
|
||||
) -> "BoundBox":
|
||||
"""Returns a modified (expanded) bounding box
|
||||
|
||||
@ -777,6 +777,8 @@ class BoundBox(object):
|
||||
This bounding box is not changed.
|
||||
"""
|
||||
|
||||
tol = TOL if tol is None else tol # tol = TOL (by default)
|
||||
|
||||
tmp = Bnd_Box()
|
||||
tmp.SetGap(tol)
|
||||
tmp.Add(self.wrapped)
|
||||
|
||||
@ -488,8 +488,8 @@ class Shape(object):
|
||||
|
||||
return Shape.centerOfMass(self)
|
||||
|
||||
def CenterOfBoundBox(self, tolerance: float = 0.1) -> Vector:
|
||||
return self.BoundingBox().center
|
||||
def CenterOfBoundBox(self, tolerance: Optional[float] = None) -> Vector:
|
||||
return self.BoundingBox(tolerance=tolerance).center
|
||||
|
||||
@staticmethod
|
||||
def CombinedCenter(objects: Iterable["Shape"]) -> Vector:
|
||||
|
||||
Reference in New Issue
Block a user