FCMacro and moment of inertia of assembly
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
FCMacro and moment of inertia of assembly
Hi,
I have played with freecad all day and trying to get right values out.
The problem is that I have STEP file, that includes various bodes. Is there way to calculate moment of inertia from all the bodes combine? I know that you can fusion the parts, but if there is 26 small parts, it would be cool if I can calculate moment of inertia without fusion.
Other question is that is it possible to calculate moment of inertia from given point? I understood that inertia is calculated around center of mass, but sometimes I need to get inertia from different point.
Otherwise the FCInfo is really handy tool! Thanks Mario52!
Sorry for my bad English.
I have played with freecad all day and trying to get right values out.
The problem is that I have STEP file, that includes various bodes. Is there way to calculate moment of inertia from all the bodes combine? I know that you can fusion the parts, but if there is 26 small parts, it would be cool if I can calculate moment of inertia without fusion.
Other question is that is it possible to calculate moment of inertia from given point? I understood that inertia is calculated around center of mass, but sometimes I need to get inertia from different point.
Otherwise the FCInfo is really handy tool! Thanks Mario52!
Sorry for my bad English.
Re: FCMacro and moment of inertia of assembly
Hey @pinq. congrats on your first post and welcome to the forum. Please take a moment to review the forum guidelines so that you're on the 'same page' in regards to what we've all agreed to when posting on the forum. For example it's important to include you full FC info so we know exactly what you are talking about. Thanks in advance.
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
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
Re: FCMacro and moment of inertia of assembly
Hi @pinq.
FCInfo and fusing things together likely is the easiest and working solution. Everything else would likely include math, Python code and lots of time invested to do it.
FCInfo and fusing things together likely is the easiest and working solution. Everything else would likely include math, Python code and lots of time invested to do it.
Re: FCMacro and moment of inertia of assembly
Kunda1:
I'm talking about parts moment of inertia. I know that FC info gives inertia matrix without density( or it is 1(kg/dm?)). But I wonder is it possible to add some other coordinate to the body and calculate inertia around it. Example if I have box and now it calculates moment of inertia around center point or center of mass, but what I have to do that it would calculate moment of inertia around the corner of the box. I know that you can get parts inertia info with python console using(I think that FC info is using same command), but is it possible to define in python console from where to calculate moment of inertia.
triplus:
So it is possible to do for loop that fusios all the parts to one? You can't really select all and then fusion it ^^
I'm talking about parts moment of inertia. I know that FC info gives inertia matrix without density( or it is 1(kg/dm?)). But I wonder is it possible to add some other coordinate to the body and calculate inertia around it. Example if I have box and now it calculates moment of inertia around center point or center of mass, but what I have to do that it would calculate moment of inertia around the corner of the box. I know that you can get parts inertia info with python console using
Code: Select all
MatrixOfInertia
triplus:
So it is possible to do for loop that fusios all the parts to one? You can't really select all and then fusion it ^^
Re: FCMacro and moment of inertia of assembly
Sure.
I mean that is it possible to build a for loop in python that goes through all the parts and fusions them to one fusion. and how to you run python script?
Re: FCMacro and moment of inertia of assembly
Yes it is possible:
Code: Select all
import Part
import FreeCAD as App
shapes = []
for i in App.ActiveDocument.Objects:
try:
shapes.append(i.Shape)
except:
pass
if len(shapes) > 1:
base = shapes.pop(0)
try: # multiple arguments (FreeCAD 0.17 + OCC 6.9.0+/OCE 0.18+)
result = base.fuse(shapes)
except:
for i in shapes:
base = base.fuse(i)
result = base
Part.show(result)
Re: FCMacro and moment of inertia of assembly
Triplus:
That works Perfectly! thanks!
I made some modifications on FC info and now it shows also units of the moment of inertia and it also changes when length unit is changed.
I also added second matrix where you get moment of inertia with mass and right units.
If the FC info editor wants it, I can share this with him or if someone else wants it.
Still wondering how can you calculate inertia around some point.
By the way is it possible to set/add visually coordinate system that shows local coordinate and maybe center of mass?
That works Perfectly! thanks!
I made some modifications on FC info and now it shows also units of the moment of inertia and it also changes when length unit is changed.
I also added second matrix where you get moment of inertia with mass and right units.
If the FC info editor wants it, I can share this with him or if someone else wants it.
Still wondering how can you calculate inertia around some point.
By the way is it possible to set/add visually coordinate system that shows local coordinate and maybe center of mass?
Re: FCMacro and moment of inertia of assembly
You're welcome.
I guess best to ask the author for the opinion. As for the rest that are specific questions. I am sure it could be done but ATM i don't have much time to invest in thinking about this. Maybe somebody else will provide assistance.I made some modifications on FC info and now it shows also units of the moment of inertia and it also changes when length unit is changed.
Re: FCMacro and moment of inertia of assembly
hi pinq
thanks for appreciate my macro i am interested for you modification
your modification is good for this tread ? Mass Moment of Inertia for Crankshaft
mario
thanks for appreciate my macro i am interested for you modification
your modification is good for this tread ? Mass Moment of Inertia for Crankshaft
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.
My macros on Gist.github here complete macros Wiki and forum.