Description
Classes | |
class | chrono::utils::ChBenchmarkTest |
Base class for a Chrono benchmark test. More... | |
class | chrono::utils::ChBenchmarkFixture< TEST, SKIP > |
Generic benchmark fixture for Chrono tests. More... | |
class | chrono::utils::ChBodyGeometry |
Utility class defining geometry (visualization and collision) and contact materials for a rigid body. More... | |
class | chrono::utils::ChTSDAGeometry |
Utility class defining visualization geometry for a TSDA. More... | |
class | chrono::utils::CompositeInertia |
Utility class for calculating inertia properties of a composite body. More... | |
class | chrono::utils::ChControllerPID |
Simple PID controller. More... | |
class | chrono::utils::ChConvexHull2D |
Simple 2D convex hull class. More... | |
class | chrono::utils::ChRunningAverage |
Moving average filter for smoothing running data. More... | |
class | chrono::utils::ChMovingAverage |
Moving average filter for smoothing a data array. More... | |
class | chrono::utils::ChAnalogueFilter |
Base class for simulated analogue filters in the time domain. More... | |
class | chrono::utils::ChFilterI |
Calculate the integral of an input signal in the time domain: H(s) = 1 / ( Ti * s) More... | |
class | chrono::utils::ChFilterD |
Caclulate the time derivation of an input signal: H(s) = Td * s. More... | |
class | chrono::utils::ChFilterPT1 |
Delay an input signal: H(s) = Kpt1 / ( T1 * s + 1 ) More... | |
class | chrono::utils::ChFilterPD1 |
PD1 controller: H(s) = Kdt1 * ( Td1 * s + 1 ) More... | |
class | chrono::utils::ChFilterPDT1 |
PDT1 controller: H(s) = Kp * ( Td1 * s + 1 ) / ( T1 * s + 1) More... | |
class | chrono::utils::ChButterworthLowpass |
Butterworth low-pass filter. More... | |
class | chrono::utils::ChButterworthHighpass |
Butterworth high-pass filter. More... | |
class | chrono::utils::ChAbsorbedPowerVertical |
Filter for vertical absorbed power. More... | |
class | chrono::utils::ChISO2631_1_Wk |
Combined filter Wk. More... | |
class | chrono::utils::ChISO2631_1_Wd |
Combined filter Wd. More... | |
class | chrono::utils::ChISO2631_1_Wf |
Combined filter Wf. More... | |
class | chrono::utils::ChISO2631_5_Wxy |
ISO2631-5 weighting filter for shock like signal in horizontal direction. More... | |
class | chrono::utils::ChISO2631_5_Wz |
ISO2631-5 weighting filter for shock like signal in vertical direction. More... | |
class | chrono::utils::ChISO2631_Vibration_SeatCushionLogger |
Easy to use class for evaluation of ISO 2361-1 vibration load on sitting vehicle occupants Input: 3 seat accelerations x,y,z in [m/s^2]. More... | |
class | chrono::utils::ChISO2631_Shock_SeatCushionLogger |
Easy to use class for evaluation of ISO 2361-5 shock load on sitting vehicle occupants. More... | |
class | chrono::utils::ChMotionFilter |
Base class for smoothing basic motion laws with discrete time-domain nonlinear filters. More... | |
class | chrono::utils::ChMotionFilterSecondOrder |
Second-order nonlinear filter for smoothing basic motion laws (e.g. More... | |
class | chrono::utils::ChMotionFilterThirdOrder |
Third-order nonlinear filter for smoothing basic motion laws (e.g. More... | |
class | chrono::utils::ChSocketCommunication |
Class for socket communication interface. More... | |
class | chrono::utils::ChMixtureIngredient |
Encapsulation of an ingredient of one of the supported types in a mixture. More... | |
class | chrono::utils::ChGenerator |
Provides functionality for generating sets of bodies with positions drawn from a specified sampler and various mixture properties. More... | |
class | chrono::utils::ChSampler< T > |
Base class for different types of point samplers. More... | |
class | chrono::utils::ChPDGrid< Point > |
Simple 3D grid utility class for use by the Poisson Disk sampler. More... | |
class | chrono::utils::ChPDSampler< T > |
Sampler for 3D domains (box, sphere, or cylinder) using Poisson Disk Sampling. More... | |
class | chrono::utils::ChGridSampler< T > |
Sampler for 3D volumes using a regular (equidistant) grid. More... | |
class | chrono::utils::ChHCPSampler< T > |
Sampler for 3D volumes using a Hexagonally Close Packed structure. More... | |
Macros | |
#define | CH_BM_SIMULATION_LOOP(TEST_NAME, TEST, SKIP_STEPS, SIM_STEPS, REPETITIONS) |
Define and register a test named TEST_NAME using the specified ChBenchmark TEST. More... | |
#define | CH_BM_SIMULATION_ONCE(TEST_NAME, TEST, SKIP_STEPS, SIM_STEPS, REPETITIONS) |
Define and register a test named TEST_NAME using the specified ChBenchmark TEST. More... | |
Enumerations | |
enum | chrono::utils::MixtureType { SPHERE, ELLIPSOID, BOX, CYLINDER, CONE, CAPSULE } |
Enumeration of various geometric shapes available for mixtures. | |
enum | chrono::utils::SamplingType { chrono::utils::SamplingType::REGULAR_GRID, chrono::utils::SamplingType::POISSON_DISK, chrono::utils::SamplingType::HCP_PACK } |
Volumetric sampling method. More... | |
Functions | |
void | chrono::utils::AddSphereGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a sphere collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddEllipsoidGeometry (ChBody *body, ChContactMaterialSharedPtr material, const ChVector3d &axes, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add an ellipsoid collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddBoxGeometry (ChBody *body, ChContactMaterialSharedPtr material, const ChVector3d &size, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a box collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddBiSphereGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double cDist, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a bisphere collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddCapsuleGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double height, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a capsule shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddCylinderGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double height, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a cylinder shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddCylinderGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, const ChVector3d &p1, const ChVector3d &p2, bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a cylinder shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddConeGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double height, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a cone shape and optionally a corresponding visualization asset to the specified body. More... | |
bool | chrono::utils::AddTriangleMeshGeometry (ChBody *body, ChContactMaterialSharedPtr material, const std::string &obj_filename, const std::string &name, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a triangular mesh collision shape and optionally a corresponding visualization asset to the specified body. More... | |
bool | chrono::utils::AddTriangleMeshConvexDecomposition (ChBody *body, ChContactMaterialSharedPtr material, const std::string &obj_filename, const std::string &name, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), float skin_thickness=0.0f, bool use_original_asset=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add convex hull collision shapes and optionally a corresponding visualization asset to the specified body. | |
bool | chrono::utils::AddTriangleMeshConvexDecompositionV2 (ChBody *body, ChContactMaterialSharedPtr material, const std::string &obj_filename, const std::string &name, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool use_original_asset=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add convex hull collision shapes and optionally a corresponding visualization asset to the specified body. | |
bool | chrono::utils::AddTriangleMeshConvexDecompositionSplit (ChSystem *system, ChContactMaterialSharedPtr material, const std::string &obj_filename, const std::string &name, const ChVector3d &pos, const ChQuaterniond &rot, double total_mass) |
Add convex hull collision shapes and optionally a corresponding visualization asset to the specified body. | |
void | chrono::utils::AddTriangleGeometry (ChBody *body, ChContactMaterialSharedPtr material, const ChVector3d &vertA, const ChVector3d &vertB, const ChVector3d &vertC, const std::string &name, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a triangle collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddRoundedBoxGeometry (ChBody *body, ChContactMaterialSharedPtr material, const ChVector3d &size, double srad, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a rounded box (sphere-swept box) collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddRoundedCylinderGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double height, double srad, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a rounded cylinder (sphere-swept cylinder) collision shape and optionally a corresponding visualization asset to the specified body. More... | |
void | chrono::utils::AddTorusGeometry (ChBody *body, ChContactMaterialSharedPtr material, double radius, double thickness, int segments=20, int angle=360, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a torus collision shape (compound object created with capsules) and optionally a corresponding visualization asset to the specified body. | |
void | chrono::utils::AddBoxContainer (std::shared_ptr< ChBody > body, ChContactMaterialSharedPtr material, const ChFrame<> &frame, const ChVector3d &size, double thickness, const ChVector3i faces, bool visualization=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add collision shapes representing a box container of specified dimensions to the given body. More... | |
std::shared_ptr< ChBody > | chrono::utils::CreateBoxContainer (ChSystem *system, ChContactMaterialSharedPtr mat, const ChVector3d &size, double thickness, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool collide=true, bool overlap=true, bool closed=false) |
Create a fixed body with collision and visualization geometry representing a box volume. More... | |
std::shared_ptr< ChBody > | chrono::utils::CreateCylindricalContainerFromBoxes (ChSystem *system, ChContactMaterialSharedPtr mat, double radius, double height, double thickness, int numBoxes, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool collide=true, bool overlap=true, bool closed=false, bool isBoxBase=true, bool partialVisualization=true) |
Create a fixed body with collision and visualization representing a cylindrical volume. More... | |
bool | chrono::utils::LoadConvexMesh (const std::string &file_name, ChTriangleMeshConnected &convex_mesh, ChConvexDecompositionHACDv2 &convex_shape, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), int hacd_maxhullcount=1024, int hacd_maxhullmerge=256, int hacd_maxhullvertexes=64, float hacd_concavity=0.01f, float hacd_smallclusterthreshold=0.0f, float hacd_fusetolerance=1e-6f) |
Load an object from a Wavefront OBJ file and generate its convex decomposition. | |
bool | chrono::utils::LoadConvexHulls (const std::string &file_name, ChTriangleMeshConnected &convex_mesh, std::vector< std::vector< ChVector3d >> &convex_hulls) |
Given a path to an obj file, loads the obj assuming that the individual objects in the obj are convex hulls, useful when loading a precomputed set of convex hulls. More... | |
void | chrono::utils::AddConvexCollisionModel (std::shared_ptr< ChBody > body, ChContactMaterialSharedPtr material, std::shared_ptr< ChTriangleMeshConnected > convex_mesh, ChConvexDecompositionHACDv2 &convex_shape, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), bool use_original_asset=true, ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Given a convex mesh and its decomposition add it to a ChBody use_original_asset can be used to specify if the mesh or the convex decomp should be used for visualization. | |
void | chrono::utils::AddConvexCollisionModel (std::shared_ptr< ChBody > body, ChContactMaterialSharedPtr material, std::shared_ptr< ChTriangleMeshConnected > convex_mesh, std::vector< std::vector< ChVector3d >> &convex_hulls, const ChVector3d &pos=ChVector3d(0, 0, 0), const ChQuaterniond &rot=ChQuaterniond(1, 0, 0, 0), ChVisualMaterialSharedPtr vis_material=ChVisualMaterial::Default()) |
Add a convex mesh to an object based on a set of points. More... | |
bool | chrono::utils::LineLineIntersect (const ChVector3d &p1, const ChVector3d &p2, const ChVector3d &p3, const ChVector3d &p4, ChVector3d *pa, ChVector3d *pb, double *mua, double *mub) |
Calculate the line segment PaPb that is the shortest route between two lines P1P2 and P3P4. More... | |
double | chrono::utils::PointLineDistance (const ChVector3d &B, const ChVector3d &A1, const ChVector3d &A2, double &u, bool &in_segment) |
Calculate distance between a point B and the segment (A1,A2). More... | |
double | chrono::utils::PointTriangleDistance (const ChVector3d &B, const ChVector3d &A1, const ChVector3d &A2, const ChVector3d &A3, double &u, double &v, bool &in_triangle, ChVector3d &Bprojected) |
Calculate distance of a point from a triangle surface. More... | |
bool | chrono::utils::DegenerateTriangle (const ChVector3d &Dx, const ChVector3d &Dy) |
Check if the triangle defined by the two given vectors is degenerate. | |
bool | chrono::utils::DegenerateTriangle (const ChVector3d &v1, const ChVector3d &v2, const ChVector3d &v3) |
Check if the triangle defined by the three given vertices is degenerate. | |
template<typename T > | |
std::vector< ChVector3< T > > | chrono::utils::ChPDLayerSamplerBox (ChVector3< T > center, ChVector3< T > hdims, T diam, T padding_factor=1.02, bool verbose=false) |
Poisson Disk sampler for sampling a 3D box in layers. More... | |
void | chrono::utils::ChBenchmarkTest::Simulate (int num_steps) |
void | chrono::utils::ChBenchmarkTest::ResetTimers () |
Variables | |
template<class T > | |
constexpr T | chrono::utils::Pi = T(3.1415926535897932385L) |
Macro Definition Documentation
◆ CH_BM_SIMULATION_LOOP
#define CH_BM_SIMULATION_LOOP | ( | TEST_NAME, | |
TEST, | |||
SKIP_STEPS, | |||
SIM_STEPS, | |||
REPETITIONS | |||
) |
Define and register a test named TEST_NAME using the specified ChBenchmark TEST.
This method benchmarks consecutive (in time) simulation batches and is therefore appropriate for cases where the cost per step is expected to be relatively uniform. An initial SKIP_STEPS integration steps are performed for hot start, after which measurements are conducted for batches of SIM_STEPS integration steps. The test is repeated REPETITIONS number of times, to collect statistics. Note that each reported benchmark result may require simulations of several batches (controlled by the benchmark library in order to stabilize timing results).
◆ CH_BM_SIMULATION_ONCE
#define CH_BM_SIMULATION_ONCE | ( | TEST_NAME, | |
TEST, | |||
SKIP_STEPS, | |||
SIM_STEPS, | |||
REPETITIONS | |||
) |
Define and register a test named TEST_NAME using the specified ChBenchmark TEST.
This method benchmarks a single simulation interval and is appropriate for cases where the cost of simulating a given length time interval can vary significantly from interval to interval. For each measurement, the underlying model is recreated from scratch. An initial SKIP_STEPS integration steps are performed for hot start, after which a single batch of SIM_STEPS is timed and recorded. The test is repeated REPETITIONS number of times, to collect statistics.
Enumeration Type Documentation
◆ SamplingType
|
strong |
Function Documentation
◆ AddBiSphereGeometry()
ChApi void chrono::utils::AddBiSphereGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
double | cDist, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a bisphere collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius sphere radius cDist distance between centers pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddBoxContainer()
ChApi void chrono::utils::AddBoxContainer | ( | std::shared_ptr< ChBody > | body, |
ChContactMaterialSharedPtr | material, | ||
const ChFrame<> & | frame, | ||
const ChVector3d & | size, | ||
double | thickness, | ||
const ChVector3i | faces, | ||
bool | visualization = true , |
||
ChVisualMaterialSharedPtr | vis_material = ChVisualMaterial::Default() |
||
) |
Add collision shapes representing a box container of specified dimensions to the given body.
The center of the box volume is at the origin of the given frame and the the container is aligned with the frame axes. The container walls are constructed with the specified thickness. The 'faces' input vector specifies which faces of the container are to be created: for each direction, a value of -1 indicates the face in the negative direction, a value of +1 indicates the face in the positive direction, and a value of 2 indicates both faces. Setting a value of 0 does not create container faces in that direction.
- Parameters
-
body associated body material contact material frame position and orientation wrt body frame size interior container dimensions thickness wall thickness faces indices of container faces to be created visualization create visualization shape vis_material visualization material
◆ AddBoxGeometry()
ChApi void chrono::utils::AddBoxGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
const ChVector3d & | size, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a box collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material size box side lengths pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddCapsuleGeometry()
ChApi void chrono::utils::AddCapsuleGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
double | height, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a capsule shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius capsule radius height capsule height (cylindrical portion) pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddConeGeometry()
ChApi void chrono::utils::AddConeGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
double | height, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a cone shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius cone radius height cone height pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddConvexCollisionModel()
ChApi void chrono::utils::AddConvexCollisionModel | ( | std::shared_ptr< ChBody > | body, |
ChContactMaterialSharedPtr | material, | ||
std::shared_ptr< ChTriangleMeshConnected > | convex_mesh, | ||
std::vector< std::vector< ChVector3d >> & | convex_hulls, | ||
const ChVector3d & | pos = ChVector3d(0, 0, 0) , |
||
const ChQuaterniond & | rot = ChQuaterniond(1, 0, 0, 0) , |
||
ChVisualMaterialSharedPtr | vis_material = ChVisualMaterial::Default() |
||
) |
Add a convex mesh to an object based on a set of points.
This version will use the triangle mesh to set the visualization geometry.
◆ AddCylinderGeometry() [1/2]
ChApi void chrono::utils::AddCylinderGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
const ChVector3d & | p1, | ||
const ChVector3d & | p2, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a cylinder shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius cylinder radius p1 first end point p2 second end point visualization create visualization shape vis_material visualization material
◆ AddCylinderGeometry() [2/2]
ChApi void chrono::utils::AddCylinderGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
double | height, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a cylinder shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius cylinder radius height cylinder height pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddEllipsoidGeometry()
ChApi void chrono::utils::AddEllipsoidGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
const ChVector3d & | axes, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add an ellipsoid collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material axes elipsoid axes pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddRoundedBoxGeometry()
ChApi void chrono::utils::AddRoundedBoxGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
const ChVector3d & | size, | ||
double | srad, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a rounded box (sphere-swept box) collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material size box side lengths srad radius of sweeping sphere pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddRoundedCylinderGeometry()
ChApi void chrono::utils::AddRoundedCylinderGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
double | height, | ||
double | srad, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a rounded cylinder (sphere-swept cylinder) collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius cylinder radius height cylinder radius srad radius of sweeping sphere pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddSphereGeometry()
ChApi void chrono::utils::AddSphereGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
double | radius, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a sphere collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material radius sphere radius pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddTriangleGeometry()
ChApi void chrono::utils::AddTriangleGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
const ChVector3d & | vertA, | ||
const ChVector3d & | vertB, | ||
const ChVector3d & | vertC, | ||
const std::string & | name, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a triangle collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material vertA first triangle vertex vertB second triangle vertex vertC third triangle vertex name name of generated mesh pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ AddTriangleMeshGeometry()
ChApi bool chrono::utils::AddTriangleMeshGeometry | ( | ChBody * | body, |
ChContactMaterialSharedPtr | material, | ||
const std::string & | obj_filename, | ||
const std::string & | name, | ||
const ChVector3d & | pos, | ||
const ChQuaterniond & | rot, | ||
bool | visualization, | ||
ChVisualMaterialSharedPtr | vis_material | ||
) |
Add a triangular mesh collision shape and optionally a corresponding visualization asset to the specified body.
- Parameters
-
body associated body material contact material obj_filename name of Wavefront OBJ file name mesh name pos position on body rot orientation wrt body frame visualization create visualization shape vis_material visualization material
◆ ChPDLayerSamplerBox()
std::vector<ChVector3<T> > chrono::utils::ChPDLayerSamplerBox | ( | ChVector3< T > | center, |
ChVector3< T > | hdims, | ||
T | diam, | ||
T | padding_factor = 1.02 , |
||
bool | verbose = false |
||
) |
Poisson Disk sampler for sampling a 3D box in layers.
The computational efficiency of PD sampling degrades as points are added, especially for large volumes. This class provides an alternative sampling method where PD sampling is done in 2D layers, separated by a specified distance (padding_factor * diam). This significantly improves computational efficiency of the sampling but at the cost of discarding the PD uniform distribution properties in the direction orthogonal to the layers.
- Parameters
-
center Center of axis-aligned box to fill hdims Half-dimensions along the x, y, and z axes diam Particle diameter padding_factor Multiplier on particle diameter for spacing verbose Output progress during generation
◆ CreateBoxContainer()
ChApi std::shared_ptr< ChBody > chrono::utils::CreateBoxContainer | ( | ChSystem * | system, |
ChContactMaterialSharedPtr | mat, | ||
const ChVector3d & | size, | ||
double | thickness, | ||
const ChVector3d & | pos = ChVector3d(0, 0, 0) , |
||
const ChQuaterniond & | rot = ChQuaterniond(1, 0, 0, 0) , |
||
bool | collide = true , |
||
bool | overlap = true , |
||
bool | closed = false |
||
) |
Create a fixed body with collision and visualization geometry representing a box volume.
The center of the bottom box wall is at the body origin.
- Parameters
-
system containing system mat contact material size interior container dimensions thickness wall thickness pos body position rot body orientation collide enable collision overlap include overlap at container edges closed create top wall
◆ CreateCylindricalContainerFromBoxes()
ChApi std::shared_ptr< ChBody > chrono::utils::CreateCylindricalContainerFromBoxes | ( | ChSystem * | system, |
ChContactMaterialSharedPtr | mat, | ||
double | radius, | ||
double | height, | ||
double | thickness, | ||
int | numBoxes, | ||
const ChVector3d & | pos = ChVector3d(0, 0, 0) , |
||
const ChQuaterniond & | rot = ChQuaterniond(1, 0, 0, 0) , |
||
bool | collide = true , |
||
bool | overlap = true , |
||
bool | closed = false , |
||
bool | isBoxBase = true , |
||
bool | partialVisualization = true |
||
) |
Create a fixed body with collision and visualization representing a cylindrical volume.
The volume geometry is modeled using boxes. The container is aligned with the z direction with the center of the bottom at the body origin. Optionally, the side boxes in the first quadrant are not visualized.
- Parameters
-
system containing system mat contact material radius container inner radius height container inner height thickness wall thickness numBoxes number of circumference boxes pos body position rot body orientation collide enable collision overlap include overlap at box edges closed create top isBoxBase use a box or a cylinder for bases partialVisualization visualize only half of the boxes
◆ LineLineIntersect()
ChApi bool chrono::utils::LineLineIntersect | ( | const ChVector3d & | p1, |
const ChVector3d & | p2, | ||
const ChVector3d & | p3, | ||
const ChVector3d & | p4, | ||
ChVector3d * | pa, | ||
ChVector3d * | pb, | ||
double * | mua, | ||
double * | mub | ||
) |
Calculate the line segment PaPb that is the shortest route between two lines P1P2 and P3P4.
Calculate also the values of mua and mub where Pa = P1 + mua (P2 - P1) Pb = P3 + mub (P4 - P3) Return false if no solution exists.
◆ LoadConvexHulls()
ChApi bool chrono::utils::LoadConvexHulls | ( | const std::string & | file_name, |
ChTriangleMeshConnected & | convex_mesh, | ||
std::vector< std::vector< ChVector3d >> & | convex_hulls | ||
) |
Given a path to an obj file, loads the obj assuming that the individual objects in the obj are convex hulls, useful when loading a precomputed set of convex hulls.
The output of this function is used with AddConvexCollisionModel
◆ PointLineDistance()
ChApi double chrono::utils::PointLineDistance | ( | const ChVector3d & | B, |
const ChVector3d & | A1, | ||
const ChVector3d & | A2, | ||
double & | u, | ||
bool & | in_segment | ||
) |
Calculate distance between a point B and the segment (A1,A2).
Returns the distance from B to the line and sets the line parameter 'u' such that u=0 indicates that B projects into A1 and u=1 indicates that B projects into A2. If 0 <= u <= 1, in_segment is set to 'true'.
◆ PointTriangleDistance()
ChApi double chrono::utils::PointTriangleDistance | ( | const ChVector3d & | B, |
const ChVector3d & | A1, | ||
const ChVector3d & | A2, | ||
const ChVector3d & | A3, | ||
double & | u, | ||
double & | v, | ||
bool & | in_triangle, | ||
ChVector3d & | Bprojected | ||
) |
Calculate distance of a point from a triangle surface.
Also computes if projection is inside the triangle. If is_into = true, Bprojected is also computed. Returns distance (positive if 'out' side, out is where points A1 A2 A3 can be read in clockwise fashion).