[brlcad-commits] SF.net SVN: brlcad:[55337] brlcad/trunk/src/librt/shoot.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <ind...@us...> - 2013-05-08 18:04:24
|
Revision: 55337 http://sourceforge.net/p/brlcad/code/55337 Author: indianlarry Date: 2013-05-08 18:04:18 +0000 (Wed, 08 May 2013) Log Message: ----------- The non-uniform binary space partitioning tree used to partition solids into RPP cells within librt to speed raytracing was using an absolute "nudge" value to walk/step the ray into the next partition cell. In certain circumstances the "nudge" value was causing grazing cell hits to walk over thin intersections even when these intgersections were greater than the thinness tolerance. This update modified this code to use our distance tolerance instead. Now our distance tolerance default or a user specified value can be used. This was turned up by Richard Weiss while testing 'rtarea' results from BREP conversions of our implicits. Modified Paths: -------------- brlcad/trunk/src/librt/shoot.c Modified: brlcad/trunk/src/librt/shoot.c =================================================================== --- brlcad/trunk/src/librt/shoot.c 2013-05-08 17:15:28 UTC (rev 55336) +++ brlcad/trunk/src/librt/shoot.c 2013-05-08 18:04:18 UTC (rev 55337) @@ -210,14 +210,13 @@ * below. * * Therefore, "nudge" the point just slightly into the next - * cell by adding OFFSET_DIST. + * cell by adding our distance tolerance. * * XXX At present, a cell is never less than 1mm wide. * - * XXX The value of OFFSET_DIST should be some percentage of - * the cell's smallest dimension, rather than an absolute - * distance in mm. This will prevent doing microscopic - * models. + * XXX The "nudge" value was based on an absolute value defined + * by OFFSET_DIST but has been changed to use distance tolerance + * specified in mm and can now be overridden by a user. */ t0 = ssp->box_start; @@ -293,8 +292,8 @@ */ if (cutp->cut_type == CUT_CUTNODE && - t0 + OFFSET_DIST < ssp->tv[out_axis]) { - t0 += OFFSET_DIST; + t0 + ssp->ap->a_rt_i->rti_tol.dist < ssp->tv[out_axis]) { + t0 += ssp->ap->a_rt_i->rti_tol.dist; break; } @@ -377,7 +376,7 @@ * NOTE: This portion implements Muuss' non-uniform binary * space partitioning tree. *********************************************************/ - t0 += OFFSET_DIST; + t0 += ssp->ap->a_rt_i->rti_tol.dist; cutp = curcut; break; default: @@ -483,7 +482,7 @@ * Move newray point further into new box. * Try again. */ - t0 += OFFSET_DIST; + t0 += ssp->ap->a_rt_i->rti_tol.dist; goto top; } /* Don't get stuck within the same box for long */ @@ -552,7 +551,7 @@ /* See if point marched outside model RPP */ if (ssp->box_start > ssp->model_end) goto pop_space_stack; - t0 = ssp->box_start + OFFSET_DIST; + t0 = ssp->box_start + ssp->ap->a_rt_i->rti_tol.dist; goto top; } if (push_flag) { @@ -704,7 +703,7 @@ goto done; } else { /* increment cur_dist into next cell for next execution of this loop */ - cur_dist = ray.r_max + OFFSET_DIST; + cur_dist = ray.r_max + ss->ap->a_rt_i->rti_tol.dist; } /* process this box node (look at all the pieces) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |