diff options
| author | Don Bright <hugh.m.bright@gmail.com> | 2013-08-14 02:14:56 (GMT) | 
|---|---|---|
| committer | Don Bright <hugh.m.bright@gmail.com> | 2013-08-14 02:14:56 (GMT) | 
| commit | 506ed4e693a086eff0ffe9e49ded5ca2edc981d1 (patch) | |
| tree | 5b9eeb844b881b253c9f6fa3c0b7642a9d9e54af /src | |
| parent | d2933590c23ae3a3d95bd1d2d74d03cdbb7897cc (diff) | |
first step of dealing with issue #455
Diffstat (limited to 'src')
| -rw-r--r-- | src/CGALEvaluator.cc | 10 | ||||
| -rw-r--r-- | src/cgaladv.cc | 2 | 
2 files changed, 8 insertions, 4 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; diff --git a/src/cgaladv.cc b/src/cgaladv.cc index ee3d657..8fd030a 100644 --- a/src/cgaladv.cc +++ b/src/cgaladv.cc @@ -98,7 +98,7 @@ AbstractNode *CgaladvModule::instantiate(const Context *ctx, const ModuleInstant  			if ( va.size() >= 3 ) node->autosize[2] = va[2].toBool();  		}  		else if ( autosize.type() == Value::BOOL ) { -			node->autosize << true, true, true; +			node->autosize << autosize.toBool(),autosize.toBool(),autosize.toBool();  		}  	} | 
