if we get empty brushes in CSG subtract, don't complain, just don't insert the new brush (as this can happen intentionally when a brush is entirely covered)

This commit is contained in:
Rudolf Polzer 2011-02-27 07:18:02 +01:00
parent 277c57b2db
commit 5b8b0dd6b2

View File

@ -397,13 +397,17 @@ public:
for(brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i) for(brush_vector_t::const_iterator i = out.begin(); i != out.end(); ++i)
{ {
++m_after; ++m_after;
NodeSmartReference node((new BrushNode())->node());
(*i)->removeEmptyFaces(); (*i)->removeEmptyFaces();
ASSERT_MESSAGE(!(*i)->empty(), "brush left with no faces after subtract"); if(!(*i)->empty())
{
NodeSmartReference node((new BrushNode())->node());
Node_getBrush(node)->copy(*(*i)); Node_getBrush(node)->copy(*(*i));
delete (*i); delete (*i);
Node_getTraversable(path.parent())->insert(node); Node_getTraversable(path.parent())->insert(node);
} }
else
delete (*i);
}
Path_deleteTop(path); Path_deleteTop(path);
} }
} }