[brlcad-commits] SF.net SVN: brlcad:[41281] brlcad/trunk/src/librt/primitives/nmg
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2010-11-08 16:57:11
|
Revision: 41281 http://brlcad.svn.sourceforge.net/brlcad/?rev=41281&view=rev Author: brlcad Date: 2010-11-08 16:57:03 +0000 (Mon, 08 Nov 2010) Log Message: ----------- remove lots and lots of dead code. particularly for #if 0 and #if 1 code that has no else clause, but even for some of those that do that are not relevant without revisiting the code. Modified Paths: -------------- brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c brlcad/trunk/src/librt/primitives/nmg/nmg_class.c brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c brlcad/trunk/src/librt/primitives/nmg/nmg_manif.c brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_ck.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -1293,12 +1293,9 @@ eu_orig = eu; eu1 = eu; - /* If this eu is a wire, advance to first non-wire (skipping dangling faces). */ + /* If this eu is a wire, advance to first non-wire. */ while ((fu = nmg_find_fu_of_eu(eu)) == (struct faceuse *)NULL || nmg_find_s_of_eu((struct edgeuse *)eu) != s -#if BO_DANGLE - || nmg_dangling_face(fu, (char *)NULL) -#endif ) { eu = eu->radial_p->eumate_p; if (eu == eu1) return 0; /* wires all around */ @@ -1313,14 +1310,10 @@ do { /* * Search until another edgeuse in this shell is found. - * Continue search if it is a wire edge or dangling face. + * Continue search if it is a wire edge. */ - while (nmg_find_s_of_eu((struct edgeuse *)eur) != s || - (fu = nmg_find_fu_of_eu(eur)) == (struct faceuse *)NULL -#if BO_DANGLE - || nmg_dangling_face(fu, (char *)NULL) -#endif - ) { + while (nmg_find_s_of_eu((struct edgeuse *)eur) != s + || (fu = nmg_find_fu_of_eu(eur)) == (struct faceuse *)NULL) { /* Advance to next eur */ NMG_CK_EDGEUSE(eur->eumate_p); if (eur->eumate_p->eumate_p != eur) { Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_class.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_class.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_class.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -585,7 +585,7 @@ #if 1 {3, 2, 1}, /* Normally the first dir */ #else - {1, 0, 0}, /* Make this first dir to wring out ray-tracer XXX */ + {1, 0, 0}, /* DEBUG: Make this first dir to wring out ray-tracer */ #endif {1, 0, 0}, {0, 1, 0}, Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -216,14 +216,6 @@ if (is->mag_len <= BU_PTBL_END(is->l1) || is->mag_len <= BU_PTBL_END(is->l2)) bu_log("Array for distances to vertexuses is too small (%d)\n", is->mag_len); -#if 0 - /* Check the geometry */ - if (bn_distsq_line3_pt3(is->pt, is->dir, vu->v_p->vg_p->coord) > is->tol.dist_sq) { - bu_log("nmg_enlist_vu() WARNING: vu=x%x, v=x%x not within tolerance of intersect line\n", - vu, vu->v_p); - } -#endif - sv = nmg_find_s_of_vu(vu); fuv = nmg_find_fu_of_vu(vu); @@ -913,17 +905,6 @@ (struct loopuse *)NULL, (void (*)())NULL, (void (*)())NULL, (char *)NULL, 0, 0, &is->tol); - if (class == NMG_CLASS_AoutB) { - /* point outside face loop, no need to break eu1 */ -#if 0 - bu_log("%%%%%% point is outside face loop, no need to break eu1?\n"); - return (struct vertexuse *)NULL; -#endif - /* Can't optimize this break out -- need to have - * the new vertexuse on the line of intersection, - * to drive the state machine of the face cutter! - */ - } eu1forw = nmg_ebreaker((struct vertex *)NULL, eu1, &is->tol); vu1_final = eu1forw->vu_p; @@ -1070,16 +1051,7 @@ default: case -1: /* P not on line */ -#if 0 /* This can happen when v2 is a long way from the lseg */ - V2PRINT("a", a); - V2PRINT("p", p); - V2PRINT("b", b); - VPRINT("A", v1a->vg_p->coord); - VPRINT("P", v2->vg_p->coord); - VPRINT("B", v1b->vg_p->coord); - bu_bomb("nmg_break_eu_on_v() P not on line?\n"); -#endif break; case 1: /* P is at A */ @@ -1933,23 +1905,17 @@ goto out; } -#if 0 - if (dist_to_plane <= edge_len + is->tol.dist) -#endif - { - /* Second point is on plane of face, by geometry */ - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tedge ends at plane intersect\n"); + /* Second point is on plane of face, by geometry */ + if (rt_g.NMG_debug & DEBUG_POLYSECT) + bu_log("\tedge ends at plane intersect\n"); - eunext = BU_LIST_PNEXT_CIRC(edgeuse, eu1); - NMG_CK_EDGEUSE(eunext); - if (eunext->vu_p->v_p != v1b) - bu_bomb("nmg_isect_wireedge3p_face3p: discontinuous eu loop\n"); + eunext = BU_LIST_PNEXT_CIRC(edgeuse, eu1); + NMG_CK_EDGEUSE(eunext); + if (eunext->vu_p->v_p != v1b) + bu_bomb("nmg_isect_wireedge3p_face3p: discontinuous eu loop\n"); - vu1_final = eunext->vu_p; - vu2_final = nmg_enlist_vu(is, vu1_final, 0, MAX_FASTF); - goto out; - } + vu1_final = eunext->vu_p; + vu2_final = nmg_enlist_vu(is, vu1_final, 0, MAX_FASTF); out: /* If vu's were added to list, run some quick checks here */ @@ -2288,10 +2254,7 @@ nmg_pr_ptbl_vert_list("vert_list1", &vert_list1, mag1); nmg_pr_ptbl_vert_list("vert_list2", &vert_list2, mag2); } -#if 0 - nmg_purge_unwanted_intersection_points(&vert_list1, mag1, fu2, &is->tol); - if (fu1)nmg_purge_unwanted_intersection_points(&vert_list2, mag2, fu1, &is->tol); -#endif + if (rt_g.NMG_debug & DEBUG_FCUT) { bu_log("nmg_isect_edge2p_face2p(eu1=x%x, fu2=x%x) vert_lists D:\n", eu1, fu2); nmg_pr_ptbl_vert_list("vert_list1", &vert_list1, mag1); @@ -2510,11 +2473,7 @@ NMG_CK_VERTEX_G(vg1b); VSUB2(vt1_3d, vg1b->coord, vg1a->coord); -#if 0 - nmg_get_2d_vertex(pt1a, eu1->vu_p->v_p, is, (long *)fu1); - nmg_get_2d_vertex(pt1b, eu1->eumate_p->vu_p->v_p, is, (long *)fu1); - VSUB2(vt1, pt1b, pt1a); -#endif + for (j=0; j<BU_PTBL_END(&eu2_list); j++) { struct edgeuse *eu2; struct vertex_g *vg2a, *vg2b; @@ -2527,21 +2486,13 @@ eu2 = (struct edgeuse *)BU_PTBL_GET(&eu2_list, j); NMG_CK_EDGEUSE(eu2); -#if 0 - nmg_get_2d_vertex(pt2a, eu2->vu_p->v_p, is, (long *)fu1); - nmg_get_2d_vertex(pt2b, eu2->eumate_p->vu_p->v_p, is, (long *)fu1); - VSUB2(vt2, pt2b, pt2a); -#endif + vg2a = eu2->vu_p->v_p->vg_p; vg2b = eu2->eumate_p->vu_p->v_p->vg_p; VSUB2(vt2_3d, vg2b->coord, vg2a->coord); -#if 0 - code = bn_isect_lseg2_lseg2(dist, pt1a, vt1, - pt2a, vt2, &is->tol); -#else + code = bn_isect_lseg3_lseg3(dist, vg1a->coord, vt1_3d, vg2a->coord, vt2_3d, &is->tol); -#endif if (code < 0) continue; @@ -2607,11 +2558,6 @@ nmg_vertex_gv(hitv, hit_pt); vg1b = eu1->eumate_p->vu_p->v_p->vg_p; VSUB2(vt1_3d, vg1b->coord, vg1a->coord); -#if 0 - bu_ptbl_ins(&eu1_list, (long *)new_eu); - nmg_get_2d_vertex(pt1b, eu1->eumate_p->vu_p->v_p, is, (long *)fu1); - VSUB2(vt1, pt1b, pt1a); -#endif } } if (code == 1 && hitv != eu2->vu_p->v_p && hitv != eu2->eumate_p->vu_p->v_p) { @@ -3799,28 +3745,7 @@ bu_log("\tnmg_isec_eu_fu: no intersection\n"); return; } -#if 0 - /* make sure intersection is within limits of eu */ - if (dist < (-is->tol.dist) || dist > eu_len+is->tol.dist) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tnmg_isec_eu_fu: intersection beyond ends of EU\n"); - return; - } - if (dist <= is->tol.dist) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tintersection at eu_vu_p\n"); - (void)nmg_make_dualvu(eu->vu_p->v_p, fu, &is->tol); - return; - } - - if (dist >= eu_len - is->tol.dist) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tintersection at eu->eumate_p->vu_p\n"); - (void)nmg_make_dualvu(eu->eumate_p->vu_p->v_p, fu, &is->tol); - return; - } -#endif VJOIN1(hit_pt, vg1->coord, dist, dir); if (rt_g.NMG_debug & DEBUG_POLYSECT) @@ -4237,43 +4162,6 @@ } if (*eg1 == is->on_eg) { -#if 0 - colinear: - /* - * This edge_g is known to be ON the face/face line. - * Intersect all pairs of edgeuses, and enlist - * every vertexuse along the edge. - * Because the list can grow, scan in upwards direction. - */ - if (rt_g.NMG_debug & DEBUG_POLYSECT) { - bu_log("\tThis edge_geom generated the line. Enlisting.\n"); - } - for (eu1_index=0; eu1_index < BU_PTBL_END(eu1_list); eu1_index++) { - eu1 = (struct edgeuse *)BU_PTBL_GET(eu1_list, eu1_index); - NMG_CK_EDGEUSE(eu1); - if (eu1->g.lseg_p != is->on_eg) continue; - /* eu1 is from fu1 */ - - for (eu2_index=0; eu2_index < BU_PTBL_END(eu2_list); eu2_index++) { - eu2 = (struct edgeuse *)BU_PTBL_GET(eu2_list, eu2_index); - NMG_CK_EDGEUSE(eu2); - - if (eu2->g.lseg_p != is->on_eg) continue; - /* - * eu2 is from fu2. - * Perform intersection. - * New edgeuses are added to lists. - */ - (void)nmg_isect_2colinear_edge2p(eu1, eu2, - fu1, is, eu1_list, eu2_list); - } - - /* For the case where only 1 face is involved */ - nmg_enlist_vu(is, eu1->vu_p, 0, MAX_FASTF); - nmg_enlist_vu(is, BU_LIST_PNEXT_CIRC(edgeuse, eu1)->vu_p, 0, MAX_FASTF); - } - continue; -#else point_t pca; struct edgeuse *eu_end; struct vertex_g *vg; @@ -4365,7 +4253,6 @@ } } continue; -#endif } /* @@ -4404,16 +4291,11 @@ nmg_pr_eg(&(*eg1)->l.magic, 0); nmg_pr_eg(&is->on_eg->l.magic, 0); bu_log("nmg_isect_line2_face2pNEW() eg1 colinear to on_eg?\n"); -#if 0 - /* XXX See if this helps. */ - nmg_model_fuse(nmg_find_model(&fu1->l.magic), &(is->tol)); - bu_bomb("nmg_isect_line2_face2pNEW() eg1 colinear to on_eg?\n"); -#else + /* fuse eg1 with on_eg, handle as colinear */ bu_log("fusing eg1 with on_eg, handling as colinear\n"); nmg_jeg(is->on_eg, *eg1); goto colinear; -#endif } /* If on_eg was specified, do a search for topology intersection */ @@ -4552,7 +4434,7 @@ if (rt_g.NMG_debug & DEBUG_POLYSECT) { VPRINT("\t2 lines intersect at", hit3d); } -#if 1 + if (!V3PT_IN_RPP(hit3d, fu1->f_p->min_pt, fu1->f_p->max_pt)) { /* Lines intersect outside bounds of this face. */ if (rt_g.NMG_debug & DEBUG_POLYSECT) { @@ -4576,7 +4458,7 @@ } else if (rt_g.NMG_debug & DEBUG_POLYSECT) { bu_log("\t\tnmg_class_pt_fu_except(fu1) returns %s\n", nmg_class_name(class)); } -#endif + VJOIN1_2D(hit2d, is->pt2d, dist[0], is->dir2d); /* Consistency check between geometry, and hit_v. */ @@ -4669,14 +4551,8 @@ goto hit_a; } if (hit_v == vu1a->v_p) goto hit_a; -#if 0 - nmg_repair_v_near_v(hit_v, vu1a->v_p, - is->on_eg, *eg1, 1, &(is->tol)); - bu_ptbl_free(&eg_list); - goto re_tabulate; -#else + /* Fall through to bn_isect_pt2_lseg2() */ -#endif } tmp_dist_sq = bn_distsq_line3_pt3(is->pt, is->dir, vu1b->v_p->vg_p->coord); if (rt_g.NMG_debug & DEBUG_POLYSECT) { @@ -4691,14 +4567,8 @@ goto hit_b; } if (hit_v == vu1b->v_p) goto hit_b; -#if 0 - nmg_repair_v_near_v(hit_v, vu1b->v_p, - is->on_eg, *eg1, 1, &(is->tol)); - bu_ptbl_free(&eg_list); - goto re_tabulate; -#else + /* Fall through to bn_isect_pt2_lseg2() */ -#endif } /* Third, a geometry check of the HITPT -vs- the line segment */ @@ -4814,8 +4684,7 @@ nmg_enlist_vu(is, vu1, 0, MAX_FASTF); } -#if 1 - /* This can probably be removed */ + /* FIXME: This can probably be removed */ /* recent OLD WAY: */ /* To prevent an OT_BOOLPLACE from being overlooked, * break *both* sets of eu's @@ -4854,7 +4723,7 @@ bu_ptbl_ins_unique(eu2_list, (long *)&new_eu->l.magic); nmg_enlist_vu(is, new_eu->vu_p, 0, MAX_FASTF); } -#endif + } bu_ptbl_free(&eg_list); @@ -5171,76 +5040,7 @@ && rt_g.NMG_debug & DEBUG_PLOTEM) { nmg_pl_2fu("Iface%d.pl", fu1, fu2, 0); } -#if 0 - /* Topology search */ - /* See if 2 faces share an edge already. If so, get edge_geom line */ - if ((is->on_eg = nmg_find_eg_between_2fg(fu1, fu2, &(is->tol)))) { - NMG_CK_EDGE_G_LSEG(is->on_eg); -#ifdef TOO_STRICT - /* Verify that this edge_g is with tol of both planes */ - if (!rt_line_on_plane(is->on_eg->e_pt, is->on_eg->e_dir, n1, &(is->tol))) { - bu_log("WARNING: shared on_eg not on plane of fu1, omitting.\n"); - is->on_eg = NULL; - } else if (!rt_line_on_plane(is->on_eg->e_pt, is->on_eg->e_dir, n2, &(is->tol))) { - bu_log("WARNING: shared on_eg not on plane of fu2, omitting.\n"); - is->on_eg = NULL; - } -#endif - /* - * There is a topological edge_g in common between - * the two face geometries. - * The intersection still needs to be done, because - * there might be partial sharing due to the fuser, - * but a full intersection may not have been performed - * on both faceuses yet. - */ - /* Check angle first */ - VMOVE(unit_e_dir, is->on_eg->e_dir); - VUNITIZE(unit_e_dir); - dot = VDOT(is->dir, unit_e_dir); - if (fabs(dot) < is->tol.para && /* not parallel */ - !bn_2line3_colinear( - is->pt, is->dir, - is->on_eg->e_pt, unit_e_dir, 1000.0, &(is->tol))) { - ang = acos(fabs(dot)); - bu_log("WARNING nmg_isect_two_face3p() is->pt and on_eg lines differ by %g deg. (shared topo)\n", - ang * bn_radtodeg); - } - /* Take geometry from the known shared edge is->on_eg */ - nmg_isect_construct_nice_ray(is, fu2); - } - if (!is->on_eg) { - /* Geometry search */ - if (!(is->on_eg = nmg_find_eg_on_line(&fu1->l.magic, is->pt, is->dir, &(is->tol)))) { - is->on_eg = nmg_find_eg_on_line(&fu2->l.magic, is->pt, is->dir, &(is->tol)); - } - if (is->on_eg) { - /* Check angle */ - VMOVE(unit_e_dir, is->on_eg->e_dir); - VUNITIZE(unit_e_dir); - dot = VDOT(is->dir, unit_e_dir); - if (fabs(dot) < is->tol.para && /* not parallel */ - !bn_2line3_colinear( - is->pt, is->dir, - is->on_eg->e_pt, unit_e_dir, 1000.0, &(is->tol))) { - ang = acos(fabs(dot)); - bu_log("WARNING nmg_isect_two_face3p() is->pt and on_eg lines differ by %g deg. (geom search)\n", - ang * bn_radtodeg); - if (ang * bn_radtodeg > 1.0) { - /* Forget about this shared topology */ - bu_log("nmg_isect_two_face3p() line direction mismatch (geom), clearing on_eg.\n"); - is->on_eg = (struct edge_g_lseg *)NULL; - } - } - } - } - if (is->on_eg) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) { - VPRINT("is->on_eg->e_pt ", is->on_eg->e_pt); - VPRINT("is->on_eg->e_dir", is->on_eg->e_dir); - } - } -#endif + bu_ptbl_init(&vert_list1, 64, "vert_list1 buffer"); bu_ptbl_init(&vert_list2, 64, "vert_list2 buffer"); @@ -5266,34 +5066,8 @@ is->fu2 = fu2; is->mag1 = mag1; is->mag2 = mag2; -#if 0 - /* Intersect the line with everything in fu1. - * Note any colinear edgeuses in fu2 for potential sharing. - */ - nmg_isect_line2_face2pNEW(is, fu1, fu2, &eu1_list, &eu2_list); - if (rt_g.NMG_debug & DEBUG_VERIFY) { - nmg_fu_touchingloops(fu1); - nmg_fu_touchingloops(fu2); - nmg_vfu(&fu1->s_p->fu_hd, fu1->s_p); - nmg_vfu(&fu2->s_p->fu_hd, fu2->s_p); - } - /* - * Now intersect the line with the other face. - */ - if (rt_g.NMG_debug & DEBUG_FCUT) { - bu_log("nmg_isect_two_face3p(fu1=x%x, fu2=x%x) vert_lists A:\n", fu1, fu2); - nmg_pr_ptbl_vert_list("vert_list1", &vert_list1, mag1); - nmg_pr_ptbl_vert_list("vert_list2", &vert_list2, mag2); - } - - if (rt_g.NMG_debug & DEBUG_POLYSECT) { - bu_log("nmg_isect_two_face3p(fu1=x%x, fu2=x%x) START21\n", fu1, fu2); - } -#endif - - /* * Now do the intersection with the other face. */ is->l2 = &vert_list1; @@ -5314,10 +5088,7 @@ nmg_vfu(&fu1->s_p->fu_hd, fu1->s_p); nmg_vfu(&fu2->s_p->fu_hd, fu2->s_p); } -#if 0 - nmg_purge_unwanted_intersection_points(&vert_list1, mag1, fu2, &is->tol); - nmg_purge_unwanted_intersection_points(&vert_list2, mag2, fu1, &is->tol); -#endif + if (rt_g.NMG_debug & DEBUG_FCUT) { bu_log("nmg_isect_two_face3p(fu1=x%x, fu2=x%x) vert_lists B:\n", fu1, fu2); nmg_pr_ptbl_vert_list("vert_list1", &vert_list1, mag1); @@ -5350,11 +5121,6 @@ nmg_fu_touchingloops(fu2); } -#if 0 - nmg_show_broken_classifier_stuff((long *)fu1, (long **)NULL, 1, 0); - nmg_show_broken_classifier_stuff((long *)fu2, (long **)NULL, 1, 0); -#endif - out: (void)bu_ptbl_free(&vert_list1); (void)bu_ptbl_free(&vert_list2); @@ -5835,20 +5601,6 @@ bu_log("Considering EU x%x (%g %g %g) <-> (%g %g %g)\n", eu1, V3ARGS(vg1a->coord), V3ARGS(vg1b->coord)); -#if 0 - /* only consider edges in the plane of the other face */ - if (!NEAR_ZERO(DIST_PT_PLANE(vg1a->coord, pl2), is->tol.dist)) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tvg1a is not in other plane (%g)\n", DIST_PT_PLANE(vg1a->coord, pl2)); - continue; - } - if (!NEAR_ZERO(DIST_PT_PLANE(vg1b->coord, pl2), is->tol.dist)) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\tvg1b is not in other plane (%g)\n", DIST_PT_PLANE(vg1b->coord, pl2)); - continue; - } -#endif - VSUB2(vt1, vg1b->coord, vg1a->coord); len_vt1 = MAGNITUDE(vt1); VSCALE(vt1, vt1, 1.0/len_vt1); @@ -5872,21 +5624,6 @@ if (rt_g.NMG_debug & DEBUG_POLYSECT) bu_log("\tConsidering EU2 x%x (%g %g %g) <-> (%g %g %g)\n", eu2, V3ARGS(eu2->vu_p->v_p->vg_p->coord), V3ARGS(eu2->eumate_p->vu_p->v_p->vg_p->coord)); -#if 0 - /* only consider edges in the plane of the other face */ - if (!NEAR_ZERO(DIST_PT_PLANE(eu2->vu_p->v_p->vg_p->coord, pl1), is->tol.dist)) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\t\tEU2 start pt not in other plane (%g)\n", - DIST_PT_PLANE(eu2->vu_p->v_p->vg_p->coord, pl1)); - continue; - } - if (!NEAR_ZERO(DIST_PT_PLANE(eu2->eumate_p->vu_p->v_p->vg_p->coord, pl1), is->tol.dist)) { - if (rt_g.NMG_debug & DEBUG_POLYSECT) - bu_log("\t\tEU2 end pt not in other plane (%g)\n", - DIST_PT_PLANE(eu2->eumate_p->vu_p->v_p->vg_p->coord, pl1)); - continue; - } -#endif /* if these edges are radial, nothing to do */ if (eu1->vu_p->v_p == eu2->vu_p->v_p && @@ -6217,23 +5954,6 @@ } -#if 0 -static void -jra_save_fu_data(fu1, fu2, pl1, pl2) - struct faceuse *fu1, *fu2; - plane_t pl1, pl2; -{ - NMG_CK_FACEUSE(fu1); - NMG_CK_FACEUSE(fu2); - - bu_log("STARTDATA\n"); - bu_log("%f %f %f %f\n", V4ARGS(pl1)); - bu_log("%f %f %f %f\n", V4ARGS(pl2)); - nmg_pr_fu_briefly(fu1, ""); - nmg_pr_fu_briefly(fu2, ""); - bu_log("ENDDATA\n"); -} -#endif #define MAX_FACES 200 void nmg_check_radial_angles(char *str, struct shell *s, const struct bn_tol *tol) @@ -6382,10 +6102,6 @@ NMG_GET_FU_PLANE(pl1, fu1); NMG_GET_FU_PLANE(pl2, fu2); -#if 0 - jra_save_fu_data(fu1, fu2, pl1, pl2); -#endif - nmg_edgeuse_tabulate(&eu1_list, &fu1->l.magic); nmg_edgeuse_tabulate(&eu2_list, &fu2->l.magic); @@ -7267,12 +6983,7 @@ } nmg_isect2d_cleanup(&bs); -#if 0 - /* TOO EARLY, These are needed for identifying shared vertices */ - /* Eliminate any OT_BOOLPLACE self-loops now. */ - nmg_sanitize_fu(fu1); - nmg_sanitize_fu(fu2); -#endif + /* Eliminate stray vertices that were added along edges in this step */ (void)nmg_unbreak_region_edges(&fu1->l.magic); (void)nmg_unbreak_region_edges(&fu2->l.magic); @@ -7304,13 +7015,6 @@ nmg_pl_s(fp, fu2->s_p); fclose(fp); } - -#if 0 - /* This should really be controlled by it's own bit. */ - sprintf(name, "model%d.g", nshell); - nmg_stash_model_to_file(name, m, "After 2d isect"); - nshell++; -#endif } if (rt_g.NMG_debug & DEBUG_VERIFY) { @@ -7862,12 +7566,7 @@ /* Eliminate stray vertices that were added along edges in this step */ (void)nmg_unbreak_region_edges(&s1->l.magic); (void)nmg_unbreak_region_edges(&s2->l.magic); -#if 0 - /* TOO EARLY!!! These are needed to identify shared vertices */ - /* clean things up now that the intersections have been built */ - nmg_sanitize_s_lv(s1, OT_BOOLPLACE); - nmg_sanitize_s_lv(s2, OT_BOOLPLACE); -#endif + nmg_isect2d_cleanup(&is); if (rt_g.NMG_debug & DEBUG_VERIFY) { @@ -7894,19 +7593,17 @@ vu = nmg_loop_touches_self(lu); if (vu) { NMG_CK_VERTEXUSE(vu); -#if 0 + /* Right now, this routine is used for debugging ONLY, - * so if this condition exists, die. + * so if this condition exists, blather. * However, note that this condition happens a lot * for valid reasons, too. */ - bu_log("nmg_fu_touchingloops(lu=x%x, vu=x%x, v=x%x)\n", - lu, vu, vu->v_p); - nmg_pr_lu_briefly(lu, 0); - bu_bomb("nmg_fu_touchingloops()\n"); -#else - /* Perhaps log something here? */ -#endif + if (rt_g.NMG_debug & DEBUG_MANIF) { + bu_log("nmg_fu_touchingloops(lu=x%x, vu=x%x, v=x%x)\n", lu, vu, vu->v_p); + nmg_pr_lu_briefly(lu, 0); + } + return 1; } } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_manif.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_manif.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_manif.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -141,10 +141,9 @@ struct edgeuse *eu; const struct edgeuse *eur; -#if 1 if (rt_g.NMG_debug & DEBUG_MANIF) bu_log("nmg_paint_face(%08x, %d)\n", fu, paint_color); -#endif + if (NMG_INDEX_VALUE(paint_table, fu->index) != 0) return; @@ -224,10 +223,7 @@ { struct edgeuse *eu_p; struct vertexuse *vu_p; -#if 0 - if (rt_g.NMG_debug & DEBUG_MANIF) - bu_log("nmg_set_loop_sub_manifold(%08x)\n", lu_p); -#endif + NMG_CK_LOOPUSE(lu_p); NMG_SET_MANIFOLD(tbl, lu_p, manifold); Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -358,9 +358,7 @@ PLPRINT(" fur", fur->f_p->g.plane_p->N); { int debug = rt_g.NMG_debug; -#if 0 - rt_g.NMG_debug |= DEBUG_MESH; -#endif + if (nmg_two_face_fuse(fu1->f_p, fur->f_p, tol) == 0) bu_bomb("faces didn't fuse?\n"); rt_g.NMG_debug = debug; @@ -389,9 +387,6 @@ } cont: -#if 0 - if (iteration2 > 9997) rt_g.NMG_debug |= DEBUG_MESH_EU; -#endif /* If eu1 is only one pair of edgeuses, done */ if (eu1 == eur->eumate_p) break; eu1 = eur->eumate_p; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -2834,15 +2834,10 @@ } } if (fu->f_p->g.plane_p) { -#if 1 /* Do it this way if you expect to change the normals */ plane_t n; NMG_GET_FU_PLANE(n, fu); nmg_face_g(new_fu, n); -#else - /* Do it this way to share fu's geometry struct */ - nmg_jfg(fu, new_fu); -#endif /* XXX Perhaps this should be new_fu->f_p->g.plane_p ? */ if (fu->f_p->g.plane_p->index >= tbl_size) bu_bomb("nmg_dup_shell: trans table exceeded\n"); @@ -8466,7 +8461,7 @@ bu_log("nmg_kill_cracks(s=%x)\n", s); NMG_CK_SHELL(s); -#if 1 + /* Loops may be inadvertently connected with a crack, * this code is to dissconnect them and kill the connecting crack. * Look for cracks that are two EU's from one loop that @@ -8538,7 +8533,7 @@ } } } -#endif + fu = BU_LIST_FIRST(faceuse, &s->fu_hd); while (BU_LIST_NOT_HEAD(fu, &s->fu_hd)) { struct loopuse *lu; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -930,9 +930,7 @@ myhit->outbound_use = (long *)South_vu; switch (myhit->in_out) { -#if 1 case HMG_HIT_ON_ON: /* fallthrough??? -MJM??? */ -#endif case HMG_HIT_IN_IN: /* fallthrough */ case HMG_HIT_OUT_OUT: /* fallthrough */ case HMG_HIT_IN_ON: /* fallthrough */ Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c 2010-11-08 16:34:05 UTC (rev 41280) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c 2010-11-08 16:57:03 UTC (rev 41281) @@ -1881,16 +1881,10 @@ } /* check to see if we're joining two loops that share a vertex */ if (p1->vu_p->v_p == p2->vu_p->v_p) { -#if 1 if (rt_g.NMG_debug & DEBUG_TRI) bu_log("Joining two loops that share a vertex at (%g %g %g)\n", V3ARGS(p1->vu_p->v_p->vg_p->coord)); (void)nmg_join_2loops(p1->vu_p, p2->vu_p); -#else - if (rt_g.NMG_debug & DEBUG_TRI) - bu_log("NOT Joining two loops that share a vertex at (%g %g %g)\n", - V3ARGS(p1->vu_p->v_p->vg_p->coord)); -#endif return; } @@ -2188,37 +2182,6 @@ } -#if 0 - /* if the bottom vertexuse is on a rising edge and - * is a top vertex of another trapezoid then - * replace the occurrance of the old bottom - * vertexuse with the new one in trapezoid "top" - * locations. - */ - bot_next = PT2D_NEXT(tbl2d, tp->bot); - - if (P_LT_V(tp->bot, bot_next)) { - register struct pt2d *new_pt; - struct trap *trp; - - /* find the new vertexuse of this vertex */ - new_pt = PT2D_PREV(tbl2d, tp->top); - - /* replace all "top" uses of tp->bot with - * new_pt - */ - for (BU_LIST_FOR(trp, trap, tlist)) { - if (trp->top == tp->bot) { - trp->top = new_pt; - } - } - - /* clean up old trapezoid so that top/bot - * are in same loop - */ - tp->top = PT2D_PREV(tbl2d, tp->bot); - } -#endif } else { /* points are in different loops, join the @@ -2704,9 +2667,6 @@ NMG_CK_REGION(r); for (BU_LIST_FOR(s, shell, &r->s_hd)) { NMG_CK_SHELL(s); -#if 0 - nmg_s_split_touchingloops(s, tol); -#endif for (BU_LIST_FOR(fu, faceuse, &s->fu_hd)) { NMG_CK_FACEUSE(fu); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |