voxcraft / voxcraft-sim

a GPU-accelerated voxel-based physics engine
Creative Commons Zero v1.0 Universal
43 stars 10 forks source link

Material density #45

Closed nhatminh2h closed 3 years ago

nhatminh2h commented 3 years ago

Hi,

Thank you for answering my questions earlier in the GPUVoxels repo.

I just have a quick question regarding how/where density is handled in voxelyze. I'm trying to simulate robots with some thermoplastics, which all have density in the range of ~1200 kg/m^3. With these values, the robot seems to float in mid-air when I view the design in voxcraft-viz and voxcad. As I increase the density value, the speed that the object fall increases. So gravity is working. Could this be the interaction with the surrounding "air"? I have noticed identical behaviour with the old voxelyze and voxcraft-sim.

I have included the concatenated .vxa file (base.vxa+robot.vxd) of the design, and an example with a single voxel. I don't think point 3, 4, and 5 on the "readme_before_reporting_issues" is needed but please let me know and I will try and produce them(bit difficult as I have only ran voxcraft-sim on colab, while voxcraft-viz, evosoro, and the old voxelyze is on my computer).

Robot.txt single voxel.txt

skriegman commented 3 years ago

There is no surrounding friction except on the surface plane. The time step of integration is reduced (and thus the video is slowed) dramatically when attempting to simulate rigid bodies in this simulator (or any other beam-mass model). If you take your elastic modulus and divide by density, the higher this value is, the slower the simulation needs to be to capture the resonance frequency. More details can be found here: https://www.creativemachineslab.com/uploads/6/9/3/4/69340277/dynamicsimulation.pdf

nhatminh2h commented 3 years ago

I have look at the timesteps calculations and as I understand it, the optimal timestep is calculated by the engine, and I can further adjust how small/large the time step is with . Polymers require smaller timestep because they have high Elastic Mod and low density, and therefore take longer to compute. Is this correct?

At the moment, the only solution I can think of is to wait longer for the simulation to play out. Could you suggest an alternative?

Also looking at the output image , the numbers do not add up. How can an object fall 2.87mm in 1 second? Am I missing something obvious?

Many Thanks,

skriegman commented 3 years ago

Minh Vu, I'm sorry but the simulator cannot natively handle this material, which has stiffness to density ratio on the order of 10^6. If you need to simulate rigid materials, you might want to try pybullet.