Visual Python

Ask a question or request a feature related to the website or forum...

Moderator: scott

User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

@ME

Been learning proofs of the kinetic formulas.

There maybe two members, including me who are seeing a temporary K.E. gain.

I think you have pointed us on the correct path.

That being KEt = Kinetic Energy by translation & KEr = Kinetic Energy by rotation.

Then It = Inertia to translation & Ir = Inertia to rotation (MoI)

If these are not matched correctly then this can cause this effect.
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

I have found this book and python library

https://www.amazon.co.uk/Students-Guide ... B00WXLQ7CO

animator library

https://pypi.python.org/pypi/imageio

Some Other lab has been working on this issue

http://www.lanl.gov/org/padste/adeps/ma ... plications
/condensed-matter-magnet-science/thermoacoustics/animations.php

Regards
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

I have been able to get screen shots during a visual python application run.

From that I used python too convert them to gif8.
Then convert that to mp4 using ffmpeg.

The 2 meg file is now 200kb and still to big the this site.

Will try gain reduced size, reduced colour etc.
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

Visual Python on Linux

I had given up on Visual Python as I could only get it working on MS.

However it appears to work !!!

I used these lines too install into my Linux System.

sudo apt-get install python3-pip
pip3 install vpython
python3 -c "from vpython import *; sphere()"

Other example

http://www.glowscript.org/#/user/GlowSc ... um-VPython
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

OfflIne VPython version available.

For those interested it is possible to build a 3D simulation in VPython.
Convert to javascript then publish to a server.

Or save it on your PC something.html and it will run when clicked on.

There is a small fault I see that can be fixed by dragging the window sizer.
That can be found on the bottom left part of the window.

All testing has been done with chrome.

Below works in Firefox

https://steampunks.ddns.net/doublependulum.html
[MP] Mobiles that perpetuate - external energy allowed
rocky700
Dabbler
Dabbler
Posts: 1
Joined: Tue Feb 05, 2019 7:17 am

re: Visual Python

Post by rocky700 »

The given code is really well made and it will be very useful for the beginners as they can know the code of the python and how it can be implemented.
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

I look forward to seeing other members examples in the forum.

Here are the main examples

http://www.glowscript.org/#/user/GlowSc ... /Examples/

The download for the zip file is on this link. The down load button is down to the right.

https://github.com/BruceSherwood/glowsc ... ine2.7.zip

This will give members an Off-Line Development Environment to study and create there visualizations/simulations.

note. I used this programming language with relation to this thread

http://www.besslerwheel.com/forum/viewt ... 88&start=0

Also the main web site https://steampunks.ddns.net - best viewed in the Chrome browser.

Regards
[MP] Mobiles that perpetuate - external energy allowed
User avatar
Senax
Devotee
Devotee
Posts: 1016
Joined: Thu Jul 12, 2018 7:26 pm

Post by Senax »

Reading this thread I see I was born too early. All I had in my early research career was batch processing on the Elliott 603 at Boreham Wood. 5 hole paper tape I seem to remember.
Furcurequs
Devotee
Devotee
Posts: 1605
Joined: Sat Mar 17, 2012 4:50 am

re: Visual Python

Post by Furcurequs »

I was interested in computers when I was a kid. That meant, though, that I had to read about them in the library. Well, until both my high school and a neighbor of mine were able to buy some Radio Shack TRS-80s.

As far as graphic modeling now, I would prefer using the LIghtflow Rendering Tools which have a python interface also, but unfortunately their free license was only for personal, non-commercial use. Should I at some point be successful with any of my projects and need some descriptive animations, I guess it would be better to have things made with tools that have fewer restrictions.

From what I've seen of Visual Python examples, though, I think I would rather just stick with using Pov-Ray or Blender for any 3D animations or simulations.
I don't believe in conspiracies!
I prefer working alone.
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

I found creating 3D visuals in POV-RAY less of a strain.

I think that is because it's the first product learned.

In the same way the first computer language is the one you return to when required.

However you gain more when you put some study time into new tools.

So I am looking at a Blender with python simulation approach.

There is a need to implement to a wider group and that is where this product comes into the mix.

It is a quick method for doing python / maths to graphs.

The first system I used other than a Pet Commondor 3032 with BASIC was a Westtrecks punchtape teletype machine which sent the Fortran to the ICL 1900 for batch processing.

The time I hard to manually punch out missing holes in the tape. Well the tape rolled up and made a good dart board.

Now here we are with all this IT tech. We just have to keep it simple to use; so we can get back to the simple computer days.
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

Here is a little toy.

The HTML files is only 84 lines long and is written in Glowscript. That is generated javascript and that was hand written VPython originally.

Anyway you can download the txt file.
Change the extension to HTML and double click.

Your browser will then render a transparent cylinder.
It's rotating at 1 radian per second for 6.284 seconds.

That is one rotation.

You will see it has all the 3D viewing options.

The red sphere is the COM.

All the Best
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

Just working at getting my head around these technology.

You may need chrome browser for this as Firefox wants the https to be running.
hpps is not available for now.

http://steampunks.ddns.net/fma-d1.html

This is the link to the 1 Dimensional F=MA

It just show a 1kg mass being pushed by 1 Newton

The Rod is 1 metre long

The arrows show you when the force is applied.

This link is to the progression with 2 Dimensional force version

http://steampunks.ddns.net/fma-d2.html

Cheers
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

Re: re: Visual Python

Post by agor95 »

agor95 wrote:Here is a little toy.

The HTML files is only 84 lines long and is written in Glowscript. That is generated javascript and that was hand written VPython originally.

Your browser will then render a transparent cylinder.
It's rotating at 1 radian per second for 6.284 seconds.

That is one rotation.

You will see it has all the 3D viewing options.

The red sphere is the COM.

All the Best
http://steampunks.ddns.net/RotateRod.html
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

Re: re: Visual Python

Post by agor95 »

agor95 wrote:Just working at getting my head around these technology.

You may need chrome browser for this as Firefox wants the https to be running.
hpps is not available for now.

http://steampunks.ddns.net/fma-d1.html

This is the link to the 1 Dimensional F=MA

It just show a 1kg mass being pushed by 1 Newton

The Rod is 1 metre long

The arrows show you when the force is applied.

This link is to the progression with 2 Dimensional force version

http://steampunks.ddns.net/fma-d2.html

Cheers
Well the HTTPS is fine but Firefox on Linux is still on the blink.

Anyway all these presentation are using really simple scripts.
The 2 Dimensional version looks like the ball is rotating.

However it's only swinging in 2 dimensions.

I am looking at these simple foundations example and than building up a tool kit to allow flexible modelling.

I have some matrix GPU programming skills now. so by doing these simple examples and then move to that program type. Then see if they are the same but faster.

All the Best
[MP] Mobiles that perpetuate - external energy allowed
User avatar
agor95
Addict
Addict
Posts: 7724
Joined: Wed Sep 24, 2008 8:09 pm
Location: Earth Orbit
Contact:

re: Visual Python

Post by agor95 »

Here is the last of this set.

https://steampunks.ddns.net/fma-d3.html

Keep in mind each ball is just swinging in a straight line along each vector.
Were each ball has two combining vectors.

This give the appearance of rotation.

Cheers
[MP] Mobiles that perpetuate - external energy allowed
Post Reply