sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Drop object with centre of gravity?

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 5 Posters 316 Views 5 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.
    • thomthomT Offline
      thomthom
      last edited by

      Is there a plugin that will allow you to drop geometry (group or component) and have it "land" as if it was a real object placed on the ground?

      I don't want to use SketchPhysics - as it's a big packages that does more than what I want and it's know to cause conflicts with other plugin.

      I'm not looking for simulating bounce or anything - just want to rest on ground more naturally.

      If there is no plugin for it - anyone familiar with the math?
      And I so assume the geometry would be solid.

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • cottyC Offline
        cotty
        last edited by

        I think the mathematical steps would be:

        • calculate center of gravity
        • drop until a first point hit the ground
        • rotate object in the vertical plane with both points in it
        • rotate around line which connects the first two ground points until a third point of the object hits the ground

        my SketchUp gallery

        1 Reply Last reply Reply Quote 0
        • andybotA Offline
          andybot
          last edited by

          Could you do a two part process? The smart drop component plugin combined with something that calculates the component origin to lowest point on the object?

          Is there a plugin already that recalculates origin based on geometry? It can be time consuming to fix the origins on components individually if there are a lot of messed up ones. In any case, I'd love to see what comes of this.

          http://charlottesvillearchitecturalrendering.com/

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @andybot said:

            Could you do a two part process? The smart drop component plugin combined with something that calculates the component origin to lowest point on the object?

            No - it's not that simple. Smart Drop doesn't work for this.
            PhysicDrop.png

            @andybot said:

            Is there a plugin already that recalculates origin based on geometry?

            What do you mean by "origin" in this context? The point in the geometry that hits the surface ground first? ❓
            If you mean component origin then it would be of no significance - it's the actual geometry I'm interested in here.

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • andybotA Offline
              andybot
              last edited by

              oh man, that is complicated! If anyone can figure it out... πŸ‘

              http://charlottesvillearchitecturalrendering.com/

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Ane - I have no idea what so ever how that is calculated. 😞

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • cottyC Offline
                  cotty
                  last edited by

                  If the vertical projection of the center of gravity is not over the standing face, the object have to be rotated in the vertical plane with the center of gravity in it. I tried manually with the attached model, but couldn't even guess the desired endposition. What would you think should be the position in this case?


                  dropgravity.skp

                  my SketchUp gallery

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

                    Not only that, SP uses center of bounding box, not the actual center of gravity!

                    Maybe try exporting ur model to blender, and simulation test ur simulation there?

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

                      Another way is to collect some of these NASA Aerodynamics
                      formulas together and calculate it all up.

                      Or write ur own "SketchyPhysics", using some physics engine; Bullet, might be a good one

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

                        I wrote a tool that using 'slices' to find an object's [approx] center-of-gravity...

                        You could project every vertex.position in the object down to the surface below as a raytest using Z_AXIS.reverse.
                        The one with the shortest distance to raytest[1] gives the vector to move it down vertically, so it touches the surface as if it were dropped vertically.

                        You really ought to make points along all edges in the object at minuscule centers and test these as a surface might well have a 'bump' that avoids vertices but which would affect the object.
                        BUY another alternative might be to do the nearest vertex drop and do a temp grouped intersect between the two objects, if there's a result then there's a 'bump' that the object should have caught on and you can shunt the object up to suit that,,,

                        Now you have an 'anchor' point of sorts.

                        You know the vector from that 'first point of contact' and the CoG.
                        If it's parallel with the Z_AXIS it's balancing on a pinpoint - but chances are it's not !
                        So... Rotate the object around the cross of Z-AXIS and that vector by small incrementing angles.
                        Each time do a temp intersect with the surface.
                        If there's a result back up in 1/10 increments until there's virtually none.
                        The object is now on the surface and tilted downwards towards it CoG until it rests on the surface.
                        If the CoG is not vertically on the vector from the 'first point of contact' to this 'second point of contact' then the object needs to rotate yet again - around this vector - again testing for intersections until a 'third point of contact is found'.

                        Now the object is resting on the surface with three points of contact and the CoG is somewhere within that triangle of points - it is stable.

                        If in any of the two points of contact steps the CoG of a vertically aligned with the vector you can choose for a 'dangerous stability' - balanced on a 'knife-edge' - or choose to tilt randomly in either direction until a 'hit' with an intersect give another point that is stable...

                        It's actually very complex as the initial anchor might no longer be on the surface after the second or third tilt !

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement