[Plugin] Center of Gravity
-
Are you sure that the selection is of two groups of CofG text?
Select one and look at Entity Info...If you have copied one it'll report as two versions of the same thing...
The geometry should be unique instances, as should the text group...
Please edit one of them, make no changes and then close it immediately - this will have the affect of making the two into unique versions - perhaps that's the issue and it'll fix it...
I just tried it and it works OK - provided that they are two unique things...
If not, than please post a simple SKP containing them and I'll investigate further...
-
From the screen shot it looks like you are selecting the geometry groups, not selecting the CofG groups as the instructions indicate.
-
Great job TIG, really useful plugin. I have a doubt, though. When there are many nested groups/components but all of them are made from the same material so density is constant across all of them, (e.g. a piece of furniture made from same wood) can the plugin directly find the COG of the final group containing all subgroups/subcomponents? Or should I find COG of every object separately and join them toghether with "Composite COG" tool?
In the overview of the plugin is explained that you can select "a group of groups" and in fact I see that I can select the outer object and I get a result, but then the calculated weight is wrong, sometimes just a bit, others almost double than real, depending on the model. And if that matters, as far as I know all subcomonents/subgroups are solids. I don't know if this is because the plugin is not intended to work this way or it is because of a model issue or any other mistake in my workflow. Thanks in advance for your help.
Antonio -
Hi again, I will add an example of what I asked in my last post.
In this model I have copied twice the same group, made out from 7 subgroups/subcomponents (all of them solids, with a volume I can see in the entity info).
If I select the "group of groups/components" (right) and run CoG I obtain a weight of 38kg.
If I run CoG for each of the subgroups or subcomponents separately and then run Composite CoG from the obtained CoG entities, (left) I obtain a weight of only about 13 kg.
What is the reason for that? Can't this plugin be used for a group of groups, even if the density is the same for all of them?
Thank you for any help you can give me.
Antonio
-
If the selected group is a solid then it's straightforward to find its volume and the only convolution is the 'slicing' of the form to calculate its CofG.
But a collection of solids does not form a solid - look at 'entity info' to confirm this.
A solid contains only geometry, and that needs to be suitably set up.You can select a number of solids [best copied to the side] and then simply combine them into a single solid using the Solid Tools 'Union' command.
If the parts all have the same density then the returned CofG volume and weight should be correct and the Combined CofG is not needed at all... -
@TIG Should I look for an older version or is there any way to make it work in 8.0 Pro?
-
@robertWan
v8 is very old, and unsupported by many newer extensions, but CofG should work with it...
It appears the '.round()' function isn't working...
I don't have that version installed to test it...
I can't find an earlier version without the round code in it...
You could try editing the RB file with Notepad++ so the
lines#379 to #390, which readdp=4 volume=0 ### ### convert it to units matching density... while volume == 0 volume=(vol * 0.000016387064).round(dp) if @units=~/\/m3/ volume=(vol * 16.387064).round(dp) if @units=~/\/cm3/ volume=(vol * 0.000021433471).round(dp) if @units=~/\/yd3/ volume=(vol * 0.000578703704).round(dp) if @units=~/\/ft3/ dp+=1 end dp-=1
becomes this edited version to avoid any arguments for the round method.
#dp=4 #volume=0 ### ### convert it to units matching density... #while volume == 0 volume=(vol * 0.000016387064).round if @units=~/\/m3/ volume=(vol * 16.387064).round if @units=~/\/cm3/ volume=(vol * 0.000021433471).round if @units=~/\/yd3/ volume=(vol * 0.000578703704).round if @units=~/\/ft3/ #dp+=1 #end #dp-=1
restart SketchUp and see if that helps...
-
@TIG said in [Plugin] Center of Gravity:
restart SketchUp and see if that helps...
Unfortunately it didn't help.
Robert
-
I missed some 'dp' variables [sorry]
line#393
changevolTxt = sprintf("%.#{dp}f", volume)
to read
volTxt = sprintf("%.4f", volume)
line#409
changeweight = (volume * @density).round(dp)
to read
weight = (volume * @density.round)
and line#417
changeweightTxt = sprintf("%.#{dp}f", weight)
to read
weightTxt = sprintf("%.4f", weight)
I think that's all of them !!
-
Works!
I am extremely grateful.
Thank you.Robert
Advertisement