siconos.io.rocks_generator module¶
Tools to generate random convex blocks (mostly used in rockfall simulations)
- class siconos.io.rocks_generator.RockShapeConfig(nb_pts=50, y_aspect_ratio=1.0, z_aspect_ratio=1.0, volume_min=1.0, volume_max=2.0, density=2650.0)[source]¶
Bases:
objectParameters to define a ‘random’ shape block
- Attributes:
nb_pts (int) – number of vertices of the generated convex hull Must be >= 4. Default=50.
y_aspect_ratio (float) – ratio (relative to x axis) along y-axis. Default=1 0.8 means the block is 80% as wide in y as in x.
z_aspect_ratio (float) – same as y_ratio in z dir. Default = 1.
volume_min (float) – minimum volume for the block
volume_max (float) – max volume for the block
- nb_pts = 50¶
- y_aspect_ratio = 1.0¶
- z_aspect_ratio = 1.0¶
- volume_min = 1.0¶
- volume_max = 2.0¶
- density = 2650.0¶
- class siconos.io.rocks_generator.RocksDropConfig(drop_zone, number_of_rocks=10, height_fall_min=2.0, height_fall_max=2.0)[source]¶
Bases:
objectParameters to define
- Attributes:
drop_zone (string) – input file (stl) defining the drop zone
number_of_rocks (int) – number of rocks to be dropped. Default=10
height_fall_min (float) – mininmal drop height
height_fall_max (float) – maximal drop height
dest_vol : float Required volume of the generated block. Default = 1.
- drop_zone¶
- number_of_rocks = 10¶
- height_fall_min = 2.0¶
- height_fall_max = 2.0¶
- siconos.io.rocks_generator.normalize_shape(vertices, y_aspect_ratio, z_aspect_ratio, dest_vol)[source]¶
Transform a raw set of 3D points into a ‘block’, convex and normalized to match aspect ratios and a given volume.
- Parameters:
vertices (array like object of shape (nb_points, 3)) – The 3D points set.
y_aspect_ratio (float) – normalisation ratio in y direction relative to x. For example, 0.8 means the block is 80% as wide in y as in z.
z_aspect_ratio (float) – same as y_aspect_ration for z dir.
dest_vol (float) – Targeted volume of the normalized shape.
- Returns:
vertices (ndarray of shape (new_nb_points, 3)) – Convex hull vertices, centered at the origin, normalized to fit with aspect ratios and volume. Interior (concave) points of initial set have been removed.
- siconos.io.rocks_generator.generate_shape(nbPts, y_aspect_ratio, z_aspect_ratio, dest_vol)[source]¶
Generate a random convex 3D rock block shape.
- Parameters:
- Returns:
norm_vertices (ndarray of shape (nbPts, 3)) – Vertices of the generated convex block, centered at the origin, normalized to fit with aspect ratios and volume.