[Top][All Lists]
[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: |
Fri, 13 Jun 2003 09:23:44 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/06/13 09:23:44
Modified files:
include/vob/geom: Fillets2.hxx
Log message:
cleanup
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/geom/Fillets2.hxx.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: libvob/include/vob/geom/Fillets2.hxx
diff -u libvob/include/vob/geom/Fillets2.hxx:1.12
libvob/include/vob/geom/Fillets2.hxx:1.13
--- libvob/include/vob/geom/Fillets2.hxx:1.12 Fri Jun 13 08:13:36 2003
+++ libvob/include/vob/geom/Fillets2.hxx Fri Jun 13 09:23:44 2003
@@ -215,13 +215,6 @@
}
ZVec point(Vec dir, bool &success, float *ptfract = NULL) const {
- if (!infillet(dir)) {
- success = false;
- return ZVec();
- }
-
-
-
float f0 = 0;
float f1 = 1;
float f;
@@ -229,27 +222,22 @@
ZVec p0 = point(f0) - node.ctr;
ZVec p1 = point(f1) - node.ctr;
ZVec p;
+
+ if (dir.cross(p0) * dtSign < 0 ||
+ dir.cross(p1) * dtSign > 0) {
+ success = false;
+ return ZVec();
+ }
- const float eps = 1E-3;
- float coseps = cos(eps);
+ Vec dir2 = dir.cw90();
+ double err;
+ double maxerr = .01 * node.r;
while (1) {
f = 0.5 * (f0 + f1);
p = point(f) - node.ctr;
-
- float t = dir.dot(p);
- /*
- cout << f << Vec(p.x,p.y).normalized()
- << f0 << Vec(p0.x,p0.y).normalized()
- << f1 << Vec(p1.x,p1.y).normalized()
- << dir << t * t / p.dot(p) << std::endl;
- */
- if (t * t > coseps * (p.x * p.x + p.y * p.y)) break;
-
- if (f < eps || f > (1 - eps)) {
- success = false;
- return p + node.ctr;
- }
+ err = dir2.dot(p);
+ if (fabs(err) < maxerr) break;
if (dir.cross(p) * dtSign > 0) {
p0 = p;
@@ -262,7 +250,7 @@
success = true;
if (ptfract) *ptfract = f;
- return p + node.ctr;
+ return p - err * dir2 + node.ctr;
}
void cutEnd(Vec dir) {
bool success;
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Tuomas J. Lukka, 2003/06/01
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Tuomas J. Lukka, 2003/06/05
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Tuomas J. Lukka, 2003/06/05
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx,
Janne V. Kujala <=
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Janne V. Kujala, 2003/06/13
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Janne V. Kujala, 2003/06/23
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Janne V. Kujala, 2003/06/24
- [Gzz-commits] libvob/include/vob/geom Fillets2.hxx, Janne V. Kujala, 2003/06/24