Revision: 41483
http://brlcad.svn.sourceforge.net/brlcad/?rev=41483&view=rev
Author: indianlarry
Date: 2010-11-30 15:34:31 +0000 (Tue, 30 Nov 2010)
Log Message:
-----------
Try to iterate to a solution within BREP_INTERSECTION_ROOT_EPSILON, if cannot
get to that resolution check result and accept if within
BREP_INTERSECTION_ROOT_SETTLE.
Modified Paths:
--------------
brlcad/trunk/include/brep.h
brlcad/trunk/src/librt/primitives/brep/brep.cpp
Modified: brlcad/trunk/include/brep.h
===================================================================
--- brlcad/trunk/include/brep.h 2010-11-30 15:25:20 UTC (rev 41482)
+++ brlcad/trunk/include/brep.h 2010-11-30 15:34:31 UTC (rev 41483)
@@ -58,6 +58,8 @@
#define BREP_MAX_ITERATIONS 100
/** Root finding threshold */
#define BREP_INTERSECTION_ROOT_EPSILON 1e-6
+/* if threshold not reached what will we settle for close enough */
+#define BREP_INTERSECTION_ROOT_SETTLE 1e-2
/** Jungle Gym epsilon */
/* Use vector operations? For debugging */
Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2010-11-30 15:25:20 UTC
(rev 41482)
+++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2010-11-30 15:34:31 UTC
(rev 41483)
@@ -590,10 +590,10 @@
if (d < BREP_INTERSECTION_ROOT_EPSILON) {
TRACE1("R:"<<ON_PRINT2(Rcurr));
- found = true; break;
- } else if (d > Dlast) {
- found = false;
+ found = true;
break;
+ } else if (d < BREP_INTERSECTION_ROOT_SETTLE) {
+ found = true;
}
brep_newton_iterate(pr, Rcurr, su, sv, nuv, new_uv);
@@ -636,8 +636,10 @@
ray.m_dir.Reverse();
brep_get_plane_ray(ray, pr);
+ if (d < Dlast) {
move(nuv, new_uv);
Dlast = d;
+ }
}
if (found) {
uv.x = nuv[0];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits