Hide rectangel behind another

Post questions on how to use or achieve an effect in Inkscape.
ittayd
Posts: 4
Joined: Thu Mar 20, 2014 10:22 pm

Hide rectangel behind another

Postby ittayd » Fri Mar 28, 2014 5:57 pm

I have two rectangles, no fill (because I want the background to show through). One is shifted down and left. How can I make the parts that are "inside" the other rectangle hidden? So that if I reposition, they appear again?

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

Re: Hide rectangel behind another

Postby Lazur » Fri Mar 28, 2014 9:20 pm

Hi.

Make a clipping object from the one with no fill.
To do that, convert it to path (Ctrl+Shift+C), duplicate it (Ctrl+D), scale it up, reverse path direction -or mirror it-,
and combine it with the original.
That will result in a path that has a "hole" inside where the original transparent rectangle was.
You can add any colour fill to it.

Then, move it to the top (Home), add other rectangle to selection, and set clipping.
Once clipping being set you can select the clipped object inside, with the node editor tool, and move it aroud,
and it will be transparent where the other rectangle was.

http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Clip-Clipping.html

ittayd
Posts: 4
Joined: Thu Mar 20, 2014 10:22 pm

Re: Hide rectangel behind another

Postby ittayd » Sat Mar 29, 2014 10:50 pm

Sorry, it doesn't work. I start with rects.svg and end up with rects2.svg (both attached). in the latter, the page seems to be empty, but there's an empty clip in it.
Attachments
rects2.svg
(2.64 KiB) Downloaded 148 times
rects.svg
(2.12 KiB) Downloaded 148 times

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

Re: Hide rectangel behind another

Postby Lazur » Sun Mar 30, 2014 4:34 am

Hmm one step I may missed: put the mask to be clipped inside a group (Ctrl+G).
In the attached svg it seems working what you are after if I understood it right.
By double clicking on the clipped rectangle, you can enter the group, and once entered you can move it around, and a part of it will be hidden.
Make a larger clipping mask if you want to move the clipped object further from the other rectangle.

Other than that missing step the previous method was used.
Attachments
rects3.svg
(3.5 KiB) Downloaded 150 times

ittayd
Posts: 4
Joined: Thu Mar 20, 2014 10:22 pm

Re: Hide rectangel behind another

Postby ittayd » Sun Mar 30, 2014 5:05 am

sorry again. i tried to follow your steps and also work with the file you attached and it doesn't work for me. any simpler way?

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

Re: Hide rectangel behind another

Postby Lazur » Sun Mar 30, 2014 5:56 am

Can't think of other possibilities for a live solution.
I had in mind how the vector files could be improved with adding options out of the svg specification for compositing, but it seems with inkscape it won't happen.
Either I'm missing your point -could think of another one-, or you missing this solution.

So does the rects3.svg appear without any changes in position of the objects as it should look?
Last edited by Lazur URH on Sun Mar 30, 2014 9:29 am, edited 1 time in total.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Hide rectangel behind another

Postby tylerdurden » Sun Mar 30, 2014 9:08 am

I can't find a dynamic solution... but it's fairly easy to use some duplicates and the Exclusion tool to knit the paths and then delete the segments where you like.

ittay3Screen.jpg
ittay3Screen.jpg (29.27 KiB) Viewed 1538 times


(Hide the originals in a layer for future use.)
Attachments
ittayd-question-3.svg
(6.67 KiB) Downloaded 161 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/


Return to “Help with using Inkscape”