diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-09-13 00:44:07 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-09-13 00:44:07 (GMT) |
commit | d6a57b89682ed7991744dc142e9af21d5e74cb83 (patch) | |
tree | d9fdaca01282825ff51f0f2719f03eba6c0e1752 /src/CGALEvaluator.cc | |
parent | c87e9f8d6e210a387ca223f7e8cb14c77b22d8e2 (diff) |
fix bug in 2d resize code
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r-- | src/CGALEvaluator.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 09070d5..8da4649 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -215,6 +215,7 @@ 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<N.dim;i++) { if (node.newsize[i]) { @@ -229,7 +230,10 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node) newsizemax_index = i; } } - NT3 autoscale = NT3( node.newsize[ newsizemax_index ] ) / bbox_size[ newsizemax_index ]; + + 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; |