[Plugin] Center of Gravity
-
@unknownuser said:
This is exactly what I have been looking for I think. I just don't know how to program Ruby well enough, and I'm really unclear on the sketchup API object model. This rocks my whole world and maybe now I can finish that telescope.
I had such high hopes, but here there are a couple things that make it not work for me as is.
Here is a very simply example to illustrate the problem, and I am sure that woodworkers would be familiar. I corral parts into assemblies of sub parts and create components from them.
A side and a rail become a 'side assembly'.
Two side assemblies, a front, a back, and a bottom and a knob become a 'drawer'.
Three drawers become a 'drawer set'.
Two drawer sets, side by side go into a desk carcass.Drilling down into a 'side assembly' and selecting the rail part I run CoG.
Then I select the side part and run its CoG.
Then I select both CoGs and run their composite CoG, to get CoG of the 'side assembly' system as a whole.
Because the side assembly is mirrored on the other side of the drawer, it too gets a composite CoG in it.
But the COG for it is physically on the other side of the drawer.
Going up a level in the assembly hierarchy is the 'drawer' component I'd like to get the CoG of it. It is the composite of the individual drawer parts.the COG of the back
the COG of the front
the COG of the bottom
the COG of the knob
the COG of the left side (problem here)
the COG of the right side (problem here too)The problem is, the left and right side assemblies don't have their CoG exposed at the same level as the other 4 parts.
If I use the outliner to drag the left one out of the one instance to the containing instance (the first drawer for example)then it has the correct position for the left side, but then its not part of the component anymore. Opening the right side assembly reveals that it is indeed gone. So before moving anything to the containing instance, I must first make a copy of it for each instance it exists in. Then, I visit each of those instances, select one of them in outliner and move it up a level. That works pretty good. Everything then being at the same level, (drawer) a composite COG for the drawer can be made. But again, once made, if you use more than one drawer (the 'drawer set') then you have to copy the CompCOG object for as many drawers as you have and visit each drawer with outliner and move those up a level in order to make a second level 'drawer set' CompCOG. And likewise for the desk carcass which consists of two of those 'drawer sets'. As you can see, its pretty darned cumbersome, but it works, and its potentially better than I had before with spreadsheets.Of course, finding the CoG of a desk with drawers is trivial because who cares. It's on four legs and it sits stationary in an office. But a telescope is required to be balanced. There are mirror cells, draw tubes, eyepieces, bearings, gimbals, finder rings, finders, prisms, dew heaters, tracking motors, cameras and every imaginable part.
A warning when you pull something in from a saved component that has one of these CoG elements in it. Sometimes the embedded "CoG" crosshairs get renamed to "CoG#1" and "CoG#2" etc. The code, as it stands ignores them. To make them work, you need to replace them with "CoG" after you reload the saved component... which negates the whole reason for saving components in my estimation... I haven't gotten the hang of all that, especially when it comes to replacing complex components for simplified proxy components to speed up rendering.
The thing is, I really like Sketchup. It's intuitive, accurate enough for actually building things. I understand how it works out of the box. And every time I go back to TurboCad I feel like I want to take a shower. The learning curve on Autocad and SolidWorks (as if I could ever afford that) is so far beyond my capability If it were my job it would be a different story, but I'm not an architect or mechanical engineer.
When I have $400 - $4000 to kill, I spend it on tools for my woodshop. I think a lot of other Sketchup users are the same way. Spending $10-#20 on a great script is not a problem though. I drop that kind of dough in a heartbeat down at the home improvement store every week.
So TIG, if you can figure out my ramblings (sorry, I am like that) I would be willing to donate $20 or more and I would urge others to contribute to make it worth your while too.
-
Bill
Sorry not to reply before - somehow I missed your post.
Could you explain why you want to find the CoGs of your joinery items and how you perhaps need to combine them, and ultimately how you'll use them all to help you.
Don't get hung up on what the current tool does - just say what some new 'wonder-tool' would do for you - a step-by-step explanation of how you might use it [without worrying about technicalities, grouping, sub-componenting etc too much...] would be good...
Then I can have a think about how I might help you further... -
Hello,
I'm sorry but my english is véry bad! (normal, i'm french!
I have just a question about the plugin CofG (that was a wonderfull plugin.. thanks for this work!)
I have SU8pro.
I have installed the plugin and it work marvelously for some of calcul of center of gravity, and weight.
But when the pieces was littel... it doesn't work. because there is a problem with the units of calcul of density and cube metter..
When the pieces was smaller then 0.001 cube meter the calcul of the weignt was 0.0kg...
then when i use the composite CofG... the adition was wrong too...
Look at the picture, cube 808080mm was the same weight ten Ă 100100100mm with the same density.So is it possible to change the units of the calcul?
Thanks for the answers, and so sorry for my english...Best reggards
Stef
-
You could use 'g/cm3' as the density.
You'll then get a result you can use
1 g/cm3 == 1000 kg/m3 !Vous pourriez utiliser 'g/cm3' comme la densité.
Vous aurez alors obtenir un résultat que vous pouvez utiliser
1 g/cm3 == 1000 kg/m3! -
Hello TIG!
Thanks for this logic answers.... I haven't see that I can change the units of density...
i'm so stupid.... I have loose a day to find how it works!!
Thanks for your job!!
Just a think, I have installed sketchyphysic 3.2 to try to find something for de CofG... and to move my model (it was a spécial door for boat)..
But when Sketchyphysic was installed, your plugin CofG run correctly, but not the composite... when i run it, nothing happend... I have unistalled Sketchyphysic, and it works...
Thats strange!Other think, my door is arround 25 group in an other group. when I run CofG, the résult was really haevy (arround 320kg) and the center of gravity looks wrong, and when a run CofG for each group, and i Composite after, i looks like better. (117 kg thats reallist)
Center of gravity looks better too.All groups are in the same matérial Steel arround 7800kg/cu.m
I dont understand why?
Thanks for your answers.!
Best reggards
Stef -
Very, very good plugin!!!
I can't even think how to calculate that kind of stuff, that's just pro.
-
@stefanka said:
Hello TIG!
Thanks for this logic answers.... I haven't see that I can change the units of density...
i'm so stupid.... I have loose a day to find how it works!!
Thanks for your job!!
Just a think, I have installed sketchyphysic 3.2 to try to find something for de CofG... and to move my model (it was a spécial door for boat)..
But when Sketchyphysic was installed, your plugin CofG run correctly, but not the composite... when i run it, nothing happend... I have unistalled Sketchyphysic, and it works...
Thats strange!Other think, my door is arround 25 group in an other group. when I run CofG, the résult was really haevy (arround 320kg) and the center of gravity looks wrong, and when a run CofG for each group, and i Composite after, i looks like better. (117 kg thats reallist)
Center of gravity looks better too.All groups are in the same matérial Steel arround 7800kg/cu.m
I dont understand why?
Thanks for your answers.!
Best reggards
StefSketchy Physics doesn't uses center of mass/gravity. It just uses the bounds center
-
Hi,
I have just installed CofG in Trimble Sketchup 8 and it works fine.
However I have a special need. I am designing a houseboat, and I need to calculate the global center of mass of it.
For the parts that are made with materials, like walls, floors, the plugin is ok. But for components that I have added as a whole, like a diesel genset, or a washing machine, I do not know the equivalent density.
What I would like to do is to assume the component is homogeneous, and to assign it a weight.
I have studied how CofG works, and I noticed that each CofG group is given 2 attributes : volume and weight. I have tried to edit the weight attribute, to see what happens. Of course, the text associated with it must also be manually edited.
What surprises me is that whenever I change the weight attribute, the composite calculation command fails. It says "calculating", but produces nothing : no new CofG object is created. What prevents it from working?
Actually what I would like is an additional command with a new dialog to calculate the CofG: instead of entering the density, I would like to be able to enter the total weight, and have the command place the G point at the center of mass of the group or component. In other words, once the volume is calculated, and the center of mass found, assign the weight attribute with the weight specified in the dialog.
Is this feasible?
Jean-Marc -
Hello, I have applied all the proper steps but the Composite C of G but nothing happens :<
Its not working, I selected two CofG groups but after I applied Composite C of G onlyCofG Composite:
Weight= 0.0 kgappears and it is enclosed in a box when you click it, can you help interpret what this means? Thank you, ill upload the photo
-
It is NOT the Composite tool that's the issue.
Because if you notice, the two 'motor's' CofG's have 0 weight returned anyway !
This is probably because the two selected objects are too complex, and are not 'solids' and probably have internal partitions, single planes etc.
If you make a simple grouped solid cylinder the same size as the 'motor' you should get a proper a weight and a true CofG for it...
Of course none of this is definite because you haven't supplied the SKP in question...
-
Here's v1.6
http://sketchucation.com/forums/viewtopic.php?p=229401#p229401
1.6 20130209 Intersection gaps caused by tiny facets healed to improve accuracy.
Volume is now exact if it's a solid or best approximation otherwise.
Accuracy option added: default is 1%, note that making if lower will dramatically slow things down, more that 5% could be inaccurate on some complex forms.
The lingvo files have been updated to suit. -
I did not expect to see a tool like this available for SU. TIG, you continue to astound and amaze us. Thanks!
-
Hi TIG,
Great plugin, but I'm having a bit of a trouble getting Composite C of G to work. It is probably just user error!
I select two previously made CofG groups (different group names, same density). I get no errors, but no Composite C of G either. Ruby console has the following:
Error: #<NoMethodError: undefined method
entities' for nil:NilClass> /Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:649:in
do_composite'
/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:116:ininitialize' /Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:816:in
new'
/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:816
/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:649:in `call'
/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/CofGravity.rb:649I'm on a MacBook Pro running 10.7 using SketchUp 8 and CofG v 1.6. I'm also in the process of learning Ruby, but am as yet a novice, especially Ruby with SketchUp.
I know you have probably moved on to other things by now, but a hint on any changes would be great!
thanks,
mark -
Are the CofG groups intact with all of their contents etc as originally made.
Maybe there's some text missing ?
Can you post the SKP ?
Or PM it... -
Tig
CofG has become a MUST Have for me lately. I am starting to map out the CofG for a few hundred groups and components on 2 major aviation models. Grouping helps but I have a serious need for an improvement to CofG.
Some background......
To compute the CofG for an airplane, I need to locate each of the components CofG in relation to a common point of origin, called the "Datum Zero" line, which is almost always the nose tip, but could be offset fore or aft of that. Multiply the distance from that origin to the CofG for that component gives a moment arm value. Sum all the moments values and divide by the total weight gives the airplanes center of gravity, which has to lie very close to the center of lift.Then calculating the variables of fuel, payload, etc and the control surfaces ability to vary the center of lift gives me the operating envelope, or an indication of what needs to be moved to put the CofG and CofLift within the operating envelope.
Right now I have to measure the offset of the CofG from the components most forward point, and the distance of that forward point from Datum Zero. Those values, and the components weight go into an Excel spreadsheet. A significant problem is when my components bounding box is rotated away from normal, making the finding of the most forward point difficult.
Grouping helps but I have a serious need for an improvement to CofG.
Would it be possible to map the components CofG offset (X-Y-Z) from the SU axis origin point, as an option?
I can then place the models Datum Zero on the SU Axis Origin point, and it would vastly simplify my task. I would only need to enter the offset and weight into my Excel sheet, and not have to measure anything.
Thanks.
-
Have you considered moving the axes of your components ?
Select an instance and right-click context-menu Change Axes...
That way you can ensure that all axes are sensible arranged, making other tasks easier...
I also wrote a tool to move all selected components' axes to the model-origin...
Perhaps using that will do what you want ?
-
Hadn't thought of that, but, in my case it won't work. I have many of the same component strung out along the length and breadth of the aircraft. These would be skin panels, frames, passenger seats, washrooms, etc, as well as structural parts and equipment. So moving the components origin to the SU origin is unworkable. It would also make the bounding boxes so large that it would be a visual nightmare trying to select individual components with all the overlapping bounding boxes. It would also require me to change the comps axis position every time I moved the comp.
Also, changing the comps local axes point won't help either, especially when the comp is rotated a bit in final placement. Regardless of rotation, I will still need to measure every components location of its most forward point from Datum Zero and then measure its CofG offset from that point as well.
If your CofGravity.rb could measure the distance from SU origin in X-Y-Z (Green-Blue-Red) to the comps computed CofG then that would eliminate any measuring and would give me a more accurate moment offset.
CATIA does this moment offset (distance from Datum Zero to CofG of part) automatically and generates the moments table as the parts are defined (as solids with material defined). The table is dynamic, so if parts are moved, the CofG of the airplane is updated in real time, but then CATIA is purpose designed for aerospace and costs $35,000++ a seat. A bit too rich for my blood.
-
Can't you use Xray mode, then a tool like my 'Coords Text Tag from Datum' http://sketchucation.com/forums/viewtopic.php?p=284829#p284829to add the XYZ in the model, set from the Origin as the datum OR you could set any other 3d point as the datum... The tag can be relocated to any point and gives the current XYZ values, you can also tailor how the numbers are shown...
-
Looks like it should work for me.
I'll try it later today or tomorrow and report back here. -
Tig Re: Coords....
It seems to do what I need, but I have a few questions about some of the dialogs, which I will post in Coords post.
All I need to say here is, Please think about combining the XYZ coords part with the CofGravity Ruby
I would think that the hard part of coding has been done, and all you really need do is an integration and dialog box changes. I know it is not a trivial task, but a lot of the hard work has been done.
Advertisement