boolean logic fails on some SVG files

Bug #1048845 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Alvin Penner

Bug Description

livarot has a known problem - it cannot draw an outline properly if the input path contains elliptical arcs. The solution as noted in numerous places in sp-livarot.cpp is to do something like this:

    cleanpath = Path_for_pathvector(pathv_to_linear_and_cubic_beziers( pathva));

The problem is that whether or not that actually happens somewhere after a call to sp_selected_path_boolop() apparently
depends in some complicated way on the SVG syntax of the input file. In the two example files one was saved as inkscape
svg and the other as plain svg. The latter one no longer works. The reason it no longer works it that the paths it contains
are not converted from elliptical arcs to Bezier curves. I traced down through the logic a few levels and did not find where
this difference in logic is located.

I am 100% sure that this is the problem though, because I have a modified sp-livarot.cpp which contains a function that does

  PathVector = boolops(PathVector va, PathVector vb, bool_op);

and it does the Path_for_pathvector() conversion and works all the time.

Tags: boolops
Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :
su_v (suv-lp)
tags: added: boolops
Revision history for this message
David Mathog (mathog) wrote :

This patch does NOT fix the bug described here. Instead it implements the function

Geom::PathVector
sp_pathvector_boolop(Geom::PathVector const &pathva, Geom::PathVector const &pathvb, bool_op bop, fill_typ fra, fill_typ frb)

which if called with the same paths as screw up in the two example SVG files, works correctly. This function explicitly calls Path_for_pathvector() on each of the two input paths. Before those two calls were added it behaved exactly like the
broken function

void
sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb, const Glib::ustring description)

from which it was derived.

Also, if one puts in debug lines like:

std::cout << splivarot_path->svg_dump_path() << std::endl;

one can easily see that in the *_plain.svg case the path still contains "A" records, whereas for the good svg all of those are converted to "C" records.

Forget to mention - ignore the yellow/black ellipse as it is broken in both of the SVG files.

Kris (kris-degussem)
Changed in inkscape:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → David Mathog (mathog)
Revision history for this message
su_v (suv-lp) wrote :

Merging David's branch into trunk (r12488) did not fix the issue (still reproducible with the file 'nested_ellipse3_plain.svg').

Removing branch link.

Changed in inkscape:
status: In Progress → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

I think this is 'probably' fixed in rev 12756. any testing would be welcome.

su_v (suv-lp)
Changed in inkscape:
assignee: David Mathog (mathog) → Alvin Penner (apenner)
milestone: none → 0.49
status: Confirmed → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.