Hi devs,

I'm looking at Boolean operations (particularly Difference ops) on real-world SVG files again, and I've come across another bug, which I've reported here for posterity: https://bugs.launchpad.net/inkscape/+bug/1209281. This comes with a sample SVG file which might reproduce the bug. Note that I say "might" because it is reproduced on the current trunk on my x86 Ubuntu 12.04, but not on the latest Windows build I'm running (0.48.4).

I aim to have a look into what's going on here and hopefully come up with a patch - I've looked through the livarot code in a bit of detail now, and I think I understand at a basic level how the various path-intersection algorithms are implemented (particularly wrt quantization of coordinates and the implications for the sweep-line method).

Meanwhile, a couple of questions:

1) While I expect I'll be able to fix the current unstable behaviour (occasional copying of topmost path's coords into bottom-most path during difference operations, for too-small paths that "fall through" the quantization grid), the whole requirement for quantization in livarot is a bit unsatisfactory. Longer-term, it might be nice to switch to a path-intersection algorithm without the quantization restriction, and that deals better with degenerate cases - perhaps something like the CGAL 2D intersection methods (http://www.cgal.org/Manual/beta/doc_html/cgal_manual/packages.html#part_VIII)? I believe this part of CGAL is GPL licensed, is this an issue? Thoughts?

2) I keep coming across code in Inkscape that could be improved with the RAII pattern (particularly, things like:

{
Thing *t = new Thing();
... do stuff with t ...
delete t;
}

When writing new code, I'd much prefer to use smart pointers, e.g.

{
std::unique_ptr<Thing> t(new Thing());
... do stuff with t ...
}

Obviously things like std::unique_ptr and std::shared_ptr require (part of) C++11. I note that parts of inkscape use boost::shared_ptr - is use of boost the way to go in this case, to keep support for older (non-C++11) compilers?

Thanks

Eric