[brlcad-commits] SF.net SVN: brlcad:[58709] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <n_...@us...> - 2013-11-29 21:48:39
|
Revision: 58709 http://sourceforge.net/p/brlcad/code/58709 Author: n_reed Date: 2013-11-29 21:48:35 +0000 (Fri, 29 Nov 2013) Log Message: ----------- need to use 2D macros for 2D vectors Modified Paths: -------------- brlcad/trunk/include/vmath.h brlcad/trunk/src/libbn/obr.c brlcad/trunk/src/libbn/tests/bn_obr.c Modified: brlcad/trunk/include/vmath.h =================================================================== --- brlcad/trunk/include/vmath.h 2013-11-29 04:06:30 UTC (rev 58708) +++ brlcad/trunk/include/vmath.h 2013-11-29 21:48:35 UTC (rev 58709) @@ -1276,8 +1276,8 @@ /** @brief Return scalar magnitude of vector at `a' */ #define MAGNITUDE(a) sqrt(MAGSQ(a)) +#define MAGNITUDE2(a) sqrt(MAG2SQ(a)) - /** * Store cross product of 3D vectors at `b' and `c' in vector at `a'. * Note that the "right hand rule" applies: If closing your right hand Modified: brlcad/trunk/src/libbn/obr.c =================================================================== --- brlcad/trunk/src/libbn/obr.c 2013-11-29 04:06:30 UTC (rev 58708) +++ brlcad/trunk/src/libbn/obr.c 2013-11-29 21:48:35 UTC (rev 58709) @@ -197,7 +197,7 @@ V2SCALE(U, u, extent0); /*bu_log("U: %f, %f, %f\n", U[0], U[1], U[2]);*/ /*bu_log("VDOT(v, left_bottom_diff): %f\n", VDOT(v,left_bottom_diff));*/ - V2SCALE(V, v, extent1 - VDOT(v,left_bottom_diff)); + V2SCALE(V, v, extent1 - V2DOT(v,left_bottom_diff)); /*bu_log("V: %f, %f, %f\n", V[0], V[1], V[2]);*/ V2ADD3(obr->center, left_pnt, U, V); bu_log("center: %f, %f\n\n", obr->center[0], obr->center[1]); @@ -234,7 +234,7 @@ case 1: /* Bound line */ V2SUB2(vline, pmax, pmin); - obr->extent0 = MAGNITUDE(vline) * 0.5; + obr->extent0 = MAGNITUDE2(vline) * 0.5; obr->extent1 = BN_TOL_DIST; V2SET(obr->center, center[0]/2, center[1]/2); V2SUB2(vline, pmax, center); Modified: brlcad/trunk/src/libbn/tests/bn_obr.c =================================================================== --- brlcad/trunk/src/libbn/tests/bn_obr.c 2013-11-29 04:06:30 UTC (rev 58708) +++ brlcad/trunk/src/libbn/tests/bn_obr.c 2013-11-29 21:48:35 UTC (rev 58709) @@ -54,11 +54,11 @@ bu_log(" u (%f, %f)\n", V2ARGS(u)); bu_log(" v (%f, %f)\n", V2ARGS(v)); V2ADD3(output_pnts[2], center, u, v); - VSCALE(u, u, -1); + V2SCALE(u, u, -1); V2ADD3(output_pnts[3], center, u, v); - VSCALE(v, v, -1); + V2SCALE(v, v, -1); V2ADD3(output_pnts[0], center, u, v); - VSCALE(u, u, -1); + V2SCALE(u, u, -1); V2ADD3(output_pnts[1], center, u, v); bu_log(" op1 (%f, %f)\n", V2ARGS(output_pnts[0])); bu_log(" op2 (%f, %f)\n", V2ARGS(output_pnts[1])); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |