Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT]: Refactor autoscaling in 3D #28444

Open
@timhoffm

Description

@timhoffm

Summary

From#28403 (review):

Current logic

Extract all data coordinatesxyz from the artist and feed them intoauto_scale_xyz().

This updates thexy_dataLim,zz_dataLim BBoxes via.Bbox.update_from_data_xy/x/y(), which in turn creates aPath 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 someBbox.update_from_box, a kind of an in-placeBbox.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())

and

def auto_scale_lim(bbox3d):     ...     self.dataLim_xy.update_from_box(bbox3d.to_bbox_xy())     self.dataLim_zz.update_from_box(bbox3d.to_bbox_zz())

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp