Scene helper¶
- class manim_extensions.compass.CompassScene(camera_class=<class 'manim.camera.moving_camera.MovingCamera'>, **kwargs)[source]¶
Bases:
MovingCameraSceneA scene equipped with a compass, ruler, and pencil. Mainly implements compass placement, arc drawing, and ruler/pencil animations.
- compass_move_niddle_tip_to(pos=array([0., 0., 0.]), run_time=1)[source]¶
Move the compass needle tip to pos.
- rotate_compass_about_niddle_tip(angle_or_arc, arc=None, added_anims=None, **kwargs)[source]¶
Rotate angle around the compass needle tip (niddle_tip).
- compass_split_span(span=3, run_time=1)[source]¶
Rotate the two compass legs uniformly outward/inward so the opened distance equals span.
- split_cmpass_span(span=1, run_time=1)[source]¶
Fix niddle_tip, then move pen_tip along the line through niddle_tip and pen_tip to reach the given span.
- set_compass(niddle_pos=None, pen_pos=None, run_time=1.0)[source]¶
Place the compass at the specified positions: move niddle_tip to niddle_pos and pen_tip to pen_pos.
- draw_arc(niddle_point=array([0., 0., 0.]), pen_point=array([1., 0., 0.]), angle=1.0471975511965976, move_time=1.0, wait_time=1.0, run_time=1.0, arc_color=None, **kwargs)[source]¶
Draw an arc with the compass. The arc radius is computed from niddle_point and pen_point.
- Parameters:
niddle_point – centre of the arc
pen_point – starting point of the arc
angle – central angle of the arc
move_time – time to move the compass into position
run_time – time to draw the arc
wait_time – wait time between the two animations
arc_color – colour of the arc
kwargs – other keyword arguments for the arc
return – The drawn arc
- Return type:
- put_compass_aside(aside_pos=array([1., 0., 0.]), span_buff=0.1, run_time=1.0)[source]¶
Put the compass aside.
- set_ruler(start=None, end=None, lag_ratio=0.5, run_time=1.0, with_pencil=True)[source]¶
Place the ruler so that one of its edges aligns with start and end.
- draw_line(start=None, end=None, run_time=1.0, with_pencil=True, color=ManimColor('#F7D96F'), **kwargs)[source]¶
Draw a straight line using the ruler.
- Return type:
- put_pencil_away(pos=array([0., -3., 0.]), run_time=1)[source]¶
Translate the pencil as a whole to the specified position.