Macro CenterOfMass: Difference between revisions
No edit summary |
m (<!--T:26--> duplicated) |
||
(36 intermediate revisions by 5 users not shown) | |||
Line 3: | Line 3: | ||
<!--T:5--> |
<!--T:5--> |
||
{{Macro |
|||
⚫ | |||
|Name=Macro CenterOfMass |
|||
⚫ | |||
|Author=schupin |
|||
|Version=0.4.2 |
|||
|Date=2019-06-09 |
|||
|FCVersion=0.18 |
|||
|Download=Download the [https://forum.freecadweb.org/download/file.php?id=84270 Macro_CenterOfMass_Icon] package and extract it in the same directory of the macro. |
|||
}} |
|||
==Description== <!--T:6--> |
==Description== <!--T:6--> |
||
Line 10: | Line 18: | ||
Gives the total mass and the location of the center of mass resulting of multiple objects selected. Different densities could be chosen for each object. |
Gives the total mass and the location of the center of mass resulting of multiple objects selected. Different densities could be chosen for each object. |
||
</translate> |
</translate> |
||
{{Codeextralink|https://raw.githubusercontent.com/ |
{{Codeextralink|https://raw.githubusercontent.com/chupins/FreeCAD-macros/SC_Branch/Information/CenterOfMass.FCMacro}} |
||
[[File:Macro CenterOfMass 01.png |
[[File:Macro CenterOfMass 01.png]] |
||
⚫ | |||
<translate> |
<translate> |
||
<!--T:8--> |
<!--T:8--> |
||
The |
The values (mass and center of mass) results can be saved in a spreadsheet |
||
</translate> |
</translate> |
||
[[File:Macro CenterOfMass 02.png|left]] |
[[File:Macro CenterOfMass 02.png|left]] |
||
Line 23: | Line 30: | ||
<translate> |
<translate> |
||
== |
==Usage== <!--T:4--> |
||
<!--T:9--> |
<!--T:9--> |
||
Line 35: | Line 42: | ||
<!--T:12--> |
<!--T:12--> |
||
icon file download and paste in |
icon file download and paste in a sub directory named CenterOfMass in the macro directory |
||
<!--T:18--> |
|||
toolBar icon |
|||
</translate> |
</translate> |
||
[[File:Macro_CenterOfMass.png]] |
|||
[[File:SaveIcon.png]] [[File:CdgIcon.png]] [[File:ComputeIcon.png]] [[File:ImportIcon.png]] [[File:MaterialIcon.png]] |
|||
[[File:Macro_CenterOfMass_save.png]] [[File:Macro_CenterOfMass_com.png]] [[File:Macro_CenterOfMass_compute.png]] [[File:Macro_CenterOfMass_import.png]] [[File:Macro_CenterOfMass_material.png]][[File:Macro_CenterOfMass_colorify.png]] |
|||
Download the [https://forum.freecadweb.org/download/file.php?id=84270 Macro_CenterOfMass_Icon] package and extract it in the same directory of the macro. |
|||
⚫ | |||
'''Macro CenterOfMass.FCMacro''' |
'''Macro CenterOfMass.FCMacro''' |
||
Line 47: | Line 62: | ||
</translate> |
</translate> |
||
[https:// |
[https://github.com/chupins/FreeCAD-macros/blob/SC_Branch/Information/CenterOfMass.FCMacro Macro CenterOfMass.FCMacro] |
||
<translate> |
<translate> |
||
==Link== <!--T:14--> |
==Link== <!--T:14--> |
||
Line 56: | Line 72: | ||
==Version== <!--T:16--> |
==Version== <!--T:16--> |
||
<!--T:26--> |
|||
0.4.2 / 2019-06-09 : - check last version number on github and popup if not last version |
|||
- automatic update of show CdG (if it exists) when densities are changed |
|||
- bug correction when changing radius |
|||
<!--T:27--> |
|||
0.4.1 / 2019-05-25 : add default density button, sphere cursor, change window behavior, correct a container part issue |
|||
<!--T:17--> |
<!--T:17--> |
||
0.3.6 / 2019-05-22 : Radius of pheres representing centers of mass of each solid depends on each masses |
|||
<!--T:22--> |
|||
0.3.5 / 2019-05-21 : Arrays and clone correction |
|||
<!--T:23--> |
|||
0.3.4 / 2019-03-18 : minor |
|||
<!--T:24--> |
|||
0.3.3 / 2019-03-17 : loading .csv corrections |
|||
<!--T:25--> |
|||
0.3.2 / 2019-03-14 : add a colorify push button to add color on shapes depending on their density |
|||
<!--T:21--> |
|||
0.3.0 / 2019-03-03 : python 3 compatibility |
|||
<!--T:19--> |
|||
0.2.3 / 2018-11-22 : new icon name |
|||
<!--T:20--> |
|||
0.1.2 / 2018-11-10 : xx |
0.1.2 / 2018-11-10 : xx |
||
</translate> |
</translate> |
Revision as of 09:54, 23 May 2020
Description |
---|
Gives the Center of mass multiple of multiple objects selected. Macro version: 0.4.2 Last modified: 2019-06-09 FreeCAD version: 0.18 Download: Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro. Author: schupin |
Author |
schupin |
Download |
Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro. |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
0.4.2 |
Date last modified |
2019-06-09 |
FreeCAD Version(s) |
0.18 |
Default shortcut |
None |
See also |
None |
Description
Gives the total mass and the location of the center of mass resulting of multiple objects selected. Different densities could be chosen for each object.
Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro
# This code is copied instead of the original macro code # to guide the user to the online download page. # Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki # or if the RAW code URL is somewhere else in the wiki. from PySide import QtGui, QtCore diag = QtGui.QMessageBox(QtGui.QMessageBox.Information, "Information", "This macro must be downloaded from this link\n" "\n" "https://raw.githubusercontent.com/chupins/FreeCAD-macros/SC_Branch/Information/CenterOfMass.FCMacro" + "\n" "\n" "Quit this window to access the download page") diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) diag.setWindowModality(QtCore.Qt.ApplicationModal) diag.exec_() import webbrowser webbrowser.open("https://raw.githubusercontent.com/chupins/FreeCAD-macros/SC_Branch/Information/CenterOfMass.FCMacro")
File:Macro CenterOfMass 01.png
The values (mass and center of mass) results can be saved in a spreadsheet
Usage
Select the object(s)
Run the macro
Script
icon file download and paste in a sub directory named CenterOfMass in the macro directory
toolBar icon
File:Macro CenterOfMass save.png File:Macro CenterOfMass com.png File:Macro CenterOfMass compute.png File:Macro CenterOfMass import.png File:Macro CenterOfMass material.pngFile:Macro CenterOfMass colorify.png
Download the Macro_CenterOfMass_Icon package and extract it in the same directory of the macro.
Macro CenterOfMass.FCMacro Download in Github
Link
the forum discussion Macro to compute center of mass
Version
0.4.2 / 2019-06-09 : - check last version number on github and popup if not last version - automatic update of show CdG (if it exists) when densities are changed - bug correction when changing radius
0.4.1 / 2019-05-25 : add default density button, sphere cursor, change window behavior, correct a container part issue
0.3.6 / 2019-05-22 : Radius of pheres representing centers of mass of each solid depends on each masses
0.3.5 / 2019-05-21 : Arrays and clone correction
0.3.4 / 2019-03-18 : minor
0.3.3 / 2019-03-17 : loading .csv corrections
0.3.2 / 2019-03-14 : add a colorify push button to add color on shapes depending on their density
0.3.0 / 2019-03-03 : python 3 compatibility
0.2.3 / 2018-11-22 : new icon name
0.1.2 / 2018-11-10 : xx