mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Have density of anchor points on arcs depend on arc length
This commit is contained in:
parent
045e1f6b8a
commit
46c898977a
1 changed files with 5 additions and 1 deletions
|
@ -208,12 +208,16 @@ class Arc(TipableVMobject):
|
|||
start_angle: float = 0,
|
||||
angle: float = TAU / 4,
|
||||
radius: float = 1.0,
|
||||
n_components: int = 8,
|
||||
n_components: Optional[int] = None,
|
||||
arc_center: Vect3 = ORIGIN,
|
||||
**kwargs
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if n_components is None:
|
||||
# 16 components for a full circle
|
||||
n_components = int(15 * (abs(angle) / TAU)) + 1
|
||||
|
||||
self.set_points(quadratic_bezier_points_for_arc(angle, n_components))
|
||||
self.rotate(start_angle, about_point=ORIGIN)
|
||||
self.scale(radius, about_point=ORIGIN)
|
||||
|
|
Loading…
Add table
Reference in a new issue