CheckGeometry tool now with advanced shape content

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
TheMarkster
Posts: 2048
Joined: Thu Apr 05, 2018 1:53 am

CheckGeometry tool now with advanced shape content

Post by TheMarkster » Fri Sep 11, 2020 9:48 pm

CheckGeometry tool in Part workbench now includes advanced information in the Shape Content panel. This includes information such as volume, mass, length, area, center of mass, among other things, depending on the type of shape object being checked. This screenshot is from checking a default Part workbench Cube object:
Snip macro screenshot-857f7f.png
Snip macro screenshot-857f7f.png (27.79 KiB) Viewed 699 times
I don't know what some of that stuff means, but I'm sure someone does.

Advanced shape content can be disabled in the settings:
Snip macro screenshot-2ae005.png
Snip macro screenshot-2ae005.png (27.08 KiB) Viewed 699 times
This is when checking a sketch containing a single arc of circle, end points constrained to the horizontal axis 180 degrees apart, centered at the origin with radius 5mm:
Snip macro screenshot-920c07.png
Snip macro screenshot-920c07.png (28.56 KiB) Viewed 699 times
And this the same sketch, but now it's a full circle instead of the semi-circle:
Snip macro screenshot-8a8ad3.png
Snip macro screenshot-8a8ad3.png (27.77 KiB) Viewed 699 times
Notice how the isClosed property is true for one and false for the other. And also the center of mass is different for the arc since all of the mass of the object is above the x axis.
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: CheckGeometry tool now with advanced shape content

Post by sgrogan » Fri Sep 11, 2020 10:07 pm

TheMarkster wrote:
Fri Sep 11, 2020 9:48 pm
mass,
Where is density pulled from? Looks like 1 by default.
"fight the good fight"
TheMarkster
Posts: 2048
Joined: Thu Apr 05, 2018 1:53 am

Re: CheckGeometry tool now with advanced shape content

Post by TheMarkster » Fri Sep 11, 2020 10:11 pm

It's done with python and produces whichever value gets returned from:

Code: Select all

obj.Shape.Mass
where obj is the object being checked.
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: CheckGeometry tool now with advanced shape content

Post by sgrogan » Sat Sep 12, 2020 3:25 pm

TheMarkster wrote:
Fri Sep 11, 2020 10:11 pm
It's done with python and produces whichever value gets returned from:
Thanks, but I still don't understand.
For example a default Part Cube.
Do I need to use an Arch or FEM object that supports material, or add a property with dd Workbench to the cube?
I think I'm missing something very fundamental.
"fight the good fight"
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: CheckGeometry tool now with advanced shape content

Post by vocx » Sat Sep 12, 2020 4:01 pm

sgrogan wrote:
Fri Sep 11, 2020 10:07 pm
Where is density pulled from? Looks like 1 by default.
I think it just uses the default units.

For example, a cube of 1 mm x 1 mm x 1 mm (unit length in each direction), that is, 1 mm^3, corresponds to one 1 unit volume, and has a mass of 1 unit mass, which is 1 kg. So the basic density would be 1 kg/mm^3.

Code: Select all

>>> App.Units.Mass
Unit: kg (0,1,0,0,0,0,0,0) [Mass]
>>> App.Units.Volume
Unit: mm^3 (3,0,0,0,0,0,0,0) [Volume]
>>> App.Units.Density
Unit: kg/mm^3 (-3,1,0,0,0,0,0,0) [Density]
You could define another parameter to hold a custom density and calculate the mass in that way.
Last edited by vocx on Sun Sep 13, 2020 4:21 pm, edited 2 times in total.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
TheMarkster
Posts: 2048
Joined: Thu Apr 05, 2018 1:53 am

Re: CheckGeometry tool now with advanced shape content

Post by TheMarkster » Sat Sep 12, 2020 4:50 pm

At this time CheckGeometry does not calculate any of that information. It only reports what's already there, which can be found by examining the object in the python console. For example, the mass is reported as what can be found by entering obj.Shape.Mass in the python console. The same is true for the other properties reported, such as Area, Volume, Length, etc. if somebody knows a way in python to check for the material associated with an object to get its density I can add some code to CheckGeometry to find a calculated mass and report that.
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
User avatar
GlouGlou
Posts: 2620
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: CheckGeometry tool now with advanced shape content

Post by GlouGlou » Sat Sep 12, 2020 5:16 pm

nice improvement. easy to use. ;)
User avatar
Kunda1
Posts: 8710
Joined: Thu Jan 05, 2017 9:03 pm

Re: CheckGeometry tool now with advanced shape content

Post by Kunda1 » Sat Sep 12, 2020 6:13 pm

Nice this needs to be added to the 0.19 release notes
Along with Macro Recent history list
Great work TheMarkster!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
jmaustpc
Posts: 10367
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: CheckGeometry tool now with advanced shape content

Post by jmaustpc » Sun Sep 13, 2020 2:12 am

TheMarkster wrote:
Fri Sep 11, 2020 9:48 pm
This is when checking a sketch containing a single arc of circle, end points constrained to the horizontal axis 180
Seems strange that 2d objects have a mass. On my phone just now, so no idea if that is being wrongly reported in checkgeometry or if it's there in the object itself.
polymer
Posts: 272
Joined: Fri Sep 12, 2014 8:49 am

Re: CheckGeometry tool now with advanced shape content

Post by polymer » Mon Sep 14, 2020 3:33 am

What about projected surface area in X, Y and Z direction?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest