Skip to content

Commit f800d5a

Browse files
committed
add bounding box to BaseConduit
1 parent 5db89fb commit f800d5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/compas_rhino/conduits/base.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class BaseConduit(Rhino.Display.DisplayConduit):
2525
def __init__(self, refreshrate=1):
2626
super(BaseConduit, self).__init__()
2727
self.refreshrate = refreshrate
28+
self._boundingbox = None
2829

2930
@contextmanager
3031
def enabled(self):
@@ -36,6 +37,17 @@ def enabled(self):
3637
finally:
3738
self.disable()
3839

40+
@property
41+
def boundingbox(self):
42+
if self.boundgbox is None:
43+
boundingbox = self.CalculateBoundingBox()
44+
self._boundingbox = boundingbox
45+
return self._boundingbox
46+
47+
def CalculateBoundingBox(self, e):
48+
bbox = Rhino.Geometry.BoundingBox(-1000, -1000, -1000, 1000, 1000, 1000)
49+
e.IncludeBoundingBox(bbox)
50+
3951
def enable(self):
4052
"""Enable the conduit."""
4153
self.Enabled = True

0 commit comments

Comments
 (0)