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: Tuomas J. Lukka
Subject: [Gzz-commits] libvob/include/vob/geom Fillets2.hxx
Date: Thu, 05 Jun 2003 03:15:53 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/06/05 03:15:53

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

Log message:
        doccing

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

Patches:
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.5 
libvob/include/vob/geom/Fillets2.hxx:1.6
--- libvob/include/vob/geom/Fillets2.hxx:1.5    Thu Jun  5 00:56:12 2003
+++ libvob/include/vob/geom/Fillets2.hxx        Thu Jun  5 03:15:53 2003
@@ -50,7 +50,7 @@
        }
     };
 
-    /** A connection. The node is assumed to be known.
+    /** A connection. 
      */
     struct LinearConnectionHalf {
        const CircularNode &node;
@@ -110,6 +110,7 @@
         * node) on the connection
         * line, it will be clamped to the center.
         * Useful for generating internal points.
+        * XXX Z calculation needs thinking.
         */
        ZVec projectToConnLine(ZVec v) const {
            float l = (v - node.ctr).xylength();
@@ -124,12 +125,19 @@
     };
 
     /** A circular fillet edge span, for a circular node.
+     * This is simply a circular arc from the connection to the point
+     * where it is tangent to the circular node.
      */
     struct CircleCircleFillet {
        const CircularNode &node;
        const LinearConnectionHalf &conn;
 
+       /** Center of the circle of which the arc is taken.
+        */
        Vec fcenter;
+
+       /** Radius of the arc.
+        */
        float frad;
 
        /** The direction vector from the center of the node
@@ -138,9 +146,17 @@
         */
        Vec dirtang;
 
+       /** The sign: calculate cross product of a vector with dirtang,
+        * if sign is same as here, then we it is on the same side as the 
+        * arc.
+        */
        float dtsign;
 
+       /** The start angle of the arc, looking from fcenter.
+        */
        float astart;
+       /** The end angle of the arc, looking from fcenter.
+        */
        float aend;
 
        CircleCircleFillet(
@@ -197,12 +213,20 @@
            return in;
        }
 
+       /** Whether the given direction vector from the center of the node is 
inside
+        * the fillet. This does *not* guarantee that point(dir) will be a 
success:
+        * this function includes vectors inside the connection to the fillet 
but point()
+        * naturally does not.
+        */
        bool infillet(Vec dir) const {
            return dirtang.cross(conn.dir) * dirtang.cross(dir) >= 0 &&
                conn.dir.cross(dirtang) * conn.dir.cross(dir) >= 0;
        }
        /** Returns true if either of the directions where the circles
         * are tangent is inside the other fillet area.
+        * This is not *quite* the same as the trivial definition
+        * of overlapping: it returns false if the tangent points are 
+        * past the connections.
         */
        bool overlaps(const CircleCircleFillet &other) const {
            return infillet(other.dirtang) || other.infillet(dirtang);
@@ -241,6 +265,9 @@
        }
     };
 
+    /** A linearly interpolated fillet span between two given 
+     * ones.
+     */
     template<class S1, class S2> struct LerpFilletSpan {
        const S1 &s1;
        const S2 &s2;
@@ -255,11 +282,14 @@
            return res;
        }
     };
+
     template<class S1, class S2> LerpFilletSpan<S1, S2> makeLerpFilletSpan(
                const S1 &s1, const S2 &s2, float fract) {
        return LerpFilletSpan<S1,S2>(s1, s2, fract);
     }
 
+    /** A span of the circular node shape. 
+     */
     struct CircularNodeSpan {
        const CircularNode &node;
        float astart;




reply via email to

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