Revision: 48522
http://brlcad.svn.sourceforge.net/brlcad/?rev=48522&view=rev
Author: n_reed
Date: 2012-01-12 16:48:41 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
bad control logic, CID 167
Modified Paths:
--------------
brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2012-01-12
16:46:20 UTC (rev 48521)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2012-01-12
16:48:41 UTC (rev 48522)
@@ -1174,9 +1174,7 @@
struct edgeuse *eu_p;
struct edgeuse *fu_eu;
vect_t edge_left;
- vect_t eu_vec;
vect_t norm;
- int faces_found;
vect_t r_dir_unit;
VMOVE(r_dir_unit, rd->rp->r_dir);
@@ -1200,13 +1198,11 @@
s = nmg_find_s_of_eu(eu);
- faces_found = 0;
eu_p = eu->e_p->eu_p;
do {
fu=nmg_find_fu_of_eu(eu_p);
if (fu) {
fu_eu = eu_p;
- faces_found = 1;
if (fu->orientation == OT_OPPOSITE &&
fu->fumate_p->orientation == OT_SAME) {
fu = fu->fumate_p;
@@ -1214,21 +1210,21 @@
}
if (fu->orientation != OT_SAME) {
bu_log("%s[%d]: I can't seem to find an OT_SAME faceuse\nThis
must be a `dangling' face. I'll skip it\n", __FILE__, __LINE__);
- goto next_edgeuse;
+ continue;
}
if (fu->s_p != s)
- goto next_edgeuse;
+ continue;
if (nmg_find_eu_leftvec(edge_left, eu_p)) {
bu_log("edgeuse not part of faceuse");
- goto next_edgeuse;
+ continue;
}
if (! (NMG_3MANIFOLD &
NMG_MANIFOLDS(rd->manifolds, fu->f_p))) {
bu_log("This is not a 3-Manifold face. I'll skip it\n");
- goto next_edgeuse;
+ continue;
}
cos_angle = VDOT(edge_left, r_dir_unit);
@@ -1254,29 +1250,13 @@
bu_log("New outb cos_angle %g\n", outb_cos_angle);
}
}
- next_edgeuse: eu_p = eu_p->eumate_p->radial_p;
- } while (eu_p != eu->e_p->eu_p);
+ } while ((eu_p = eu_p->eumate_p->radial_p) != eu->e_p->eu_p);
if (!inb_fu || !outb_fu) {
- return;
- }
-
- if (!faces_found) {
/* we hit a wire edge */
myhit->in_out = HMG_HIT_ANY_ANY;
myhit->hit.hit_private = (genptr_t)eu;
myhit->inbound_use = myhit->outbound_use = (long *)eu;
-
- eu_p = BU_LIST_PNEXT_CIRC(edgeuse, eu);
- VSUB2(eu_vec, eu->vu_p->v_p->vg_p->coord,
- eu_p->vu_p->v_p->vg_p->coord);
- VCROSS(edge_left, eu_vec, r_dir_unit);
- VCROSS(myhit->inbound_norm, eu_vec, edge_left);
- if (VDOT(myhit->inbound_norm, r_dir_unit) > SMALL_FASTF) {
- VREVERSE(myhit->inbound_norm, myhit->inbound_norm);
- }
- VMOVE(myhit->outbound_norm, myhit->inbound_norm);
-
return;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits