diff options
author | Marius Kintel <marius@kintel.net> | 2013-09-13 05:06:17 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-09-13 05:06:17 (GMT) |
commit | ead8749e99238c18a3d7bb903f98bb7bca6a7685 (patch) | |
tree | baa054dc0bd236e11a0ad29c41f092193a52245d /src/CGALEvaluator.cc | |
parent | 233406230281d8fefe24902fea52d916dfb3d88e (diff) | |
parent | f82ff8272b9698e7c572d6c67a5b69bf26896933 (diff) |
Merge pull request #476 from openscad/testfixes
Testfixes
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r-- | src/CGALEvaluator.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index adaec4a..ec01315 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -216,7 +216,7 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node) 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++) { + for (int i=0;i<N.dim;i++) { if (node.newsize[i]) { if (bbox_size[i]==NT3(0)) { PRINT("WARNING: Resize in direction normal to flat object is not implemented"); @@ -229,8 +229,11 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node) newsizemax_index = i; } } - NT3 autoscale = NT3( node.newsize[ newsizemax_index ] ) / bbox_size[ newsizemax_index ]; - for (int i=0;i<3;i++) { + + NT3 autoscale = NT3( 1 ); + if ( node.newsize[ newsizemax_index ] != 0 ) + autoscale = NT3( node.newsize[ newsizemax_index ] ) / bbox_size[ newsizemax_index ]; + for (int i=0;i<N.dim;i++) { if (node.autosize[i] && node.newsize[i]==0) scale[i] = autoscale; } |