DOCS // pyrofx

Obstacles

[[obstacles]] are solids the gas flows around: spheres, boxes, cylinders and capsules. carve = true cuts holes. Keys move them; holdout and shadow hide and shade the gas.

Contents5 sections
  1. Example
  2. Drop a ball through smoke
  3. Fields
  4. Combining solids
  5. Questions

Example

The window fire: a block, a room carved out of it and a window carved through the front.

window_fire.pyro.toml (excerpt)
# The building: fills the back of the box from the floor to the top. Its front is at Z = -0.5,
# which leaves 3 m of open air in front for the flame to roll out into.
[[obstacles]]
shape = "box"
position_m = [0, 4, -1.5]
size_m = [2.5, 4, 1.0]

# The room inside it, with a wall 0.2 m thick in front.
[[obstacles]]
shape = "box"
carve = true
position_m = [0, 1.3, -1.5]
size_m = [1.3, 1.1, 0.8]

# The window through that wall.
[[obstacles]]
shape = "box"
carve = true
position_m = [0, 1.5, -0.6]
size_m = [0.7, 0.65, 0.25]
WINDOW_FIREFINAL
First frame of the window_fire bake
Window fire, 3.9 x 4.7 m, compiled with Spatial Compiler. Spec →

Drop a ball through smoke

Compare the same smoke with the obstacle present and absent. To capture more of its fall, set a frame rate in the export settings.

Compiled with Spatial Compiler. View the source spec obstacles.start_s=999

Fields

FieldMeaningDefault
shapesphere, box, cylinder or capsule; a cylinder and a capsule stand along their own Ysphere
position_mCenter (t). A moving solid pushes the gas.[0, 1, 0]
size_mRadius of a sphere, cylinder or capsule; half-extents of a box (t)0.5
height_mFull length of a cylinder; length of the straight part of a capsule (t)1.0
rotation_degRotation (t). Spinning drags gas at the surface.[0, 0, 0]
carveCuts its shape from earlier obstacles; the first cannot carvefalse
holdoutHides gas behind it in the sheetstrue
shadowBlocks the light, so gas in its shade is darkertrue
start_s, end_sWhen it is there; end_s = 0 never leaves0, 0

Combining solids

  • Spec order applies: later solids fill earlier carves; later carves cut every earlier solid.
  • Solids are at least one cell thick, which stops gas at any angle.
  • Solids outside the camera frame still hide and shade.
  • Solids are not drawn. They stand in for your engine’s model; holdout leaves a clean hole for it.
  • Keep emitters clear of solids.

See Model-shaped obstacles.

Questions

How do I carve a room or window out of a pyrofx obstacle?

Add a later obstacle with carve set to true to cut its shape from earlier obstacles.

What do holdout and shadow do on a pyrofx obstacle?

Holdout hides gas behind the solid in the output sheets, while shadow darkens gas in its shade.

Do pyrofx obstacles appear as visible meshes in the output sheets?

No, solids are not drawn because they stand in for your engine model and leave a clean hole.