83#define BN_CK_TOL(_p) BU_CKMAG(_p, BN_TOL_MAGIC, "bn_tol")
88#define BN_TOL_INIT(_p) { \
89 (_p)->magic = BN_TOL_MAGIC; \
91 (_p)->dist_sq = 0.0; \
100#define BN_TOL_INIT_ZERO { BN_TOL_MAGIC, 0.0, 0.0, 0.0, 1.0 }
105#define BN_TOL_INIT_TOL {BN_TOL_MAGIC, BN_TOL_DIST, BN_TOL_DIST * BN_TOL_DIST, 1.0e-6, 1.0 - 1.0e-6 }
106#define BN_TOL_INIT_SET_TOL(_p) { \
107 (_p)->magic = BN_TOL_MAGIC; \
108 (_p)->dist = BN_TOL_DIST; \
109 (_p)->dist_sq = BN_TOL_DIST * BN_TOL_DIST; \
110 (_p)->perp = 1.0e-6; \
111 (_p)->para = 1.0 - 1.0e-6; \
117#define BN_TOL_IS_INITIALIZED(_p) (((struct bn_tol *)(_p) != (struct bn_tol *)0) && LIKELY((_p)->magic == BN_TOL_MAGIC))
122#define BN_TOL_DIST 0.0005
128#define BN_VECT_ARE_PARALLEL(_dot, _tol) \
129 (((_dot) <= -SMALL_FASTF) ? (NEAR_EQUAL((_dot), -1.0, (_tol)->perp)) : (NEAR_EQUAL((_dot), 1.0, (_tol)->perp)))
135#define BN_VECT_ARE_PERP(_dot, _tol) \
136 (((_dot) < 0) ? ((-(_dot))<=(_tol)->perp) : ((_dot) <= (_tol)->perp))
Header file for the BRL-CAD common definitions.
Global registry of recognized magic numbers.
double dist_sq
dist * dist