Macro to compute center of mass

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Macro to compute center of mass

Post by mario52 »

Hi

yes but the original macro:

Code: Select all

__Author__ = 'schupin'
https://github.com/chupins/FreeCAD-macr ... ss.FCMacro

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.
schupin
Posts: 476
Joined: Sun Jan 21, 2018 1:43 pm

Re: Macro to compute center of mass

Post by schupin »

The 0.5 released containing all SyProLei improvements has been "officially" merged !

Here is its changelog :
  • New: Code base, Requirement raised to Qt5.12+ and Python3 (FreeCAD 0.19)
  • New: Show mass of each solid
  • New: Start window docked or floating (can be set in Parameter Editor)
  • New: Selection matches up tree view or is sorted by name (can be set in Parameter Editor)
  • New: Option to save densities in document
  • Improved: FreeCAD alike Gui look and feel
  • Improved: Scaled color palette (from green to red) to colorify shapes
  • Improved: Visualising the displacement of centre of mass to the geometry
  • Improved: Internal tracking of units
  • Fix: Handling of groups and group objects
  • Fix: Handling of App::Link
  • Fix: Replaced deprecated Qt class
You can get it by updating the macro through the addon manager.
Last edited by schupin on Thu Apr 07, 2022 7:15 pm, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Macro to compute center of mass

Post by Kunda1 »

Congrats and thank you!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Macro to compute center of mass

Post by Syres »

schupin wrote: Thu Apr 07, 2022 12:55 pm The 0.5 released containing all SyProLei improvements has been "officially" merged !

Here is its changelog :
  • New: Code base, Requirement raised to Qt5.12+ and Python3 (FreeCAD 0.19)
I would like to point out that 0.20 FC is fully supported using Qt5.9.5 (there's more than just Windows involved) but seeing as the old version of the macro works fine for my requirements it's not a show stopper.
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Macro to compute center of mass

Post by chennes »

I've just submitted a PR to the FreeCAD-Macros repo -- the __Icon__ metadata points to an invalid URL. See https://github.com/FreeCAD/FreeCAD-macros/pull/127
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
SyProLei
Posts: 12
Joined: Tue Feb 15, 2022 9:43 am
Contact:

Re: Macro to compute center of mass

Post by SyProLei »

New Release: Version 0.5.8 is officially available.
Here is the changelog, apart from the internal code improvements:
  • Reinserted: Bounding Box
  • New: Setting to color spheres
  • New: Setting to change color maps
  • Rearranged GUI: Update calculation added, Total density added
  • Fix: Message Boxes could not be used when not running FreeCAD on primary screen in a multimonitor setup
  • Fix: More than one Mesh was not calculated correctly
We are part of the technology transfer program for lightweight engineering funded by German Federal Ministry for Economic Affairs and Climate Action.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Macro to compute center of mass

Post by Kunda1 »

SyProLei wrote: Tue Jun 07, 2022 4:24 pm New Release: Version 0.5.8 is officially available.
Nice!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
schupin
Posts: 476
Joined: Sun Jan 21, 2018 1:43 pm

Re: Macro to compute center of mass

Post by schupin »

For moderators : don't you think we could move this topic to "Announcements & Features" ?
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Macro to compute center of mass

Post by chrisb »

schupin wrote: Wed Jun 08, 2022 9:32 pm For moderators : don't you think we could move this topic to "Announcements & Features" ?
This whole discussion is much more than an announcement, so it is probably better if you make a new announcement with a link hereto where to discuss it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
SyProLei
Posts: 12
Joined: Tue Feb 15, 2022 9:43 am
Contact:

Re: Macro to compute center of mass

Post by SyProLei »

chrisb wrote: Thu Jun 09, 2022 6:54 am
schupin wrote: Wed Jun 08, 2022 9:32 pm For moderators : don't you think we could move this topic to "Announcements & Features" ?
This whole discussion is much more than an announcement, so it is probably better if you make a new announcement with a link hereto where to discuss it.
IMHO it would fit in "Python scripting and macros". From our project, we can announce the last big update:

New Release: Version 0.6.0 is officially available.
Here is the changelog:
- New: Masses are editable (a highly requested feature)
- New: Highlights the solid you are working on
- New: No duplicate entries when container and content selected concurrently
- New: Pie charts show density relation in combo box
- New: Legibility of text on colored combo box with WCAG21 1.4.6 Contrast (Enhanced) conformity
- Fix: A Part used as a container for meshes (e.g. .stl's) is recognized correctly
- Fix: Fixes for error and language handling, material editing, combo box and GUI size adjustment
We are part of the technology transfer program for lightweight engineering funded by German Federal Ministry for Economic Affairs and Climate Action.
Post Reply