fenfire-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ff-cvs] libvob/vob demo/multifil/stretching.py fillet/l...


From: Janne V. Kujala
Subject: [ff-cvs] libvob/vob demo/multifil/stretching.py fillet/l...
Date: Thu, 21 Aug 2003 08:20:15 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/08/21 08:20:15

Modified files:
        vob/demo/multifil: stretching.py 
        vob/fillet     : light3d.py 
        vob/usertest   : fillet1.py 

Log message:
        fillet exper twids; use positive asymptotic thickness

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/stretching.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/usertest/fillet1.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: libvob/vob/demo/multifil/stretching.py
diff -u libvob/vob/demo/multifil/stretching.py:1.6 
libvob/vob/demo/multifil/stretching.py:1.7
--- libvob/vob/demo/multifil/stretching.py:1.6  Wed Jul  9 04:01:17 2003
+++ libvob/vob/demo/multifil/stretching.py      Thu Aug 21 08:20:15 2003
@@ -44,24 +44,6 @@
     def scene(self, vs):
        vs.put( background((.5,1,.2)))
 
-        #angle = vs.orthoCS(0, "Ang", 0, self.angle, 0, 0, 0);
-
-       #thick = vs.orthoCS(0, "Thi", 0, self.thick, 0, 0, 0);
-        #thick = vs.orthoCS(0, "Thi", 0, 100*(self.thick / (math.hypot(self.x 
- 500, self.y - 500)+50)), 0, 0, 0);
-
-        thick = vs.coords.rational1D22(0, self.thick, 0, 0,  1, 1, 0);
-        thick = vs.coords.rational1D22(0, 4 * self.thick, self.thick, 0, 4, 1, 
1);
-        thick = vs.coords.power1D(0, self.thick, -1/2.);
-        
-        t = 1
-        m = self.thick
-        thick = vs.coords.rational1D22(0, 2*m, t*m, 0, 2, t, 1);
-        angle = vs.coords.rational1D22(0, 1, 0, self.angle, 0, 1, 0);
-        angle = vs.coords.rational1D22(0, 1, self.angle, 0, 1, 0, 0);
-        angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
-        vs.matcher.add(thick, "Thi2")
-        vs.matcher.add(angle, "Ang2")
-
         N = 10
 
         a = [vs.orthoBoxCS(0, "A%s" % i, 0, 100, 100+100*i,
@@ -74,8 +56,8 @@
        def pc(conns, cs):
 
             for i in range(0, N):
-                vs.put(conns, [thick, angle, a[i],  b[i]]);
-                vs.put(conns, [thick, angle, b[i],  a[i]]);
+                vs.put(conns, cs + [a[i],  b[i]]);
+                vs.put(conns, cs + [b[i],  a[i]]);
 
 
         light3d.drawFillets(self, vs, pc)
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.38 libvob/vob/fillet/light3d.py:1.39
--- libvob/vob/fillet/light3d.py:1.38   Tue Aug 19 11:14:36 2003
+++ libvob/vob/fillet/light3d.py        Thu Aug 21 08:20:15 2003
@@ -334,7 +334,10 @@
             thick = vs.coords.rational1D22(0, .5 * self.thick, 0, 0,  1, 1, 0);
             angle = vs.coords.rational1D22(0, self.angle, 0, 0,  1, 0, 0);
 
-            thick = vs.coords.rational1D22(0, 2*self.thick, self.thick, 0, 2, 
1, 1);
+            thick = vs.coords.rational1D22(0,
+                                           2*self.thick, self.thick,
+                                           .05, 2, 1, 1);
+            
             angle = vs.coords.power1D2(0, self.angle, 1/3., 1, -1);
         else:
             thick = vs.coords.power1D2(0, .15 * self.thick, 0, 0, 0)
Index: libvob/vob/usertest/fillet1.py
diff -u libvob/vob/usertest/fillet1.py:1.1 libvob/vob/usertest/fillet1.py:1.2
--- libvob/vob/usertest/fillet1.py:1.1  Tue Aug 19 11:14:36 2003
+++ libvob/vob/usertest/fillet1.py      Thu Aug 21 08:20:15 2003
@@ -25,33 +25,58 @@
 from vob.putil.misc import *
 from java.lang import Thread
 import math
+from random import shuffle
 
 from vob.demo.multifil import randgraph
 
+from vob.putil import demowindow
+
 def run():
+    demowindow.w.setLocation(0,0,1600,1200)
+
+    
+    seed = java.lang.System.currentTimeMillis()
 
     outfile = open("fillet.dat", "a")
-    outfile.write("---\n")
+    outfile.write("--- %s\n" % (seed,))
 
-    r = java.util.Random(java.lang.System.currentTimeMillis())
+    r = java.util.Random(seed)
     for i in range(0,100): # drive in: problem with java.util.Random
        r.nextDouble()
 
     sc = randgraph.Scene()
-    sc.size = 30
-    sc.box = 700
+    #sc.size = 30
+    #sc.box = 700
+    sc.size = 50
+    sc.box = 1100
     sc.blend3d = 1
 
     vs0 = getvs()
     vs0.put(background((.5,1,.2)))
 
-    while 1:
+    graphs = []
+    for i in range(0,6):
+        for path2 in (0,1):
+            for N in (9,15,21):
+                graphs.append( (r.nextInt(), r.nextInt(), path2, N) )
+
+    trials = []
+    for g in graphs:
+        for fillets in (0,1):
+            trials.append( (g[0], g[1], g[2], g[3], fillets) )
+
+    shuffle(trials, r.nextDouble)
+
+
+    while trials:
+
+        #sc.seed = r.nextInt()
+        #sc.seed2 = r.nextInt()
+        #sc.path2 = r.nextBoolean()
+        #sc.N = 3 * r.nextInt(4) + 9
+        #sc.fillets = r.nextBoolean()
 
-        sc.seed = r.nextInt()
-        sc.seed2 = r.nextInt()
-        sc.path2 = r.nextBoolean()
-        sc.N = 3 * r.nextInt(4) + 9
-        sc.fillets = r.nextBoolean()
+        sc.seed, sc.seed2, sc.path2, sc.N, sc.fillets = trials.pop()
 
         vs1 = getvs()
         sc.scene(vs1)
@@ -63,7 +88,6 @@
 
         render(vs1)
        (key, msec) = waitkey()
-       # print delta
 
        render(vs0)
         




reply via email to

[Prev in Thread] Current Thread [Next in Thread]