On Sat, Jul 19, 2008 at 2:58 AM, MenTaLguY <mental@...3...> wrote:
An interesting question is whether it should really be open versus closed, though... I wonder whether filled versus unfilled ought to be the real distinction for boolops purposes? At least, it might make more sense from an artistic/visual perspective.
I don't think so. I'd say what you need to do is this: treat any open subpath as a closed path where one of the segments (joining the ends) is straight and marked as special. Then, perform the boolop as usual, but preserve the specialness of this segment - that is, if some segment of the result "comes from" a special segment in the source, mark it as special too. And then, when translating the result to a path, convert those special segments to unstroked movetos. This still won't work 100% when the special segments of two source paths intersect _and_ the paths are filled, but in all other cases I think it will give the most useful and intuitively correct result, regardless of whether the source was filled or not.
Problem #2: after converting to path, the points of intersection of the beziers have two nodes at the same place instead of one.
This has given me some headaches.
Our main goal was, when we cut a path segment in boolops, the point of the cut must lie exactly on the segment, so that the segment's shape is not altered. This saves us from the problems that most boolops implementations like livarot's have, where they can end up with invalid intersection topology because the curves have moved around. Also, even when the topology would have remained valid, exact cuts should eliminate most of the bug reports we get about boolops being visibly inexact.
And that is great, I remember how I cursed Xara for its ugly linear segments it inserted at path intersections. So, kudos for the achievement, but please remember we're creating a practical tool, not a mathematical demo :) so I think you should merge any nodes that will end up in the exact same position anyway after serializing to SVG.