[brlcad-commits] SF.net SVN: brlcad:[37422] brlcad/trunk/src/librt/primitives/bot/ g_bot_include.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2010-01-26 21:28:00
|
Revision: 37422 http://brlcad.svn.sourceforge.net/brlcad/?rev=37422&view=rev Author: brlcad Date: 2010-01-26 21:27:53 +0000 (Tue, 26 Jan 2010) Log Message: ----------- add some additional thoughts about FILO vs LIFO, an example on a concave case as well, and the issue about slipping through cracks without checking neighbors. Modified Paths: -------------- brlcad/trunk/src/librt/primitives/bot/g_bot_include.c Modified: brlcad/trunk/src/librt/primitives/bot/g_bot_include.c =================================================================== --- brlcad/trunk/src/librt/primitives/bot/g_bot_include.c 2010-01-26 20:42:58 UTC (rev 37421) +++ brlcad/trunk/src/librt/primitives/bot/g_bot_include.c 2010-01-26 21:27:53 UTC (rev 37422) @@ -800,42 +800,44 @@ } } } + /* - * Handle cases where there are multiple adjacent entrances or exits - * along the shotline. Using the FILO approach where we keep the - * "First In" from multiple entrances and the "Last Out" for multiple - * exits. + * Handle cases where there are multiple adjacent entrances or + * exits along the shotline. Using the FILO approach where we + * keep the "First In" from multiple entrances and the "Last + * Out" for multiple exits. * - * Many of these cases were being generated when the shot ray grazed - * a surface. Grazing shots are treated as non-hits but can causes - * multiple entrance/exits when adjacent surfaces are hit. + * Many of these cases were being generated when the shot ray + * grazed a surface. Grazing shots should USUALLY be treated + * as non-hits (and is the case for other primitives). With + * BoTs, however, these can cause multiple entrances and exits + * when adjacent surfaces are hit. * - * example: cross section of convex solid + * Example #1: CROSS-SECTION OF CONVEX SOLID + * * -------------- * | | - * | | * |entrance |exit * ray--> ------------ ------------ * |entrance |exit * | | * - * LOS(X) was being shown as: + * For this grazing hit, LOS(X) was being shown as: * -------------- * | | - * | | * |entrance |exit * ray--> XXXXXXXXXXXX XXXXXXXXXXXXX * |entrance |exit * | | * - * now LOS(X) shows as: + * Using a FILO approach, now LOS(X) shows as: * -------------- * | | - * | | * |entrance |exit * ray--> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX * |entrance |exit * | | + * */ for (i=0; i<nhits-1; i++) { if (hits[i].hit_vpriv[X] < 0.0) { /* entering */ @@ -854,6 +856,37 @@ } } } + + /* + * Note that we could try to use a LIFO approach so that we + * more consistently count all grazing hits as a miss, but + * there's an increased chance of slipping through a crack + * with BoTs without a change to check mesh neighbors: + * + * Using a LIFO approach, the above LOS(X) would have been: + * + * -------------- + * | | + * |entrance |exit + * ray--> -----------XXXXXXXXXXXXXX------------ + * |entrance |exit + * | | + * + * Example #2: CROSS-SECTION OF CONCAVE SOLID + * + * ray--> ------------ ------------ + * |entrance |exit |entrance |exit + * | | | | + * -------------- + * + * Using LIFO, we would report a miss for the concave case, + * but with FILO this will return two hit segments. + * + * ray--> XXXXXXXXXXXX XXXXXXXXXXXX + * |entrance |exit |entrance |exit + * | | | | + * -------------- + */ } /* if first hit is an exit, it is likely due to the "piece" for This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |