BRL-CAD
bn_tol Struct Reference

Support for uniform tolerances. More...

#include <tol.h>

Data Fields

uint32_t magic
 
double dist
 >= 0 More...
 
double dist_sq
 dist * dist More...
 
double perp
 nearly 0 More...
 
double para
 nearly 1 More...
 

Detailed Description

Support for uniform tolerances.

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)

perp & para establish the angular tolerance.

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
Note
tol->dist_sq = tol->dist * tol->dist;
tol->para = 1 - tol->perp;

Definition at line 71 of file tol.h.

Field Documentation

double dist

>= 0

Definition at line 73 of file tol.h.

Referenced by _ged_get_solid_keypoint(), add_seg(), avpp_val_compare(), bn_between(), bn_dist_line3_line3(), bn_dist_line3_lseg3(), bn_dist_pt2_lseg2(), bn_dist_pt3_lseg3(), bn_isect_line2_lseg2(), bn_isect_line3_plane(), bn_isect_line_lseg(), bn_isect_lseg2_lseg2(), bn_isect_lseg3_lseg3(), bn_lseg3_lseg3_parallel(), bn_mat_is_equal(), bn_math_cmd(), classify_seg(), diff_init_result(), Eplot(), find_metaballpt_nearest_pt(), find_pipept_nearest_pt(), fire_row(), fix_halfs(), gcv_compute_intervals_isectline(), gcv_stl_read(), ged_gqa(), ged_move_arb_face(), ged_nmg_fix_normals(), ged_polygons_overlap(), ged_tol(), getEdgePoints(), getSurfacePoints(), getUVCurveSamples(), guess_class_from_hitlist_max(), guess_class_from_hitlist_min(), isect_ray_faceuse(), isect_ray_planar_face(), isect_ray_triangle(), isect_ray_vertexuse(), light_hit(), main(), nmg_assess_vu(), nmg_break_e_on_v(), nmg_break_eg_on_v(), nmg_ck_fu_verts(), nmg_ck_v_in_2fus(), nmg_ck_v_in_fus(), nmg_ck_vert_on_fus(), nmg_class_lu_fu(), nmg_class_pt_fu_except(), nmg_class_pt_lu_except(), nmg_class_pt_s(), nmg_classify_pt_loop(), nmg_classify_pt_loop_new(), nmg_clone_model(), nmg_crackshells(), nmg_cut_lu_into_coplanar_and_non(), nmg_dangling_face(), nmg_do_radial_flips(), nmg_edge_g_fuse(), nmg_extrude_shell(), nmg_face_cutjoin(), nmg_faces_can_be_intersected(), nmg_fix_crossed_loops(), nmg_get_edge_lines(), nmg_get_interior_pt(), nmg_get_max_edge_inters(), nmg_is_crack_outie(), nmg_is_vertex_on_inter(), nmg_isect_2faceuse(), nmg_isect_eu_eu(), nmg_isect_eu_fu(), nmg_isect_line2_face2pNEW(), nmg_isect_pt_facet(), nmg_isect_two_generic_faces(), nmg_loop_g(), nmg_loop_plane_area2(), nmg_mc_evaluate(), nmg_no_isect_fu_pl(), nmg_pr_inter(), nmg_purge_unwanted_intersection_points(), nmg_repair_v_near_v(), nmg_shell_coplanar_face_merge(), nmg_snurb_is_planar(), nmg_two_face_fuse(), poly2tri_CDT(), recurse_dsp_bb(), remove_from_bsp(), rt_advance_to_next_cell(), rt_arb_centroid(), rt_arb_check_points(), rt_arb_describe(), rt_arb_find_e_nearest_pt2(), rt_arb_get_cgtype(), rt_arb_get_edge_list(), rt_arb_volume(), rt_arbn_plot(), rt_arbn_prep(), rt_arbn_tess(), rt_arc2d_to_cnurb(), rt_ars_shot(), rt_ars_tess(), rt_boolfinal(), rt_boolweave(), rt_bot_find_e_nearest_pt2(), rt_brep_plot(), rt_brep_prep(), rt_cell_n_on_ray(), rt_ct_populate_box(), rt_dsp_shot(), rt_ell_prep(), rt_ell_tess(), rt_ell_tnurb(), rt_extrude_shot(), rt_find_backing_dist(), rt_hrt_prep(), rt_hrt_shot(), rt_hrt_vshot(), rt_line_on_plane(), rt_metaball_tess(), rt_new_rti(), rt_nmg_adjust(), rt_nmg_import4(), rt_nmg_import5(), rt_nmg_mc_crosspew(), rt_nmg_mc_pew(), rt_nugrid_cut(), rt_nurb_prep(), rt_pg_shot(), rt_pg_to_bot(), rt_pipe_elim_dups(), rt_pr_tol(), rt_rec_shot(), rt_shootray(), rt_sketch_surf_area(), rt_sph_prep(), rt_split_mostly_empty_cells(), rt_superell_prep(), rt_tgc_adaptive_plot(), rt_tgc_tess(), rt_tol_default(), rt_tor_prep(), rt_tor_shot(), rt_tor_vshot(), rt_weave0seg(), single_conversion(), split_face(), state3(), state4(), tesselate_pipe_end(), tesselate_pipe_linear(), tesselate_pipe_start(), test_compose(), test_face_split_single(), test_face_splits(), test_intersection(), triangulateFace(), wdb_init(), and XGLUE().

double dist_sq

dist * dist

Definition at line 74 of file tol.h.

Referenced by bn_2line3_colinear(), bn_3pts_collinear(), bn_3pts_distinct(), bn_dist_line3_line3(), bn_dist_pt2_lseg2(), bn_dist_pt3_lseg3(), bn_distsq_pt3_lseg3(), bn_distsq_pt3_lseg3_v2(), bn_isect_line2_lseg2(), bn_isect_line3_line3(), bn_isect_line_lseg(), bn_isect_pt2_lseg2(), bn_isect_pt_lseg(), bn_mk_plane_3pts(), bn_npts_distinct(), bn_polygon_area(), bn_pt2_pt2_equal(), bn_pt3_pt3_equal(), diff_init_result(), find_metaballpt_nearest_pt(), find_pipept_nearest_pt(), gcv_stl_read(), ged_nmg_fix_normals(), ged_polygons_overlap(), ged_tol(), main(), make_near_list(), nmg_2edgeuse_g_coincident(), nmg_ck_eg_verts(), nmg_class_pt_lu_except(), nmg_clone_model(), nmg_cnurb_is_on_crv(), nmg_dangling_face(), nmg_do_radial_flips(), nmg_get_edge_lines(), nmg_is_crack_outie(), nmg_is_eu_on_line3(), nmg_is_vertex_on_inter(), nmg_isect_line2_face2pNEW(), nmg_isect_line2_vertex2(), nmg_loop_is_ccw(), nmg_pr_inter(), nmg_ptbl_vfuse(), nmg_search_v_eg(), nmg_simplify_inter(), nmg_split_linear_trim(), nmg_split_trim(), pnt2d_array_get_dimension(), rt_arb_centroid(), rt_arb_describe(), rt_arb_find_e_nearest_pt2(), rt_arb_get_edge_list(), rt_arb_setup(), rt_arb_tess(), rt_arb_tnurb(), rt_arb_volume(), rt_arbn_plot(), rt_arbn_tess(), rt_bot_find_e_nearest_pt2(), rt_new_rti(), rt_nmg_adjust(), rt_nmg_import4(), rt_nmg_import5(), rt_pr_tol(), rt_sketch_surf_area(), rt_sph_prep(), rt_tgc_tess(), rt_tol_default(), single_conversion(), tesselate_pipe_bend(), test_compose(), test_face_split_single(), test_face_splits(), test_intersection(), wdb_init(), and XGLUE().


The documentation for this struct was generated from the following file: