FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Macro CenterOfMass

{{Macro |Name=Macro CenterOfMass |Description=Compute and show the center of mass for multiple solids. |Author=Schupins, SyProLei |Version=0.8.0 |Date=2024-12-17 |FCVersion=0.19 and above }}

Description

Gives the total mass and the location of the center of mass of selected objects. Different densities can be chosen for each object.

{{Codeextralink|https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Information/CenterOfMass.FCMacro}}

Usage

  1. Select one or more solids.
  2. Launch the macro.
  3. You\'ll have a window listing the solids. You can specify the density of your material in different unit systems or choose from predefined materials.

Available Options

  • Color the solids according to density.
  • Display the location of the center of mass.
  • Export and import masses, materials and densities (even if it\'s not a .csv file from the macro, but columns must be named accordingly).
  • Save densities in the document (remove them again when setting material to {{ComboBox|default}}).
  • You can change some preferences at Tools → Edit parameters → Preferences → Macros.

Script

You can download the macro from GitHub: Macro CenterOfMass.FCMacro

You can use this icon file as a toolbar icon:

Link

The forum discussion: Macro to compute center of mass

Version

Version / Date of merge

0.8.0 / 2025-01-06: Thanks to farahats9 for the contribution

  • New: Show Volume and Surface area
  • New: Calculate Moments of Inertia
  • Fix: Macro now works with the Assembly example in FreeCAD 1.0
  • Fix: Automatically select material for solids if it is already assigned by the new material system
  • Minor UI changes

0.7.6 / 2024-08-01: Prepare for major FreeCAD release

  • Fix: Make 0.22.0dev AssemblyExample work
  • Fix: BOM Import containing custom material
  • Fix: Support the new material cards
  • Fix: Changed or missing icons, version checks

0.7.3 / 2023-09-11:

  • New: Added buttons for Copy to clipboard
  • New: Scalable Vector Graphics icon
  • Fix: Compatibility for FreeCAD versions and web

0.7.0 / 2023-02-13:

  • New: Searchbar for solids
  • New: Reworked import function to improve external bill of materials (BOM) import with better input tolerance. Caption \"weight\" has to be changed to \"mass\" if you want to import mass from an old file export of the macro.
  • New: Mass can be set zero to exclude solid from calculation and visualization
  • Fix: Behaviour of default value spin and \"Apply to all\"
  • Fix: Preserve original solids color when \"New\" button pressed

0.6.0 / 2022-08-27:

  • 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

0.5.8 / 2022-05-31:

  • 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

0.5.0 / 2022-04-07: complete rewrite by s-quirin (SyProLei project at Saarland University)

  • 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.

0.4.1 / 2019-05-25: Last update with old requirements and GUI available in official repository

0.1.2 / 2018-11-10: Initial version from chupins merged in official repository


⏵ documentation index > Macro CenterOfMass

This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Macro_CenterOfMass.md

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub