#1129 Fixed crash when performing empty projection

master
Marius Kintel 2015-01-01 23:01:09 -05:00
parent b68ac5e6f2
commit 09e7bfc96d
2 changed files with 9 additions and 3 deletions

View File

@ -953,9 +953,10 @@ Response GeometryEvaluator::visit(State &state, const ProjectionNode &node)
}
if (!Nptr->isEmpty()) {
Polygon2d *poly = CGALUtils::project(*Nptr, node.cut_mode);
assert(poly);
poly->setConvexity(node.convexity);
geom.reset(poly);
if (poly) {
poly->setConvexity(node.convexity);
geom.reset(poly);
}
}
}
}

View File

@ -14,6 +14,11 @@ group() {
}
}
}
projection(cut = true, convexity = 0) {
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 5], [0, 0, 0, 1]]) {
cube(size = [5, 5, 5], center = true);
}
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) {
projection(cut = true, convexity = 0) {
union() {