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 vobs/Fille...


From: Janne V. Kujala
Subject: [Gzz-commits] libvob/include/vob geom/Fillets2.hxx vobs/Fille...
Date: Wed, 25 Jun 2003 09:15:21 -0400

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

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

Log message:
        angle and thickness fixes

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

Patches:
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.23 
libvob/include/vob/geom/Fillets2.hxx:1.24
--- libvob/include/vob/geom/Fillets2.hxx:1.23   Wed Jun 25 07:58:53 2003
+++ libvob/include/vob/geom/Fillets2.hxx        Wed Jun 25 09:15:21 2003
@@ -213,6 +213,8 @@
 
            float xn = x + C*x*x*x + x0;
 
+           if (!(fabs(C) < 1E4)) xn = (fract == 0) ? conn.d : x0;
+
            ZVec pt = node.ctr + xn * conn.dir + y * conn.norm;
 
            ZVec proj = conn.projectToConnLine(pt);
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.24 
libvob/include/vob/vobs/Fillet.hxx:1.25
--- libvob/include/vob/vobs/Fillet.hxx:1.24     Wed Jun 25 07:58:53 2003
+++ libvob/include/vob/vobs/Fillet.hxx  Wed Jun 25 09:15:21 2003
@@ -153,18 +153,28 @@
 
            a = angle_t.transform(ZVec(d / r, 0, 0)).x;
 
-           // XXX: prevent negative stretching by adjusting the "tangent"
-           // angles, if necessary
+           // XXX: prevent the connection from being thicker than the node
+           //if (th > 2 * r0) th = 2 * r0;
+
            float t = 0.5 * th;
+
+           // XXX: prevent the middle of the connection from being 
+           // thicker than the start by adjusting the "tangent" 
+           // angle if necessary
+           float aw = asin(t / r0);
+           if (a < aw) a = aw;
+
+           // XXX: prevent negative stretching by adjusting the "tangent"
+           // angle, if necessary
            float r2 = (d*d+t*t-r0*r0) / (2*r0 - 2*t);
            float at = asin((t + r2) / (r0 + r2));
            if (a > at) a = at;
 
            // XXX: interpolate angle to zero from the point of
            // "overlap" (i.e., where the beginning and end of the side
-           // of a fillet meet) to when the nodes coincide.
-           float f = d / (cos(a) * r0);
-           if (f < 1.0) a = asin(t / r0) * sin(M_PI_2 * f);
+           // of a fillet meet) to where the nodes coincide.
+           float f = d / (cos(aw) * r0);
+           if (f < 1.0) a = aw * sin(M_PI_2 * f);
 
            DBG(dbg_vfillets) << 
                format("FilletSpan CONN: r: %s d: %s  th: %s a: %s") %




reply via email to

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