[solved] intersecting lines

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10307
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

[solved] intersecting lines

Postby brynn » Tue Jun 17, 2008 8:00 am

Hi again :D
Here is yet another seemingly simple, even basic thing that I just can't figure out. Well, I can think of some ways to do it, but there must be an easier or better way that I'm missing.

All I want to do is take 2 lines, cross them over each other, and end up with one node where they intersect.

I've tried all manner of adding nodes, splitting paths, joining nodes, combining, braking apart, deleting nodes, layers, no layers, everything I can think of. But the only way I can come up with is to just put 2 "elbow" shaped lines (with node at the apex, really close together, or even overlapping.

Isn't there some way to do this so there's one node at the intersection? I did search these forums for info, but nothing really helpful was found. [Edit] I've also looked at a few Inkscape Guides and Manuals, but can't find any helpful info.

Thanks for your help 8-)

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: intersecting lines

Postby SureWhyNot » Tue Jun 17, 2008 9:04 am

Worse case scenario: Two curves that do not interest in the center.

I don't think you can make a node that is shared by two paths, but you can make two nodes from two different paths line up perfectly.

1. Draw your lines
2. With the pen tool still selected, double click the intersection point to make a new node. This only does it for one path (the one on top).
3. For easy viewing, change the stroke of this upper path to a different color, so you can differentiate it from the one on the bottom
4. Send the upper layer to the back.
5. Double click the intersecting point (with the second path selected) to make a new node for path #2.
6. Select BOTH paths and use the combine command. (NOT union) Now you can see the nodes for both paths at the same time.
7. Select ONLY the two nodes you created at the intersect point.
8. Open the alignment dialog. At the bottom is a series of buttons that specifically deal with nodes.Press the two leftmost buttons. This will align the nodes vertically and horizontally, making them overlap perfectly.
9. Now you can manipulate the intersection point as if it were two nodes by using click-and-drag over the intersection point (really points).

Note: When you select overlapping nodes, it looks weird, almost like there's nothing selected at all. :? That means you DID select something, and you can move it around.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: intersecting lines

Postby microUgly » Tue Jun 17, 2008 10:24 am

SureWhyNot wrote:I don't think you can make a node that is shared by two paths

That's correct. You can't branch a node.

An idea was posted to make such activities easier to manage though - viewtopic.php?f=28&t=1090

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

Re: intersecting lines

Postby brynn » Tue Jun 17, 2008 11:21 am

Thanks SureWhyNo and microUgly,
So SWN, basically you're saying -- put nodes where you want the intersection and align them perfectly, one on top of the other. And by selecting both nodes, you can move them as if they were one? Aaahhh, that's what I was missing -- selecting more than one node.

But I lost you here
9. Now you can manipulate the intersection point as if it were two nodes by using click-and-drag over the intersection point (really points).


Also, the reason I need intersecting lines, is so I can fill each 4 quadrants (created by the X shape) with a different color. I know there's the Paint Bucket tool (:tool_paintbucket:), but it tends to leave thin uncolored or less colored spaces around the border of the closed area. So I wanted to be able to use Fill.

But, I guess I'll just have to do the overlapping nodes, or maybe use layers and alignment.

You know, I can sort of understand the logic in nodes not sharing paths or vice versa, but it does seem like it could be a useful feature.

Anyway, thanks for your help guys :D

User avatar
loonquawl
Posts: 135
Joined: Thu May 15, 2008 7:57 pm

Re: intersecting lines

Postby loonquawl » Tue Jun 17, 2008 5:43 pm

brynn wrote:But I lost you here

9. Now you can manipulate the intersection point as if it were two nodes by using click-and-drag over the intersection point (really points).


I guess what SWN wanted to say was that after you aligned the points you can drag them both, even though there is only one visible and the selection looks weird.

brynn wrote:Also, the reason I need intersecting lines, is so I can fill each 4 quadrants (created by the X shape) with a different color. I know there's the Paint Bucket tool (:tool_paintbucket:), but it tends to leave thin uncolored or less colored spaces around the border of the closed area. So I wanted to be able to use Fill.


In the option-dialog at the top of the canvas, after you select the Bucket-Tool, there is the option "grow/shrink" fiddling around with that (set to positive values) will make the fill a bit larger than the area to be filled. if you then lower the resulting Color below the lines, it looks like a Fill.

macti
Posts: 50
Joined: Wed Mar 12, 2008 10:49 pm

Re: intersecting lines

Postby macti » Tue Jun 17, 2008 11:26 pm

Double clicking on the intersecting point is sometimes not precise enough.
Because aligning the two resulting nodes, will slightly change the position of the orginal path.

Here is an alternative way to make "one node": what do you think of it ?

1. Draw your lines: path (A) and path (B).
2. copy (Ctrl-C) the upper path(B) in clipboard.
3. Select both paths and choose menue->path->"Cut Path": the lower path(A) is split at intersection point in (A1) and (A2).
4. Paste (Ctrl-shift-V) the path (B) at the original position.
5. Raise one part of the cutted path (A2) to the top and copy in clipboard.
6. Select both (A2) and (B) and again "Cut Path": path (B) is split at inersection in (B1) and (B2)
7. Finally via "Path combine": A1+A2=A and B1+B2=B


Unfortunally this method doesn´t reliable work with an ellipse (seems to be a bug):

1. Draw an ellipse with the obect tool.
2. Change to path "Object to path".
3. Turn on "snapping": "node" ist checked to "snap to path" is checked.
4. Draw path (B) and snap its node to the ellipse.
5. Apply the above mentioned method.
Most of the times it fails to cut the ellipse this way.

If some of you confirms this kind of behaviour, I´ll report a bug...

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: intersecting lines

Postby SureWhyNot » Thu Jun 19, 2008 5:11 am

Heh. Pro tip: Color with a second layer.

Make a new layer under your line art, then make filled but strokeless paths to add color.

Like this

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: intersecting lines

Postby microUgly » Thu Jun 19, 2008 7:16 am

Off topic:
Your example says to stop using the bucket, but your method is exactly what the bucket was designed for--creating a fill as a seperate object as your example does.

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

Re: intersecting lines

Postby brynn » Thu Jun 19, 2008 8:08 pm

Just wanted to say thanks also to SureWhyNot, macti, and loonquawl.
All good info!
I ended up using 4 quarter pie shapes, with the apex nodes aligned on top of each other. And each quadrant carried its own fill.

Macti, wow! I consider myself pretty good at breaking things down into basic components, rearranging and putting back together. But I never would have thought of your process of using the clipboard, Cut Path, etc. Not until I'm way more experienced with computer graphics, anyway. It's brilliant!


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: No registered users and 5 guests