mirror of https://github.com/vitalif/openscad
Filter empty children before performing minkowski sum. Fixes #1196
parent
e4d7de133b
commit
1d66d2154b
|
@ -123,7 +123,15 @@ GeometryEvaluator::ResultObject GeometryEvaluator::applyToChildren3D(const Abstr
|
|||
// Only one child -> this is a noop
|
||||
if (children.size() == 1) return ResultObject(children.front().second);
|
||||
|
||||
if (op == OPENSCAD_MINKOWSKI) return ResultObject(CGALUtils::applyMinkowski(children));
|
||||
if (op == OPENSCAD_MINKOWSKI) {
|
||||
Geometry::ChildList actualchildren;
|
||||
BOOST_FOREACH(const Geometry::ChildItem &item, children) {
|
||||
if (!item.second->isEmpty()) actualchildren.push_back(item);
|
||||
}
|
||||
if (actualchildren.empty()) return ResultObject();
|
||||
if (actualchildren.size() == 1) return ResultObject(actualchildren.front().second);
|
||||
return ResultObject(CGALUtils::applyMinkowski(actualchildren));
|
||||
}
|
||||
|
||||
CGAL_Nef_polyhedron *N = CGALUtils::applyOperator(children, op);
|
||||
// FIXME: Clarify when we can return NULL and what that means
|
||||
|
|
|
@ -207,6 +207,9 @@ namespace CGALUtils {
|
|||
return visited.size() == p.size_of_facets();
|
||||
}
|
||||
|
||||
/*!
|
||||
children cannot contain NULL objects
|
||||
*/
|
||||
Geometry const * applyMinkowski(const Geometry::ChildList &children)
|
||||
{
|
||||
CGAL::Timer t,t_tot;
|
||||
|
|
|
@ -7,3 +7,14 @@ minkowski() {
|
|||
import("notfound.dxf");
|
||||
}
|
||||
}
|
||||
|
||||
minkowski() {
|
||||
linear_extrude() {
|
||||
import("notfound.dxf");
|
||||
}
|
||||
linear_extrude() {
|
||||
import("notfound.dxf");
|
||||
}
|
||||
cube();
|
||||
cube();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue