In one sentence: "Allow the choice of fill rules (odd/even VS non-zero) for experiment brush." Currently, the experiment brush is always drawn with 'odd/even' fill rule (that is, when the shape intersects itself, it creates holes in the result). This is useful for creating the more exotic shapes. For quickly building a silhouette, the 'non-zero' fill rule is more reliable (If the shape intersects itself, it still does not create a hole, so it's easier to make neat coherent shapes at high speed.). Examples of how this works: * Choice between odd/even and nonzero fill rule is found in Inkscape's Fill/Stroke dialog. * GrafX2's "contour fill" tool is like a nonzero-fill-rule version of experiment brush. * With Cairo, CAIRO_FILL_RULE_WINDING selects non-zero fill rule (see http://www.cairographics.org/manual/cairo-cairo-t.html ) http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html gives a nice visual example of the difference. Reproducible: Always
This can be done quite easily, it just needs a UI for configuration
Confirmed, then.
I have implemented this, and also added a 'hard edge' option which makes it much nicer for composition design and cel-type shading. I wanted to avoid the phrase 'winding fill' in the UI, however the alternative I came up with, 'inclusive fill', was not much of an improvement. I welcome suggestions. Patch attached.
Created attachment 84474 [details] Implement "Winding fill" and "Hard Edge" options for Experiment brush
Created attachment 84475 [details] Simple demo of new options Demonstrates effect of drawing a triangle-in-triangle shape with each possible combination of the new settings.
Hi, D Gowers! Your patch looks really nice! I have only a small comment about it: m_path object may be overridden while the stroke is running. E.g. in calls to trySimplifyPath(), so you might need to move the 'm_path.setFillRule(Qt::WindingFill)' line to the beginning of paintRegion() function to ensure the setting is applied in all circumstances. After checking this issue we can surely push the patch. Do you have a write access to KDE's git repo? If not, I can push it for you.
Thank you Dmitry. I have tested with some more exotic settings, and indeed the winding setting of the path can get lost when smoothing is on. (oddly enough, the antialiasing state is preserved correctly.) Anyway I have implemented your proposed solution and it appears to fix this. Updated patch attached. I'd appreciate if you would push it for me, I don't currently have push privileges.
Created attachment 84489 [details] Set path/paint options in paintRegion instead Also fixed some cosmetic consistency issues.
Git commit 3e5908f3af3b14317eff7c3b955a89f32dfc54f2 by Dmitry Kazakov, on behalf of David Gowers. Committed on 07/01/2014 at 08:22. Pushed by dkazakov into branch 'master'. Add support for nonzero fill rule for experiment brush Thanks David Gowers for preparing this patch! M +9 -0 krita/plugins/paintops/experiment/kis_experiment_paintop.cpp M +3 -0 krita/plugins/paintops/experiment/kis_experiment_paintop.h M +6 -0 krita/plugins/paintops/experiment/kis_experimentop_option.cpp M +7 -0 krita/plugins/paintops/experiment/kis_experimentop_option.h M +18 -0 krita/plugins/paintops/experiment/wdgexperimentoptions.ui http://commits.kde.org/calligra/3e5908f3af3b14317eff7c3b955a89f32dfc54f2
Hi, David! Congrats! Now you have your first patch in KDE repo! :)
Git commit 6ae1bfc4ae6adb13906f0687b97d19abca0482c7 by Dmitry Kazakov, on behalf of David Gowers. Committed on 07/01/2014 at 08:22. Pushed by dkazakov into branch 'calligra/2.8'. Add support for nonzero fill rule for experiment brush Thanks David Gowers for preparing this patch! M +9 -0 krita/plugins/paintops/experiment/kis_experiment_paintop.cpp M +3 -0 krita/plugins/paintops/experiment/kis_experiment_paintop.h M +6 -0 krita/plugins/paintops/experiment/kis_experimentop_option.cpp M +7 -0 krita/plugins/paintops/experiment/kis_experimentop_option.h M +18 -0 krita/plugins/paintops/experiment/wdgexperimentoptions.ui http://commits.kde.org/calligra/6ae1bfc4ae6adb13906f0687b97d19abca0482c7