diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-01 20:43:14 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-01 20:43:14 (GMT) |
commit | 5fee135293b7b55f5a28ab673481abeef1374a61 (patch) | |
tree | 2b7beca5d3afa863167a280afcf76687734ae9bf | |
parent | 3f863ae4594190a94f9944e093b971cbfcff52b3 (diff) |
bugfix: Ignore empty polyhedrons when doing CSG ops
-rw-r--r-- | src/CGALEvaluator.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 4bc5fc2..1336cf5 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -46,6 +46,7 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr if (target.dim != 2 && target.dim != 3) { assert(false && "Dimension of Nef polyhedron must be 2 or 3"); } + if (src.dim == 0) { return; } // Empty polyhedron. This can happen for e.g. square([0,0]) assert(target.dim == src.dim); switch (op) { @@ -377,6 +378,8 @@ public: CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps) { + if (ps.empty()) return CGAL_Nef_polyhedron(); + if (ps.is2d) { #if 0 |