sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Center of Gravity

    Scheduled Pinned Locked Moved Plugins
    183 Posts 41 Posters 297.6k Views 41 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      zstadel
      last edited by

      TIG please help!

      The Center of Gravity tool works great, but I can't get Composite C of G to work.

      I select two C of G groups,
      then I go to Extensions>C of G...>Composite C of G
      and it looks as though another group is generated, but it's empty

      Running SketchUp Pro 17.2.2554 on MacOS 10.13.4

      Thanks for any help you can offer
      Zack


      1.png


      2.png


      3.png

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Works fine for me !
        Your objects are quite small and have a small volume/weight.
        I'm wondering if the two CofG's combined have zero values ?
        If you retry with the Ruby Console open are there any error messages ?
        If you try with more appropriate settings in the dialog does it improve ?
        What version of CofG are you using ?
        The most up to date one from the PluginStore ??

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          auvergnemobois
          last edited by

          Capture.JPGHello, I have a problem With the same component, I get 2 different volumes and a different center of gravity depending on the position of the component ??

          j'ai un soucis. Avec le même composant, j'obtiens 2 volumes différents et un centre de gravité différent suivant la position du composant ??

          1 Reply Last reply Reply Quote 0
          • Dave RD Offline
            Dave R
            last edited by

            Change the axes on the rotated component so the blue axis is up. Make it unique before doing this so as not to affect the other one.

            Etaoin Shrdlu

            %

            (THERE'S NO PLACE LIKE)

            G28 X0.0 Y0.0 Z0.0

            M30

            %

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              What level of accuracy are you using ?
              If it's a solid it has no affect, but if your object is a non-solid [like this one] then it takes a series of horizontal slices through the form, and accumulates those areas to arrive at an approx volume - the more slices the more accuracy, however if it does slices that just miss some parts of some elements, then their assumed volume is less.
              It wasn't really intended for 'stick' assemblies, as potentially a significant part of some horizontal sticks could be overlooked.
              Laying your non-solid assembly 'flat' on the ground would probably give the most accurate result, since every 'stick' then gets sliced evenly and only a tiny sliver might get missed...
              Whereas 'solid' objects will have a set volume or even pseudo-solids will approximate well too...
              If you were to explode all of the sub-component parts and intersect them together, and then run a 'solid' tool on the main container, then you should find them to be solid, and the Entity Info volume is then used in CofG...
              Such 'solid' fixer tools include my 'SolidSolver' and thomthom's 'SolidInspector' - which are available from the SketchUcation PluginStore...

              TIG

              1 Reply Last reply Reply Quote 0
              • A Offline
                auvergnemobois
                last edited by

                i dont understand

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  @auvergnemobois said:

                  i dont understand
                  You don't understand what ?
                  Anything at all. or something specific ?

                  Since you seem to be French [?] here's a translation of my previous post...


                  What level of accuracy are you using ?

                  If it's a solid it has no affect, but if your object is a non-solid [like this one] then it takes a series of horizontal slices through the form, and accumulates those areas to arrive at an approx volume - the more slices the more accuracy, however if it does slices that just miss some parts of some elements, then their assumed volume is less.

                  It wasn't really intended for 'stick' assemblies, as potentially a significant part of some horizontal sticks could be overlooked.

                  Laying your non-solid assembly 'flat' on the ground would probably give the most accurate result, since every 'stick' then gets sliced evenly and only a tiny sliver might get missed...
                  Whereas 'solid' objects will have a set volume or even pseudo-solids will approximate well too...

                  If you were to explode all of the sub-component parts and intersect them together, and then run a 'solid' tool on the main container, then you should find them to be solid, and the Entity Info volume is then used in CofG...

                  Such 'solid' fixer tools include my 'SolidSolver' and thomthom's 'SolidInspector' - which are available from the SketchUcation PluginStore...


                  *Comme tu sembles être français [?] Voici une traduction de mon post précédent ...

                  Quel niveau de précision utilisez-vous?

                  Si c'est un solide, cela n'a aucun effet, mais si votre objet est un non-solide [comme celui-ci] alors il faut une série de tranches horizontales à travers le formulaire et accumule ces, pour arriver à un volume approximatif, plus de précision, cependant, si elle fait des tranches qui ne manquent que certaines parties de certains éléments, leur volume supposé est inférieur.

                  Il n'était pas vraiment destiné aux assemblages de «bâtons», car une partie importante de certains bâtons horizontaux pourrait être négligée.

                  Si vous posez votre assemblage non-solide à plat sur le sol, vous obtiendrez probablement le résultat le plus précis, car chaque «bâton» est alors tranchée uniformément et seul un petit ruban peut être manqué...

                  Alors que les objets "solides" auront un volume défini, ou même des pseudo-solides approcheront bien aussi...

                  Si vous deviez faire exploser toutes les parties du sous-composant et les croiser ensemble, puis exécuter un outil «solide» sur le conteneur principal, vous devriez les trouver solides et le volume d'informations d'entité est ensuite utilisé dans CofG...

                  Parmi ces outils de correction «solides», par example mon «SolidSolver» ou «SolidInspector» de thomthom, disponibles dans le PluginStore de SketchUcation...*

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    auvergnemobois
                    last edited by

                    Thank you "TIG", indeed I am very "french" !!
                    I had pretty much understood. I did a flat test (see picture, like this?)
                    Capture.JPG
                    and in the normal position. It's about the same.
                    On the other hand without the high and low frame. Because when they are there, it gives a bad result (597kg instead of 119.7kg !! and CofG bad !!!)
                    Capture.JPG2.JPG

                    it does not matter, because the high and low frames are the same weight, so it does not change the center of gravity.Maybe a story with the "z" axis (blue).

                    1 Reply Last reply Reply Quote 0
                    • sketchartist023S Offline
                      sketchartist023
                      last edited by

                      Hello TIG and others,

                      I have a question about the COG. I tried using it to get the COG information for a plane design and it only created a grouped stack of planes on Z axis top to bottom of the solid. I used a simple square solid and same effect. Here is a pic of what it creates. Not sure what I am looking at but I do find this useful too for other ideas Im working on for crafting lol.

                      Using: Sketchup v8 (i know....google version but I like it)
                      P.S. I did have this working once before, years ago.

                      Thanks if you can help 😄


                      TIGcogPlugineffect.png

                      1 Reply Last reply Reply Quote 0
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        It might be a v8 incompatibility: see here: https://sketchucation.com/forums/viewtopic.php?p=630803#p630803
                        Please ensure you are using the latest [compatible] version [perhaps copy it from your last working v8 Plugins folder ? I did PM you an older version at the start of this year ? I re-PM it if I can find it...].

                        Also run it with the Ruby Console open and report all of the error messages you get...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          TommyWoodbury
                          last edited by

                          Awesome plugin, thanks TIG! Any plans on making it 2019 compatible?

                          1 Reply Last reply Reply Quote 0
                          • Dave RD Offline
                            Dave R
                            last edited by

                            It works just fine in SketchUp 2019. And in SketchUp 2020.

                            Here's an example done in SU2020.
                            Screenshot - 5_28_2020 , 7_15_31 AM.png

                            Etaoin Shrdlu

                            %

                            (THERE'S NO PLACE LIKE)

                            G28 X0.0 Y0.0 Z0.0

                            M30

                            %

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              Mare99
                              last edited by

                              Hi, thanks for this plug-in, this is what I was looking for! But it dodn't work for me. I do everything like in your video but mistake "Selection NOT 2 C of G Groups!".
                              I am sure that I have two Groups (see in apdx). I try do the same with two Components and there is mistake : "Selection is NOT group!".
                              What I do bad? I have Sketchup 2018.
                              Thank you for help!
                              Jirka


                              Capture-22.jpg

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                @Mare99

                                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...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • Dave RD Offline
                                  Dave R
                                  last edited by

                                  From the screen shot it looks like you are selecting the geometry groups, not selecting the CofG groups as the instructions indicate.
                                  Screenshot - 11_13_2020 , 1_29_00 PM.png

                                  Screenshot - 11_13_2020 , 1_29_16 PM.png

                                  Etaoin Shrdlu

                                  %

                                  (THERE'S NO PLACE LIKE)

                                  G28 X0.0 Y0.0 Z0.0

                                  M30

                                  %

                                  1 Reply Last reply Reply Quote 0
                                  • A Offline
                                    antuan
                                    last edited by

                                    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

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      antuan
                                      last edited by

                                      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


                                      CoG differences.png

                                      1 Reply Last reply Reply Quote 0
                                      • TIGT Offline
                                        TIG Moderator
                                        last edited by

                                        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

                                        1 Reply Last reply Reply Quote 0
                                        • robertWanR Offline
                                          robertWan @TIG
                                          last edited by robertWan

                                          @TIG Should I look for an older version or is there any way to make it work in 8.0 Pro?CoG.png

                                          TIGT 1 Reply Last reply Reply Quote 0
                                          • TIGT Offline
                                            TIG Moderator @robertWan
                                            last edited by TIG

                                            @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 read

                                            dp=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

                                            robertWanR 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 9 / 10
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement