summaryrefslogtreecommitdiff
path: root/src/csgterm.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-08-30 03:07:59 (GMT)
committerMarius Kintel <marius@kintel.net>2011-08-30 03:07:59 (GMT)
commit3f58ca2ddd8464713aff254f084f0aeb47ba5085 (patch)
treeca9cd515a58c09425adadf2e220d6d8956faea1d /src/csgterm.cc
parent573a78c3c34b53bc1dc9750cd8b297d00c9b58c2 (diff)
bugfix: bbox calculation didn't take transformation matrix into account
Diffstat (limited to 'src/csgterm.cc')
-rw-r--r--src/csgterm.cc13
1 files changed, 12 insertions, 1 deletions
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;i<polysets.size();i++) {
if (types[i] != CSGTerm::TYPE_DIFFERENCE) {
- bbox.extend(polysets[i]->getBoundingBox());
+ 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;
contact: Jan Huwald // Impressum