Open StefanDeYoung opened 4 years ago
You would think that the vpython.ring() object would be perfect. Unfortunately, vpython.ring() is a torus rather than a flat ring. So far, my best guess is a circular extrusion with a circular cutout:
saturn = sphere(pos=vector(0,0,0), texture='saturnmap.jpg', radius=1)
outer_circ = shapes.circle(radius=1.116saturn.radius) inner_circ = shapes.circle(radius=2.327saturn.radius) ring_thickness = 8.29e-6 expath = [vec(0,0,-ring_thickness/2), vec(0,0,ring_thickness/2)]
ex = extrusion(path=expath,shape=[outer_circ,inner_circ],texture='saturn_circle.png')
I opened a question in the vpython group. Bruce Sherwood provided the following response: https://groups.google.com/d/msgid/vpython-users/af60d67a-e448-49ae-b646-67f292fe92d9o%40googlegroups.com?utm_medium=email&utm_source=footer
I generated some rings like this:
scene.width = scene.height = 1000 for r in arange(0.1, 5, 0.1): c = color.hsv_to_rgb(vec(random(),1,1)) ring(radius=r, thickness=0.02, axis=vec(0,0,1), color=c) scene.pause() scene.capture('rings')
It looks like this:
Then moved rings.png from Downloads to my program folder and executed this:
extrusion(path=[vec(0,0,0), vec(0,0,1)], shape=[shapes.circle(radius=10), shapes.circle(radius=5)], texture='rings.png')
It looks like this:
What I don't know is how to take an arbitrary image and manipulate its formatting. But my experience suggests that if you can find some way to display the image you want, in some app or other, you could capture that image and use it in the extrusion.
Bruce
I downloaded the saturn map and saturn ring color from: http://planetpixelemporium.com/saturn.html
I used the tiled clones feature in inkscape to revolve the saturn ring colour image
Based on Bruce's response, I think I can make a texture in inkscape by revolving the saturn ring color image, but I need to leave a circular hole in the middle that is the same size as the circular cutout.
bless bruce, he's a great guy
Add ring structures to the solar system gas giants. Spectacle! Realism!