how to extract (from a path) only the visible part

Post questions on how to use or achieve an effect in Inkscape.
b3zra1y
Posts: 2
Joined: Mon Nov 19, 2012 5:08 am

how to extract (from a path) only the visible part

Postby b3zra1y » Mon Nov 19, 2012 5:13 am

let's say I have a semicircle.
that shape is now a path
part of that path is 'obfuscated' by other shapes/paths that are on top of it (ie., have higher z orders)

can I easily just tell inkscape to convert that path *only* into the visible part I can see ?

i'd rather not select the shape *in conjunction with* others
is it possible to just select the path and just turn it into the part that's currently visible ?

hope this make sense
THANKS

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

Re: how to extract (from a path) only the visible part

Postby brynn » Mon Nov 19, 2012 5:55 am

Welcome to the forum :D

I'm not sure I entirely understand what you're asking. If the path on top entirely covers the part you don't want, you could use a path operation -- Difference. But it does require selecting the 2 paths at the same time, in order to perform the operation.

You could select only that path, and use node editing to get rid of the part that's not visible. But node editing generally takes a little more work than Difference (depending on the situation).

Could you show us a screenshot? Maybe we could understand better with an illustration?

sanzoghenzo
Posts: 22
Joined: Wed Dec 12, 2012 8:04 pm

Re: how to extract (from a path) only the visible part

Postby sanzoghenzo » Wed Dec 12, 2012 9:02 pm

Hi there, I think my question has much in common with this discussion.
I would rephrase the question like this:
how can I run the difference keeping the operator path?
I Imported a Cad drawing which had solid hatches, but I want to superimpose that drawing over a gimp postproduction, so I had to get rid of all fills. the problem is lines that where hidden now are visible. So I begun to use difference to get rid of all unwanted parts of paths. for every part I have to:
  • duplicate the frontmost path
  • select the path on the bottom
  • shift-select the frontmost path
  • run difference operation (ctrl+-)
I have to to this with plenty of elements, so I wonder if there's an option to keep the operator path (the frontmost element), so I can skip the first step (which is in fact two steps: select and duplicate).
thanks for the attention

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

Re: how to extract (from a path) only the visible part

Postby brynn » Thu Dec 13, 2012 2:51 pm

Image
Welcome to InkscapeForum!

Hhm, I guess the op never came back. Or maybe the solution I proposed actually did work? Who knows? They've never posted another message. Image

If I understand what you're doing, then no, you can't make it permanently on top. That's because the top object is consumed by the Difference process. So you have to keep creating new ones to use, each time. But there well could be an easier way to approach this. I don't clearly understand what you're doing either. So if you could show us at least a screenshot, or better the SVG file, we might come up with some other options :D

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: how to extract (from a path) only the visible part

Postby druban » Thu Dec 13, 2012 4:01 pm

The only possible streamlining to your method is to copy the cutting path to the clipboard. Then, every time you use it up, ctrl-alt-V pastes it on top in exactly the same location as before - already selected. So the workflow would be: ctrl-alt-V, shift-select path to be cut, Ctrl- minus. Repeat.
One combo keypress, one mouseclick, one combo keypress. That's not too much... :D .

I note you said, "I had to get rid of all fills..." This does offer another possibility - select all the paths to be cut. Combine them (ctrl-k), there should be no difference at all in appearance if the paths have no fill, then shift select the cutting path (which is on top, of course), and do the difference. Now do a break apart, and you should have - perhaps - what you are looking for.
Much depends on the compound status of the paths you are starting with, i.e. if there are already combined paths then this might not be very satisfactory.
Your mind is what you think it is.

sanzoghenzo
Posts: 22
Joined: Wed Dec 12, 2012 8:04 pm

Re: how to extract (from a path) only the visible part

Postby sanzoghenzo » Thu Dec 13, 2012 7:06 pm

Thanks for the answers.
For my first image I managed to clean it up, once I figured out how difference works exactly: I thought it was a matter of the selection order, but now I know it's about Z-order.
This plus combine helps to speed up the process: select the frontmost path, ctrl+d, shift+select the path to trim + ctrl+-
"Troubles" comes when I have to trim multiple paths: sometimes I forget to ctrl+d (for the speed or simply because I can't guess if the path has been duplicated), so I use difference, then I have to go back and repeat the step. a magic button that duplicates the frontmost path and does difference would make the job easier (and faster).
Meanwhile, druban solution seems to be good for my next image, thanks a lot :)

My story: I did some architectural drawings in archicad which has plenty of hatches on top of each other (every object has fill and/or border stroke).
I wanted to add some graphics effects in GIMP, but I would like to keep vectorial borders for printing. I used a PDF as a base for GIMP post production, but If I import the resulting image directly in archicad layout, i got it covered because of the hatches. If I set hatches to transparent, unwanted hidden lines comes up.
So I exported a DXF and loaded into inkscape to do the trimming job (in order to keep my archicad drawing intact for future modifications).
Now I know that I can streamline the workflow starting from archicad (or any other cad) by better organizing the drawing in layers, so it's much easier to combine paths in inkscape.
Next step is to implement a inkscape -> gimp workflow to make use of paths, but I'll get to that in another post ;)

Thanks again friends!


Return to “Help with using Inkscape”