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

    SketchyPhysics 3x June 27 version.

    Scheduled Pinned Locked Moved SketchyPhysics
    95 Posts 12 Posters 23.0k Views 12 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.
    • C Offline
      CPhillips
      last edited by

      Here is a new Experimental version. Its major feature is the new scripting system so it is primarily for users who are comfortable with script. It is work in progress code and possibly very buggy. You guys let me know.

      Because this is not even an alpha I am putting a notice not to upload to 3dwarehouse. But PLEASE post models to these forums. I need to know how you are using the scripts so I can figure out how they will ultimately turn out.

      Documentation for this release is going to take a while. I will start with examples in the next post.

      Chris

      http://sketchyphysics2.googlecode.com/files/SetupSketchyPhysics3x-Jun27.exe
      No Mac version yet but there will be soon.

      1 Reply Last reply Reply Quote 0
      • C Offline
        CPhillips
        last edited by

        Here is an example using the new scripting system. It uses the "ontouch" event to create joints between objects. The wheels on the car will connect with a hinge the first thing they touch, in this case the box. The spheres will connect with a ball joint everything they are touching the first frame. That allows them to connect to anything they are touching in the chain.

        The nice thing about joints made this way is that you can copy them and they still work as expected.


        SelfConnectingJoints.skp

        1 Reply Last reply Reply Quote 0
        • C Offline
          CPhillips
          last edited by

          This example adjusts linearDamp to make bodies act like they are in space. Also shows that objects can be started in motion.


          orbit4.skp

          1 Reply Last reply Reply Quote 0
          • C Offline
            CPhillips
            last edited by

            Simple breaking objects. The breaking interface is really a work in progress. Sometimes objects breaking can cause Sketchup to crash.


            Break1.skp

            1 Reply Last reply Reply Quote 0
            • W Offline
              Wacov
              last edited by

              In the ontouch event, is the speed the speed of the collider at impact... and pos the point of impact?

              And thanks for those demos!

              Here's my first proper model with it, copyable ragdolls! You can't freeze them normally, but you could probably set them to freeze on frame 1, after the joints have connected.


              Copyable ragdoll.skp

              http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

              1 Reply Last reply Reply Quote 0
              • W Offline
                Wacov
                last edited by

                Chris, how DO you freeze objects in script? Has that been added yet? I've tried frozen=true and frozen(1), but no luck.

                http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

                1 Reply Last reply Reply Quote 0
                • P Offline
                  Physicsguy1
                  last edited by

                  Since this version is unstable, it would be best if you created a method that stops the simulation, after an amount of time, if something strange happens, or the ismulation gets laggy(breaking feature).

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    CPhillips
                    last edited by

                    @wacov said:

                    In the ontouch event, is the speed the speed of the collider at impact... and pos the point of impact?

                    Yes.

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      CPhillips
                      last edited by

                      @wacov said:

                      Chris, how DO you freeze objects in script? Has that been added yet? I've tried frozen=true and frozen(1), but no luck.

                      Doesn't look like I have hooked that up yet.

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        CPhillips
                        last edited by

                        @unknownuser said:

                        Since this version is unstable, it would be best if you created a method that stops the simulation, after an amount of time, if something strange happens, or the ismulation gets laggy(breaking feature).

                        There isn't a "magic bullet" for that. I need to find all the different ways it can break and then tackle them one at a time.

                        Post any code you find that breaks the sim and I'll put the right error checking in.

                        1 Reply Last reply Reply Quote 0
                        • W Offline
                          Wacov
                          last edited by

                          Pretty nice cloth demo. Once again, totally copyable! I love the scripted joints


                          Copyable cloth.skp

                          http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

                          1 Reply Last reply Reply Quote 0
                          • C Offline
                            CPhillips
                            last edited by

                            Nice! 😄

                            1 Reply Last reply Reply Quote 0
                            • P Offline
                              Physicsguy1
                              last edited by

                              That's a nice representation of cloth, Wacov!

                              1 Reply Last reply Reply Quote 0
                              • W Offline
                                Wacov
                                last edited by

                                Thanks guys! One thing I'm finding with the cloth is it tends to collide with itself. That seriously slows stuff down, and it's not really neccessary for a semi-realistic simulation. Can we have object-specific collision detection? So, give the choice to either collide with everything, collide with everything except '...', or collide with nothing but '...'. Keep it pretty intuitive, so using a string finds objects of that name, a var for specific objects, and let us put them into an array if needed.

                                So, on the cloth, I'd name all the bars the same, and tell them to collide with everything except each other. You might also be able to make a crude fluid flow effect by creating spheres that only collide with the static mesh.

                                http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

                                1 Reply Last reply Reply Quote 0
                                • P Offline
                                  phy
                                  last edited by

                                  I love the new Script field and script but I was wondering is there any way you can control a scripted joint with a slider or key.

                                  Tableau de comparaison de Staxyn s'agit d'un mГ©dicament uniquement sur ordonnance.

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    JaViXP
                                    last edited by

                                    Just a little test. Hit Play and see what happens 😉


                                    Download this file

                                    "Giving up is way harder than trying"
                                    JaViXP's Rendering

                                    1 Reply Last reply Reply Quote 0
                                    • P Offline
                                      Physicsguy1
                                      last edited by

                                      YES!! The simulation finally registers in-simulation created objects!

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        CPhillips
                                        last edited by

                                        @wacov said:

                                        Thanks guys! One thing I'm finding with the cloth is it tends to collide with itself. That seriously slows stuff down, and it's not really neccessary for a semi-realistic simulation. Can we have object-specific collision detection? So, give the choice to either collide with everything, collide with everything except '...', or collide with nothing but '...'. Keep it pretty intuitive, so using a string finds objects of that name, a var for specific objects, and let us put them into an array if needed.

                                        So, on the cloth, I'd name all the bars the same, and tell them to collide with everything except each other. You might also be able to make a crude fluid flow effect by creating spheres that only collide with the static mesh.

                                        In the physics engine you would need materials to do that. So don't expect it until SPIV.

                                        One thing you could do that might speed things up is to change the connect script to something like this.

                                        
                                        ontouch{|t,s,p|
                                           connect(t,"ball") if frame==1
                                        
                                            #empty the ontouch event after the first frame.
                                            #this will ensure that ontouch isnt called again.
                                           ontouch{} if frame>1 
                                        }
                                        
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • C Offline
                                          CPhillips
                                          last edited by

                                          @phy said:

                                          I love the new Script field and script but I was wondering is there any way you can control a scripted joint with a slider or key.

                                          Not yet. 😞 But I will do that next.

                                          1 Reply Last reply Reply Quote 0
                                          • C Offline
                                            CPhillips
                                            last edited by

                                            JaViXP it will work better if you change the onend to this:

                                            onend{
                                               group.erase!
                                            }
                                            
                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 1 / 5
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement