controltheorylib.mech_vis.rect_mass

rect_mass = <function rect_mass>[source]

Generates a mass object as a rectangle with centered text.

Parameters:
  • pos (np.ndarray | Sequence[float]) – The position of the center of mass.

  • width (float) – Width of the rectangular mass.

  • height (float) – Height of the rectangular mass.

  • font_size (float | None) – Font size of the mass label. If None, scaled proportionally to height.

  • label (str) – Text displayed inside the mass.

  • label_color (Color) – Color of the label.

  • **kwargs (Any) – Additional arguments passed to the Rectangle constructor (e.g., stroke_width, fill_color, fill_opacity).

Returns:

A Manim VGroup containing the rectangular mass and its label.

Return type:

VGroup