sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] Center of Gravity

    已排程 已置頂 已鎖定 已移動 Plugins
    183 貼文 41 Posters 307.5k 瀏覽 41 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • TIGT 離線
      TIG Moderator
      最後由 編輯

      But how would you determine the individual part's material and density/weight ?
      You need the composite of several CofGs to do that - since a very heavy part will change the CofG in the combined assembly.
      If all of the parts use the same material, then you just need to make a single 'group' of all of them, and then create one CofG of that one object. That way you can 'group' parts with the same material, get their containers' CofGs, and then combine those into a 'Combined CofG' - properly reflecting the weight-distribution...

      TIG

      1 條回覆 最後回覆 回覆 引用 0
      • NemesisN 離線
        Nemesis
        最後由 編輯

        @tig said:

        But how would you determine the individual part's material and density/weight ?
        You need the composite of several CofGs to do that - since a very heavy part will change the CofG in the combined assembly.

        Yeah, now I understand.

        @unknownuser said:

        If all of the parts use the same material, then you just need to make a single 'group' of all of them, and then create one CofG of that one object. That way you can 'group' parts with the same material, get their containers' CofGs, and then combine those into a 'Combined CofG' - properly reflecting the weight-distribution...

        Just tried it, and it worked like a charm. Thank you.

        One more question about accuracy. Bigger value means more accuracy or vice versa?

        1 條回覆 最後回覆 回覆 引用 0
        • TIGT 離線
          TIG Moderator
          最後由 編輯

          The default accuracy of 1.0 - which is sufficient for most analyzed forms.
          It means the form is sampled in 1/100 == 100+2 steps.
          A higher number means fewer steps, and an even smaller number means even more steps.
          The number of steps affects the time taken to process the form - a bigger number == less time.
          If your form is a solid or quite a simple them the number is of little relevance as the reported CofG weight is unlikely to vary.
          If the form is more complex, then a higher number gives fewer steps [say 50 = 50/100 == 2+2 steps], so the reported weight may well be less than the one from the smaller value [say 1/100 == 100+2 steps].
          But the chances are that 1.0 will be fine almost every time...

          TIG

          1 條回覆 最後回覆 回覆 引用 0
          • NemesisN 離線
            Nemesis
            最後由 編輯

            I made a test with my base frame. All parts are solids, with density 7800 kg/m3. Accuracy for both tests is = 1.

            For the first one, I've determined CoG for each part separatly and then compose them. Results are looking true.

            For the second I've merged all parts in a group and determined CoG, the result is to much high.

            Where is my mistake? 😞

            http://i.imgur.com/OCtMRDQ.png

            Here is the test model:
            TestPart

            1 條回覆 最後回覆 回覆 引用 0
            • TIGT 離線
              TIG Moderator
              最後由 編輯

              When you say 'merged', do you mean that you have exploded the various parts into a single container and then ensured that the container is now a 'solid' ?

              TIG

              1 條回覆 最後回覆 回覆 引用 0
              • NemesisN 離線
                Nemesis
                最後由 編輯

                @tig said:

                When you say 'merged', do you mean that you have exploded the various parts into a single container and then ensured that the container is now a 'solid' ?

                Under "merged" I meant - group all separate solids in one group, that was my mistake. Now, I made one solid from all parts and CoGs are now almost identical in both cases (separate solids and one big solid). Thank you for your patience.

                1 條回覆 最後回覆 回覆 引用 0
                • sketchartist023S 離線
                  sketchartist023
                  最後由 編輯

                  Can you tell me what the accuracy % option does? I set to 100 and its quicker but sees less weight and at 1% takes forever but sees more weight. What should that be set at nominally for the most accurate readings? Thank you!!! Very great plugin, TIG 😄

                  1 條回覆 最後回覆 回覆 引用 0
                  • TIGT 離線
                    TIG Moderator
                    最後由 編輯

                    The 'accuracy' setting affects the result... as you have found.
                    For simple forms the 'accuracy' of the results will not improve beyond a certain point, no matter what the settings are...
                    But otherwise the more 'iterations' the tool does the nearer the result is to being 'true'.
                    If you choose a 'more accurate' value, then the 'weight' might become more accurate, and the CofG might adjust very slightly.
                    If you have the time... then more iterations gives the most accurate results...
                    BUT sometimes the differences are so small it's not worth the delay...
                    It's up to you - your model - your time... 🤓

                    TIG

                    1 條回覆 最後回覆 回覆 引用 0
                    • sketchartist023S 離線
                      sketchartist023
                      最後由 編輯

                      @tig said:

                      The 'accuracy' setting affects the result... as you have found.
                      For simple forms the 'accuracy' of the results will not improve beyond a certain point, no matter what the settings are...
                      But otherwise the more 'iterations' the tool does the nearer the result is to being 'true'.
                      If you choose a 'more accurate' value, then the 'weight' might become more accurate, and the CofG might adjust very slightly.
                      If you have the time... then more iterations gives the most accurate results...
                      BUT sometimes the differences are so small it's not worth the delay...
                      It's up to you - your model - your time... 🤓

                      Thanks 😄 I found that using an accuracy of 5% works quite well with realtime weight on my end using the correct density I found on the internet for the material I use. Works a charm! Helps with configuring shipping information BEFORE having to go to Fedex etc and create real products beforehand so it reduces capital costs for me 😄 Thanks so much again. I have been within 5lbs accuracy with actual shipping items that I modeled. Just an update 😄

                      1 條回覆 最後回覆 回覆 引用 0
                      • P 離線
                        pazzamnik
                        最後由 編輯

                        Hey Tig,

                        Thanks for the CofG plugin. It has been working quite well, but have one small easy, which I think is easy to overcome. I have drawn an aluminum extrusion and set the aluminum density. The size of the extrusion is 1m in length, so I can know my run length cost/per linear meter.

                        Whether I extend the extrusion 1m to 20m in length, CofG always comes back and gives me the same weight? Yet if I copy the meter long extrusion, put a couple bends on it, and run CofG, it gives me a new and hopefully correct weight.

                        Wondering if there might b an issue with my group that is causing an issue?

                        Thanks.

                        1 條回覆 最後回覆 回覆 引用 0
                        • Dave RD 離線
                          Dave R
                          最後由 編輯

                          What method are you using to extend the extrusion? If you are just scaling the group or component, you aren't updating its definition. If you open the group/component for editing and then modify its length, the definition gets changed and the plugin should give you the results you are looking for.

                          Etaoin Shrdlu

                          %

                          (THERE'S NO PLACE LIKE)

                          G28 X0.0 Y0.0 Z0.0

                          M30

                          %

                          1 條回覆 最後回覆 回覆 引用 0
                          • jojo9J 離線
                            jojo9
                            最後由 編輯

                            Great plugin! its possible to add some toolbar buttons? i tried but had no luck.

                            #--------- menu -----------------------------
                            unless file_loaded?(File.basename(__FILE__))
                               txt0="C of G..."
                               txt1="Find C of G"
                               txt2="Composite C of G"
                               dir=File.dirname(__FILE__)+"/TIGtools"
                               toolname="CofGravity"
                               locale=Sketchup.get_locale.upcase
                               path=dir+"/"+toolname+locale+".lingvo"
                               if File.exist?(path)
                                 txt0=deBabelizer(txt0,path)
                                 txt1=deBabelizer(txt1,path)
                                 txt2=deBabelizer(txt2,path)
                               end#if
                               submenu=UI.menu("Plugins").add_submenu(txt0)
                               submenu.add_item(txt1){CofGravity.new(1)}
                               submenu.add_item(txt2){CofGravity.new(2)}
                               
                            =begin   
                              #plus
                             	tb= UI.toolbar "Konstruktion"
                             	
                            	cmd = UI;;Command.new(txt1) {CofGravity.calculate}
                            	cmd.small_icon = "../Images/Center_component_lg.png"
                            	cmd.tooltip = "Teilmassen Zentrum"
                            	tb.add_item(cmd)
                            	
                            	cmd1 = UI;;Command.new(txt2) {CofGravity.composite}
                            	cmd1.small_icon = "../Images/Center_component_lg_sum.png"
                            	cmd1.tooltip = "Hauptmassen Zentrum"
                            	tb.add_item(cmd1)   
                            =end  
                            end#if
                            file_loaded(File.basename(__FILE__))
                            #---------------------------------
                            

                            sidenote. unable to format my text as code. I get a weird looking format table (please see attachment)

                            1 條回覆 最後回覆 回覆 引用 0
                            • TIGT 離線
                              TIG Moderator
                              最後由 編輯

                              tb = UI.toolbar**.new**("Konstruktion")
                              Makes the new toolbar.
                              And use: cmd.small_icon = "Images/Center_component_lg.png"

                              • assuming Images in in the same subfolder as the loading RB file ?
                                You cannot add a new button to a existing toolbar unless you have just made it, OR if the toolbar has been made during the same start-up session AND it has an enduring reference...
                                So in some earlier loading file [they load alphanumerically] use something like:
                              module MY_STUFF
                                ###
                                TOOLBAR = UI.toolbar.new("Konstruktion")
                                ###
                              end
                              

                              Then in your second file: tb = MY_STUFF::TOOLBAR Which is an enduring reference to the 'MY_STUFF' toolbar entitled 'Konstruktion'...
                              You can then add buttons to that toolbar as SketchUp starts - in any later loading script...

                              TIG

                              1 條回覆 最後回覆 回覆 引用 0
                              • jojo9J 離線
                                jojo9
                                最後由 編輯

                                TIG, thanks for helping! i got it running, with another loader script, as you said.
                                Furthermore, i corrected the call commands.

                                1 條回覆 最後回覆 回覆 引用 0
                                • PockocmocP 離線
                                  Pockocmoc
                                  最後由 編輯

                                  Hi all, I am doing a 3D model in Sketchup 2016 and when trying to use CoG, it gives to me "weight=0.0"... How is it possible?

                                  Here is how I do :
                                  I create my 3D object, I select it and press "G" to save it as a single component. Then I select it, and I run CoG, applying a density of 7850 Kg/m3 (c40 steel density). It calculates during 5-6 minutes and finally shows 0.0 ...

                                  Any idea?

                                  Thanks!

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • TIGT 離線
                                    TIG Moderator
                                    最後由 編輯

                                    Is it a 'Solid' object in Entity Info ?

                                    Without seeing the actual object and the settings you used I can't say what the issue might be.

                                    TIG

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • PockocmocP 離線
                                      Pockocmoc
                                      最後由 編輯

                                      Hi 😄 !

                                      Well, it seems it is not recognized as a solid, because there is no "volume" entry in the Entity Info box.

                                      Here is a picture :

                                      http://img15.hostingpics.net/pics/522313Prot3.png

                                      Thank you.

                                      Pock'

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • PockocmocP 離線
                                        Pockocmoc
                                        最後由 編輯

                                        Oh, and even with a simple cube, (wich is solid) it does the same : no weight...

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • TIGT 離線
                                          TIG Moderator
                                          最後由 編輯

                                          What version do you have ?
                                          It should be v1.7 from the SketchUcation PluginStore ?
                                          It's 3 years old but works on newer SketchUps anyway...

                                          If you run it with the Ruby Console open are there any error messages ?

                                          What settings are you using ?

                                          What is getting reported exactly ?

                                          Obviously the object's size versus the chosen density units can cause small objects to be reported as 0...
                                          A small 'blade' probably needs to be in g/cm³ or similar...

                                          Here's what I get with a component cube with protruding numerals [v2016].
                                          It's a but over 1 m³ with a density of 2000 kg/m³ at the default 1% accuracy setting it returns a true volume in m³ and a weight in kg...
                                          A much smaller [scaled] version reports '0' when the overly large units misapplied, but with g/cm³ it's fine...

                                          Can you post a simple SKP that has issues so I can test it...


                                          Capture.PNG


                                          Capture1.PNG

                                          TIG

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • BoxB 離線
                                            Box
                                            最後由 編輯

                                            It sounds like you may be creating component, but failing to tick the box that replaces the raw geometry with the component.
                                            If there is no bounding box around your object it is just raw geometry, see if the component is in the component browser for you ready to use.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 9 / 10
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement