self-intersecting shape display and union error

Bug #1459944 reported by valmooo on 2015-05-29
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Low
Tavmjong Bah

Bug Description

When I draw with the calligraphy tool a self-intersecting shape, I see some gaps, hollow areas at the intersection. If I apply "union" these gaps won't fill - I can not weld a self-intersecting shape into a no gaps shape.
The same union bug applies to self-intersecting polygons, self-intersecting Bezier curves or self-intersecting freehand lines too.

=====
Windows 7 64bit / Inkscape 0.91 64bit

valmooo (valmooo) wrote :
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version to the bug description, and attach a test case (Inkscape SVG file) with original and unioned paths, to allow further investigation.

Not reproduced based on the data available in the screenshot (the example on the right with the gray fill) - both Inkscape 0.48.5 and 0.91 (on OS X 10.7.5) produce the same (and AFAIK expected correct) result i.e. the union path operation respects the fill rule.

tags: added: boolops
removed: gaps intersecting self-intersecting union
Changed in inkscape:
status: New → Incomplete
valmooo (valmooo) wrote :

Windows 7 64bit / Inkscape 0.91 64bit
The shapes created in 0.48.5 weld well in 0.91 with Ctrl++ (no gaps there). It seems the way they are rendered is the problem. I'm not a tech person. I hope the .svg files will be telling enough.

valmooo (valmooo) wrote :
valmooo (valmooo) wrote :
valmooo (valmooo) wrote :

drawing-1.svg is for paths drawn in Inkscape 0.48.5 and drawing-2.svg for paths drawn in Inkscape 0.91

valmooo (valmooo) wrote :

I deleted the settings from user appdata (Roaming) and the problem persists only for the Bezier tool.

su_v (suv-lp) on 2015-05-29
Changed in inkscape:
status: Incomplete → New
description: updated
jazzynico (jazzynico) wrote :

Tested on Windows XP (32bit) with 0.91 and 0.48.5.
The difference between the two versions is that 0.48.5 creates paths with nonzero fill rule, and 0.91 with evenodd fill rule. The union command removes the gaps with nonzero, but not with evenodd.

valmooo (valmooo) wrote :

Correct!
Thank you, jazzynico, it was the fill rule. By default, 0.91 uses "evenodd". Before any union operation, I have to switch to "nonzero" on the fill and stroke dialog, top right area.

su_v (suv-lp) wrote :

On 2015-06-16 17:08 (+0200), jazzynico wrote:
> The difference between the two versions is that 0.48.5 creates paths
> with nonzero fill rule, and 0.91 with evenodd fill rule.

Based on tests with archived builds (on OS X 10.7.5), the default fill rule (e.g. for new paths drawn with the pen tool, with default (new) prefs) changed in r13298:
- Inkscape 0.91+devel rev <= 13297: nonzero
- Inkscape 0.91"devel rev >= 13299: evenodd

Related commit history:
http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/changes/13299

@Tav - was this change intentional?

Tavmjong Bah (tavmjong-free) wrote :

No, this change was not intentional.

The new style code does define the default 'fill-rule' to be 'nonzero' as dictated by SVG 1.1.

However, line 94 in preferences-skeleton.h set the default 'fill-rule' to 'evenodd' for the pen and pencil tools. This was not changed in the two commits 13298 and 13299 so it appears the old code somehow ignored this. The best place way to fix this problem is probably to remove 'fill-rule' from line 94. It should not be necessary. (Looks like there could be a lot of clean-up done to preferences-skeleton.h.)

jazzynico (jazzynico) wrote :

Fix suggested comment #11 tested successfully on Windows XP (32 bit), with Inkscape trunk rev. 14221.

Changed in inkscape:
assignee: nobody → Tavmjong Bah (tavmjong-free)
importance: Undecided → Low
milestone: none → 0.91.1
status: New → In Progress
jazzynico (jazzynico) wrote :

Fix committed in the 0.91.x branch (rev. 13776) and trunk (rev. 14224).

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: preferences
su_v (suv-lp) wrote :

Can't confirm any changes in 0.91+devel rev >= 14224 (or 0.91.x) wrt paths drawn with the pen or pencil tool - they still default to evenodd (testing with default new prefs), unlike 0.48 and earlier versions (nonzero). The change in rev 14224 seems to be a no-op, limited to the (not-affected) calligraphy tool (the tool defaults (with new prefs) to nonzero in 0.91 already, does so in 14220 as well as after 14224. The tool defaults to 'last used style' however i.e. the fill rule in effect for new paths drawn with the calligraphy tool depends on the user's most recent workflow).

Not sure if this report needs a follow-up one about the other tools., or better be reopened (or whether I'm completely confused about the original scope of the report, and what commit 14224 actually changed or fixed).

su_v (suv-lp) wrote :

Reopening - see comment 7, comment 14.

Attached patch fixes the default for the pencil (freehand) and pen (bezier) tool to match the behavior in Inkscape 0.48 (and the SVG spec). It also reverts r14224 - the default for the calligraphy tool was correctly defined for new preferences (and what is used later on depends on the user's past actions since the calligraphy tool by default uses the last used style).

Changed in inkscape:
milestone: 0.91.1 → 0.92
status: Fix Committed → New
jazzynico (jazzynico) on 2016-05-23
Changed in inkscape:
status: New → In Progress
jazzynico (jazzynico) wrote :

> I'm completely confused about the original scope of the report, and what commit 14224 actually changed or fixed

My fault, I applied the patch to the wrong line...

jazzynico (jazzynico) wrote :

Now correctly fixed in the trunk, rev. 14917.
Thanks ~suv!

Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce) on 2017-01-10
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions