Constraints

A constraint in Sandbox is a connection with restricts or limits. Connections can be made between solid bodies and dictate how objects can move relative to each other. Constraints can be adjusted and tuned to act as close to reality as possible.

The figures below show translational and rotational degrees of freedom (DoF) available for hinges. Different hinges have any combination of these freedoms removed to make it suitable for various purposes.

../_images/translational.png

Figure A: 3 translational degrees of freedom (DoF)

../_images/rotational.png

Figure B: 3 rotational degrees of freedom (DoF)

Constraints available in Sandbox

Lock Joint

lock

Lock joint will lock all 6 degrees of freedom of an object. It will be locked and not able to slide, rotate or move in any way. Unless compliance is adjusted.

Translational freedoms removed:

3

Rotational freedoms removed:

3

Controllable:

No

lockxyz

Ball Joint

ball

Ball joint will act as a position lock, and disable movement in X, Y and Z directions, but still allow for rotation around origin.

Translational freedoms removed:

3

Rotational freedoms removed:

0

Controllable:

No

ballxyz

Hinge

hinge

Hinge will lock the object in X, Y and Z direction, but still allow for rotation around the Z axis like a hinge.

Translational freedoms removed:

3

Rotational freedoms removed:

2

Controllable:

Yes

hingexyz

Prismatic

prismatic

Prismatic constrain will lock all rotation and movement along the X and Y axis but still allow for sliding along the Z axis.

Translational freedoms removed:

2

Rotational freedoms removed:

3

Controllable:

Yes

prismaticxyz

 

Ring Constraint

ring

Ring constraint works like the hinge constraint, but there are no male and female types. The ring constraint can be connected to any other.

Translational freedoms removed:

3

Rotational freedoms removed:

2

Controllable:

Yes

ringxyz

 

Adding Constraints

Note

Always position/rotate the rigid bodies involved in a constrained system to their desired positions before attaching them to a constraint.

  1. In the left-hand menu, click the Edit Scenery button edit

  2. Click the Add Constraints button constraint

A window of available constraints will appear:

../_images/constraints.png

After selecting one of the available constraints types you are presented with a pair of constraint nodes. One of the nodes will be controllable if the selected constraint type supports it. The controllable constraint node should be placed on the object that should have motion.

../_images/type.png

A hinge constraint has a controllable element. Please refer to the list above for available constraints and their properties.

Select the desired constraint and then drag and drop both of the constraint nodes to the objects that will receive the constraint. It is important to drag and drop the constraint nodes on to the correct parenting object. The controllable constraint (to the right in menu while placing) should be dropped and assigned to the object that will be moving. The controllable constraint will be indicated in red (as illustrated in figure to the right below) and can be selected and further manipulated in the right-hand menu.

../_images/hinge_actors.png

Controllable constraints will appear in red, while non-controllable constraints will appear in yellow.

Aligning Constraints

All directional signifiers need to align and correspond. Click the align button in the left menu before connecting to make sure the constraint will work as intended. With hinges, for example, place the controllable hinge 02 on the object that should have motion and place the other non-controllable hinge 01 on the static object. Then make sure the controllable hinge is placed correctly for the desired motion. When in place, select the non-controllable hinge and click the Align button 04 located under the controllable hinge actor. Compliance can be set during setup 06 , or later under the Input ports section in the properties panel 08 . After the constraints are aligned, they can be added to the scene by clicking the Connect button 07 . Constraints can be removed before they are connected by clicking the Delete button 05 located under each constraint. If unsure which constraint is selected, refer to the properties panel located on the right which will have the selected object’s name 03 at the top.

../_images/example5.png

Click to enlarge

 

Constraints Scaling and Visibility

The scale and visibility of constraints can be adjusted in the constraints menu:

../_images/constraints-visibility.png
  1. Adjust the size of constraints in the scene by moving the slider left or right.

  2. Set the visibility of constraints in the scene by toggling the checkbox.

Keep in mind that these settings affect all constraints in the scene. Holding C + scrolling the middle mouse wheel zoom-slim will also adjust the scale of the constraints.

Example: Using Ring Constraints to connect a rigging arrangement to a hook

The video below demonstrates how to add ring constraints to a hook and a rigging arrangement and how to connect them by using the context menu of the constraints.

Helicopter flight mode was added in version 4.20.0.