Notifications
Clear all

[Closed] Better fracture – setting piece mass by its volume

Hi dudes,

There is the following problem: When a mesh is pre-fractured (split into many parts), to be passed to Fracture, the usual solution is to assign the same mass to all pieces. This creates some problems, so I am thinking about a scripting solution to the problem.

For a start, a not too accurate solution will be great, too. The volume could be easily calculated if one can get the dimensions of a bounding box around an object. Then just multiply abc and then by a user set coefficient, and put this in the mass parameter.

And since I can not script yet (which is about to change very soon, argh!), could I interest you in making such script?

Thanks a lot!

7 Replies
 rdg

As a starting point I combined snippets from the maxScript help.

Download: rdg_massByVolume4Fractures.ms

This scipt has no interface.
Select all the fracture parts and execute by crtl-e.

It generates a rigidbodyCollection and assigns a mass proprtional to the volume of the part.

You can set the density in the upper part of the script.
I linked some wikipediapages with listings of popular desities.

As I currently don’t know how the calulcalated volume corresponds to the scene units, I also introduced a “divider”-variable. Just play arround until the mass assigned is something usefull.

maybe this helps.

Georg

Wow, thanks for the fast reply! I’ll play with it tonight!

ditto – thanks

The CalculateVolumeAndCenterOfMass script that is in the MAXScript Reference returns the volume in Cubic Generic Units. If your System Units are set to 1 Generic Unit = 1 inch, you would get cubic inches.

This http://www.deconstudio.net/down/assignMass.ms is basicly the same function but with UI and spinner to set density, doesn’t make a rbc to you, but after made that yourself just select the fragments and run the script

Cheers,
Timo

 rdg

and it converts to meters!
nice one.

Georg

You can also use Rigid Body Pro, which is an improved version of the default property editor.

Light