chrono::particlefactory::ChRandomShapeCreatorShavings Class Reference

## 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>

Inheritance diagram for chrono::particlefactory::ChRandomShapeCreatorShavings:
Collaboration diagram for chrono::particlefactory::ChRandomShapeCreatorShavings:

## Public Member Functions

virtual std::shared_ptr< ChBodyRandomGenerate (ChCoordsys<> mcoords) override
Function that creates a random ChBody particle each time it is called. More...

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< ChBodyRandomGenerateAndCallbacks (ChCoordsys<> mcoords)
This function does RandomGenerate and also executes the the custom callback, if provided. More...

Set the callback function to execute at each each particle generation.

Set if the created particles must include the collision shape(s). More...

Set if the created particles must include the visualization asset(s). More...

## Additional Inherited Members

Protected Attributes inherited from chrono::particlefactory::ChRandomShapeCreator

## Member Function Documentation

 virtual std::shared_ptr chrono::particlefactory::ChRandomShapeCreatorShavings::RandomGenerate ( ChCoordsys<> mcoords )
overridevirtual

Function that creates a random ChBody particle each time it is called.

 void chrono::particlefactory::ChRandomShapeCreatorShavings::SetSpheresSpacingFactor ( double md )

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.