Does anyone else struggle to get accurate inertia and mass values for 3D-printed parts in sim?

I was playing around with a LeRobot SO101 arm and simulating it in [MuJoCo/PyBullet/Gazebo]. Something that kept bugging me: CAD tools, URDF exporters, (and slicers’ STEP exports) compute the inertia tensor as if the part is a solid block of plastic which is not accurate at all.

When you feed that solid-block inertia into a simulator, the dynamics are off, which as per my understanding widens the sim-to-real gap.

I tried finding a tool for this but did not find anything.

So I vibe coded a small open-source tool (printphys) that takes your mesh + your actual print settings (material, infill %, pattern, wall count, layer height) and outputs mass, center of mass, and the full inertia tensor as a ready-to-paste URDF <inertial> block (SDF and MJCF too).

To sanity-check it, I printed a part, weighed it on a scale, and compared:

  • printphys estimate: 1.93 g

  • Measured on a scale: 2.07 g (~7% off, and it tightens with a finer voxel resolution to less than 5% off. The part was not a good estimate due to its small size, walls dominate weight more than infill, and I will be validating with other parts as well)

It also has a --weighed-mass mode: if you weigh the real part, it rescales everything to match the measurement.

Repo (still early): [ GitHub - LakshyaSaraff/printphys: Accurate physics descriptions for 3D printed parts · GitHub ]

What I actually want to know from you all:

  1. Is inaccurate inertia on printed parts something you hit, or do you just not worry about it?

  2. If you do care — what’s your current workaround? (guess a density? measure? ignore it?)

  3. For those doing sim-to-real: how much do you think inertia error actually contributes vs. friction/actuator modeling?

  4. Anything obviously missing that would make this useful to you?

  5. Any other suggestions to add new features or improve the repo.

Your feedback will be really useful to know whether this is something helpful.

1 Like