Revision: 69098
          http://sourceforge.net/p/brlcad/code/69098
Author:   starseeker
Date:     2016-10-17 14:03:16 +0000 (Mon, 17 Oct 2016)
Log Message:
-----------
Investigating why a zero thickness surface mode BoT didn't raytrace, it turns 
out that a block of logic used by the standard prep to ensure the bbox 
thickness never ended up zero in any dimension was never added to the bottie 
prep routines.

Modified Paths:
--------------
    brlcad/trunk/NEWS
    brlcad/trunk/src/librt/primitives/bot/btg.c

Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS   2016-10-17 12:06:44 UTC (rev 69097)
+++ brlcad/trunk/NEWS   2016-10-17 14:03:16 UTC (rev 69098)
@@ -13,6 +13,7 @@
 --- 2016-07-XX  Release 7.26.2                                     ---
 ----------------------------------------------------------------------
 
+* fixed TIE raytracing for zero thickness BoTs - Cliff Yapp
 * added Wavefront OBJ File->Open GUI support in Archer - Cliff Yapp
 * fixed attr show error printing large attribute values - Cliff Yapp
 * fixed rt support for lights created prior to rel 6.0 - Sean Morrison

Modified: brlcad/trunk/src/librt/primitives/bot/btg.c
===================================================================
--- brlcad/trunk/src/librt/primitives/bot/btg.c 2016-10-17 12:06:44 UTC (rev 
69097)
+++ brlcad/trunk/src/librt/primitives/bot/btg.c 2016-10-17 14:03:16 UTC (rev 
69098)
@@ -63,7 +63,7 @@
 }
 
 int
-bottie_prep_double(struct soltab *stp, struct rt_bot_internal *bot_ip, struct 
rt_i *UNUSED(rtip))
+bottie_prep_double(struct soltab *stp, struct rt_bot_internal *bot_ip, struct 
rt_i *rtip)
 {
     struct tie_s *tie;
     struct bot_specific *bot;
@@ -129,6 +129,21 @@
 
     VMOVE(stp->st_min, tie->amin);
     VMOVE(stp->st_max, tie->amax);
+
+    /* zero thickness will get missed by the raytracer */
+    if (NEAR_EQUAL(stp->st_min[X], stp->st_max[X], rtip->rti_tol.dist)) {
+       stp->st_min[X] -= rtip->rti_tol.dist;
+       stp->st_max[X] += rtip->rti_tol.dist;
+    }
+    if (NEAR_EQUAL(stp->st_min[Y], stp->st_max[Y], rtip->rti_tol.dist)) {
+       stp->st_min[Y] -= rtip->rti_tol.dist;
+       stp->st_max[Y] += rtip->rti_tol.dist;
+    }
+    if (NEAR_EQUAL(stp->st_min[Z], stp->st_max[Z], rtip->rti_tol.dist)) {
+       stp->st_min[Z] -= rtip->rti_tol.dist;
+       stp->st_max[Z] += rtip->rti_tol.dist;
+    }
+
     VMOVE(stp->st_center, tie->mid);
     stp->st_aradius = tie->radius;
     stp->st_bradius = tie->radius;

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
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to