Revision: 55296
          http://sourceforge.net/p/brlcad/code/55296
Author:   starseeker
Date:     2013-05-02 19:26:23 +0000 (Thu, 02 May 2013)
Log Message:
-----------
Rather than defining a VMATH macro that unitizes and returns if there is a 
tolerance error, just do the test in the calling code and use the standard 
UNITIZE macro.

Modified Paths:
--------------
    brlcad/trunk/include/vmath.h
    brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c

Modified: brlcad/trunk/include/vmath.h
===================================================================
--- brlcad/trunk/include/vmath.h        2013-05-02 18:13:41 UTC (rev 55295)
+++ brlcad/trunk/include/vmath.h        2013-05-02 19:26:23 UTC (rev 55296)
@@ -1011,15 +1011,6 @@
        } \
     } while (0)
 
-/** @brief If vector magnitude is too small, return an error code. */
-#define VUNITIZE_RET(a, ret) do { \
-       register double _f; \
-       _f = MAGNITUDE(a); \
-       if (_f < VDIVIDE_TOL) return ret; \
-       _f = 1.0/_f; \
-       (a)[X] *= _f; (a)[Y] *= _f; (a)[Z] *= _f; \
-    } while (0)
-
 /**
  * @brief Find the sum of two points, and scale the result.  Often
  * used to find the midpoint.

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c    2013-05-02 18:13:41 UTC 
(rev 55295)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_misc.c    2013-05-02 19:26:23 UTC 
(rev 55296)
@@ -1404,7 +1404,8 @@
     area = 0.5 * MAGNITUDE(plane);
 
     /* Error if the area is too small to unitize the normal vector */
-    VUNITIZE_RET(plane, (fastf_t)(-1.0));
+    if (MAGNITUDE(plane) < VDIVIDE_TOL) return -1.0;
+    VUNITIZE(plane);
 
     /* calculate plane[W] as average distance to plane */
     for (BU_LIST_FOR (eu, edgeuse, &lu->down_hd)) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to