gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob/include/vob/geom Fillets2.hxx


From: Janne V. Kujala
Subject: [Gzz-commits] libvob/include/vob/geom Fillets2.hxx
Date: Tue, 24 Jun 2003 09:13:25 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/06/24 09:13:25

Modified files:
        include/vob/geom: Fillets2.hxx 

Log message:
        fix div by zero in z calculation

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/geom/Fillets2.hxx.diff?tr1=1.19&tr2=1.20&r1=text&r2=text

Patches:
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.19 
libvob/include/vob/geom/Fillets2.hxx:1.20
--- libvob/include/vob/geom/Fillets2.hxx:1.19   Tue Jun 24 07:51:10 2003
+++ libvob/include/vob/geom/Fillets2.hxx        Tue Jun 24 09:13:24 2003
@@ -147,8 +147,13 @@
                v = v - dir.dot(v-node.ctr) * dir;
            }
 #endif
-           v.z = lerp(node.ctr.z, z, (l - node.r) / (d - node.r));
-           if (l < node.r) v.z = node.ctr.z;
+           float f = (l - node.r) / (d - node.r);          
+           if (f >= 1)
+               v.z = z;
+           else if (f >= 0)
+               v.z = lerp(node.ctr.z, z, f);
+           else 
+               v.z = node.ctr.z;
            return v;
        }
 




reply via email to

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