gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/sqfillet.py libcoords/Coords.hxx l...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx demo/sqfillet.py libcoords/Coords.hxx l...
Date: Wed, 23 Oct 2002 02:13:04 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/23 02:13:04

Modified files:
        gfx/demo       : sqfillet.py 
        gfx/libcoords  : Coords.hxx 
        gfx/libfillet  : Fillet.cxx Fillet.hxx 
        gfx/librenderables: renderables.py 

Log message:
        Twid, doc coords

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/sqfillet.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.hxx.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libfillet/Fillet.cxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libfillet/Fillet.hxx.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.111&tr2=1.112&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/sqfillet.py
diff -u gzz/gfx/demo/sqfillet.py:1.2 gzz/gfx/demo/sqfillet.py:1.3
--- gzz/gfx/demo/sqfillet.py:1.2        Tue Oct 22 13:03:45 2002
+++ gzz/gfx/demo/sqfillet.py    Wed Oct 23 02:13:04 2002
@@ -4,9 +4,13 @@
 class SqfScene:
     def __init__(self):
        self.x = [105, 850, 900]
+       self.flags = [1, 0]
     def key(self, key):
        if key == "c":
            rotatelist(self.x)
+       if key == "f":
+           rotatelist(self.flags)
+           print "Flags: ",self.flags[0]
        pass
     def scene(self, vs):
        vs.map.put(background((.2, .4, .5)))
@@ -35,22 +39,21 @@
            LineWidth 1
        """))
 
-       vs.map.put(GLRen.createSqFilletConnection(40), cs1, 
-           cs2)
+       fil = GLRen.createSqFilletConnection(20, self.flags[0])
+
+       vs.map.put(fil, cs1, cs2)
 
        vs.map.put(getDListNocoords("""
            Color 1 0 0
        """))
 
-       vs.map.put(GLRen.createSqFilletConnection(40), cs1, 
-           cs3)
+       vs.map.put(fil, cs1, cs3)
 
        vs.map.put(getDListNocoords("""
            Color 0 1 0
        """))
 
-       vs.map.put(GLRen.createSqFilletConnection(40), cs2, 
-           cs3)
+       vs.map.put(fil, cs2, cs3)
 
 
 currentScene = SqfScene()
Index: gzz/gfx/libcoords/Coords.hxx
diff -u gzz/gfx/libcoords/Coords.hxx:1.17 gzz/gfx/libcoords/Coords.hxx:1.18
--- gzz/gfx/libcoords/Coords.hxx:1.17   Tue Oct 22 12:28:22 2002
+++ gzz/gfx/libcoords/Coords.hxx        Wed Oct 23 02:13:04 2002
@@ -168,15 +168,16 @@
            }
        }
        /** Set the coordinate systems.
-        * @param points1 npts floats
-        * @param typeindex1 Array of length ninds*3, containing interleaved
-        *        the type of the coordsys, the parent coordsys, then index in 
points1
-        *        Note: the first three elements are purposefully ignored.
-        * @param typeindex2 Array of length ninds*3, containing interleaved
-        *        the type of the coordsys, the parent coordsys, then index in 
points2
-        *        Note: the first three elements are purposefully ignored.
-        *        The only elements used here are the indices in point2, indexed
-        *        by interpinds.
+        * @param points1 floats: the parameters of the coordinate
+        *              systems.
+        * @param inds1 Array of length ninds, 
+        *      containing descriptions of coordinate systems.
+        *      1) type code
+        *      2) parent and determining coordinate systems,
+        *         as many as the type code requires (usually 1 or 2)
+        *      3) an index to the points1 array, where the parameters
+        *         of the coordinate system should be read from.
+        * @param inds2 A second array, similar to inds1, but for points2.
         */
        void CoordSet::setPoints( int ninds, 
                                 int *inds1, float *points1, 
Index: gzz/gfx/libfillet/Fillet.cxx
diff -u gzz/gfx/libfillet/Fillet.cxx:1.2 gzz/gfx/libfillet/Fillet.cxx:1.3
--- gzz/gfx/libfillet/Fillet.cxx:1.2    Tue Oct 22 13:03:45 2002
+++ gzz/gfx/libfillet/Fillet.cxx        Wed Oct 23 02:13:04 2002
@@ -53,6 +53,9 @@
        // Blending functions
        float b = 1 - sqrt(sqrt(1-(1-t)*(1-t)*(1-t)*(1-t))); // distance
        // float b = 1 - sqrt(1-(1-t)*(1-t)); // distance
+       
+       if(flags & 1) 
+           b *= (fabs(y) / (fabs(x) + fabs(y))); // multiply by angle.
        float c = 1 - t * t * (3 - 2 * t * t); // direction
 
 
Index: gzz/gfx/libfillet/Fillet.hxx
diff -u gzz/gfx/libfillet/Fillet.hxx:1.4 gzz/gfx/libfillet/Fillet.hxx:1.5
--- gzz/gfx/libfillet/Fillet.hxx:1.4    Tue Oct 22 13:03:45 2002
+++ gzz/gfx/libfillet/Fillet.hxx        Wed Oct 23 02:13:04 2002
@@ -87,9 +87,10 @@
        float length;
        Vec dir;
        Vec norm;
+       int flags;
 
-       FilletDistort(ZPt center, ZPt to, float width) :
-           center(center), to(to), width(width) {
+       FilletDistort(ZPt center, ZPt to, float width, int flags) :
+           center(center), to(to), width(width), flags(flags) {
            dir = Vec(to-center).normalize();
            norm = dir.cw90();
            length = Vec(to-center).length();
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.111 
gzz/gfx/librenderables/renderables.py:1.112
--- gzz/gfx/librenderables/renderables.py:1.111 Tue Oct 22 12:28:22 2002
+++ gzz/gfx/librenderables/renderables.py       Wed Oct 23 02:13:04 2002
@@ -293,9 +293,9 @@
 {
     "Type": "2",
     "Name": "SqFilletConnection",
-    "Data": "float width;",
-    "Params": "float width",
-    "ParamCode": "this->width = width;",
+    "Data": "float width;int flags;",
+    "Params": "float width, int flags",
+    "ParamCode": "this->width = width; this->flags = flags; ",
     "RenderCode" : """
            vector<ZPt> sq1;
            vector<ZPt> sq2;
@@ -311,8 +311,8 @@
            ZPt ctr2 = coords2.transform(ZPt(.5, .5, 0));
            ZPt mid = 0.5*(ctr1 + ctr2);
 
-           Fillet::FilletDistort d1(ctr1, mid, width);
-           Fillet::FilletDistort d2(ctr2, mid, width);
+           Fillet::FilletDistort d1(ctr1, mid, width, flags);
+           Fillet::FilletDistort d2(ctr2, mid, width, flags);
 
            vector<ZPt> o1;
            if(!Fillet::blendEdge(sq1.begin(), sq1.end(), 




reply via email to

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