diff options
author | Marius Kintel <marius@kintel.net> | 2013-08-15 03:01:43 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-08-15 03:01:43 (GMT) |
commit | ea606f69fcf5e0c75b2b484f49d6f3fe1c69ff78 (patch) | |
tree | 99724a00db25f825d68752230f2b89751ca6d42f /src/CGALEvaluator.cc | |
parent | 70247b75457afed5a1ca3c0caf1168dff22b690e (diff) | |
parent | af7e8320e2d0fda0e2b8505f50080ff3d33e7531 (diff) |
Merge branch 'master' of github.com:openscad/openscad
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r-- | src/CGALEvaluator.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 8e1b5eb..adaec4a 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -215,20 +215,24 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node) bbox_size.push_back( bb.xmax()-bb.xmin() ); bbox_size.push_back( bb.ymax()-bb.ymin() ); bbox_size.push_back( bb.zmax()-bb.zmin() ); + int newsizemax_index = 0; for (int i=0;i<3;i++) { if (node.newsize[i]) { if (bbox_size[i]==NT3(0)) { - PRINT("WARNING: Cannot resize in direction normal to flat object"); + PRINT("WARNING: Resize in direction normal to flat object is not implemented"); return N; } else { scale[i] = NT3(node.newsize[i]) / bbox_size[i]; } + if ( node.newsize[i] > node.newsize[newsizemax_index] ) + newsizemax_index = i; } } - NT3 autoscale = std::max( scale[0], std::max( scale[1], scale[2] )); + NT3 autoscale = NT3( node.newsize[ newsizemax_index ] ) / bbox_size[ newsizemax_index ]; for (int i=0;i<3;i++) { - if (node.autosize[i]) scale[i] = autoscale; + if (node.autosize[i] && node.newsize[i]==0) + scale[i] = autoscale; } Eigen::Matrix4d t; |