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


From: Janne V. Kujala
Subject: [Gzz-commits] libvob/include/vob/vobs Fillet.hxx
Date: Tue, 24 Jun 2003 08:04:44 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/06/24 08:04:42

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

Log message:
        cleanup

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

Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.18 
libvob/include/vob/vobs/Fillet.hxx:1.19
--- libvob/include/vob/vobs/Fillet.hxx:1.18     Tue Jun 24 07:51:10 2003
+++ libvob/include/vob/vobs/Fillet.hxx  Tue Jun 24 08:04:41 2003
@@ -152,6 +152,20 @@
            th = r * thick_t.transform(ZVec(d / r, 0, 0)).x;
 
            a = angle_t.transform(ZVec(d / r, 0, 0)).x;
+
+           // XXX: prevent negative stretching by adjusting the "tangent"
+           // angles, if necessary
+           float t = 0.5 * th;
+           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 / r0;
+           if (f < 1.0) a = asin(t / r) * sin(M_PI_2 * f);
+
            DBG(dbg_vfillets) << 
                format("FilletSpan CONN: r: %s d: %s  th: %s a: %s") %
                    r% d% th% a;
@@ -285,28 +299,8 @@
 
        float csize = crad(t0);
 
-       Conn conn1(thick_t, angle_t, t0, t1, d1);//0.5 * (p1 - ctr).length());
-       Conn conn2(thick_t, angle_t, t0, t2, d2);//0.5 * (p2 - ctr).length());
-
-       // XXX: prevent negative stretching by adjusting the "tangent"
-       // angles, if necessary
-       float r = csize;
-       float T1 = 0.5 * conn1.th;
-       float T2 = 0.5 * conn2.th;
-       float R1 = (d1*d1+T1*T1-r*r) / (2*r - 2*T1);
-       float R2 = (d2*d2+T2*T2-r*r) / (2*r - 2*T2);
-       float at1 = asin((T1 + R1) / (r + R1));
-       float at2 = asin((T2 + R2) / (r + R2));
-       if (conn1.a > at1) conn1.a = at1;
-       if (conn2.a > at2) conn2.a = at2;
-
-       // 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 frac1 = 2 * d1 / (crad(t0) + crad(t1));
-       float frac2 = 2 * d2 / (crad(t0) + crad(t2));
-       if (frac1 < 1.0) conn1.a = asin(T1 / r) * sin(M_PI_2 * frac1);
-       if (frac2 < 1.0) conn2.a = asin(T2 / r) * sin(M_PI_2 * frac2);
+       Conn conn1(thick_t, angle_t, t0, t1, d1);
+       Conn conn2(thick_t, angle_t, t0, t2, d2);
 
        float th1 = conn1.th;
        float th2 = conn2.th;




reply via email to

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