Revision: 69033
http://sourceforge.net/p/brlcad/code/69033
Author: starseeker
Date: 2016-10-12 01:01:44 +0000 (Wed, 12 Oct 2016)
Log Message:
-----------
Move rt_in_rpp into libbg, rename.
Modified Paths:
--------------
brlcad/trunk/CHANGES
brlcad/trunk/include/bg/CMakeLists.txt
brlcad/trunk/include/bg/defines.h
brlcad/trunk/include/bg.h
brlcad/trunk/include/raytrace.h
brlcad/trunk/include/rt/calc.h
brlcad/trunk/include/rt/xray.h
brlcad/trunk/src/conv/bot_shell-vtk.c
brlcad/trunk/src/lgt/octree.c
brlcad/trunk/src/libbg/util.c
brlcad/trunk/src/libbn/plane.c
brlcad/trunk/src/libged/bigE.c
brlcad/trunk/src/liboptical/sh_grass.c
brlcad/trunk/src/librt/bbox.c
brlcad/trunk/src/librt/bundle.c
brlcad/trunk/src/librt/primitives/bot/bot.c
brlcad/trunk/src/librt/primitives/bspline/bspline.cpp
brlcad/trunk/src/librt/primitives/ebm/ebm.c
brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c
brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
brlcad/trunk/src/librt/primitives/pipe/pipe.c
brlcad/trunk/src/librt/primitives/vol/vol.c
brlcad/trunk/src/librt/shoot.c
brlcad/trunk/src/librt/vshoot.c
Added Paths:
-----------
brlcad/trunk/include/bg/util.h
Modified: brlcad/trunk/CHANGES
===================================================================
--- brlcad/trunk/CHANGES 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/CHANGES 2016-10-12 01:01:44 UTC (rev 69033)
@@ -1293,3 +1293,5 @@
rename old nurbs functions intertwined with nmg to use nmg prefix
[7.26]
s/RTG.NMG_debug/nmg_debug/g
make nmg debug flag top level, like libbu's [7.26]
+s/rt_in_rpp/bg_ray_in_rpp/g
+ move rt_in_rpp into libbg [7.26]
Modified: brlcad/trunk/include/bg/CMakeLists.txt
===================================================================
--- brlcad/trunk/include/bg/CMakeLists.txt 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/include/bg/CMakeLists.txt 2016-10-12 01:01:44 UTC (rev
69033)
@@ -5,6 +5,7 @@
polygon.h
tri_ray.h
tri_tri.h
+ util.h
)
install(FILES ${bg_headers} DESTINATION ${INCLUDE_DIR}/brlcad/bg)
Modified: brlcad/trunk/include/bg/defines.h
===================================================================
--- brlcad/trunk/include/bg/defines.h 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/include/bg/defines.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -30,6 +30,7 @@
#define BG_DEFINES_H
#include "common.h"
+#include "vmath.h"
#ifndef BG_EXPORT
# if defined(BG_DLL_EXPORTS) && defined(BG_DLL_IMPORTS)
@@ -47,6 +48,24 @@
#define BG_CW 1
#define BG_CCW -1
+__BEGIN_DECLS
+
+/**
+ * @brief Primary ray data structure
+ *
+ * Not called just "ray" to prevent conflicts with VLD stuff.
+ */
+struct xray {
+ uint32_t magic;
+ int index; /**< @brief Which ray of a bundle */
+ point_t r_pt; /**< @brief Point at which ray starts
*/
+ vect_t r_dir; /**< @brief Direction of ray (UNIT
Length) */
+ fastf_t r_min; /**< @brief entry dist to bounding
sphere */
+ fastf_t r_max; /**< @brief exit dist from bounding
sphere */
+};
+
+__END_DECLS
+
#endif /* BG_DEFINES_H */
/** @} */
/*
Added: brlcad/trunk/include/bg/util.h
===================================================================
--- brlcad/trunk/include/bg/util.h (rev 0)
+++ brlcad/trunk/include/bg/util.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -0,0 +1,75 @@
+/* U T I L . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2004-2016 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+/*----------------------------------------------------------------------*/
+/* @file util.h */
+/** @addtogroup bg/util */
+/** @{ */
+
+#ifndef BG_UTIL_H
+#define BG_UTIL_H
+
+#include "common.h"
+#include "vmath.h"
+#include "bg/defines.h"
+
+__BEGIN_DECLS
+
+/**
+ * Compute the intersections of a ray with a rectangular
+ * parallelepiped (RPP) that has faces parallel to the coordinate
+ * planes
+ *
+ * The algorithm here was developed by Gary Kuehl for GIFT. A good
+ * description of the approach used can be found in "??" by XYZZY and
+ * Barsky, ACM Transactions on Graphics, Vol 3 No 1, January 1984.
+ *
+ * Note: The computation of entry and exit distance is mandatory, as
+ * the final test catches the majority of misses.
+ *
+ * Note: A hit is returned if the intersect is behind the start point.
+ *
+ * Returns -
+ * 0 if ray does not hit RPP,
+ * !0 if ray hits RPP.
+ *
+ * Implicit return -
+ * rp->r_min = dist from start of ray to point at which ray ENTERS solid
+ * rp->r_max = dist from start of ray to point at which ray LEAVES solid
+ */
+BG_EXPORT extern int bg_ray_in_rpp(struct xray *rp,
+ const fastf_t *invdir,
+ const fastf_t *min,
+ const fastf_t *max);
+
+
+__END_DECLS
+
+#endif /* BG_UTIL_H */
+/** @} */
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: brlcad/trunk/include/bg/util.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: brlcad/trunk/include/bg.h
===================================================================
--- brlcad/trunk/include/bg.h 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/include/bg.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -55,6 +55,7 @@
#include "bg/polygon.h"
#include "bg/tri_ray.h"
#include "bg/tri_tri.h"
+#include "bg/util.h"
#endif /* BG_H */
Modified: brlcad/trunk/include/raytrace.h
===================================================================
--- brlcad/trunk/include/raytrace.h 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/include/raytrace.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -58,6 +58,7 @@
#include "bu/str.h"
#include "bu/vls.h"
#include "bn.h"
+#include "bg.h" /* bg_ray_in_rpp - should be pushed into C files */
#include "./rt/db5.h"
#include "nmg.h"
#include "pc.h"
Modified: brlcad/trunk/include/rt/calc.h
===================================================================
--- brlcad/trunk/include/rt/calc.h 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/include/rt/calc.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -55,32 +55,6 @@
fastf_t *min_rpp,
fastf_t *max_rpp);
-/**
- * Compute the intersections of a ray with a rectangular
- * parallelepiped (RPP) that has faces parallel to the coordinate
- * planes
- *
- * The algorithm here was developed by Gary Kuehl for GIFT. A good
- * description of the approach used can be found in "??" by XYZZY and
- * Barsky, ACM Transactions on Graphics, Vol 3 No 1, January 1984.
- *
- * Note: The computation of entry and exit distance is mandatory, as
- * the final test catches the majority of misses.
- *
- * Note: A hit is returned if the intersect is behind the start point.
- *
- * Returns -
- * 0 if ray does not hit RPP,
- * !0 if ray hits RPP.
- *
- * Implicit return -
- * rp->r_min = dist from start of ray to point at which ray ENTERS solid
- * rp->r_max = dist from start of ray to point at which ray LEAVES solid
- */
-RT_EXPORT extern int rt_in_rpp(struct xray *rp,
- const fastf_t *invdir,
- const fastf_t *min,
- const fastf_t *max);
/* Find the bounding box given a struct rt_db_internal : bbox.c */
Modified: brlcad/trunk/include/rt/xray.h
===================================================================
--- brlcad/trunk/include/rt/xray.h 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/include/rt/xray.h 2016-10-12 01:01:44 UTC (rev 69033)
@@ -28,23 +28,10 @@
#include "common.h"
#include "vmath.h"
+#include "bg/defines.h"
__BEGIN_DECLS
#define CORNER_PTS 4
-
-/**
- * @brief Primary ray data structure
- *
- * Not called just "ray" to prevent conflicts with VLD stuff.
- */
-struct xray {
- uint32_t magic;
- int index; /**< @brief Which ray of a bundle */
- point_t r_pt; /**< @brief Point at which ray starts
*/
- vect_t r_dir; /**< @brief Direction of ray (UNIT
Length) */
- fastf_t r_min; /**< @brief entry dist to bounding
sphere */
- fastf_t r_max; /**< @brief exit dist from bounding
sphere */
-};
#define RAY_NULL ((struct xray *)0)
#define RT_CK_RAY(_p) BU_CKMAG(_p, RT_RAY_MAGIC, "struct xray");
Modified: brlcad/trunk/src/conv/bot_shell-vtk.c
===================================================================
--- brlcad/trunk/src/conv/bot_shell-vtk.c 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/src/conv/bot_shell-vtk.c 2016-10-12 01:01:44 UTC (rev
69033)
@@ -548,7 +548,7 @@
VSCALE(ap.a_ray.r_pt, sum, 1.0/3.0);
VREVERSE(ap.a_ray.r_dir, tri->tri_N);
VINVDIR(inv_dir, ap.a_ray.r_dir);
- if (rt_in_rpp(&ap.a_ray, inv_dir, rtip->mdl_min, rtip->mdl_max)
== 0) {
+ if (bg_ray_in_rpp(&ap.a_ray, inv_dir, rtip->mdl_min,
rtip->mdl_max) == 0) {
tri = tri->tri_forw;
continue;
}
Modified: brlcad/trunk/src/lgt/octree.c
===================================================================
--- brlcad/trunk/src/lgt/octree.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/lgt/octree.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -371,7 +371,7 @@
octnt_max[X] = op->o_points->c_point[X] + delta;
octnt_max[Y] = op->o_points->c_point[Y] + delta;
octnt_max[Z] = op->o_points->c_point[Z] + delta;
- if (rt_in_rpp(&ap->a_ray, inv_dir, octnt_min, octnt_max)) {
+ if (bg_ray_in_rpp(&ap->a_ray, inv_dir, octnt_min, octnt_max)) {
/* Hit octant. */
if (op->o_child == OCTREE_NULL) {
/* We are at a leaf node. */
Modified: brlcad/trunk/src/libbg/util.c
===================================================================
--- brlcad/trunk/src/libbg/util.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/libbg/util.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -23,7 +23,10 @@
#include "vmath.h"
#include "bn/plane.h"
#include "bn/tol.h"
+#include "bg/defines.h"
+#include "bg/util.h"
+
/* TODO - need routines for 2D and 3D point sets that check for degeneracy -
(dimension < 2 for a 2D
* set, dimension < 3 for a 3D set. Probably want to use Eigen's matrix
routines and a rank check:
*
https://en.wikipedia.org/wiki/Coplanarity#Coplanarity_of_points_whose_coordinates_are_given
@@ -175,7 +178,109 @@
return 0;
}
+/* Copyright (c) 1990-2016 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+int
+bg_ray_in_rpp(struct xray *rp,
+ register const fastf_t *invdir, /* inverses of rp->r_dir[] */
+ register const fastf_t *min,
+ register const fastf_t *max)
+{
+ register const fastf_t *pt = &rp->r_pt[0];
+ register fastf_t sv;
+#define st sv /* reuse the register */
+ register fastf_t rmin = -MAX_FASTF;
+ register fastf_t rmax = MAX_FASTF;
+
+ /* Start with infinite ray, and trim it down */
+
+ /* X axis */
+ if (*invdir < -SMALL_FASTF) {
+ /* Heading towards smaller numbers */
+ /* if (*min > *pt) miss */
+ if (rmax > (sv = (*min - *pt) * *invdir))
+ rmax = sv;
+ if (rmin < (st = (*max - *pt) * *invdir))
+ rmin = st;
+ } else if (*invdir > SMALL_FASTF) {
+ /* Heading towards larger numbers */
+ /* if (*max < *pt) miss */
+ if (rmax > (st = (*max - *pt) * *invdir))
+ rmax = st;
+ if (rmin < ((sv = (*min - *pt) * *invdir)))
+ rmin = sv;
+ } else {
+ /*
+ * Direction cosines along this axis is NEAR 0,
+ * which implies that the ray is perpendicular to the axis,
+ * so merely check position against the boundaries.
+ */
+ if ((*min > *pt) || (*max < *pt))
+ return 0; /* MISS */
+ }
+
+ /* Y axis */
+ pt++; invdir++; max++; min++;
+ if (*invdir < -SMALL_FASTF) {
+ if (rmax > (sv = (*min - *pt) * *invdir))
+ rmax = sv;
+ if (rmin < (st = (*max - *pt) * *invdir))
+ rmin = st;
+ } else if (*invdir > SMALL_FASTF) {
+ if (rmax > (st = (*max - *pt) * *invdir))
+ rmax = st;
+ if (rmin < ((sv = (*min - *pt) * *invdir)))
+ rmin = sv;
+ } else {
+ if ((*min > *pt) || (*max < *pt))
+ return 0; /* MISS */
+ }
+
+ /* Z axis */
+ pt++; invdir++; max++; min++;
+ if (*invdir < -SMALL_FASTF) {
+ if (rmax > (sv = (*min - *pt) * *invdir))
+ rmax = sv;
+ if (rmin < (st = (*max - *pt) * *invdir))
+ rmin = st;
+ } else if (*invdir > SMALL_FASTF) {
+ if (rmax > (st = (*max - *pt) * *invdir))
+ rmax = st;
+ if (rmin < ((sv = (*min - *pt) * *invdir)))
+ rmin = sv;
+ } else {
+ if ((*min > *pt) || (*max < *pt))
+ return 0; /* MISS */
+ }
+
+ /* If equal, RPP is actually a plane */
+ if (rmin > rmax)
+ return 0; /* MISS */
+
+ /* HIT. Only now do rp->r_min and rp->r_max have to be written */
+ rp->r_min = rmin;
+ rp->r_max = rmax;
+ return 1; /* HIT */
+}
+
+
+
+
/*
* Local Variables:
* mode: C
Modified: brlcad/trunk/src/libbn/plane.c
===================================================================
--- brlcad/trunk/src/libbn/plane.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/libbn/plane.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -2450,7 +2450,7 @@
* Intersect a line segment with a rectangular parallelepiped (RPP)
* that has faces parallel to the coordinate planes (a clipping RPP).
* The RPP is defined by a minimum point and a maximum point. This is
- * a very close relative to rt_in_rpp() from librt/shoot.c
+ * a very close relative to bg_ray_in_rpp() from librt/shoot.c
*
* @return 0 if ray does not hit RPP,
* @return !0 if ray hits RPP.
Modified: brlcad/trunk/src/libged/bigE.c
===================================================================
--- brlcad/trunk/src/libged/bigE.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/libged/bigE.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -1265,7 +1265,7 @@
/* actually shoot the ray, assign segments to the leaf, and
* mark them as IN_SOL.
*/
- if (rt_in_rpp(&rp, rd.rd_invdir, shoot->l.stp->st_min,
shoot->l.stp->st_max)) {
+ if (bg_ray_in_rpp(&rp, rd.rd_invdir, shoot->l.stp->st_min,
shoot->l.stp->st_max)) {
if (OBJ[shoot->l.stp->st_id].ft_shot &&
OBJ[shoot->l.stp->st_id].ft_shot(shoot->l.stp, &rp, dgcdp->ap, rd.seghead)) {
struct seg *seg;
Modified: brlcad/trunk/src/liboptical/sh_grass.c
===================================================================
--- brlcad/trunk/src/liboptical/sh_grass.c 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/src/liboptical/sh_grass.c 2016-10-12 01:01:44 UTC (rev
69033)
@@ -799,7 +799,7 @@
}
r->r.r_min = r->r.r_max = 0.0;
- if (! rt_in_rpp(&r->r, r->rev, pl->pmin, pl->pmax)) {
+ if (! bg_ray_in_rpp(&r->r, r->rev, pl->pmin, pl->pmax)) {
if (rdebug&RDEBUG_SHADE) {
point_t in_pt, out_pt;
bu_log("min:%g max:%g\n", r->r.r_min, r->r.r_max);
Modified: brlcad/trunk/src/librt/bbox.c
===================================================================
--- brlcad/trunk/src/librt/bbox.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/bbox.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -157,91 +157,6 @@
return 1;
}
-
-int
-rt_in_rpp(struct xray *rp,
- register const fastf_t *invdir, /* inverses of rp->r_dir[] */
- register const fastf_t *min,
- register const fastf_t *max)
-{
- register const fastf_t *pt = &rp->r_pt[0];
- register fastf_t sv;
-#define st sv /* reuse the register */
- register fastf_t rmin = -MAX_FASTF;
- register fastf_t rmax = MAX_FASTF;
-
- /* Start with infinite ray, and trim it down */
-
- /* X axis */
- if (*invdir < -SMALL_FASTF) {
- /* Heading towards smaller numbers */
- /* if (*min > *pt) miss */
- if (rmax > (sv = (*min - *pt) * *invdir))
- rmax = sv;
- if (rmin < (st = (*max - *pt) * *invdir))
- rmin = st;
- } else if (*invdir > SMALL_FASTF) {
- /* Heading towards larger numbers */
- /* if (*max < *pt) miss */
- if (rmax > (st = (*max - *pt) * *invdir))
- rmax = st;
- if (rmin < ((sv = (*min - *pt) * *invdir)))
- rmin = sv;
- } else {
- /*
- * Direction cosines along this axis is NEAR 0,
- * which implies that the ray is perpendicular to the axis,
- * so merely check position against the boundaries.
- */
- if ((*min > *pt) || (*max < *pt))
- return 0; /* MISS */
- }
-
- /* Y axis */
- pt++; invdir++; max++; min++;
- if (*invdir < -SMALL_FASTF) {
- if (rmax > (sv = (*min - *pt) * *invdir))
- rmax = sv;
- if (rmin < (st = (*max - *pt) * *invdir))
- rmin = st;
- } else if (*invdir > SMALL_FASTF) {
- if (rmax > (st = (*max - *pt) * *invdir))
- rmax = st;
- if (rmin < ((sv = (*min - *pt) * *invdir)))
- rmin = sv;
- } else {
- if ((*min > *pt) || (*max < *pt))
- return 0; /* MISS */
- }
-
- /* Z axis */
- pt++; invdir++; max++; min++;
- if (*invdir < -SMALL_FASTF) {
- if (rmax > (sv = (*min - *pt) * *invdir))
- rmax = sv;
- if (rmin < (st = (*max - *pt) * *invdir))
- rmin = st;
- } else if (*invdir > SMALL_FASTF) {
- if (rmax > (st = (*max - *pt) * *invdir))
- rmax = st;
- if (rmin < ((sv = (*min - *pt) * *invdir)))
- rmin = sv;
- } else {
- if ((*min > *pt) || (*max < *pt))
- return 0; /* MISS */
- }
-
- /* If equal, RPP is actually a plane */
- if (rmin > rmax)
- return 0; /* MISS */
-
- /* HIT. Only now do rp->r_min and rp->r_max have to be written */
- rp->r_min = rmin;
- rp->r_max = rmax;
- return 1; /* HIT */
-}
-
-
/**
* Traverse the passed tree using rt_db_internals to show the way
* This function supports rt_bound_internal and is internal to librt
Modified: brlcad/trunk/src/librt/bundle.c
===================================================================
--- brlcad/trunk/src/librt/bundle.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/bundle.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -222,7 +222,7 @@
* If ray does not enter the model RPP, skip on.
* If ray ends exactly at the model RPP, trace it.
*/
- if (!rt_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max) ||
+ if (!bg_ray_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max)
||
ap->a_ray.r_max < 0.0) {
resp->re_nmiss_model++;
if (ap->a_miss)
@@ -326,7 +326,7 @@
/* Check against bounding RPP, if desired by solid */
if (OBJ[stp->st_id].ft_use_rpp) {
- if (!rt_in_rpp(&ss2_newray, ss.inv_dir,
+ if (!bg_ray_in_rpp(&ss2_newray, ss.inv_dir,
stp->st_min, stp->st_max)) {
if (debug_shoot)bu_log("rpp miss %s by ray %d\n",
stp->st_name, ray);
resp->re_prune_solrpp++;
Modified: brlcad/trunk/src/librt/primitives/bot/bot.c
===================================================================
--- brlcad/trunk/src/librt/primitives/bot/bot.c 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/src/librt/primitives/bot/bot.c 2016-10-12 01:01:44 UTC (rev
69033)
@@ -4124,7 +4124,7 @@
inv_dir[Z] = INFINITY;
}
- if (!rt_in_rpp(&ap.a_ray, inv_dir, rtip->mdl_min, rtip->mdl_max)) {
+ if (!bg_ray_in_rpp(&ap.a_ray, inv_dir, rtip->mdl_min,
rtip->mdl_max)) {
/* ray missed!!! */
bu_log("ERROR: Ray missed target!!!!\n");
}
Modified: brlcad/trunk/src/librt/primitives/bspline/bspline.cpp
===================================================================
--- brlcad/trunk/src/librt/primitives/bspline/bspline.cpp 2016-10-12
00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/primitives/bspline/bspline.cpp 2016-10-12
01:01:44 UTC (rev 69033)
@@ -383,7 +383,7 @@
struct nmg_nurb_uv_hit *hp;
for (BU_LIST_FOR (s, face_g_snurb, &nurb->bez_hd)) {
- if (!rt_in_rpp(rp, invdir, s->min_pt, s->max_pt))
+ if (!bg_ray_in_rpp(rp, invdir, s->min_pt, s->max_pt))
continue;
#define UV_TOL 1.0e-6 /* Paper says 1.0e-4 is reasonable for 1k images, not
close up */
Modified: brlcad/trunk/src/librt/primitives/ebm/ebm.c
===================================================================
--- brlcad/trunk/src/librt/primitives/ebm/ebm.c 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/src/librt/primitives/ebm/ebm.c 2016-10-12 01:01:44 UTC (rev
69033)
@@ -282,7 +282,7 @@
/* intersect ray with ideal grid rpp */
VSETALL(P, 0);
- if (! rt_in_rpp(rp, invdir, P, ebmp->ebm_large))
+ if (! bg_ray_in_rpp(rp, invdir, P, ebmp->ebm_large))
return 0; /* MISS */
VJOIN1(P, rp->r_pt, rp->r_min, rp->r_dir);
Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2016-10-12 00:33:12 UTC
(rev 69032)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2016-10-12 01:01:44 UTC
(rev 69033)
@@ -63,11 +63,10 @@
#include "bn/mat.h"
#include "bn/plane.h"
#include "bn/plot3.h"
+#include "bg/util.h"
#include "nmg.h"
#include "rt/nmg.h"
-#include "raytrace.h" /* for rt/calc.h - rt_in_rpp */
-
#define ISECT_NONE 0
#define ISECT_SHARED_V 1
#define ISECT_SPLIT1 2
@@ -2039,7 +2038,7 @@
VINVDIR(invdir, line.r_dir);
/* nmg_loop_g() makes sure there are no 0-thickness faces */
- if (!rt_in_rpp(&line, invdir, fu2->f_p->min_pt, fu2->f_p->max_pt)) {
+ if (!bg_ray_in_rpp(&line, invdir, fu2->f_p->min_pt, fu2->f_p->max_pt)) {
/* The edge ray missed the face RPP, nothing to do. */
if (nmg_debug & DEBUG_POLYSECT) {
VPRINT("r_pt ", line.r_pt);
Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2016-10-12
00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2016-10-12
01:01:44 UTC (rev 69033)
@@ -1906,7 +1906,7 @@
bu_log("isect_ray_snurb_face: using planes (%g %g %g %g) (%g %g
%g %g)\n",
V4ARGS(pl1), V4ARGS(pl2));
(void)nmg_nurb_s_bound(srf, srf_min, srf_max);
- if (!rt_in_rpp(rd->rp, rd->rd_invdir, srf_min, srf_max)) {
+ if (!bg_ray_in_rpp(rd->rp, rd->rd_invdir, srf_min, srf_max)) {
nmg_nurb_free_snurb(srf, rd->ap->a_resource);
continue;
}
@@ -2284,7 +2284,7 @@
VMOVE(rd->plane_pt, hit_pt);
rd->ray_dist_to_plane = dist;
- } else if (!rt_in_rpp(rd->rp, rd->rd_invdir,
+ } else if (!bg_ray_in_rpp(rd->rp, rd->rd_invdir,
fu_p->f_p->min_pt, fu_p->f_p->max_pt)) {
NMG_GET_HITMISS(myhit, rd->ap);
NMG_INDEX_ASSIGN(rd->hitmiss, fu_p->f_p, myhit);
@@ -2331,7 +2331,7 @@
* is no need to record the miss for the shell, as there is only
* one "use" of a shell.
*/
- if (!rt_in_rpp(rd->rp, rd->rd_invdir,
+ if (!bg_ray_in_rpp(rd->rp, rd->rd_invdir,
s_p->sa_p->min_pt, s_p->sa_p->max_pt)) {
if (nmg_debug & DEBUG_RT_ISECT)
bu_log("nmg_isect_ray_shell(no RPP overlap) %p, %p\n", (void *)rd,
(void *)s_p);
@@ -2383,7 +2383,7 @@
NMG_CK_REGION_A(r_p->ra_p);
/* does ray intersect nmgregion rpp? */
- if (! rt_in_rpp(rd->rp, rd->rd_invdir,
+ if (! bg_ray_in_rpp(rd->rp, rd->rd_invdir,
r_p->ra_p->min_pt, r_p->ra_p->max_pt))
continue;
Modified: brlcad/trunk/src/librt/primitives/pipe/pipe.c
===================================================================
--- brlcad/trunk/src/librt/primitives/pipe/pipe.c 2016-10-12 00:33:12 UTC
(rev 69032)
+++ brlcad/trunk/src/librt/primitives/pipe/pipe.c 2016-10-12 01:01:44 UTC
(rev 69033)
@@ -1703,7 +1703,7 @@
if (!pipe_id->pipe_is_bend) {
struct lin_pipe *lin = (struct lin_pipe *)pipe_id;
- if (!rt_in_rpp(rp, ap->a_inv_dir, lin->pipe_min, lin->pipe_max)) {
+ if (!bg_ray_in_rpp(rp, ap->a_inv_dir, lin->pipe_min,
lin->pipe_max)) {
continue;
}
linear_pipe_shot(stp, rp, lin, hits, &total_hits, seg_no);
Modified: brlcad/trunk/src/librt/primitives/vol/vol.c
===================================================================
--- brlcad/trunk/src/librt/primitives/vol/vol.c 2016-10-12 00:33:12 UTC (rev
69032)
+++ brlcad/trunk/src/librt/primitives/vol/vol.c 2016-10-12 01:01:44 UTC (rev
69033)
@@ -164,7 +164,7 @@
/* intersect ray with ideal grid rpp */
VSETALL(P, 0);
- if (! rt_in_rpp(rp, invdir, P, volp->vol_large))
+ if (! bg_ray_in_rpp(rp, invdir, P, volp->vol_large))
return 0; /* MISS */
VJOIN1(P, rp->r_pt, rp->r_min, rp->r_dir); /* P is hit point */
if (RT_G_DEBUG&DEBUG_VOL)VPRINT("vol_large", volp->vol_large);
Modified: brlcad/trunk/src/librt/shoot.c
===================================================================
--- brlcad/trunk/src/librt/shoot.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/shoot.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -572,7 +572,7 @@
ssp->newray.r_pt[X] = px;
ssp->newray.r_pt[Y] = py;
ssp->newray.r_pt[Z] = pz;
- if (!rt_in_rpp(&ssp->newray, ssp->inv_dir,
+ if (!bg_ray_in_rpp(&ssp->newray, ssp->inv_dir,
cutp->bn.bn_min,
cutp->bn.bn_max)) {
bu_log("rt_advance_to_next_cell(): MISSED BOX\nrmin,
rmax(%.20e, %.20e) box(%.20e, %.20e)\n",
@@ -690,7 +690,7 @@
/* we are now at the box node for the current point */
/* check if the ray intersects this box */
- if (!rt_in_rpp(&ray, ss->inv_dir, cutp->bn.bn_min, cutp->bn.bn_max)) {
+ if (!bg_ray_in_rpp(&ray, ss->inv_dir, cutp->bn.bn_min,
cutp->bn.bn_max)) {
/* ray does not intersect this cell
* one of two situations must exist:
* 1. ray starts outside model bounding box (no need for these
calculations)
@@ -709,7 +709,7 @@
if (BU_BITTEST(solidbits, plp->stp->st_bit) == 0) {
/* we haven't looked at this primitive before */
- if (rt_in_rpp(&ray, ss->inv_dir, plp->stp->st_min,
plp->stp->st_max)) {
+ if (bg_ray_in_rpp(&ray, ss->inv_dir, plp->stp->st_min,
plp->stp->st_max)) {
/* ray intersects this primitive bounding box */
if (ray.r_min < BACKING_DIST) {
@@ -1022,7 +1022,7 @@
* If ray does not enter the model RPP, skip on. If ray ends
* exactly at the model RPP, trace it.
*/
- if (!rt_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max) ||
+ if (!bg_ray_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max)
||
ap->a_ray.r_max < 0.0) {
cutp = &ap->a_rt_i->rti_inf_box;
if (cutp->bn.bn_len > 0) {
@@ -1216,7 +1216,7 @@
/* Compute ray entry and exit to entire solid's
* bounding box.
*/
- if (!rt_in_rpp(&ss.newray, ss.inv_dir,
+ if (!bg_ray_in_rpp(&ss.newray, ss.inv_dir,
stp->st_min, stp->st_max)) {
if (debug_shoot)bu_log("rpp miss %s (all pieces)\n",
stp->st_name);
resp->re_prune_solrpp++;
@@ -1299,7 +1299,7 @@
/* Check against bounding RPP, if desired by solid */
if (stp->st_meth->ft_use_rpp) {
- if (!rt_in_rpp(&ss.newray, ss.inv_dir,
+ if (!bg_ray_in_rpp(&ss.newray, ss.inv_dir,
stp->st_min, stp->st_max)) {
if (debug_shoot)bu_log("rpp miss %s\n", stp->st_name);
resp->re_prune_solrpp++;
@@ -1667,7 +1667,7 @@
* If ray does not enter the model RPP, skip on.
* If ray ends exactly at the model RPP, trace it.
*/
- if (!rt_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max) ||
+ if (!bg_ray_in_rpp(&ap->a_ray, ss.inv_dir, rtip->mdl_min, rtip->mdl_max)
||
ap->a_ray.r_max < 0.0) {
cutp = &ap->a_rt_i->rti_inf_box;
if (cutp->bn.bn_len > 0) {
Modified: brlcad/trunk/src/librt/vshoot.c
===================================================================
--- brlcad/trunk/src/librt/vshoot.c 2016-10-12 00:33:12 UTC (rev 69032)
+++ brlcad/trunk/src/librt/vshoot.c 2016-10-12 01:01:44 UTC (rev 69033)
@@ -210,7 +210,7 @@
* If ray does not enter the model RPP, skip on.
* If ray ends exactly at the model RPP, trace it.
*/
- if (!rt_in_rpp(&ap->a_ray, inv_dir, rtip->mdl_min, rtip->mdl_max) ||
+ if (!bg_ray_in_rpp(&ap->a_ray, inv_dir, rtip->mdl_min, rtip->mdl_max) ||
ap->a_ray.r_max < 0.0) {
rtip->nmiss_model++;
if (ap->a_miss)
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