You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract all data coordinates xyz from the artist and feed them into auto_scale_xyz().
This updates the xy_dataLim, zz_dataLim BBoxes via .Bbox.update_from_data_xy/x/y(), which in turn creates a Path and calls .Bbox.update_from_path().
This is quite a lot data pushing (and maybe copying) just to update dataLim bboxes.
Proposed logic
Separation of concerns: The Artists should have a function to get their data lims. These limits should be used to update the Bbox. Basically some Bbox.update_from_box, a kind of an in-place Bbox.union, which we don't seem to have.
Essentially, we have should implement a 3D variant of Collection.get_datalim` for 3D.
Proposed fix
Rough outline: We may start minimal with rolling a small
class _Bbox3d:
def __init__(self, points):
((self.xmin, self.xmax),
(self.ymin, self.ymax),
(self.zmin, self.zmax)) = points
def to_bbox_xy(self):
return Bbox(((self.xmin, self.xmax), (self.ymin, self.ymax)))
def to_bbox_zz(self):
# first component contains z, second is unused
return Bbox(((self.zmin, self.zmax), (0, 0)))
and implement _get_datalim3d() -> _Bbox3d on the 3d collections.
Then
def add_collection(col, autolim=True):
...
if autolim:
self.auto_scale_lim(col.get_datalim3d())
Activity
Thierno88 commentedon Oct 20, 2024
Can I suggest a solution on this issue?
rcomer commentedon Oct 20, 2024
Hi @Thierno88, anyone is welcome to work on anything, so if you think you see a way forward, please go for it!