[brlcad-commits] SF.net SVN: brlcad:[58684] brlcad/trunk/src/libbn/chull.c From: - 2013-11-26 22:19:29 ```Revision: 58684 http://sourceforge.net/p/brlcad/code/58684 Author: starseeker Date: 2013-11-26 22:19:25 +0000 (Tue, 26 Nov 2013) Log Message: ----------- try to avoid using really short vectors for normal calculations... Modified Paths: -------------- brlcad/trunk/src/libbn/chull.c Modified: brlcad/trunk/src/libbn/chull.c =================================================================== --- brlcad/trunk/src/libbn/chull.c 2013-11-26 22:08:15 UTC (rev 58683) +++ brlcad/trunk/src/libbn/chull.c 2013-11-26 22:19:25 UTC (rev 58684) @@ -68,13 +68,15 @@ /* Step 3 - find normal vector of plane holding points */ i = 0; + dist_pt_pt = DIST_PT_PT(*origin_pnt, p_farthest); while (!have_normal && i < n){ vect_t temp_vect; - fastf_t vdot; + fastf_t vdot, d; VSUB2(temp_vect, points_3d[i], *origin_pnt); VUNITIZE(temp_vect); vdot = fabs(VDOT(temp_vect, *u_axis)); - if (vdot < 0.6) { + d = DIST_PT_PT(*origin_pnt, points_3d[i]); + if (vdot < 0.6 && d > (dist_pt_pt * 0.01)) { if (!bn_mk_plane_3pts(plane, *origin_pnt, p_farthest, points_3d[i], &tol)) { VSET(normal, plane[0], plane[1], plane[2]); have_normal = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```