Clipping a curve with an object

Post questions on how to use or achieve an effect in Inkscape.
daviddoria
Posts: 56
Joined: Fri Oct 03, 2008 7:57 am

Clipping a curve with an object

Postby daviddoria » Fri Feb 24, 2012 10:09 am

I am trying to turn the attached curve_square.svg into the (also) attached curve_square_2.svg. I tried using Path -> Division and then doing some node editing, but it doesn't work quite right (curve_square_2.svg "looks" correct, but the paths are wacky (there are 4 nodes on one of the end points, etc).

I guess I am struggling with a few things:

1) Once I "break" a path, how do I determine which node is being selected (there are now two nodes directly on top of each other)?

2) After the division operation, things are still in pretty good shape (curve_square_3). Now to delete the remainder of the curve, would I have to add nodes to the curve where it touches the square tips, then break the curve at those new nodes? This is what I did, but that is when the "bad stuff" starts :)

Any tips on how to do this properly?

Thanks,

David
Attachments
curve_square_3.svg
(4.68 KiB) Downloaded 151 times
curve_square_2.svg
(4.63 KiB) Downloaded 160 times
curve_square.svg
(2.17 KiB) Downloaded 153 times

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

Re: Clipping a curve with an object

Postby brynn » Sat Feb 25, 2012 12:14 am

This is somewhat related to another topic: viewtopic.php?f=5&t=11562

I'm not sure that Division is the best way to approach this problem. It does seem to be the best solution to the other problem, but not necessarily this one. I see that new comments have been posted to the other topic, and I want to review those before investigating your files. Although preliminary indications are that you (again) might have used Stroke to Path instead of Object to Path. That's probably why there are so many extra nodes at the corners of the rectangle.

I'll be back shortly with comments :D

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

Re: Clipping a curve with an object

Postby brynn » Sat Feb 25, 2012 1:27 am

Ok, now I have all the info.
To answer your 1st question: When you first "Break path at selected nodes" the node that remains selected is the one connected to the segment that's toward the end of the path. They are indeed on top of each other, and it's literally impossible to select the one on the bottom, without resorting to tricks. Here are a couple of tricks, and others may post more:
1 - Select the entire segment, i.e. 2 nodes, the end node and the next one to it, by clicking on the segment. Then holding Shift key, click on the non-end node node. That deselects one of the nodes, leaving only the end node selected.
2 - Select the node next to the end node, and press Tab key once, that should cycle the selection to the next node, which is the one you want to select.
3 - Because I get confused about which end of the path was the beginning and which was the end (in a larger drawing), I often just drag the nodes apart to see which one's on top. It's the only one that you can select normally. Then I just Undo.

As I mentioned in my first reply, I don't think Division is the proper technique in this situation. I think Cut Path would be the best option here, although I'm just guessing what you might prefer, based on comments in the other topic. I would use node editing. But either way, first you must use Object to Path and not Stroke to Path on the square.
1 - Select the square
2 - Object to Path
3 - Duplicate square path
4 - Select open path
5 - Duplicate the open path
6 - Here the z-order becomes very important. If you place the Selection tool over one of the places where the open path intersects the square, you can learn what level of the z-order in which each object lies. Use the Alt key to do this. The first click selects the top object, the 2nd click (with Alt key) selects the next one down, and so on. Then you can use either Object menu or buttons on Selection tool bar to raise, lower, etc. (The duplicates are needed because they will be sort of consumed in the path operation.)
7 - They need to be arranged so that the 2 square paths are between the 2 open paths, or vice versa. So as you click down through them: open path, square path, square path, open path. Or square path, open path, open path, square path. I usually will give all these paths different colors, to help me keep track of them.
8 - Select the top one and the next one down
9 - Path menu > Cut Path
10 - Select the bottom 2
11 - Path menu > Cut Path
12 - Select and delete the 2 unwanted segments
13 - Now you'll need to join all the remaining segments. I'm not sure if I need to give you instructions for that part? But let me know, if so.

As I mentioned, I would just use node editing. For me, it's much easier. But if I wrote step-by-step instructions, they would probably be just as long. You would need to add new nodes in order to break the paths properly, while with Cut Path, these nodes are placed more precisely, since it happens during the path operation.


Return to “Help with using Inkscape”