ANN: PyPov-0.0.1

Simon Burton simonb at webone.com.au
Fri Jun 13 23:30:36 EDT 2003


PyPov

Here is a relatively simple framework for making povray files from your
favourite programming language, python.
It's good for creating structured/mathematical scenes and animations.

http://arrowtheory.com/software/python/pypov/index.html

Tutorial

###########################
# Some examples.

Sphere( (0,0,0), 1, color=(1,1,1) )

Union( Sphere(v1,r), Sphere(v2,r) )

# To change/set named args:

torus = Torus( 4, 1 )
torus.rotate = 90*x # x is actually a Vector instance 

# And unnamed args via their index (untested):

torus[0] = 8 # bigger now 

# Use the File object to output these to a pov file.

file = File( "out.pov" )
torus.write(file)
torus.rotate = 90 * x
torus.write(file) # another torus 

# Here is a complete example for a chain of spheres:

def test04():
  cam = Camera(
    location=(0,0,-10),
    look_at=(100.0,0.0,0.0),
    angle=30 )
  light = LightSource((300,300,-1000),color=(1,1,1))
  spheres = [ Sphere( (2*i,0,0), 1, Pigment(color=(1,1,1)) )
    for i in range(400) ]
  file = File( "spheres.pov", cam, light, *spheres )


# Simon Burton.





More information about the Python-list mailing list