#include <bn.h>
Data Fields | |
unsigned long | magic |
double | dist |
>= 0 | |
double | dist_sq |
dist * dist | |
double | perp |
nearly 0 | |
double | para |
nearly 1 |
B N _ T O L
A handy way of passing around the tolerance information needed to perform approximate floating-point calculations on geometry.
dist & dist_sq establish the distance tolerance.
If two points are closer together than dist, then they are to be considered the same point. For example:
point_t a,b; vect_t diff; VSUB2( diff, a, b ); if( MAGNITUDE(diff) < tol->dist ) a & b are the same. or, more efficiently: if( MAQSQ(diff) < tol->dist_sq )
If two rays emanate from the same point, and their dot product is nearly one, then the two rays are the same, while if their dot product is nearly zero, then they are perpendicular. For example:
vect_t a,b; if( fabs(VDOT(a,b)) >= tol->para ) a & b are parallel if( fabs(VDOT(a,b)) <= tol->perp ) a & b are perpendicular
Definition at line 137 of file bn.h.
|
Definition at line 138 of file bn.h. Referenced by classify_sketch_loops(), nmg_dangling_face(), nmg_do_radial_flips(), rt_nmg_import(), rt_nmg_import5(), wdb_dbopen(), and wdb_init_obj(). |
|
|
|
nearly 0
Definition at line 141 of file bn.h. Referenced by bn_isect_line3_plane(), bn_mat_is_equal(), classify_sketch_loops(), nmg_dangling_face(), nmg_do_radial_flips(), nmg_loop_is_ccw(), rt_hf_prep(), rt_nmg_import(), rt_nmg_import5(), rt_pr_tol(), wdb_dbopen(), wdb_init_obj(), and wdb_tol_cmd(). |
|
nearly 1
Definition at line 142 of file bn.h. Referenced by bn_isect_line2_line2(), classify_sketch_loops(), nmg_dangling_face(), nmg_do_radial_flips(), nmg_shell_coplanar_face_merge(), rt_line_on_plane(), rt_nmg_import(), rt_nmg_import5(), rt_pr_tol(), wdb_dbopen(), wdb_init_obj(), and wdb_tol_cmd(). |