Skip to main content

Pin Constraint

Pro Feature
Pro features are only available with a Professional licence. Starter licences can evaluate most Professional features via the Try Pro button at the top of the Viewport. To upgrade, visit cavalry.scenegroup.co.

Intro

Pin Shapes to their original position in a Forge Dynamics simulation while allowing them to rotate. Shapes can also be driven by a motor meaning

UI

Horizontal Alignment - Align the position of the Constraint to the left (-1) or right (1) edge of the Body.

Vertical Alignment - Align the position of the Constraint to the top (1) or bottom (-1) edge of the Body.

Motor - When checked, a pinned Shape is given a rotational force.

Motor Speed - Set the speed in which the pinned Shape rotates.

Maximum Torque - Set the torque or force for the Motor. A higher value will mean the pinned Shape is capable of acting against Shapes with a greater density.

Limit Rotation - When checked, the Constraint's rotation will be never go above or below the Rotational Limits.

Rotational Limits - Set an upper (U) and lower (L) angle to clamp the Constraint's rotation.

Tension - When this value is greater than 0, the Constraint will attempt to return to its original angle with a spring-like behaviour where a higher value will result in a stronger spring. When this value is set to 0, the Constraint will rotate freely.

Damping Ratio - Increase/decrease the damping of a Constraint's rotational 'spring' where a value of 0 = bouncy oscillation and 1 = smooth return with no bounce.

Breakable - When enabled, the Constraint can be broken by other forces.

Breaking Mode - Set a condition for the Constraint to break under:

  • Force - The Constraint will break when a force is above the Breaking Force.
  • Distance - The Constraint will break when it moves beyond its Stretch Limit.
  • Time - The Constraint will break when a force above the Breaking Force is sustained for a number of consecutive frames above the Breaking Duration.

Breaking Force - Set the amount of force required to break the Constraint.

Stretch Limit - Set a multiple of the Rest Length a Constraint is moved by before it breaks. For example, if the Rest Length is 100 and the Stretch Limit is 2, the Constraint will break when stretched to 100×2=200100 \times 2 = 200.

Breaking Duration - Set the number of consecutive frames a Constraint must be under a force above the Breaking Force before breaking.

Stress Threshold - Set a threshold as a percentage of the Breaking Force within which a Constraint will break.

Example
  1. Create a Rectangle.
  2. Set Width to 600 and Height to 30.
  3. Create an Ellipse.
  4. Set the Ellipse's Position to 100,400.
  5. Select both Shapes and click the Forge icon in the Shelf.
  6. Under the Forge Dynamics Bodies tab, click the gear icon for the Rectangle.
  7. Click the + next to the Constraints attribute towards the bottom of the window and choose Pin Constraint.
  8. Hit Play

The Ellipse will fall and hit the Rectangle causing it to rotate in place.