Get center of mass (and volume) for several objects

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Fatapatate
Posts: 1
Joined: Thu Jan 05, 2023 2:44 pm

Get center of mass (and volume) for several objects

Post by Fatapatate »

Dear all,

I would like to compute the center of mass (and buoyancy/volume) for a group of objects of different densities. As far as I see, the FC info macro only deals with single objects. Would there be a way to do that ? I was told (on Discord) to ping @Mario52.

Thanks in advance for the help!
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Get center of mass (and volume) for several objects

Post by mario52 »

Hi welcome

yes my macro give info with only one object

for more objects as you describe use this macro Macro_CenterOfMass Image

thanks

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
bambuko
Veteran
Posts: 2161
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Get center of mass (and volume) for several objects

Post by bambuko »

mario52 wrote: Fri Jan 06, 2023 10:43 am ...for more objects as you describe use this macro Macro_CenterOfMass Image
Excellent!
thank you @mario52
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Get center of mass (and volume) for several objects

Post by mario52 »

Hi bambuko

yes good macro by chupins

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply