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

    Matlab integration of Sketchy physics

    Scheduled Pinned Locked Moved SketchyPhysics
    15 Posts 3 Posters 2.5k Views 3 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.
    • Y Offline
      youthreewire
      last edited by

      Hi,

      Sketchy physics has been helping me to animate the models to a basic physics environment.I want to add some mathematical model and constraints to my model in sketchy physics.Is there I way I can integrate this with Matlab to do the math solving?Please let me know.It would be great if it can be done.It would be good for research and engineering apps.

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

        Not that I know of. SP uses the Newton physics SDK and it is constrained by its limitations. I dont know much about Matlab so I have no idea if it is compatible or not.

        Sorry.

        1 Reply Last reply Reply Quote 0
        • Y Offline
          youthreewire
          last edited by

          Even if there is an API for sketchy physics it would be great.Because the modeling done by google sketchup is top quality.So if there is some sort of an API where in the user can program in C or VC++ using Microsoft VC++ such that they can change the mass ,coefficient of friction of the bodies it would be useful as a research toll just like other softwares in the industry like MSC Nastran ,Open Dynamics Engine etc..at one level.It would be great if we can program with the API.

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

            The Newton SDK is a C/C++. It sounds like you may want to code directly to that:
            http://www.newtondynamics.com/

            1 Reply Last reply Reply Quote 0
            • Y Offline
              youthreewire
              last edited by

              Hi Phil,
              I still want to be using sketchy physics while I am doing that.I want to integrate to matlab and still program and change parameters like mass,coefficient of friction etc..It is like matlab interacts with google sketch up models via the sketchy physics.Could you please suggest me how to do this?

              1 Reply Last reply Reply Quote 0
              • Y Offline
                youthreewire
                last edited by

                Also philips, there is one more physics engine called Open Dynamics Engine which is used more in research.It would have been great if you would have developed sketchy physics on this or also made one using this.So that even academic research people who have used ODE (which does not have GUI)could use it now flexibly with google sketchup.Thus benefiting both.

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

                  As I said before I have no experience with Matlab and as such have no idea how to go about integrating it or even if it is possible. Also SP currently does not expose mass and friction. The physics engine supports it via "material" pairs, but the interface isn't easy to translate in to Sketchup terms.

                  As for ODE, when I started SP I looked at all the physics engines that were then available and chose Newton mostly because of the joint implementation. If I had it to do all over I might go with ODE or Physx but it is too late now.

                  Sorry
                  Chris

                  1 Reply Last reply Reply Quote 0
                  • Y Offline
                    youthreewire
                    last edited by

                    I think I am on my own now.But could you help me extend the same physics plugin idea to ODE.In ODE also there are several joints available.
                    http://www.ode.org/joints.pdf

                    And ODE was available since 2002.Now ODE has more features than the Newtons SDK.If Newton had the facility of setting parameters like mass and coefficient of friction,etc it would be great.Also ODE uses OpenGl.Could you please guide me about how to integrate it.

                    And ODE has a better documentation http://www.ode.org/ode-latest-userguide.html

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

                      Newton supports mass and friction I just haven't exposed it to SP yet. I plan that for the next major version. And I have nothing against ODE. As I said if I had to do it over I might do it differently.

                      If you want to make a ODE plugin for Sketchup I can offer advice and encouragement but I dont have any spare bandwidth to spend on coding. Here is an overview of whats involved.

                      The first step is to link ODE to the Ruby language that SU uses for plugins. I use Ruby/DL to link to the Newton.dll. Then at runtime initialize the physics engine and then traverse the model and create physical bodies and joints for each group tagged as a physics object. Then you can use the Sketchups Tool class to wrap animation of the physics engine (the "nextFrame" calls). After each frame readback the location of all the objects in the simulation and set the groups transformation accordingly.

                      Its not too hard to do but the devil is in the details. For example under Newton the bodies need to be scaled and rotated into the coord system of the physics engine. But I expect ODE being more widely used will have fewer problems like this.

                      Chris

                      1 Reply Last reply Reply Quote 0
                      • Y Offline
                        youthreewire
                        last edited by

                        Just was looking at PhysX.I think it was owned by Ageia and now by NVDIA.It looks better than Newton SDK (just looked at some demo videos).But I am not aware of it features like mass,cofefficient of friction etc..do you have any idea?

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

                          Pretty much any physics engine is going to support that.

                          1 Reply Last reply Reply Quote 0
                          • Y Offline
                            youthreewire
                            last edited by

                            I think if I write the plugin for another physics engine ,I would be reinventing the wheel ,atleast a part of it.If Newton SDK would also develop into newer version and improve like Sketchy Physics ,it would be great.I am not as capable as you in terms of programming.I will have to learn how to write Ruby plugins first.But an Idea is to combine a mathemetical computation software like Octave it might be good.Though it may not match Matlab but it would be great for academic purpose.

                            Link to Octave :
                            http://wiki.octave.org/

                            Parallely at one point of time in the future if you would give Mass and coefficient of friction support it would improve as a physics analysis software.Also there are open source FEA solvers which analyze the model dynamically taking it as a mesh.

                            Also develop more features like force vectors,RPM for motor etc.

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

                              Mass and friction are coming in the next major version. Some force type stuff is coming in the next minor version. I dont know anything about FEA solvers but I will look it up. 😄

                              I should point out that my first goal with this version was a game type simulation and not something scientifically accurate. It probably could be but that hasn't been the focus.

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

                                @unknownuser said:

                                I should point out that my first goal with this version was a game type simulation and not something scientifically accurate. It probably could be but that hasn't been the focus.

                                I remember reading somewhere that Google's intent on acquiring Keyhole was for gaming platforms. Last time I checked I think people are doing a lot more with GE than just gaming. And don't even get me started on Velcro.

                                Cool stuff....I am now off in the Octave world as well but mostly waiting for the latest improvements to SP.

                                1 Reply Last reply Reply Quote 0
                                • Y Offline
                                  youthreewire
                                  last edited by

                                  Well since googles products are mostly innovative,simple and based on intuition their products work like awesome.One thing which most of the physics engine don't do is: Say in a physics engine I make body move over a surface from point A to Point B with just a simple command "Move body M from point A(x1,y1,z1) to B(x2,y2,z2).But there isn't a feature which dynamically shows the free body diagram of the body with the forces working on it.Phiilips,if one can incorporate such a feature where in the force vectors are indicated by a solid translucent arrow whose orientation and length shows the forces acting on the body qualitatively then it would improve the visualization of the physics happening in there and this would also help the person better study the model.I feel it would be simply awesome

                                  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