boolean logic fails on some SVG files
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_
The problem is that whether or not that actually happens somewhere after a call to sp_selected_
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_
tags: | added: boolops |
Changed in inkscape: | |
importance: | Undecided → Medium |
status: | New → In Progress |
assignee: | nobody → David Mathog (mathog) |
Changed in inkscape: | |
assignee: | David Mathog (mathog) → Alvin Penner (apenner) |
milestone: | none → 0.49 |
status: | Confirmed → Fix Committed |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
This patch does NOT fix the bug described here. Instead it implements the function
Geom::PathVector boolop( Geom::PathVecto r const &pathva, Geom::PathVector const &pathvb, bool_op bop, fill_typ fra, fill_typ frb)
sp_pathvector_
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 path_boolop( SPDesktop *desktop, bool_op bop, const unsigned int verb, const Glib::ustring description)
sp_selected_
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.