controltheorylib.mech_vis.spring

spring = <function spring>[source]

Generates a spring shape as a Manim VGroup between two points.

Parameters:
  • start (np.ndarray) – The start point of the spring.

  • end (np.ndarray) – The end point of the spring.

  • num_coils (int) – Number of coils in the spring. Must be a positive integer.

  • coil_width (float) – Width of the coils.

  • type (str) – Type of spring shape to generate: either “zigzag” or “helical”.

  • color (Color) – Color of the spring.

  • **kwargs (Any) – Additional parameters passed to Manim’s Line and VMobject constructors.

Returns:

A Manim VGroup containing the constructed spring.

Return type:

VGroup