summaryrefslogtreecommitdiff
path: root/src/linalg.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
commit1e64dddf1ea30282c89de7f35854a68614234652 (patch)
tree165d37c1c66f6ff79d48c74794238b3f0bed09da /src/linalg.cc
parent5c779159c208ca3d88c88479ab29f9cd66574859 (diff)
parentd0856efe6da545693f9c50a8a2514a9f999ab5ef (diff)
Merge branch 'master' of github.com:openscad/openscad into issue159
Diffstat (limited to 'src/linalg.cc')
-rw-r--r--src/linalg.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/linalg.cc b/src/linalg.cc
index 30f23af..2f368f9 100644
--- a/src/linalg.cc
+++ b/src/linalg.cc
@@ -1,4 +1,5 @@
#include "linalg.h"
+#include <boost/math/special_functions/fpclassify.hpp>
// FIXME: We can achieve better pruning by either:
// o Recalculate the box based on the transformed object
@@ -25,3 +26,23 @@ BoundingBox operator*(const Transform3d &m, const BoundingBox &box)
return newbox;
}
+bool matrix_contains_infinity( const Transform3d &m )
+{
+ for (int i=0;i<m.matrix().rows();i++) {
+ for (int j=0;j<m.matrix().cols();j++) {
+ if ((boost::math::isinf)(m(i,j))) return true;
+ }
+ }
+ return false;
+}
+
+bool matrix_contains_nan( const Transform3d &m )
+{
+ for (int i=0;i<m.matrix().rows();i++) {
+ for (int j=0;j<m.matrix().cols();j++) {
+ if ((boost::math::isnan)(m(i,j))) return true;
+ }
+ }
+ return false;
+}
+
contact: Jan Huwald // Impressum