Functions¶
- manim_extensions.gearbox.involute_func(t, r, a=0, rad_offs=0, tan_offs=0)[source]¶
Returns the x-y-z values of the involute function.
- Parameters:
t (input angle or sequence of angles.)
r (base circle radius.)
a (offset angle.)
rad_offs (radial offset.)
tan_offs (tangential offset.)
Examples
Example: InvoluteFuncDocExample ¶
from manim import * from manim_extensions.gearbox import involute_func class InvoluteFuncDocExample(Scene): def construct(self): r = 2 t = np.linspace(0, 1.5, 100) points = involute_func(t, r) curve = VMobject(stroke_color=WHITE) curve.set_points_as_corners(points) base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base, curve)
from manim import * from manim_extensions.gearbox import involute_func class InvoluteFuncDocExample(Scene): def construct(self): r = 2 t = np.linspace(0, 1.5, 100) points = involute_func(t, r) curve = VMobject(stroke_color=WHITE) curve.set_points_as_corners(points) base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base, curve)
- manim_extensions.gearbox.involute_deriv_func(t, r, a=0, rad_offs=0, tan_offs=0)[source]¶
Return the derivative of the involute function at angle t.
- Parameters:
t (angle or sequence of angles at which to evaluate the derivative.)
r (base circle radius.)
a (offset angle.)
rad_offs (radial offset.)
tan_offs (tangential offset.)
Examples
Example: InvoluteDerivFuncDocExample ¶
from manim import * from manim_extensions.gearbox import involute_func, involute_deriv_func class InvoluteDerivFuncDocExample(Scene): def construct(self): r = 2 t_curve = np.linspace(0, 1.5, 100) t_samples = np.linspace(0.2, 1.5, 8) curve = VMobject(stroke_color=WHITE) curve.set_points_as_corners(involute_func(t_curve, r)) self.add(curve) for p, d in zip(involute_func(t_samples, r), involute_deriv_func(t_samples, r)): direction = 0.5 * d / np.linalg.norm(d) self.add(Arrow(p, p + direction, buff=0, color=YELLOW))
from manim import * from manim_extensions.gearbox import involute_func, involute_deriv_func class InvoluteDerivFuncDocExample(Scene): def construct(self): r = 2 t_curve = np.linspace(0, 1.5, 100) t_samples = np.linspace(0.2, 1.5, 8) curve = VMobject(stroke_color=WHITE) curve.set_points_as_corners(involute_func(t_curve, r)) self.add(curve) for p, d in zip(involute_func(t_samples, r), involute_deriv_func(t_samples, r)): direction = 0.5 * d / np.linalg.norm(d) self.add(Arrow(p, p + direction, buff=0, color=YELLOW))
- manim_extensions.gearbox.involute_height_func(k, r, **kwargs)[source]¶
Returns the radial height of the involute compared to the base circle.
- Parameters:
k (angle or sequence of angles.)
r (base circle radius.)
**kwargs (forwarded to
involute_func().)
Examples
Example: InvoluteHeightFuncDocExample ¶
from manim import * from manim_extensions.gearbox import involute_func, involute_height_func class InvoluteHeightFuncDocExample(Scene): def construct(self): r = 2 t = np.array([0.5, 1.0, 1.5]) points = involute_func(t, r) base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base) for p in points: self.add(Dot(p, color=YELLOW)) base_point = r * p / np.linalg.norm(p) self.add(Line(base_point, p, color=GREEN))
from manim import * from manim_extensions.gearbox import involute_func, involute_height_func class InvoluteHeightFuncDocExample(Scene): def construct(self): r = 2 t = np.array([0.5, 1.0, 1.5]) points = involute_func(t, r) base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base) for p in points: self.add(Dot(p, color=YELLOW)) base_point = r * p / np.linalg.norm(p) self.add(Line(base_point, p, color=GREEN))
- manim_extensions.gearbox.involute_point_gen(t, r, **kwargs)[source]¶
Returns a list of points to be for cubic bezier approximation of the involute curve. Output is compatible with Mobject.points. Input t is a list where the involute shall be evaluated, it can be unevenly spaced. Anchors are added automatically.
- Parameters:
t (sequence of angles at which to evaluate the involute.)
r (base circle radius.)
**kwargs (forwarded to
involute_func()andinvolute_deriv_func().)
Examples
Example: InvolutePointGenDocExample ¶
from manim import * from manim_extensions.gearbox import involute_point_gen class InvolutePointGenDocExample(Scene): def construct(self): r = 2 t = np.linspace(0, 1.5, 6) points = involute_point_gen(t, r) curve = VMobject(stroke_color=WHITE) curve.points = points base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base, curve)
from manim import * from manim_extensions.gearbox import involute_point_gen class InvolutePointGenDocExample(Scene): def construct(self): r = 2 t = np.linspace(0, 1.5, 6) points = involute_point_gen(t, r) curve = VMobject(stroke_color=WHITE) curve.points = points base = Circle(radius=r, color=BLUE, stroke_opacity=0.5) self.add(base, curve)