Skip to content

RShape / Mesh

The RShape driver is built from a .stl (stereolithography) or .shp (shape) file, as a mesh of faces. It allows a quick setup of complex geometries, for example from CAD. The faces of an RShape driver are processed as a sphero-polyhedron: a thin layer (the Minkowski radius) is added around each face.

RShape

register_stl_mesh / register_rshape

Parameter Description
id driver index
filename input file (.stl or .shp)
minkowski Minkowski radius
binary binary (true) or ascii (false, default) STL file; ignored for .shp files
scale scale factor applied to the shape, default 1
deform non-uniform deformation factors along x, y and z, [x, y, z], strictly positive, default [1, 1, 1]
state center, velocity, angular velocity and orientation, default {center: [0,0,0], vel: [0,0,0], vrot: [0,0,0], quat: [1,0,0,0]}; mass, surface, inertia and moment for some motions
params motion parameters, default { motion_type: STATIONARY }

STATIONARY

1
2
3
4
5
6
- register_stl_mesh:
   id: 0
   binary: false
   filename: mesh.stl
   minkowski: 0.001 m
   params: {motion_type: STATIONARY}
STL stationary

LINEAR_MOTION

1
2
3
4
5
6
- register_rshape:
   id: 0
   state: {center: [0.4, 0, 0]}
   params: { motion_type: LINEAR_MOTION, motion_vector: [-1, 0, 0], const_vel: 0.5 }
   filename: mesh.shp
   minkowski: 0.001 m
STL linear motion

TABULATED

1
2
3
4
5
6
7
8
9
- register_stl_mesh:
   id: 0
   state: {}
   params:
      motion_type: TABULATED
      time: [0, 1, 1.5, 2]
      positions: [[0.4, 0, 0], [-1, 0, 0], [0.4, 0, 0], [0.4, 0, 0]]
   filename: mesh.stl
   minkowski: 0.001 m
STL tabulated

LINEAR_FORCE_MOTION

1
2
3
4
5
6
7
- register_stl_mesh:
   id: 1
   filename: piston_haut.stl
   scale: 0.5002
   minkowski: 0.001
   state: { center: [0.0, 0.0, 9.], vel: [0, 0, -0.025], quat: [1, 0, 0, 0], mass: 1 }
   params: { motion_type: LINEAR_FORCE_MOTION, motion_vector: [0, 0, -1], const_force: 100 }
STL force motion

Note

The mass of the driver must be given.

LINEAR_COMPRESSIVE_MOTION

1
2
3
4
5
6
7
- register_stl_mesh:
   id: 1
   filename: piston_haut.stl
   scale: 0.5002
   minkowski: 0.001
   state: { center: [0.0, 0.0, 9.], vel: [0, 0, -0.025], quat: [1, 0, 0, 0], mass: 1, surface: 1.6146970415e+02 }
   params: { motion_type: LINEAR_COMPRESSIVE_MOTION, motion_vector: [0, 0, -1], sigma: 0.5, damprate: 0.5 }
STL compression

Note

The mass and the surface of the driver must be given. Without surface, exaDEM proposes the sum of the areas of the faces of the RShape.

SHAKER

1
2
3
4
5
6
7
- register_rshape:
   id: 0
   minkowski: 0.1
   filename: shaker.stl
   binary: true
   state: {center: [0, 0, 0] }
   params: { motion_type: SHAKER, amplitude: 5, omega: 2, shaker_dir: [0, 1, 0], motion_start_threshold: 10 }

Example: example/spheres/shaker/shaker_stl.msp.

STL shaker

EXPRESSION

Example (the RSA package is required): example/spheres/stl-mesh/tore_expression_motion.msp.

Torus
- register_stl_mesh:
   id: 0
   filename: tore.stl
   minkowski: 0.01
   state: { }
   params:
      motion_type: EXPRESSION
      expr:
         vz: 2.5 * cos( 10 * t)
         vrotz:  0.5 * cos(20 * t)
   binary: true
Torus expression

An expression can also impose a moment:

- register_stl_mesh:
   id: 0
   filename: pale2.stl
   minkowski: 0.01
   binary: true
   state:
      vrot: [0, 0, 0]
      center: [2.5, 2.5, 2]
      quat: [0, -0.707107, -0.707107, 0]
      mass: 49.0454
      inertia: [77.238167282, 388.401803042, 344.515979122]
   params:
      motion_type: EXPRESSION
      expr:
         momx: 0
         momy: 0
         momz: 5

Example: example/polyhedra/imposed_driver_moment/driver_expr_mom.msp, corresponding to the next section. Another example, example/spheres/cylinder_stl, is a funny variant of the rotating drum show-case:

Cylinder expression

Constant moment with sample retroaction

A constant moment can be applied while accounting for the retroaction of the sample on the driver. The driver definition must include:

  • center: the rotation center of the driver;
  • inertia: the rotational inertia of the driver;
  • mass: the mass of the driver.

As for the angular velocity, this mechanism is not a motion_type.

Note

The applied moment is restricted to the direction given in the moment slot: only the component along this direction is applied.

1
2
3
4
5
6
7
8
setup_drivers:
  - register_stl_mesh:
     id: 0
     filename: pale2.stl
     minkowski: 0.01
     binary: true
     state: { vrot: [0, 0, 0], center: [2.5, 2.5, 2], quat: [0, -0.707107, -0.707107, 0], mass: 49.0454, inertia: [77.238167282, 388.401803042, 344.515979122], moment: [0, 0, 1] } # vrot is in rad/s
     params: { motion_type: STATIONARY }
Applied moment

Examples:

  • right: example/polyhedra/imposed_driver_moment/driver_counter_mom.msp;
  • left: example/polyhedra/imposed_driver_moment/driver_applied_mom.msp.