From 3f58ca2ddd8464713aff254f084f0aeb47ba5085 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 30 Aug 2011 05:07:59 +0200 Subject: bugfix: bbox calculation didn't take transformation matrix into account diff --git a/src/csgterm.cc b/src/csgterm.cc index 411cb12..db9525a 100644 --- a/src/csgterm.cc +++ b/src/csgterm.cc @@ -234,7 +234,18 @@ BoundingBox CSGChain::getBoundingBox() const BoundingBox bbox; for (size_t i=0;igetBoundingBox()); + BoundingBox psbox = polysets[i]->getBoundingBox(); + if (!psbox.isNull()) { + Eigen::Transform3d t; + // Column-major vs. Row-major + t.matrix() << + matrices[i][0], matrices[i][4], matrices[i][8], matrices[i][12], + matrices[i][1], matrices[i][5], matrices[i][9], matrices[i][13], + matrices[i][2], matrices[i][6], matrices[i][10], matrices[i][14], + matrices[i][3], matrices[i][7], matrices[i][11], matrices[i][15]; + bbox.extend(t * psbox.min()); + bbox.extend(t * psbox.max()); + } } } return bbox; -- cgit v0.10.1