Skip to content

Conversation

@XorUnison
Copy link
Collaborator

  1. The motivation for making this change (Work on ArcBetweenPoints #40)
    mobject.py has been slightly changed to fix an issue where points that weren't passed into ArcBetweenPoints as np.array caused manim to fail.
    geometry.py had ArcBetweenPoints adjusted to also support radius instead of just angle. Small changes to Arc were necessary to facilitate that .radius returns correct values at all times.

  2. How you tested the new behavior:

class Test(Scene):
    def construct(self):
        a = Arc(radius=-1)
        print(a.radius)
        b = Arc(radius=1)
        print(b.radius)
        c = Arc(angle=2)
        print(c.radius)
        d = Arc(angle=1)
        print(d.radius)
        e = ArcBetweenPoints([-1,0,0],[1,0,0],radius=-2)
        print(e.radius)
        f = ArcBetweenPoints([-1,0,0],[1,0,0],radius=1)
        print(f.radius)
        g = ArcBetweenPoints([-1,0,0],[1,0,0],angle=0.1)
        print(g.radius)
        h = ArcBetweenPoints([-1,0,0],[1,0,0],angle=0)
        print(h.radius)

        self.play(Write(VGroup(a,b,c,d,e,f,g,h).arrange(RIGHT)));self.wait(2)

mobject.py has been slightly changed to fix an issue where points that weren't passed into ArcBetweenPoints as np.array caused manim to fail.
geometry.py had ArcBetweenPoints adjusted to support radius instead of angle. Small changes to Arc were necessary to facilitate that .radius returns correct values at all times.
Copy link
Contributor

@leotrs leotrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Made only minor comments (that will be caught by black once that is in place), so I'm approving this.

@PgBiel PgBiel added pr:bugfix Bug fix for use in PRs solving a specific issue:bug enhancement Additions and improvements in general labels May 28, 2020
# Normals
n1 = rotate_vector(t1, TAU / 4)
n2 = rotate_vector(t2, TAU / 4)
self.failed_to_get_center=False
Copy link
Member

@PgBiel PgBiel May 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be declared in init, or made a private attr (with _failed_to_get_center)?

def __init__(self, start_angle=0, angle=TAU / 4, **kwargs):
self.start_angle = start_angle
self.angle = angle
self.failed_to_get_center=False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.failed_to_get_center=False
self._failed_to_get_center=False

@XorUnison XorUnison merged commit 81a8f3c into master May 30, 2020
@XorUnison XorUnison deleted the ArcBetweenPoints-fix/enhancement branch May 30, 2020 23:54
@XorUnison XorUnison linked an issue May 30, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Additions and improvements in general pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work on ArcBetweenPoints

4 participants