[MOAB-dev] r1794 - MOAB/trunk/tools/dagmc
kraftche at mcs.anl.gov
kraftche at mcs.anl.gov
Mon May 5 17:13:14 CDT 2008
Author: kraftche
Date: 2008-05-05 17:13:14 -0500 (Mon, 05 May 2008)
New Revision: 1794
Modified:
MOAB/trunk/tools/dagmc/DagMC.cpp
Log:
Fix bug in function to get axis-aligned bounding box of oriented box: the
values of the OBB axis vectors will almost never be all positive (it is
only possible when the box is axis-aligned.)
Modified: MOAB/trunk/tools/dagmc/DagMC.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/DagMC.cpp 2008-05-05 17:56:23 UTC (rev 1793)
+++ MOAB/trunk/tools/dagmc/DagMC.cpp 2008-05-05 22:13:14 UTC (rev 1794)
@@ -1747,8 +1747,9 @@
// compute min and max verticies
for (int i=0; i<3; i++)
{
- minPt[i] = center[i] - (axis1[i] + axis2[i] + axis3[i]);
- maxPt[i] = center[i] + (axis1[i] + axis2[i] + axis3[i]);
+ double sum = fabs(axis1[i]) + fabs(axis2[i]) + fabs(axis3[i]);
+ minPt[i] = center[i] - sum;
+ maxPt[i] = center[i] + sum;
}
return MB_SUCCESS;
}
More information about the moab-dev
mailing list