Conversation
This system is used to analyze the working of webGL's inline IPython notebooks,using Three.js, and TrackBallControls.js
…e IPython notebook for simulation and visualization
There was a problem hiding this comment.
This is a method to get data to the client from the server. But you will want to either use http requests (post, get) or make use of the IPython kernel structure. It will probably be a good idea to have some methods eventually that split out all necessary information from the python code (time histories, shapes, colors, etc) as a json file which can then be passed to the js code more fluidly. But this is a good start for a demonstration of the ideas.
|
Tarun, Make sure that you include the proper license information for any external javascript code that you did not write. We can't just copy it and paste without including the license either in the code or as a file that hangs with it. |
There was a problem hiding this comment.
For this problem the solution is trivial, but I'd like you to include code here that goes from the Kane object to a ode in first order form that can be integrated with odeint (from scipy). This will make the example much easier to extend for multiple bodies. So please use the dummify, lambdify, odeint method to get your simulation results instead of writing in out explicitly.
|
three.js is MIT, so there are no license issues (you just have to have a copy of that license somewhere). The easiest way to distribute it is to either ship a minified version, or to add it as a git submodule. Look at how IPython does things in with their notebook javascript dependencies. |
|
Two things before merging:
|
|
@gilbertgede @hazelnusse @angadhn If you have time check out this concept @tarzzz put together to give some idea of how the visualization would work in an IPython notebook. |
|
For me, it shows a dot repeatedly moving from the origin, then jumping back. |
|
That's all it does. The dot's position is governed by the solution to the ode and it embeds three.js in the notebook. Nothing grand but just a small proof of concept. |
|
Right. I just expected it to look more like a mass on a spring. |
|
I think we're going to start with just rigid body animations. But we may be able to add in some flexible spring visualizations since that is such a common item in rigid body systems. |
This example is to illustrate the visualization abilities of pydy-viz.
It utilizes the javascript rendering abilities of IPython notebooks to provide visualization and simulation of a mass spring system, using WebGL (three.js).