Revisão | 905702c77dea10868c8be2a619325c1f5b9e6695 (tree) |
---|---|
Hora | 2008-06-09 19:39:47 |
Autor | iselllo |
Commiter | iselllo |
I modified the script povray_test.py, which now saves the .pov files corresponding to each snapshot of the system
sequentially. Then I have to post-process them with povray.
@@ -229,19 +229,12 @@ | ||
229 | 229 | |
230 | 230 | # pos_list=s.arange(30)*1. |
231 | 231 | #gamma = (sqrt(5)-1)/2 |
232 | - file = File("my_output.pov") | |
233 | - Camera(location=(40,40,100), look_at=(40,40,40)).write(file) | |
232 | + file = File() | |
233 | + Camera(location=(90,90,90), look_at=(40,40,40)).write(file) | |
234 | 234 | # LightSource((40,40,0), color=(0,0,1)).write(file) |
235 | 235 | # LightSource((0,40,40), color=(0,0,1)).write(file) |
236 | 236 | # LightSource((40,0,40), color=(0,0,1)).write(file) |
237 | - LightSource((40,40,80), color=(1,1,1)).write(file) | |
238 | - LightSource((0,40,80), color=(1,1,1)).write(file) | |
239 | - #LightSource((80,0,80), color=(1,1,1)).write(file) | |
240 | - # LightSource((0,0,0), color=(1,1,1)).write(file) | |
241 | - LightSource((40,0,40), color=(1,1,1)).write(file) | |
242 | - | |
243 | - | |
244 | - | |
237 | + LightSource((80,80,80), color=(1,1,1)).write(file) | |
245 | 238 | #theta = 0.0 |
246 | 239 | for i in range(len(pos_list)/3): |
247 | 240 | #r = i * 0.5 #position vector |
@@ -253,19 +246,107 @@ | ||
253 | 246 | Finish( |
254 | 247 | phong = 0.8, |
255 | 248 | ambient = 0.0, |
256 | - diffuse = 0.8, | |
257 | - reflection = 0.25, | |
249 | + diffuse = 0.5, | |
250 | + reflection = 0.15, | |
258 | 251 | specular = 0.5 |
259 | 252 | ), |
260 | 253 | Pigment ( color=color )) |
261 | 254 | #pigment { color rgb <1,1,0> } |
262 | 255 | #Pigment(color=(9,9,9))) |
263 | 256 | ).write(file) |
257 | + | |
264 | 258 | |
265 | 259 | |
266 | 260 | |
267 | 261 | |
268 | -z=my_spiral() | |
262 | +def visualize_box(snapshot_label): | |
263 | + " Fibonacci spiral " | |
264 | + | |
265 | + box=(5000./0.01)**(1./3.) | |
266 | + snapshot="read_pos_%1d"%snapshot_label | |
267 | + print "snapshot is, ", snapshot | |
268 | + pos_list=p.load(snapshot) | |
269 | + #pos_list=s.reshape(pos_list,(1,15000)) | |
270 | + pos_list=s.remainder(pos_list,box) | |
271 | + #pos_list=pos_list[0:30] | |
272 | + | |
273 | + print "pos_list is, ", pos_list | |
274 | + print "s.shape(pos_list) is, ", s.shape(pos_list) | |
275 | + | |
276 | +# pos_list=s.arange(30)*1. | |
277 | + #gamma = (sqrt(5)-1)/2 | |
278 | + #file = File("my_output.pov") | |
279 | + snout="snap_out_%05d"%snapshot_label | |
280 | + snout = snout + ".pov" | |
281 | + print "snout is, ", snout | |
282 | + #file = File("snapshot.pov") | |
283 | + file = File(snout) | |
284 | + #file = File() | |
285 | + Camera(location=(90,40,40), look_at=(40,40,40)).write(file) | |
286 | +# LightSource((40,40,0), color=(0,0,1)).write(file) | |
287 | +# LightSource((0,40,40), color=(0,0,1)).write(file) | |
288 | +# LightSource((40,0,40), color=(0,0,1)).write(file) | |
289 | + LightSource((85,40,40), color=(2.5,2.5,2.5)).write(file) | |
290 | + LightSource((85,45,85), color=(2.5,2.5,2.5)).write(file) | |
291 | + LightSource((45,85,85), color=(2.5,2.5,2.5)).write(file) | |
292 | + | |
293 | + #theta = 0.0 | |
294 | + for i in range(len(pos_list)/3): | |
295 | + #r = i * 0.5 #position vector | |
296 | + color = 0,0,1 | |
297 | + | |
298 | + v = [ pos_list[i, 0], pos_list[i, 1], pos_list[i, 2]] #particle actual positions | |
299 | + Sphere( v, 0.5, | |
300 | + Texture( | |
301 | + Finish( | |
302 | + phong = 0.8, | |
303 | + ambient = 0.0, | |
304 | + diffuse = 0.5, | |
305 | + reflection = 0.15, | |
306 | + specular = 0.5 | |
307 | + ), | |
308 | + Pigment ( color=color )) | |
309 | + #pigment { color rgb <1,1,0> } | |
310 | + #Pigment(color=(9,9,9))) | |
311 | + ).write(file) | |
312 | + | |
313 | + | |
314 | + | |
315 | + | |
316 | + | |
317 | + | |
318 | +# os.system('enter your bash command here') | |
319 | + | |
269 | 320 | |
270 | 321 | |
322 | + | |
323 | +#z=my_spiral() | |
324 | + | |
325 | +#snap=20 | |
326 | + | |
327 | +d=s.arange(0,1500,10) | |
328 | + | |
329 | +for i in d : | |
330 | + print "i is, ", i | |
331 | + #z=visualize_box(snap) | |
332 | + | |
333 | + z=visualize_box(i) | |
334 | + | |
335 | + | |
336 | + | |
337 | +# label=20 | |
338 | +# snout="snap_out_%05d"%label | |
339 | +# snout = snout + ".pov" | |
340 | +# print "snout is, ", snout | |
341 | + | |
342 | +# #`basename $i|sed -e s/.gz//` | |
343 | + | |
344 | +# os.system('povray snap_out_00020.pov -w1024 -h1024') | |
345 | + | |
346 | +# #os.system('povray `$snout`') | |
347 | + | |
348 | + | |
349 | + | |
350 | +#z=spiral() | |
351 | + | |
271 | 352 | print "So far so good" |