Description
Class for generating worm-like particles, optionally helically twisted.
This can be used, for example, to generate shavings or chips as those created in milling and grinding processes, etc. This basic class uses a row of small spheres to approximate the chip shape, in sake of high computational performance in collisions etc.
#include <ChRandomShapeCreator.h>
Public Member Functions | |
virtual std::shared_ptr< ChBody > | RandomGenerate (ChCoordsys<> mcoords) override |
Function that creates a random ChBody particle each time it is called. | |
void | SetSpheresSpacingFactor (double md) |
Since these worm-like structures are approximated with spheres, this settings tell how many spheres do you want along the line. More... | |
void | SetDiameterDistribution (std::shared_ptr< ChDistribution > mdistr) |
Set the statistical distribution for the diameter. | |
void | SetLengthRatioDistribution (std::shared_ptr< ChDistribution > mdistr) |
Set the statistical distribution for the length/diameter ratio. | |
void | SetTwistDistributionU (std::shared_ptr< ChDistribution > mdistr) |
Set the statistical distribution for the twist curvature of line (u direction). Curvature=1/radius. | |
void | SetTwistDistributionV (std::shared_ptr< ChDistribution > mdistr) |
Set the statistical distribution for the twist curvature of line (v direction). Curvature=1/radius. | |
void | SetDensityDistribution (std::shared_ptr< ChDistribution > mdistr) |
Set the statistical distribution for the random density. | |
Public Member Functions inherited from chrono::particlefactory::ChRandomShapeCreator | |
virtual std::shared_ptr< ChBody > | RandomGenerateAndCallbacks (ChCoordsys<> mcoords) |
This function does RandomGenerate and also executes the the custom callback, if provided. More... | |
void | RegisterAddBodyCallback (AddBodyCallback *callback) |
Set the callback function to execute at each each particle generation. | |
void | SetAddCollisionShape (bool addcoll) |
Set if the created particles must include the collision shape(s). More... | |
void | SetAddVisualizationAsset (bool addvisual) |
Set if the created particles must include the visualization asset(s). More... | |
Additional Inherited Members | |
Protected Attributes inherited from chrono::particlefactory::ChRandomShapeCreator | |
AddBodyCallback * | callback_post_creation |
bool | add_collision_shape |
bool | add_visualization_asset |
Member Function Documentation
◆ SetSpheresSpacingFactor()
|
inline |
Since these worm-like structures are approximated with spheres, this settings tell how many spheres do you want along the line.
To keep things more intuitive, this 'spacing' value means the following: spacing between spheres = diameter * spacing_factor. The lower, the more precise the approximation, but the more the computational time for collisions. Usually, good values are in 0.4-0.8 range. The spacing might be adjusted automatically to match the end of the shaving, btw.
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono/particlefactory/ChRandomShapeCreator.h