23 |
|
|
24 |
from vob.putil.usertestutil import * |
from vob.putil.usertestutil import * |
25 |
from vob.putil.misc import * |
from vob.putil.misc import * |
26 |
from java.lang import Thread |
from java.lang import Thread,System |
27 |
import math |
import math |
28 |
from random import shuffle |
from random import shuffle |
29 |
|
|
30 |
from vob.demo.multifil import randgraph |
from vob.demo.multifil import randgraph |
31 |
|
|
32 |
from vob.putil import demowindow |
from vob.putil import demowindow |
33 |
|
from vob.putil.saveanim import saveframe |
34 |
|
|
35 |
def run(): |
def run(): |
36 |
demowindow.w.setLocation(0,0,1600,1200) |
demowindow.w.setLocation(0,0,1600,1200) |
46 |
r.nextDouble() |
r.nextDouble() |
47 |
|
|
48 |
sc = randgraph.Scene() |
sc = randgraph.Scene() |
49 |
#sc.size = 30 |
sc.size = 30 |
50 |
#sc.box = 700 |
sc.box = 800 #1100 |
|
sc.size = 40 |
|
|
sc.box = 1100 |
|
51 |
sc.blend3d = 1 |
sc.blend3d = 1 |
52 |
sc.drawInside = 0 |
sc.drawInside = 0 |
53 |
#sc.depthColor = 0 |
#sc.depthColor = 0 |
58 |
graphs = [] |
graphs = [] |
59 |
for i in range(0,6): |
for i in range(0,6): |
60 |
for path2 in (0,1): |
for path2 in (0,1): |
61 |
for N in (6,18,30):#(24,48,96):#(9,15,21): |
for N in (6,24,42,60):#(24,48,96):#(9,15,21): |
62 |
graphs.append( (r.nextInt(), r.nextInt(), path2, N) ) |
graphs.append( (r.nextInt(), r.nextInt(), path2, N) ) |
63 |
|
|
64 |
trials = [] |
trials = [] |
69 |
shuffle(trials, r.nextDouble) |
shuffle(trials, r.nextDouble) |
70 |
|
|
71 |
|
|
72 |
|
t0 = java.lang.System.currentTimeMillis() |
73 |
while trials: |
while trials: |
74 |
|
|
75 |
#sc.seed = r.nextInt() |
#sc.seed = r.nextInt() |
78 |
#sc.N = 3 * r.nextInt(4) + 9 |
#sc.N = 3 * r.nextInt(4) + 9 |
79 |
#sc.fillets = r.nextBoolean() |
#sc.fillets = r.nextBoolean() |
80 |
|
|
81 |
sc.seed, sc.seed2, sc.path2, sc.N, sc.fillets = trials.pop() |
render(vs0) |
82 |
|
|
83 |
if sc.fillets: |
sc.seed, sc.seed2, sc.path2, sc.N, fillets = trials.pop() |
84 |
|
if fillets: |
85 |
sc.rot = (0,0,1,0) |
sc.rot = (0,0,1,0) |
86 |
else: |
else: |
87 |
sc.rot = (0,0,0,1) |
sc.rot = (0,0,0,1) |
|
|
|
88 |
|
|
89 |
vs1 = getvs() |
sc.fillets = fillets |
90 |
sc.scene(vs1) |
sc.thick = 1 |
91 |
|
vs2 = getvs() |
92 |
|
sc.scene(vs2) |
93 |
|
|
94 |
timeScrub() |
timeScrub() |
95 |
|
|
96 |
render(vs0) |
warn = "" |
97 |
Thread.sleep(1000) |
renderOnly(vs2) |
98 |
|
t1 = java.lang.System.currentTimeMillis() |
99 |
|
t = 1500 - (t1 - t0) |
100 |
|
if t > 0: |
101 |
|
Thread.sleep(t) |
102 |
|
else: |
103 |
|
warn += "B%d" % (-t,) |
104 |
|
print "Warning: did not get any sleep" |
105 |
|
|
106 |
render(vs1) |
swapBuffers() |
107 |
(key, msec) = waitkey() |
(key, msec) = waitkey() |
|
|
|
108 |
render(vs0) |
render(vs0) |
109 |
|
t0 = java.lang.System.currentTimeMillis() |
110 |
outfile.write("%s %s %s %s %s %s %s\n" % ( |
|
111 |
|
if key == "Print": |
112 |
|
globals()["frame"] = globals().get("frame", 0) + 1; |
113 |
|
saveframe("frame%d.png" % (frame, ), demowindow.w) |
114 |
|
|
115 |
|
outfile.write("%s %s %s %s %s %s %s %s\n" % ( |
116 |
key, msec, sc.fillets, sc.N, sc.path2, |
key, msec, sc.fillets, sc.N, sc.path2, |
117 |
sc.seed, sc.seed2, |
sc.seed, sc.seed2, warn, |
118 |
)) |
)) |
119 |
|
|
120 |
outfile.flush() |
outfile.flush() |
121 |
|
|
122 |
timeScrub() |
timeScrub() |
123 |
|
|
124 |
|
|
125 |
|
System.exit(0) |