Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMobject inaccurately attributes width/height attrs to its bézier control points #3619

Open
jsonvillanueva opened this issue Feb 15, 2024 · 0 comments · May be fixed by #3625
Open

VMobject inaccurately attributes width/height attrs to its bézier control points #3619

jsonvillanueva opened this issue Feb 15, 2024 · 0 comments · May be fixed by #3625
Labels
issue:bug Something isn't working... For use in issues

Comments

@jsonvillanueva
Copy link
Member

Description of bug / unexpected behavior

The VMobject width/height attributes are calculated using the points array which is actually the control points for the quadratic bézier curves. This is not very intuitive behavior for end-users.

Expected behavior

The VMobject width/height attributes should indicate the width/height of the physical curve, respectively.

How to reproduce the issue

class TestFail(Scene):
  def construct(self):
    c = Circle().scale(3)
    c.rotate(30*DEGREES)
    radius = c.width / 2
    l = Line().set_length(radius * 2).move_to(c)

    self.add(c, l)

image

Additional media files

https://discord.com/channels/581738731934056449/976376734935048223/1207665909871677500

Additional comments

Possibly related to this issue: #3344
This may be helpful for anyone fixing this issue in the future: https://stackoverflow.com/questions/2587751/an-algorithm-to-find-bounding-box-of-closed-bezier-curves

@jsonvillanueva jsonvillanueva added the issue:bug Something isn't working... For use in issues label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue:bug Something isn't working... For use in issues
Projects
Status: 🆕 New
1 participant