>From my memory, it's a util function. Check the implementation details
<https://github.com/projectchrono/chrono/blob/e76ee3de69653fea6afa37f593e660b89d0075a3/src/chrono/physics/ChBodyEasy.cpp#L48>
...
```
void ChBodyEasySphere::SetupBody(double radius,
double density,
bool visualize,
bool collide,
std::shared_ptr<ChContactMaterial>
material) {
double mmass = density * ((4.0 / 3.0) * CH_PI * std::pow(radius, 3));
double inertia = (2.0 / 5.0) * mmass * std::pow(radius, 2);
SetMass(mmass);
SetInertiaXX(ChVector3d(inertia, inertia, inertia));
if (collide) {
assert(material);
auto cshape =
chrono_types::make_shared<ChCollisionShapeSphere>(material, radius);
AddCollisionShape(cshape);
EnableCollision(true);
}
if (visualize) {
auto vshape =
chrono_types::make_shared<ChVisualShapeSphere>(radius);
AddVisualShape(vshape);
}
}
```
On Wednesday, November 20, 2024 at 6:25:35 PM UTC [email protected] wrote:
> Hi,
> I have a question regarding the difference between the commands
> "ChBodyEasyCylinder" and "AddCylinderGeometry". For what I have understood,
> the first one automatically calculates the mass and inertia of a body
> depending on the sizes and density given, while the second one provides
> only the collision shape of a cylinder (neither mass nor density if they
> are not manually given). However, I saw that there is the possibility of
> assigning the "Position on body" when using "AddCylinderGeometry" through a
> ChVector3d but the result is pretty different from what I obtain by using
> "SetPos" when I also apply a rotation to the body. What does this command
> do exactly?
> Thank you in advance for yout patience and kindness.
>
> Best Regards
>
> Gianni
>
--
You received this message because you are subscribed to the Google Groups
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/projectchrono/01b19485-4bd1-4e2e-abe2-805ef1d866adn%40googlegroups.com.