[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/include/vob Vec23.hxx geom/Fillets2.hxx ...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob/include/vob Vec23.hxx geom/Fillets2.hxx ... |
Date: |
Thu, 12 Jun 2003 09:28:53 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/06/12 09:28:53
Modified files:
include/vob : Vec23.hxx
include/vob/geom: Fillets2.hxx
include/vob/vobs: Fillet.hxx
Log message:
Use standard definitions for Vec23 atan & dirVec; ellipse fillets broken
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Vec23.hxx.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/geom/Fillets2.hxx.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: libvob/include/vob/Vec23.hxx
diff -u libvob/include/vob/Vec23.hxx:1.10 libvob/include/vob/Vec23.hxx:1.11
--- libvob/include/vob/Vec23.hxx:1.10 Fri Jun 6 04:30:59 2003
+++ libvob/include/vob/Vec23.hxx Thu Jun 12 09:28:53 2003
@@ -117,7 +117,7 @@
}
double atan() const {
- return atan2(x, y);
+ return atan2(y, x);
}
};
@@ -397,7 +397,7 @@
* (sin angle, cos angle).
*/
inline Vec dirVec(float angle) {
- return Vec(sin(angle), cos(angle));
+ return Vec(cos(angle), sin(angle));
}
}
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.10
libvob/include/vob/geom/Fillets2.hxx:1.11
--- libvob/include/vob/geom/Fillets2.hxx:1.10 Wed Jun 11 13:41:55 2003
+++ libvob/include/vob/geom/Fillets2.hxx Thu Jun 12 09:28:53 2003
@@ -91,7 +91,7 @@
/** The thickness of the connection at the middle.
*/
float t;
- /** Whether we're looking at the clockwise or counterclockwise side.
+ /** Whether we're looking at the clockwise (+1) or counterclockwise
(-1) side.
*/
int sign;
/** The z coordinate of the middle.
@@ -102,11 +102,11 @@
// The following data members are derivable from the already mentioned
ones.
// They are calculated here to be cached.
- /** The direction (unit) vector.
+ /** The direction (unit) vector of the connection (from the node).
*/
Vec dir;
- /** The normal (unit) vector.
+ /** The normal (unit) vector of the connection pointing to the outside.
*/
Vec norm;
@@ -183,7 +183,7 @@
x1 = (node.r+r1) * cos(ta);
- dirTang = dirVec(conn.a + conn.sign * tangentAngle);
+ dirTang = dirVec(conn.a - conn.sign * tangentAngle);
}
ZVec point(float fract, ZVec *intern = 0) const {
@@ -219,11 +219,15 @@
const LinearConnectionHalf &conn;
float tangentAngle;
+ /** Direction vector pointing to the point where the fillet touches
the circle
+ */
Vec dirTang;
float dtSign;
Vec ept, eno;
+ /** Lengths of the half axes
+ */
Vec elli;
Vec ey;
@@ -257,7 +261,7 @@
ecenter = conn.endPoint - ex;
- dirTang = dirVec(conn.a + conn.sign * tangentAngle);
+ dirTang = dirVec(conn.a - conn.sign * tangentAngle);
dtSign = conn.sign;
/* Now, the ellipse always starts at angle 0. Find
@@ -267,7 +271,7 @@
pt2.x *= elli.y / elli.x;
pt2.y = elli.y - pt2.y;
- eangle = pt2.atan();
+ eangle = atan2(pt2.x, pt2.y);
DBG(dbg_fillets) << format("Ellipse: ept: %s, eno: %s, elli: %s,
ecenter: %s, "
"dirtang: %s, dtsign: %s, eangle: %s\n") %
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.12
libvob/include/vob/vobs/Fillet.hxx:1.13
--- libvob/include/vob/vobs/Fillet.hxx:1.12 Fri Jun 6 16:04:20 2003
+++ libvob/include/vob/vobs/Fillet.hxx Thu Jun 12 09:28:53 2003
@@ -85,7 +85,7 @@
a[nconst].angle = -1000;
a[nconst].ind = 0;
for(int i=nconst + 1; i<n; i++) {
- a[i].angle = (v[i] - v[0]).atan();
+ a[i].angle = (v[i] - v[nconst]).atan();
a[i].ind = i;
}
@@ -247,7 +247,7 @@
}
template<class G> void renderSpan(const G &g, int sign) const {
- renderSpanPolyedged(g, -sign);
+ renderSpanPolyedged(g, sign);
}
@@ -297,8 +297,8 @@
"\n";
CircularNode node(ctr, csize);
- LinearConnectionHalf c1(node, a1, d1, th1, 1, lerp(p0.z, p1.z, .5));
- LinearConnectionHalf c2(node, a2, d2, th2, -1, lerp(p0.z, p2.z, .5));
+ LinearConnectionHalf c1(node, a1, d1, th1, -1, lerp(p0.z, p1.z, .5));
+ LinearConnectionHalf c2(node, a2, d2, th2, 1, lerp(p0.z, p2.z, .5));
if(flags & 64) { // Stretched circle
@@ -335,10 +335,10 @@
float va1 = a2 - maxw;
float va2 = a1 + maxw;
- LinearConnectionHalf vc2(node, va2, d2, th2, -1, lerp(p0.z,
p2.z, .5));
+ LinearConnectionHalf vc2(node, va2, d2, th2, 1, lerp(p0.z,
p2.z, .5));
EllipseCircleFillet vf2(node, vc2, conn2.a);
- LinearConnectionHalf vc1(node, va1, d1, th1, 1, lerp(p0.z,
p1.z, .5));
+ LinearConnectionHalf vc1(node, va1, d1, th1, -1, lerp(p0.z,
p1.z, .5));
EllipseCircleFillet vf1(node, vc1, conn1.a);
DBG(dbg_vfillets) << "P cleave: "<< w1<<" "<<w2<<" "
@@ -382,10 +382,10 @@
float va1 = a2 - maxw;
float va2 = a1 + maxw;
- LinearConnectionHalf vc2(node, va2, d2, th2, -1, lerp(p0.z,
p2.z, .5));
+ LinearConnectionHalf vc2(node, va2, d2, th2, 1, lerp(p0.z,
p2.z, .5));
CircleCircleFillet vf2(node, vc2);
- LinearConnectionHalf vc1(node, va1, d1, th1, 1, lerp(p0.z,
p1.z, .5));
+ LinearConnectionHalf vc1(node, va1, d1, th1, -1, lerp(p0.z,
p1.z, .5));
CircleCircleFillet vf1(node, vc1);
DBG(dbg_vfillets) << "P cleave: "<< w1<<" "<<w2<<" "
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob/include/vob Vec23.hxx geom/Fillets2.hxx ...,
Janne V. Kujala <=