summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r--src/CGALEvaluator.cc9
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;
}
contact: Jan Huwald // Impressum