summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-06 21:59:08 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-06 21:59:08 (GMT)
commitf9b026a2f0bb3c0a59b430c651e6c9151af3826d (patch)
tree74685cf40f7408b119a1547cdb6626fed5f03660
parenta653b0c60494f9490301579ac9081858ce848f01 (diff)
bugfix: fixed crash bugs on empty or 3D child list of linear_extrude() and rotate_extrude()
-rw-r--r--src/PolySetCGALEvaluator.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 3a7efdb..50dc358 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -264,10 +264,16 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const DxfLinearExtrudeNode &node,
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->tag_background) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- if (sum.empty()) sum = N.copy();
- else sum += N;
+ if (N.dim != 2) {
+ PRINT("ERROR: rotate_extrude() is not defined for 3D child objects!");
+ }
+ else {
+ if (sum.empty()) sum = N.copy();
+ else sum += N;
+ }
}
+ if (sum.empty()) return NULL;
dxf = sum.convertToDxfData();;
} else {
dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale);
@@ -361,10 +367,16 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const DxfRotateExtrudeNode &node,
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->tag_background) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- if (sum.empty()) sum = N.copy();
- else sum += N;
+ if (N.dim != 2) {
+ PRINT("ERROR: rotate_extrude() is not defined for 3D child objects!");
+ }
+ else {
+ if (sum.empty()) sum = N.copy();
+ else sum += N;
+ }
}
+ if (sum.empty()) return NULL;
dxf = sum.convertToDxfData();
} else {
dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale);
contact: Jan Huwald // Impressum