[solved] How to create an inverted fill object

Post questions on how to use or achieve an effect in Inkscape.
AspiringLearner
Posts: 2
Joined: Mon Jun 05, 2017 6:23 pm

[solved] How to create an inverted fill object

Postby AspiringLearner » Mon Jun 05, 2017 6:28 pm

I have read about the SVG even odd fill rule. However I can't seem to create a single object that have the fill property illustrated below. The inner shape has a fill, the outer shape is just strokes.

Thanks guys, cheers

Image

ps; I know you can group two objects together, but there is not the effect that I am looking for.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to create an inverted fill object

Postby Lazur » Mon Jun 05, 2017 6:32 pm

Hi.

Draw a bigger square and a smaller one,
duplicate the larger and flip it horizontally, then combine the three together.
Result should look as in the attached example.

sq1.svg
(2.51 KiB) Downloaded 394 times

AspiringLearner
Posts: 2
Joined: Mon Jun 05, 2017 6:23 pm

Re: How to create an inverted fill object

Postby AspiringLearner » Tue Jun 06, 2017 1:09 pm

Lazur wrote:Hi.

Draw a bigger square and a smaller one,
duplicate the larger and flip it horizontally, then combine the three together.
Result should look as in the attached example.

sq1.svg


Awesome! This work.

If you don't mind, can you explain the underlying mechanism that makes this work?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to create an inverted fill object

Postby Lazur » Tue Jun 06, 2017 1:50 pm

You are welcome!

It's related to the fill rule.
By mirroring the duplicant, its direction is reversed and by combining with the underlying path it creates a "hole", where the filled area is eventually zero -all between the duplicated edges.

Try moving one of the nodes around of that shape for a better understanding.


Return to “Help with using Inkscape”