Revision: 55795
          http://sourceforge.net/p/brlcad/code/55795
Author:   phoenixyjll
Date:     2013-06-18 08:40:42 +0000 (Tue, 18 Jun 2013)
Log Message:
-----------
Use macros to represent default tolerance and change it to 0.001 (the same as 
the default tolerance of curve/curve, curve/surface, surface/surface defined by 
openNURBS).

Modified Paths:
--------------
    brlcad/trunk/src/libbrep/intersect.cpp

Modified: brlcad/trunk/src/libbrep/intersect.cpp
===================================================================
--- brlcad/trunk/src/libbrep/intersect.cpp      2013-06-17 14:43:25 UTC (rev 
55794)
+++ brlcad/trunk/src/libbrep/intersect.cpp      2013-06-18 08:40:42 UTC (rev 
55795)
@@ -218,7 +218,7 @@
             double tolerance)
 {
     if (tolerance <= 0.0)
-       tolerance = 0.01;
+       tolerance = ON_ZERO_TOLERANCE;
 
     if (pointA.DistanceTo(pointB) <= tolerance) {
        ON_PX_EVENT Event;
@@ -234,10 +234,18 @@
 }
 
 
-#define MAX_PCI_DEPTH 8
 /**
  * Point-curve intersections (PCI)
  */
+
+// The maximal depth for subdivision - trade-off between accurancy and
+// performance
+#define MAX_PCI_DEPTH 8
+
+// We make the default tolerance for PSI the same as that of curve-curve
+// intersections defined by openNURBS (see other/openNURBS/opennurbs_curve.h)
+#define PCI_DEFAULT_TOLERANCE 0.001
+
 bool
 ON_Intersect(const ON_3dPoint& pointA,
             const ON_Curve& curveB,
@@ -246,7 +254,7 @@
             const ON_Interval* curveB_domain)
 {
     if (tolerance <= 0.0)
-       tolerance = 0.01;
+       tolerance = PCI_DEFAULT_TOLERANCE;
 
     Subcurve root;
     if (curveB_domain == NULL) {
@@ -332,6 +340,11 @@
 /**
  * Point-surface intersections (PSI)
  */
+
+// We make the default tolerance for PSI the same as that of curve-surface
+// intersections defined by openNURBS (see other/openNURBS/opennurbs_curve.h)
+#define PSI_DEFAULT_TOLERANCE 0.001
+
 bool
 ON_Intersect(const ON_3dPoint& pointA,
             const ON_Surface& surfaceB,
@@ -341,7 +354,7 @@
             const ON_Interval* surfaceB_vdomain)
 {
     if (tolerance <= 0.0)
-       tolerance = 0.01;
+       tolerance = PSI_DEFAULT_TOLERANCE;
 
     ON_Interval u_domain, v_domain;
     if (surfaceB_udomain == 0)
@@ -542,7 +555,10 @@
 };
 
 
+// The maximal depth for subdivision - trade-off between accurancy and
+// performance
 #define MAX_SSI_DEPTH 8
+
 int
 ON_Intersect(const ON_Surface* surfA,
             const ON_Surface* surfB,

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to