From 1c585e5d67cc5445b9792e0fa4b4ba567735f607 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 13 Sep 2021 15:53:55 +0200 Subject: [PATCH] Cylinder::IsIdentic use angle-epsilon --- libsrc/csg/algprim.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libsrc/csg/algprim.cpp b/libsrc/csg/algprim.cpp index 8aa9be73..09d1b497 100644 --- a/libsrc/csg/algprim.cpp +++ b/libsrc/csg/algprim.cpp @@ -877,9 +877,11 @@ namespace netgen Vec<3> v1 = b - a; Vec<3> v2 = cyl2->a - a; - if ( fabs (v1 * v2) < (1-eps) * v1.Length() * v2.Length()) return 0; + // if ( fabs (v1 * v2) < (1-1e-12) * v1.Length() * v2.Length()) return 0; + if ( Cross(v1,v2).Length2() > 1e-20 * v1.Length2() * v2.Length2()) return 0; v2 = cyl2->b - a; - if ( fabs (v1 * v2) < (1-eps) * v1.Length() * v2.Length()) return 0; + // if ( fabs (v1 * v2) < (1-eps) * v1.Length() * v2.Length()) return 0; + if ( Cross(v1,v2).Length2() > 1e-20 * v1.Length2() * v2.Length2()) return 0; inv = 0; return 1;