SketchUcation Plugin Store

 

 

[Plugin] Center of Gravity v1.5 20130209

[Plugin] Center of Gravity v1.5 20130209

Postby TIG » Wed Mar 03, 2010 2:57 pm

CofG.PNG




Copyright 2010 (c) TIG
[Parts Based on TIG's 'Volume.rb' tools & some ideas from
Alexander Schreyer's 'GetCentroid.rb']
All Rights Reserved.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

###
CofGravity.rb
###

Center of Gravity and Related Properties Tools

Usage:

'Find C of G'

This works out a 3D Shape's Center of Gravity and other properties...
Select one 'Group*' or 'Group* of Groups*' [*or 'Component Instance']
= the 'Shape'.
From the Plugins sub-menu 'C of G...' run 'Find C of G'.
[There will be error messages if it's not a suitable selection]
It asks for the Shape's 'Density' and its Units, available
units are = kg/m3, tonnes/m3, g/cm3, tons/yd3, lbs/ft3.
The defaults are 1000 and kg/m3 [the density of water].
So for example, you'd enter 2323, kg/m3 for Sandstone.
The entered Density and its Units are remembered for that Model and
thereafter they are used for the dialog until they are changed.
It also asks for the Shape's 'ID' - the default is taken from the
selected Shape's 'name' - e.g. 'Beam3' - you can enter anything
you wish as an alternative. If it's an unnamed Group its default is
'Group'. If it's a component and the instance also has a name the
definition and instance names are combined - e.g. 'Beam3:Granite'
It processes the Shape [this might take a while - please be patient...]
It adds an overlaid element, named after the 'ID'; it also has a
description added.
This element displays the Shape's ID, Volume, Density and Weight.
It also indicates the Center of Gravity [CofG] & the 6 Axial
Suspension Points [SP].
To see the CofG use Xray mode as it's often placed 'internally'.
Do not edit the contents of a C of G element if it might be used later
in 'Composite' processes.
If parts have different densities then you should group them
separately and process them in turn - you can work out the
'Composite C of G' later...

'Composite C of G'

This works out the 'Composite C of G' of two or more already processed
'C of G' elements.
It is important that they remain in their original relationships and
alignments - moving them will return inaccurate results.
Note that these must have been made with the same units of density -
e.g. all in 'kg/m3': although the densities themselves may vary.
Select two or more premade 'C of G' elements.
From the Plugins sub-menu 'C of G...' run 'Composite C of G'.
[There will be error messages if they're not suitable selections]
It processes the selected C of Gs and then adds an overlaid element:
named 'CompoCofG' - its description includes the names of those
C of Gs that have been made composite.
This displays the Combined Shapes' 'Composite Weight', it also
indicates the Combined Center of Gravity [CofG] & the 6 Combined
Axial Suspension Points [cSP].
You can reuse a 'CompoCofG' in subsequent 'Composite C of G'
processes to find another combined C of G etc...

Note:
The C of G element has a special component placed at its 'C of G' -
called 'CofG'. Do not move, edit or delete it, as it might be used in
subsequent 'Composite C of G' processes.

###

Donations:
by PayPal to info @ revitrev.org.

Version:
1.0 20100303 First Release.
1.1 20100303 Accuracy improved. CompoCofG Description improved.
1.2 20100307 FR lingvo added by Pilou.
1.3 20100308 Missing require deB... added.
1.4 20100308 'calculate' becomes 'do_calculation'.
1.5 20100310 'composite' becomes 'do_composite'
Reworked to suit all Macs as well as PC.
ES lingvo added by Oxer.
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.
Please, register (free) to access all the attachments on the forums.
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Wed Mar 03, 2010 3:17 pm

Here's a Composite C of G, made from the three stone detailing pieces assembled - useful if they are of differing density materials and to be fixed together off site and then handled/lifted on site...
[Original CofG's hidden for clarity]
CompoCofG.PNG
Please, register (free) to access all the attachments on the forums.
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Wed Mar 03, 2010 4:08 pm

Here's v1.1 viewtopic.php?p=229401#p229401
Accuracy improved.***
CompoCofG description improved.

***The shape is now sampled at 0.5% of its height.
So if it's 1000mm high that is at 5mm c/c* - this should pick up most fine detail ins and outs in its section.
Ins and outs in plan are picked up anyway.
If you do have a weird shape that's say 'combed' in the vertical at very close centers* then you could turn the shape on its side to get an even more accurate CofG... BUT 99% of the time the default analysis will be sufficient - within a 'mm' or so - considering the variability of natural materials' densities I'd say that "sufficient is fit"...
:geek:
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby MALAISE » Wed Mar 03, 2010 7:12 pm

Interesting plugin, as far as I can use it in SketchyPhysics.

Thx TIG

MALAISE :thumb:
La Connaissance n'a de valeur que partagée
MALAISE
 
Posts: 620
Joined: Sun Apr 20, 2008 1:23 pm
Location: Cergy Pontoise FRANCE
Name: Pierre

Re: [Plugin] Center of Gravity

Postby TIG » Wed Mar 03, 2010 7:50 pm

It was actually made after a request by someone making historical stonework detailing. They needed to find the top Suspension-Point to add a lifting-eye so the delicate pieces can be lifted squarely and simply and bedded in place...
For that you need the Center of Gravity which gives you six axial SP's...
:ugeek:
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby Dave R » Wed Mar 03, 2010 7:52 pm

Very nice TIG. I didn't know I needed this plugin until now. Thanks. :thumb:
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 9238
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby alexschreyer » Wed Mar 03, 2010 10:31 pm

Thanks, TIG, for expanding into the third dimension. This is a great plugin.

Cheers, Alex
Author of "Architectural Design with SketchUp":
http://sketchupfordesign.com/
User avatar
alexschreyer
 
Posts: 137
Joined: Mon Jan 28, 2008 6:58 am
Location: Amherst, MA, USA
Name: Alexander Schreyer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby honoluludesktop » Wed Mar 03, 2010 10:33 pm

Wow, SU as a structural engineering engine?
User avatar
honoluludesktop
In Remembrance
 
Posts: 2219
Joined: Fri Sep 12, 2008 12:08 am
Location: Hawaii

Re: [Plugin] Center of Gravity

Postby utiler » Thu Mar 04, 2010 12:49 am

Dave R wrote:Very nice TIG. I didn't know I needed this plugin until now. Thanks. :thumb:


Like Dave, I didn't think i needed this until now.... Looks neat TIG!!
purpose/expression/purpose/....
User avatar
utiler
Top SketchUcator
 
Posts: 1935
Joined: Wed Nov 14, 2007 11:35 am
Location: Queensland, Australia
Name: Andrew
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby mitcorb » Thu Mar 04, 2010 1:24 am

This item could be very handy. Thank you.
I take the slow, deliberate approach in my aimless wandering.
User avatar
mitcorb
Top SketchUcator
 
Posts: 3429
Joined: Sat Mar 22, 2008 2:32 pm
Location: USA
Name: Tim
Operating system: Windows
SketchUp version: 8
License type: Free/Make
SketchUp use: architecture
Level of SketchUp: Intermediate

Re: [Plugin] Center of Gravity

Postby jonorman » Thu Mar 04, 2010 11:19 pm

I am out off words. This is a plugin I`ve been waiting but thought never would come.. I`m so greatfull :berserk:
jonorman
 
Posts: 63
Joined: Sun Jan 06, 2008 12:09 am

Re: [Plugin] Center of Gravity

Postby Pilou » Fri Mar 05, 2010 5:41 pm

Damned another very cool tool for ingeniery :enlight:
Last edited by Pilou on Fri Mar 05, 2010 9:16 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10212
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced


Re: [Plugin] Center of Gravity

Postby watkins » Fri Mar 05, 2010 6:25 pm

Forgot to say that TIG's volume calculator (+ density) and CofG calculator give you the complete story when reviewing loads.
watkins
 
Posts: 1367
Joined: Wed Nov 14, 2007 5:47 pm

Re: [Plugin] Center of Gravity

Postby DSG2k » Sun Mar 07, 2010 11:06 am

Vista and SketchUp 7.1.6860 . . .

Unzip of CoG plugin zip in the plugins folder resulted in a lot of overwrite requests (I just got your Manifold, too). I overwrote the older deBabelizer with the newer one.

Now on load a "Load Errors" window pops up, saying:

Error Loading File CofGravity.rb
undefined method `deBabelizer' for main:Object

And the plugin does not appear in the Plugin menu.

I don't know Ruby so I didn't actually poke at anything in the code, nor did I see anything obvious to me.

Just FYI.
DSG2k
 
Posts: 2
Joined: Sat Mar 06, 2010 11:44 pm

Re: [Plugin] Center of Gravity

Postby TIG » Sun Mar 07, 2010 11:23 am

Have you got a file called deBabelizer.rb in the Plugins folder.
If not then please put a copy of it in there***.
You must extract all of the files and sub-folders in a zip file keeping their sub-folders etc.
A good unzip application will do that for you.
Moving files manually leads to problems as they end up in the wrong place.
Unzipping directly into Plugins can cause problems as files seemingly overwritten are not !***
With Vista you are probably best firstly extracting everything into a folder on your Desktop [e.g. 'CofG_1.1'] and then use copy/paste on all of that folder's contents [unchanged], en mass into the Plugins folder...

***You are on Vista so I suspect you have some access-right problems with your Plugins folder :roll: :?:
The dreaded 'compatibility files' issue - it looks like you put the file into the folder but Vista 'protects you' by putting it into a parallel 'compatibility folder' so you don't actually get to find it, load it etc as it's not really there...
So I recommend you change the access-rights to the folder [properties] so you can write to it without problems...
The deBabelizer.rb file issued with all tools is the same file - you only need one copy in Plugins for any tool that uses it to load and to use it...
:geek:
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby Gaieus » Sun Mar 07, 2010 3:03 pm

Hm. This is a very interesting piece of plugin, TIG; thanks!

It immediately brings teaching into my mind - as how you can (for instance) explain the different vectors arising in a Gothic structure for instance. It would be (also) interesting to see how these centers of gravity can interact with each other after a structure is assembled.
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27725
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby Pilou » Sun Mar 07, 2010 3:53 pm

Why not put the Xray mode at the end of the process?
Because we can't see the CofG when this one is inside a volume ;)
Pilou
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10212
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Sun Mar 07, 2010 9:35 pm

Here's v1.2 viewtopic.php?p=229401#p229401
with FR lingvo file by Pilou...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Sun Mar 07, 2010 9:35 pm

Pilou wrote:Why not put the Xray mode at the end of the process?
Because we can't see the CofG when this one is inside a volume ;)
Pilou


You can't set Xray mode on your own ?
Many want just the top SP for lifting, and the weight - so CofG is secondary...
If you want it then you can Xray it...

Sorry if I sound cranky... long week and tomorrow's Monday [aaargh!] ;)

Vous ne pouvez pas définir le mode Xray sur vos propres?
Beaucoup veulent juste le SP haut pour le levage, et le poids - donc CofG est secondaire ...
Si vous le souhaitez vous pouvez le Xray ...

Désolé si j'ai l'air grognon ... longue semaine et demain lundi [aaargh!];)
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Sun Mar 07, 2010 9:41 pm

Gaieus wrote:Hm. This is a very interesting piece of plugin, TIG; thanks!
It immediately brings teaching into my mind - as how you can (for instance) explain the different vectors arising in a Gothic structure for instance. It would be (also) interesting to see how these centers of gravity can interact with each other after a structure is assembled.

It came from a PM request for a tool to find the perfect lifting point for a delicate piece of restoration stonework...
I added the composite tool to combine the CoG's and SP's of assembles of multiple or varying density units...
Any more ideas welcome... :?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby Pilou » Sun Mar 07, 2010 10:59 pm

No problem i can make the Xray mode by hands ;)

Another thing
Seems "Composite mode" don't works for me :o

object goup 1(without CoF), object goup 2(without CoF),
group 3 = Group1 + Group 2
Find Cof for group3 ok :enlight:

object goup 1(with CoF), object goup 2(with CoF)
group 3 = Group1 + Group 2
Composite group 3 not Ok :(
What I miss?
Last edited by Pilou on Mon Mar 08, 2010 11:30 am, edited 2 times in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10212
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Mon Mar 08, 2010 11:27 am

'Composite C of G' is for use only on existing C of G elements - it's used to get a combined C of G for them.
If you have an assembly of parts that all have the same density then you can just make one group of all of them and find the C of G of that one group.
BUT if you have an assembly of parts of different densities you'll need to find the individual C of G's of each of them: then you select these C of G elements [only these, nothing else] and use the Composite C of G tool on them.
You only need to use the Composite C of G tool on the C of G's of parts with different densities that could unexpectedly relocate the assembly's C of G - 'off center' for example... Otherwise group and get the one C of G...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby Pilou » Mon Mar 08, 2010 11:32 am

with different densities

haaaaaaaa :enlight:
THX! :fro:
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10212
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby chrisjk » Mon Mar 08, 2010 12:55 pm

I can't seem to get it to do anything on a Mac..
Chris
chrisjk
 
Posts: 278
Joined: Fri Dec 05, 2008 8:16 am
Location: Keston, England
Name: Chris Knight

Re: [Plugin] Center of Gravity

Postby TIG » Mon Mar 08, 2010 1:46 pm

chrisjk wrote:I can't seem to get it to do anything on a Mac..

Please explain a little more...
What can't you get to work ?
Open the Window > Ruby Console.
Select a group or component instance that has a volume - we are trying to find it's C of G !
Run the tool and answer the dialog's questions...
What happens / doesn't happen ?
What are the messages if any in the Ruby Console...
There is nothing different between a PC and a Mac for this tool [except 'PEBCAK' ;) ]
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby driven » Mon Mar 08, 2010 2:08 pm

Error: #<NoMethodError: undefined method `db' for CofGravity:Class>
/Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:153:in `calculate'
/Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:813
driven
Top SketchUcator
 
Posts: 1454
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 2013
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

Re: [Plugin] Center of Gravity

Postby Dave R » Mon Mar 08, 2010 2:15 pm

I just installed it on my MacBook and tried running it. It worked fine for me. Thank you TIG.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 9238
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby TIG » Mon Mar 08, 2010 2:27 pm

driven wrote:Error: #<NoMethodError: undefined method `db' for CofGravity:Class>
/Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:153:in `calculate'
/Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb:813

Have you got deBabelizer.rb in the Plugins Folder ?
This file is for translation and is used by many of my tools and it ships with each of them - although it's always the same file...
It should come with the zip and is installed into the same folder as CofGravity.rb ?
The error is because 'db' which is the local def of deBableizer in the class is failing to get defined...
:?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Center of Gravity

Postby driven » Mon Mar 08, 2010 3:15 pm

TIG wrote:Have you got deBabelizer.rb in the Plugins Folder ? :?



Hi Tig,

I only installed it to send you a report from another Mac, and am sure I used all of the correct instal procedures.

your other tools are still working (EEby.., Manifold, Vol..2) , after the CofG_1.2 instal (including deBalelizer.rb)

after the first (_1.2) Error, I replaced both files with the _1.1 files and had the same error.

I then tested all in the same drawing
EEby Rail--worked
Volume2 --worked
Manifold --worked
CofG --same error report (-1.2 re-installed from zip)

john
driven
Top SketchUcator
 
Posts: 1454
Joined: Fri May 01, 2009 11:50 pm
Name: John
Operating system: Mac
SketchUp version: 2013
License type: Pro
SketchUp use: engineering and mechanical design
Level of SketchUp: Intermediate

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012

Next

Return to Plugins

Who is online

Users browsing this forum: Google Feedfetcher, PElgin and 10 guests