=============== Connectors =============== Connectors are primarily used for connecting two rigid bodies together or connecting a rigid body to the :term:`ground`. Connection points are defined in connected body's :term:`local coordinates`. Beams ===== Beam connectors are used for connecting two rigid bodies to each other so that they behave like a single rigid body. Beam connectors behave same as weld connectors. .. code-block:: python beam(body1=circle1, body2=rectangle1, b1x=9, b1y=0, b2x=-1, b2y=-1) Chains ====== Chain connectors are used for preventing the distance between the two connection points becoming greater than the prescribed distance. .. code-block:: python chain(body1=polygon1, body2=circle2, b1x=0, b1y=0, b2x=0, b2y=0) Gaps ============ Gap connectors are used to prevent the distance between the two connection points becoming less than the prescribed distance. .. code-block:: python gap(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0) Links ====== Link connectors are used to connect two rigid bodies to each other so that the distance between the connection points stays constant. Rigid bodies can rotate about the conneciton points. .. code-block:: python link(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0) Motors ========== Motors are used for rotating a rigid body relative to another rigid body or the :term:`ground` with constant angular velocity. .. code-block:: python motor(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0,) Pins ======== Pin connectors (aka revolute joints) are used for constraining relative rotational motion of the connected bodies about a common point. Location of the pin connector is defined in terms of the local coordinates of the connected bodies. .. code-block:: python pin(body1, body2, b1x, b1y, b2x=None, b2y=None) .. Note:: If the b2x and b2y is not provided then they are automatically computed. Springs ======= Spring connectors are used for exerting forces to the connection points along the axis formed by two connection points. They can work under :term:`compression` or :term:`tension`. .. code-block:: python spring(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0) Torsional Springs ================= Torsional spring connectors are used for exerting torque to the connected bodies. .. code-block:: python torSpring(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0) Welds ======== Weld connectors are used to anchor two rigid bodies together or a rigid body to the :term:`ground`. They can be used to create intricate shapes. .. code-block:: python weld(body1=polygon1, body2=rectangle1, b1x=10, b1y=0, b2x=-4, b2y=0)