summaryrefslogtreecommitdiff
path: root/src/PolySetCGALEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-02-19 12:09:02 (GMT)
committerMarius Kintel <marius@kintel.net>2012-02-19 12:09:02 (GMT)
commitc5703b44077ca6185f7611d6ffba68f4955c1cbd (patch)
treed427746f36983ea977a84e0d04a04d179592ce7c /src/PolySetCGALEvaluator.cc
parent955e0f1344d772119e2d7af1afb7658df7e8c43e (diff)
bugfix: Fix crash bug when using zero scale factors. Reported by Alan Cox
Diffstat (limited to 'src/PolySetCGALEvaluator.cc')
-rw-r--r--src/PolySetCGALEvaluator.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 81ae31e..6ed1ab4 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -281,12 +281,14 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const LinearExtrudeNode &node)
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->isBackground()) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- if (N.dim != 2) {
- PRINT("ERROR: linear_extrude() is not defined for 3D child objects!");
- }
- else {
- if (sum.empty()) sum = N.copy();
- else sum += N;
+ if (!N.empty()) {
+ if (N.dim != 2) {
+ PRINT("ERROR: linear_extrude() is not defined for 3D child objects!");
+ }
+ else {
+ if (sum.empty()) sum = N.copy();
+ else sum += N;
+ }
}
}
@@ -379,12 +381,14 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const RotateExtrudeNode &node)
BOOST_FOREACH (AbstractNode * v, node.getChildren()) {
if (v->modinst->isBackground()) continue;
CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v);
- 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 (!N.empty()) {
+ 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;
+ }
}
}
contact: Jan Huwald // Impressum