PySwarm Wiki

Back to PIA's main page 

PIA Containment Tab


When CONTAINMENT is activated, BOIDs can be confined to stay inside or outside specified regions of space. When BOIDs venture beyond these zones, they will naturally alter their course to go back inside the closest safe region.

With V0.5, zones can either be defined as "safe" or "restricted." Safe zones are regions of space that are considered safe by BOIDs. Restricted zones are regions of space BOIDs will remain out of.

Zone Number[]

With V0.5, you can define up to 10 different zones, each with it's own set of parameters.

  • Zone #: Use this drop-down menu to select one of the 10 zones to work with.

Zone Parameters[]

Box Zone Parameters

Cylinder Zone Parameters

Sphere Zone Parameters

Each zone is defined by it's own set of parameters. The settings that show in these fields are for the zone currently selected (above). A bounding zone forces BOIDs to remain inside or outside certain regions of space. With PySwarm V0.5, there are three types of bounding containers: Box, Cylinder, and Sphere. Set this value to the type of container you wish to define: Box, Cylinder, or Sphere.

  • Activate Zone: Check this box to activate this specific zone. 
  • Zone Type: Select the shape of this zone - Box (Cube), Cylinder, or Sphere.
  • Zone Mode: Select the zone's mode - safe (where BOIDs will try to stay inside) or restricted (where BOIDs try to stay out of).
  • Zone Strength: The relative force to be applied to BOIDs. 
  • Zone Center: This (x,y,z) value defines the center (in feet) of the zone.
  • Zone Size: This (x,y,z) value defines the dimensions of a Box zone (in feet).
  • Zone Radius: This value sets the radius of cylinder and sphere zones (in feet). Remember that the size of a sphere or cylinder in Carrara is twice the radius.
  • Zone Height: This value sets the height of a cylinder zone (in feet).

Tips and Limitations[]

  1. If COHESION is deactivated, this parameter has no effect.
  2. Restricted zones were added to keep BOIDs from flying/swimming/moving into solid objects in your Carrara scene (like buildings and trees).
  3. The force to stay out of restricted zones is greater than the force to stay within safe ones.
  4. You can define a different zone strength value for each zone. This is useful, for example, if you want to increase the strength of certain restricted zones or decrease the strength of a safe zone.
  5. You do not have to create a safe zone to bound your BOIDs. Another option is to add an attractor with a low attractor strength value (e.g., 0.3) to keep BOIDs within a certain region. You can then create restricted zones to bound regions for motion.