diff options
Diffstat (limited to 'src')
-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; |