Fix/workaround for carve aborts on windows

The issue was caused by passing start iterator larger than end iterator
to std::copy in triangulation module. It'll do nothing on linux but will
throw an exception on windows. Now behavior will be identical on both
platforms.

Proper solution would be to figure out why exactly this happened, but it's
easier to be forwarded to Tobias and we'll need to get rid of triangulation
anyway.

This should solve issues:
#30100: boolean intersect crashes blender
#33001: Crash on applying Boolean difference modifier
#33045: Boolean modifier crash with mirrored objects
This commit is contained in:
Sergey Sharybin
2012-11-05 11:34:53 +00:00
parent 77bf273e1b
commit c4a422ffbb

View File

@@ -1106,7 +1106,8 @@ namespace {
}
// copy up to the end of the path.
std::copy(base_loop.begin() + pos, base_loop.begin() + e1_1, std::back_inserter(out));
if (pos < e1_1)
std::copy(base_loop.begin() + pos, base_loop.begin() + e1_1, std::back_inserter(out));
CARVE_ASSERT(base_loop[e1_1] == p1.back());
std::copy(p1.rbegin(), p1.rend() - 1, std::back_inserter(out));