diff options
| author | Marius Kintel <marius@kintel.net> | 2013-06-15 16:48:09 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2013-06-15 16:48:09 (GMT) | 
| commit | 3f936099faa34ff47f5226b21b640828532637dc (patch) | |
| tree | 99df28024caf98797a68726afa3629f7245a73b3 /src | |
| parent | 75a5dad6b7f65c52568d2cd82f556caa538439c6 (diff) | |
Clamp linear_extrude height to 0. Fixes #405
Diffstat (limited to 'src')
| -rw-r--r-- | src/PolySetCGALEvaluator.cc | 1 | ||||
| -rw-r--r-- | src/linearextrude.cc | 6 | 
2 files changed, 4 insertions, 3 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index f0c274f..bc9206f 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -324,6 +324,7 @@ PolySet *PolySetCGALEvaluator::extrudeDxfData(const LinearExtrudeNode &node, Dxf  {  	PolySet *ps = new PolySet();  	ps->convexity = node.convexity; +	if (node.height <= 0) return ps;  	double h1, h2; diff --git a/src/linearextrude.cc b/src/linearextrude.cc index 9a7365b..c5d4529 100644 --- a/src/linearextrude.cc +++ b/src/linearextrude.cc @@ -88,7 +88,8 @@ AbstractNode *LinearExtrudeModule::instantiate(const Context *ctx, const ModuleI  	}  	node->layername = layer.isUndefined() ? "" : layer.toString(); -	node->height = height.toDouble(); +	node->height = 100; +	height.getDouble(node->height);  	node->convexity = (int)convexity.toDouble();  	origin.getVec2(node->origin_x, node->origin_y);  	node->scale_x = node->scale_y = 1; @@ -99,8 +100,7 @@ AbstractNode *LinearExtrudeModule::instantiate(const Context *ctx, const ModuleI  	if (center.type() == Value::BOOL)  		node->center = center.toBool(); -	if (node->height <= 0) -		node->height = 100; +	if (node->height <= 0) node->height = 0;  	if (node->convexity <= 0)  		node->convexity = 1;  | 
