Difference loses path segments depending on the sequence the paths were selected

Bug #1399503 reported by bz-mof
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Using inkscape 0.45 r10040 on both Win XP and Win 7 prof.

I found out the expensive way that inkscape has probably a but in the path Difference tool. I expect it to cut an upper path from an lower one.

Which it does when I select the lower path first and then the upper as the second. But it gives a different result when I select them the other way round! In my opinion it should not make a difference in which order the elements were selected.

The attached file shows the behaviour: Select the red path first, then the white one and click Path/Difference. The result looks the same like before. Undo this change and do it again, the other way round: Select the white area, add the red rectangle, click Path/Difference. The result changes, the white map loses all the islands not connected to the main mass. No idea why this happens like this.

Tags: boolops
Revision history for this message
bz-mof (bz-x) wrote :
Revision history for this message
bz-mof (bz-x) wrote :

I found out this behaviour is at least affected by the filling rules (evenodd/nonzero) of the used paths: Changing the filling rule of the bottom element will make the error with path/difference disappear IN THIS CASE.

Another example shows that it has probably nothing to do with the filling rules and the complexity of the paths used:
1) Click the left black box, shift-click blue rectangle, press ctrl-minus and everything is as expected.
2) Click the right black box, shift-click blue rectangle, press ctrl-minus and the small triangle is missing.

Path/Difference works well with the left box but not with the right one. Although they are both "ovenodd" while the bottom layer is the same "nonzero" all the time.

su_v (suv-lp)
tags: added: boolops
removed: difference path sequence
Revision history for this message
su_v (suv-lp) wrote :

On 2014-12-05 03:09 (+0100), bz-mof wrote:
> Another example shows that it has probably nothing to do with the
> filling rules and the complexity of the paths used:

Besides the fill rule as style property (via 'Fill and Stroke'), the direction of the sub-paths affects how an object is filled [1]. If in the second example the path direction of of one of the sub-paths of the right object is reversed, 'Path > Difference' produces the expected result.

The node tool can show the path direction along with the red path outline - it's a setting in the node tool preferences (this eases investigation).

[1] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html#Attributes-Fill-Rule

Revision history for this message
bz-mof (bz-x) wrote :

Hey ~suv,

thank you for the fast answer! You are right about the path directions having an impact on the Difference tool.

I altered the example file to having two sub-paths, one in clockwise, one in couterclockwise direction.

Still inkscape shows the behavious that it keeps only one of the sub-paths when you select the black shape (with the sub-paths) first, but keeps both, if the blue shape is selected first.

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.