Shape fill: Use of boundary of another shape

General discussions about Inkscape.
tays01s
Posts: 31
Joined: Tue Oct 19, 2010 4:37 pm

Shape fill: Use of boundary of another shape

Postby tays01s » Sat Oct 27, 2018 6:29 am

I have numerous juxtaposed free drawn shapes that I need to colour fill. Where there is a boundary between 2 different colours, is there a way of using this boundary for both shapes? Eg. say I had 2 D-shaped shapes that had their straight edges together. Could a single straight edge serve as the boundary for 2 different colours?

I realise mirror image D shapes is a bad example because there's not possible overlap, but the fundamental Q is for any 2 shapes where they have a common boundary.

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

Re: Shape fill: Use of boundary of another shape

Postby Lazur » Sat Oct 27, 2018 12:14 pm

Hi.

I prefer overlapping the objects.
The reason is, the anti-aliasing method the renderer uses composites the semi-transparent pixels with a simple addition which then as a result won't have the same coverage as expected.
"Rendering gap issue", so to say; the background shows through at two object's shared edge.

-A 50% transparent rectangle over another 50% transparent one will result in 50% of the top rectangle and 50% of what's below, totalling a 25% opacity of the background.-

Having said these, it IS possible to mirror seamlessly objects with a bit of thinking.
You can draw two overlapping shapes representing the mirrored areas and use them as clipping objects to clip the objects mirrored.
Here is an example for that.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Shape fill: Use of boundary of another shape

Postby brynn » Sun Oct 28, 2018 12:37 pm

Could a single straight edge serve as the boundary for 2 different colours?

Not with an ordinary fill (notwithstanding Lazur's trick). But the Paint Bucket tool was designed for this type of situation.

Although I don't usually suggest using it, if the caveats are not too much for you, it could be a good solution. First, it doesn't fill the space completely. To try to solve that, there's a Grow/Shrink setting on the control bar. So you can set Inkscape to automatically fill a little bit larger or smaller area.

Second, even after you get a good Grow setting, there still may be areas which need some tweaking with the Node tool. For example, acute angles often still create a gap in the fill. And if it's a really squiggly path, and a thin border, some of the fill might actually go outside the border in some places and inside in other places.

Using the Node tool you can see the nodes, and just drag them around to cover all the open areas. You can adjust the handles too, if necessary. Or sometimes you might only need to adjust a handle, and not move a node. (Select a node to see the handles.)


Return to “General Discussions”