49#define NMG_MISS_LIST 1
54#define HMG_INBOUND_STATE(_hm) (((_hm)->in_out & 0x0f0) >> 4)
55#define HMG_OUTBOUND_STATE(_hm) ((_hm)->in_out & 0x0f)
58#define NMG_RAY_STATE_INSIDE 1
59#define NMG_RAY_STATE_ON 2
60#define NMG_RAY_STATE_OUTSIDE 4
61#define NMG_RAY_STATE_ANY 8
63#define HMG_HIT_IN_IN 0x11
64#define HMG_HIT_IN_OUT 0x14
65#define HMG_HIT_OUT_IN 0x41
66#define HMG_HIT_OUT_OUT 0x44
67#define HMG_HIT_IN_ON 0x12
68#define HMG_HIT_ON_IN 0x21
69#define HMG_HIT_ON_ON 0x22
70#define HMG_HIT_OUT_ON 0x42
71#define HMG_HIT_ON_OUT 0x24
72#define HMG_HIT_ANY_ANY 0x88
74#define NMG_VERT_ENTER 1
75#define NMG_VERT_ENTER_LEAVE 0
76#define NMG_VERT_LEAVE -1
77#define NMG_VERT_UNKNOWN -2
79#define NMG_HITMISS_SEG_IN 0x696e00
80#define NMG_HITMISS_SEG_OUT 0x6f757400
82#define NMG_CK_RD(_rd) NMG_CKMAG(_rd, NMG_RAY_DATA_MAGIC, "ray data");
84#ifdef NO_BOMBING_MACROS
85# define NMG_CK_HITMISS(hm) (void)(hm)
87# define NMG_CK_HITMISS(hm) \
89 switch (hm->l.magic) { \
90 case NMG_RT_HIT_MAGIC: \
91 case NMG_RT_HIT_SUB_MAGIC: \
92 case NMG_RT_MISS_MAGIC: \
95 bu_log(CPP_FILELINE ": struct hitmiss has NMG_MISS_LIST magic #\n"); \
96 bu_bomb("NMG_CK_HITMISS: going down in flames\n"); \
99 bu_log(CPP_FILELINE ": struct hitmiss has NMG_MISS_LIST magic #\n"); \
100 bu_bomb("NMG_CK_HITMISS: going down in flames\n"); \
103 bu_log(CPP_FILELINE ": bad struct hitmiss magic: %u:(0x%08x)\n", \
104 hm->l.magic, hm->l.magic); \
105 bu_bomb("NMG_CK_HITMISS: going down in flames\n"); \
107 if (!hm->hit.hit_private) { \
108 bu_log(CPP_FILELINE ": NULL hit_private in hitmiss struct\n"); \
109 bu_bomb("NMG_CK_HITMISS: going down in flames\n"); \
114#ifdef NO_BOMBING_MACROS
115# define NMG_CK_HITMISS_LISTS(rd) (void)(rd)
117# define NMG_CK_HITMISS_LISTS(rd) \
119 struct nmg_hitmiss *_a_hit; \
120 for (BU_LIST_FOR(_a_hit, nmg_hitmiss, &rd->rd_hit)) {NMG_CK_HITMISS(_a_hit);} \
121 for (BU_LIST_FOR(_a_hit, nmg_hitmiss, &rd->rd_miss)) {NMG_CK_HITMISS(_a_hit);} \
125#define NMG_GET_HITMISS(_p) { \
126 (_p) = BU_LIST_FIRST(nmg_hitmiss, &(re_nmgfree)); \
127 if (BU_LIST_IS_HEAD((_p), &(re_nmgfree))) \
128 BU_ALLOC((_p), struct nmg_hitmiss); \
130 BU_LIST_DEQUEUE(&((_p)->l)); \
134#define NMG_FREE_HITLIST(_p) { \
135 BU_CK_LIST_HEAD((_p)); \
136 BU_LIST_APPEND_LIST(&(re_nmgfree), (_p)); \
139#ifdef NO_BOMBING_MACROS
140# define nmg_bu_bomb(rd, vlfree, str) (void)(rd)
142# define nmg_bu_bomb(rd, vlfree, str) { \
144 if (nmg_debug & NMG_DEBUG_NMGRT) bu_bomb("End of diagnostics"); \
145 BU_LIST_INIT(&rd->rd_hit); \
146 BU_LIST_INIT(&rd->rd_miss); \
147 nmg_debug |= NMG_DEBUG_NMGRT; \
148 nmg_isect_ray_model(rd,vlfree); \
149 bu_bomb("Should have bombed before this\n"); \
273 const struct shell *s,
274 const int in_or_out_only,
276 const struct bn_tol *tol);
Header file for the BRL-CAD common definitions.
void int char int int double * min
int nmg_class_ray_vs_shell(struct nmg_ray *rp, const struct shell *s, const int in_or_out_only, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_isect_ray_model(struct nmg_ray_data *rd, struct bu_list *vlfree)
struct bu_list re_nmgfree
head of NMG hitmiss freelist
int ray_in_rpp(struct nmg_ray *rp, const fastf_t *invdir, const fastf_t *min, const fastf_t *max)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
double fastf_t
fastest 64-bit (or larger) floating point type
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Information about where a ray hits the surface.
vect_t hit_normal
DEPRECATED: Surface Normal at hit_point, use RT_HIT_NORMAL.
struct nmg_ray * hit_rayp
pointer to defining ray
point_t hit_point
DEPRECATED: Intersection point, use VJOIN1 hit_dist.
int hit_surfno
solid-specific surface indicator
vect_t hit_vpriv
PRIVATE vector for xxx_*()
fastf_t hit_dist
dist from r_pt to hit_point
void * hit_private
PRIVATE handle for xxx_shot()
struct nmg_hitmiss * other
for keeping track of the other end of the segment when we know it
fastf_t dist_in_plane
distance from plane intersect
int start_stop
is this a seg_in or seg_out
int in_out
status of ray as it transitions this hit point.
struct bu_list rd_hit
list of hit elements
struct nmg_hitmiss ** hitmiss
1 struct hitmiss ptr per elem.
char * manifolds
structure 1-3manifold table
const struct bn_tol * tol
struct bu_list rd_miss
list of missed/sub-hit elements
fastf_t ray_dist_to_plane
ray parametric dist to plane
point_t plane_pt
ray/plane(face) intercept point
point_t r_pt
Point at which ray starts.
fastf_t r_max
exit dist from bounding sphere
vect_t r_dir
Direction of ray (UNIT Length)
fastf_t r_min
entry dist to bounding sphere
struct nmg_hit seg_out
OUT information.
struct nmg_hit seg_in
IN information.
void * seg_stp
pointer back to soltab
fundamental vector, matrix, quaternion math macros