> Introducing new magic numbers such as this one should be avoided. It is
> invariably brittle and, in the long term, bug-prone. Suggest using something
> already defined such as BN_TOL_DIST or RT_DOT_TOL or RT_LEN_TOL or
> VUNITIZE_TOL or ... etc. Still, any constant rationale/need should also just
> be documented.
> Why 0.01? Why not 0.001 or 0.1 or 0.02? What's the sensitivity and
> rationale? That should all be documented right there with the value (less
> important if it's a defined TOL, but still good to have).
I changed to use 0.001 because it's the default tolerance for intersections
(curve/curve, curve/surface and surface/surface) defined by openNURBS (see
other/openNURBS/curve.h and other/openNURBS/surface.h). Although openNURBS
doesn't have point related intersections, I think it's OK to keep the tolerance
the same for PCI and PSI. But for point/point intersections, I make the default
tolerance ON_ZERO_TOLERANCE because it should have much better accuracy.
I modified the code to use macros (PCI_DEFAULT_TOLERANCE and
PSI_DEFAULT_TOLERANCE) to represent the magic numbers, and added some comment
to document them. I'm doing some tests to make sure it works well.
Cheers!
Wu
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel