Skip to content

STL mesh (RShape)

Description

register_rshape loads an arbitrary triangulated surface from an STL file (binary or ASCII) and registers it as a solid obstacle. The mesh is first scaled, then rotated (quaternion), then translated. The obstacle is the surface thickened by the Minkowski radius \(r\) (rounded edges): a node is solid when its distance to a face is at most \(r\).

Minkowski radius

The interior of a closed mesh is not filled: only the nodes within \(r\) of a face are solid. Use \(r\) of the order of the grid spacing or larger so that the solid shell has no hole between the nodes (the Eiffel Tower examples use \(r = 2\Delta x\)); with minkowski: 0 almost no node is marked.

Note

Transform order is: scale → rotate → translate. STL coordinates are multiplied by scale to get physical units (m).

YAML syntax

1
2
3
4
5
6
7
8
set_obstacles:
  - register_rshape:
     id: 0
     filename: "my_shape.stl"
     center:      [0.15, 0.05, 0.05]
     scale:       0.01
     orientation: [1, 0, 0, 0]   # identity [w,x,y,z]
     minkowski:   0.001
Slot Type Default Description
id int required unique identifier of the obstacle
filename string required path to the STL file (binary or ASCII)
center Vec3d [0, 0, 0] translation applied after scaling and rotation (m)
scale double 1.0 uniform scale factor applied first
orientation Quaternion [1, 0, 0, 0] rotation as a quaternion [w, x, y, z]
minkowski double 0.0 Minkowski (rounding) radius \(r\) (m): thickness of the solid shell around the faces

Usage example

Eiffel Tower (lbm_tour_eiffel_bcs_*)

A 300 m scale model of the Eiffel Tower, scaled by 0.01 and centered at the base of the domain:

set_obstacles:
  - register_rshape:
     id: 0
     filename: "stl_files/toureiffel.stl"
     center:      [0.3, 0.3, 0.0]
     scale:       0.01
     orientation: [1, 0, 0, 0]
     minkowski:   0.005

See the flow around the Eiffel Tower tutorial.