gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/fillet/l...


From: Janne V. Kujala
Subject: [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/fillet/l...
Date: Tue, 01 Jul 2003 10:32:56 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/07/01 10:32:56

Modified files:
        include/vob/vobs: Fillet.hxx 
        vob/fillet     : light3d.py 

Log message:
        try a different blending function

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.35&tr2=1.36&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text

Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.35 
libvob/include/vob/vobs/Fillet.hxx:1.36
--- libvob/include/vob/vobs/Fillet.hxx:1.35     Tue Jul  1 09:09:09 2003
+++ libvob/include/vob/vobs/Fillet.hxx  Tue Jul  1 10:32:56 2003
@@ -707,19 +707,28 @@
     };
 
     ZVec blend(Conn *conns[], int N, float r, ZVec pt) const {
-       int num = 0;
+       int i, num = 0;
        float sum = 0;
+       float x[N];
 
-       for (int i = 0; i < N; i++) {
+       // Compute distances from the node for each fillet surface
+       for (i = 0; i < N; i++) {
            bool success;
            float t = conns[i]->rad(pt, success);
-           if (success) {
-               sum += t - r;
-               num++;
-           }
+           if (success)
+               sum += x[num++] = (t - r) / r;
        }
 
-       return pt * (1 + sum / r);
+       // Compute p for an l^p norm to be used as the blending function
+       // p == 1: sum of distance, 
+       // p == \infty: maximum of distances
+       float p = 1.0 + sum;
+
+       sum = 0;
+       for (i = 0; i < num; i++) 
+           sum += pow(x[i], p);
+       
+       return pt * (1 + pow(sum, 1 / p));
 
     }
 
@@ -795,6 +804,9 @@
            }
            glNormal(norm[i][0]);
            glVertex(pt[i][0]);
+
+           glNormal(norm[i+1][0]);
+           glVertex(pt[i+1][0]);
            glEnd();
        }
 
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.25 libvob/vob/fillet/light3d.py:1.26
--- libvob/vob/fillet/light3d.py:1.25   Mon Jun 30 08:28:34 2003
+++ libvob/vob/fillet/light3d.py        Tue Jul  1 10:32:56 2003
@@ -276,8 +276,8 @@
                 uLookAt 400 400 -1000 400 400 400 0 -1 0
                 """))
 
-            #if not self.blend3d:
-            pc(conns3d, [thick, angle])
+            if self.drawInside:
+                pc(conns3d, [thick, angle])
 
             if self.blend3d:
                 pc(conns3dblend, [thick, angle])




reply via email to

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