Revision: 70134
http://sourceforge.net/p/brlcad/code/70134
Author: brlcad
Date: 2017-08-27 17:06:38 +0000 (Sun, 27 Aug 2017)
Log Message:
-----------
fix the underlying problem. just because there's not a callback doesn't mean we
shouldn't test intersection. ungoto the logic so it's more clear what's going
on.
Modified Paths:
--------------
brlcad/trunk/src/librt/cut.c
Modified: brlcad/trunk/src/librt/cut.c
===================================================================
--- brlcad/trunk/src/librt/cut.c 2017-08-27 15:24:29 UTC (rev 70133)
+++ brlcad/trunk/src/librt/cut.c 2017-08-27 17:06:38 UTC (rev 70134)
@@ -1315,6 +1315,7 @@
rt_ck_overlap(register const fastf_t *min, register const fastf_t *max,
register const struct soltab *stp, register const struct rt_i *rtip)
{
RT_CHECK_SOLTAB(stp);
+
if (RT_G_DEBUG&DEBUG_BOXING) {
bu_log("rt_ck_overlap(%s)\n", stp->st_name);
VPRINT(" box min", min);
@@ -1322,32 +1323,26 @@
VPRINT(" box max", max);
VPRINT(" sol max", stp->st_max);
}
+
/* Ignore "dead" solids in the list. (They failed prep) */
- if (stp->st_aradius <= 0) return 0;
+ if (stp->st_aradius <= 0)
+ return 0;
- /* Only check RPP on finite solids */
+ /* If the object fits in a box (i.e., it's not infinite), and that
+ * box doesn't overlap with the bounding RPP, we know it's a miss.
+ */
if (stp->st_aradius < INFINITY) {
if (V3RPP_DISJOINT(stp->st_min, stp->st_max, min, max))
- goto fail;
+ return 0;
}
- if (!OBJ[stp->st_id].ft_classify)
- goto fail;
-
/* RPP overlaps, invoke per-solid method for detailed check */
- if (OBJ[stp->st_id].ft_classify(stp, min, max, &rtip->rti_tol) ==
BN_CLASSIFY_OUTSIDE)
- goto fail;
+ if (OBJ[stp->st_id].ft_classify &&
+ OBJ[stp->st_id].ft_classify(stp, min, max, &rtip->rti_tol) ==
BN_CLASSIFY_OUTSIDE)
+ return 0;
- if (RT_G_DEBUG&DEBUG_BOXING)
- bu_log("rt_ck_overlap: TRUE\n");
-
+ /* don't know, check it */
return 1;
-
-fail:
- if (RT_G_DEBUG&DEBUG_BOXING)
- bu_log("rt_ck_overlap: FALSE\n");
-
- return 0;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits