Page 1 of 1

Find end position of object without intermediate calculations

Posted: Mon Dec 02, 2019 4:53 pm
by MrEighteen

I'm new to Bullet and looking for some direction to start with the following problem:

I would like to calculate how objects fit together as fast as possible without dynamics. Like when you snap an object to a surfuce in most CAD programs. Constraints are:
  • Rigid objects
  • In the end position the object is stable (supported by 3 points or more)
  • Object can rotate round its center
  • Object can not move sideways (only going down)
  • Gravity is in the center of the object
Example in 2D (real project is in 3D)

I would like to use this to iterate the object over a surface to find the position where it is laying as flat as possible. I'm curious if Bullet is the right tool for the job, since I don't need to simulate the whole trajectory but I just wan't to iterate over the terrain and get the end positions as fast as possible.

Can anyone tell me where to start with the Bullet library (or any other library) for this problem?

Re: Find end position of object without intermediate calculations

Posted: Wed Dec 04, 2019 4:53 pm
by drleviathan
AFAIK Bullet does not have tools that would make your project trivial. However I could see how Bullet could help.

Bullet can perform "sweeps" of objects with convex shapes to figure out where they first hit other non-moving objects when travelling along a linear path. So it would be possible to sweep your test object down to figure out where it would stop and then try again. With multiple sweep tests that scatter across position and rotation you might be able to measure a "gradient" toward a local minima and then iterate toward the optimal solution until you have acceptable error.