On Jun 18, 2013, at 4:35 AM, phoenix wrote:

> 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.

That's fine, it's just that your use of their default as a magic number (i.e., 
a literal numeric value in the sources) needs/needed to be documented to say 
that. Exactly that even.  That way, the next person doesn't have to guess why 
you picked that number.  Also, when openNURBS changes their default to 
something else years from now and your literal is no longer matching, it'll be 
just a little bit easier to figure out where that obscure bug came from.

That all said, now knowing where the number comes from, it'd be interesting to 
see the sensitivity of changing to our default distance tolerance of 0.0005 
instead of using theirs (passing that tolerance to openNURBS functions 
accordingly).

> 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.

That looks much better, thank you!

Cheers!
Sean


------------------------------------------------------------------------------
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

Reply via email to