Hello,
I am working in R2 dimensions and attempting to add a disc (2D cylinder), I seem to have no difficulty defining a Rectangle (addRect) however which I change my object to disc I get the error:
FATAL: SetInertia not implemented in 2 dimensions
Here is my line for adding the Disk:
addDisk(GT_FLOATING_BODY, FT_SOLID, Point(0.0, 0.0, 0.0), 3.0*m_deltap);
This is the only line I change between the Rectangle and the Disk case. Is there something else I need for the disk and am I correct in assuming the disk is defined in 2D?
Thank you!
Hi @Ethan_Evans,
you’re doing everything right, it’s just that the inertia for the disk in 2D has not been defined (yet). Body dynamics in 2D is untested, and I wouldn’t trust the Rect
and Segment
inertia tensors either (you should have gotten a TODO: verify
message when using it).
In fact, now that I look at the code (the files in question are Disk.cc
, Rect.cc
and Segment.cc
in src/geometries
), I am pretty sure they are wrong, since in 2D the objects should only rotate on the “virtual” z axis. I’ve pushed a commit to my candidate-v6
branch that should fix this, and include the Disk moment of inertia too.
Please let me know if it works as expected, it’s possible more changes are needed for 2D body dynamics.
Thanks Giuseppe! Appreciate the help!