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

    [Plugin] Center of Gravity

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

      @gaieus said:

      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

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

        '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

        1 條回覆 最後回覆 回覆 引用 0
        • pilouP 離線
          pilou
          最後由 編輯

          No problem i can make the Xray mode by hands 😉

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

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

          object goup 1(with CoF), object goup 2(with CoF)
          group 3 = Group1 + Group 2
          Composite group 3 not Ok 😞
          What I miss?

          Frenchy Pilou
          Is beautiful that please without concept!
          My Little site :)

          1 條回覆 最後回覆 回覆 引用 0
          • pilouP 離線
            pilou
            最後由 編輯

            @unknownuser said:

            with different densities

            haaaaaaaa ☀
            THX! 😎

            Frenchy Pilou
            Is beautiful that please without concept!
            My Little site :)

            1 條回覆 最後回覆 回覆 引用 0
            • C 離線
              chrisjk
              最後由 編輯

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

              Chris

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

                @chrisjk said:

                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

                1 條回覆 最後回覆 回覆 引用 0
                • D 離線
                  driven
                  最後由 編輯

                  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

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                    I just installed it on my MacBook and tried running it. It worked fine for me. Thank you TIG.

                    Etaoin Shrdlu

                    %

                    (THERE'S NO PLACE LIKE)

                    G28 X0.0 Y0.0 Z0.0

                    M30

                    %

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

                      @driven said:

                      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

                      1 條回覆 最後回覆 回覆 引用 0
                      • D 離線
                        driven
                        最後由 編輯

                        @tig said:

                        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

                        learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                          driven

                          A mystery... 😕 😒

                          
                          def CofGravity;;calculate ### LINE 129 ==start of class/def that is reporting the error...
                          
                          def db(string)
                            dir=File.dirname(__FILE__)+"/TIGtools"
                            toolname="CofGravity" 
                            locale=Sketchup.get_locale.upcase
                            path=dir+"/"+toolname+locale+".lingvo"
                            if not File.exist?(path)
                              return string
                            else
                              deBabelizer(string,path)
                            end 
                          end#db
                          
                          if (Sketchup.version.split(".")[0].to_i<5)
                               UI.messagebox(db("C of G; Sorry, this is Version >= 6 Tool !"))
                               return nil
                          end#if
                          
                          model=Sketchup.active_model
                          entities=model.active_entities
                          
                          ############
                          if Sketchup.version[0,1].to_i > 6
                            model.start_operation((db("C of G")),true)### LINE 153 GIVES ERROR !!!
                          
                          

                          Can you look at the script's contents and see if it looks like this ?
                          Works fine on a PC for me - can't see where a Mac might trip up ?
                          ❓ ❓ ❓

                          TIG

                          1 條回覆 最後回覆 回覆 引用 0
                          • J 離線
                            Jim
                            最後由 編輯

                            Need to require 'dBabelizer' before you use it.

                            Hi

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

                              Jim

                              That's it ! Thanks.

                              Other tools requiring it were masking the fact I missed it out of the initial 'require'... 😒

                              Update on it's way !!!

                              TIG

                              1 條回覆 最後回覆 回覆 引用 0
                              • D 離線
                                driven
                                最後由 編輯

                                that appears exactly the same,
                                the only thing that seems at odds is the syntax colouring for calculate shows it as a variable??
                                I don't know enough to know why, or where to look next

                                this is odd...

                                I'll send this even if the missing "require" is at fault, because I don't understand why one and not the other would be a variable....

                                learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                  Here's v1.3...
                                  http://forums.sketchucation.com/viewtopic.php?p=229404#p229404
                                  The initial 'require' of deBabelizer was accidentally missed out, but its absence was masked by some other tools loading it anyway so most times it worked anyway...
                                  Now it is explicitly called for in the tool... 😒
                                  Sorry for the confusion...

                                  TIG

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • D 離線
                                    driven
                                    最後由 編輯

                                    Same error code, same syntax colouring for line 813

                                    seems to have something to do with it...

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                      driven

                                      Have you got the recent v1.3, with the require 'deBabelizer.rb' added ?
                                      This should fix it ?

                                      TIG

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

                                        If calculate is a reserved term in Mac Ruby versus PC I'm surprised...
                                        You can edit the file and change every ' calculate' to say ' do_calculation' and see if that helps - if so let me know asap 😕 😕 😕

                                        TIG

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • D 離線
                                          driven
                                          最後由 編輯

                                          Yes it's v1.3

                                          changed to tig_calculate (lines 131, 815)

                                          Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
                                          /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;155;in `calculate'
                                          /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;815
                                          

                                          but the colour changed

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                            @driven said:

                                            Yes it's v1.3
                                            changed to tig_calculate (lines 131, 815)

                                            Error; #<NoMethodError; undefined method `db' for CofGravity;Class>
                                            > /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;155;in `calculate'
                                            > /Library/Application Support/Google SketchUp 7/SketchUp/Plugins/CofGravity.rb;815
                                            

                                            You mustn't have changed them all as it's still calling 'calculate' ?
                                            I've redone the original and v1.4 with full 'do_calculation' will be there asap...

                                            TIG

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

                                            Advertisement