Live, Show and Run
A guide to using the live and show functions included with axtools.
In this guide, you'll learn to:
Test and watch simulations with the
runfunctionStatically display preloaded simulations with
showWatch preloaded simulations in real-time with
liveUnderstand the differences between
run,live, andshowEdit template files to manipulate display output
run
runThe run function loads and shows a simulation at the same time.
import axinite.tools as axtools
args = axtools.read("example.tmpl.ax")
axtools.run(args, axtools.vpython_frontend(args, "run"))show
showThe show function statically shows a loaded simulation. It takes the AxiniteArgs object and displays the system.
import axinite.tools as axtools
args = axtools.read("example.ax")
axtools.show(args, axtools.plotly_frontend(args, "show"))live
liveThe live function shows a loaded simulation in real-time.
live vs show vs run
live vs show vs runBoth the live and show functions display loaded simulation files. The run function is generally slower, however, because it computes and shows the simulation simultaneously. Using run is great for quick testing to see if you got the simulation parameters right. live is fun to use for experimenting and playing around, but for scientific purposes, use show.
Manipulating the Display
There are 3 attributes that can be added to simulation files that affect the output display:
"radius_multiplier": Global radius multiplier for all bodies in the system."rate": The rate at which the simulation is presented (frame every 1/rate a second)."retain": How many points on the trails should be rendered by default.
In addition, you can specify 4 body attributes:
"light": Whether a light should be placed at the position of the body."color": The color of the body."radius_multiplier": The multiplier on the radius (in addition to the global one."retain": How many points on the trail the body should retain.
Last updated