Hi,
I wondered how to insert/add a node in a simple path that overlaps, for instance, a circle. The center of the circle is snapped to the path, I'd like to insert a node at this exact point.
As an example I included a simple SVG file, the question is how to create a new node in the black path that is in the same location as the center of the green circle (the three nodes will of course be co-linear, i.e. on one line).
Add a new node in a path using the snapping tools
Add a new node in a path using the snapping tools
- Attachments
-
- AddNode.svg
- (2.67 KiB) Downloaded 246 times
Re: Add a new node in a path using the snapping tools
Hi Ailurus,
As far as I know, you can't add a node using snapping. I've been thinking about making a formal request. But I think the snapping guru (dvlierop, in this forum) is busy with other new snapping features. It probably would not hurt to make the request though. Although now that I say that, this might not be such a simple task. If adding a new node with Node tool could be snapable, the darn tiny X and tiny text announcing the snap target, would be flashing every time you pass the Node tool pointer over a target. I guess you'd have to sort of flip a switch or something, to engage that behavior. Maybe you could enable and disable snapping, but if you have a lot of nodes to place, it could become tedious. That's probably why I'm not a developer, heheh. But for all I know, it's already in the works?
Anyway, I usually approach this kind of problem by zooming in on the path intersection as far as Inkscape can zoom (25,600% if I'm not mistaken), or almost that far. At least so that the intersection fills the screen. Then I select the path where the new node will go (unless the path is already on top of the circle, in z-order). Then I can visually estimate the center of the.....well, if both lines were straight, and the same width, it would be a square -- the place where the lines intersect. If one is a circle, I'm not sure what shape to call the intersection area. Anyway, place the node in the center of the intersection area. That's the only way I know to get it as close as possible. If the node happens to land precisely on the intersection, then that's good luck
But I don't know a way to make it precise.....
....well.....I'm thinking that you could snap a Guide tangent to the circle, then create a perpendicular Guide that intersects the same point, and snap to the intersection of Guides. But that's a lot of work figuring out the precise angles needed, to be tangent to the circle at the right place.
Maybe someone else has a better technique?
As far as I know, you can't add a node using snapping. I've been thinking about making a formal request. But I think the snapping guru (dvlierop, in this forum) is busy with other new snapping features. It probably would not hurt to make the request though. Although now that I say that, this might not be such a simple task. If adding a new node with Node tool could be snapable, the darn tiny X and tiny text announcing the snap target, would be flashing every time you pass the Node tool pointer over a target. I guess you'd have to sort of flip a switch or something, to engage that behavior. Maybe you could enable and disable snapping, but if you have a lot of nodes to place, it could become tedious. That's probably why I'm not a developer, heheh. But for all I know, it's already in the works?
Anyway, I usually approach this kind of problem by zooming in on the path intersection as far as Inkscape can zoom (25,600% if I'm not mistaken), or almost that far. At least so that the intersection fills the screen. Then I select the path where the new node will go (unless the path is already on top of the circle, in z-order). Then I can visually estimate the center of the.....well, if both lines were straight, and the same width, it would be a square -- the place where the lines intersect. If one is a circle, I'm not sure what shape to call the intersection area. Anyway, place the node in the center of the intersection area. That's the only way I know to get it as close as possible. If the node happens to land precisely on the intersection, then that's good luck

....well.....I'm thinking that you could snap a Guide tangent to the circle, then create a perpendicular Guide that intersects the same point, and snap to the intersection of Guides. But that's a lot of work figuring out the precise angles needed, to be tangent to the circle at the right place.
Maybe someone else has a better technique?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Add a new node in a path using the snapping tools
Hi, looked at your file. You are a frequent contributor to this forum, so this is probably too simple an answer to your question. Anyway, here it is.
Your line is already snapped to the center off the circle.
Switch to the
Doubleclick or ctrl alt on the line to add a node aywhere.
Make sure you have snap to centers of objects enabled, then drag the node until you see one of these
Your line is already snapped to the center off the circle.
Switch to the

Doubleclick or ctrl alt on the line to add a node aywhere.
Make sure you have snap to centers of objects enabled, then drag the node until you see one of these
Your mind is what you think it is.
Re: Add a new node in a path using the snapping tools
Brynn, Druban, thank you both for your input
.
@Brynn, I'm actually trying to insert a node at the center/midpoint of the circle, not the intersection. But a similar approach could be followed in this case I guess.
@Druban, Indeed, I expected that I could snap the node by moving it along the handle lines (Ctrl + Alt). But it only snaps to the path itself, not to midpoints or rotation centers (although those options are enabled)? It does snap to the center when I don't hold Ctrl and Alt -- but the thing is, the curve shouldn't change shape while moving the node.
Is there perhaps an option to move the node along the path? Because when the path would be curved instead of straight (which is the case in the original problem), then how would you solve it?

@Brynn, I'm actually trying to insert a node at the center/midpoint of the circle, not the intersection. But a similar approach could be followed in this case I guess.
@Druban, Indeed, I expected that I could snap the node by moving it along the handle lines (Ctrl + Alt). But it only snaps to the path itself, not to midpoints or rotation centers (although those options are enabled)? It does snap to the center when I don't hold Ctrl and Alt -- but the thing is, the curve shouldn't change shape while moving the node.
Is there perhaps an option to move the node along the path? Because when the path would be curved instead of straight (which is the case in the original problem), then how would you solve it?
Re: Add a new node in a path using the snapping tools
Ailurus, i noticed that too, but it seems that that particular constrained dragging of nodes will not snap to center points. In this particular instance it makes no difference since it is a straight line, but of course with curves it will be a different story!
you could snap a guide to the center and ctrl alt drag the node to snap to the guide. But ctrl alt drag will only really work for straight lines, right?
If the curve you want to add a node to is unclosed you will really have to work around.
Duplicate your curve and path>reverse one copy.
Use the
to snap to the center of the circle and draw a short line segment from there.
Use the
and ctrl+alt to move the node of this segment that is on the center to extend this segment across the curve.
Duplicate this segment. Select the curve and one copy of the short segment and do a cut path.
Do it again with the reversed curve and the other copy of the segment. Select both halves of your curve, use the
to select the two overlapping nodes and join them to get your original curve back with the added node where you wanted it without having changed the shape of the curve.
If the path is closed it's much simpler; just draw the crossing segment, cut path and join the nodes. No duplicates or reverses.
Sorry to offer such a clunky workaround, but there it is. Is it really worth it?
you could snap a guide to the center and ctrl alt drag the node to snap to the guide. But ctrl alt drag will only really work for straight lines, right?
If the curve you want to add a node to is unclosed you will really have to work around.
Duplicate your curve and path>reverse one copy.
Use the

Use the

Duplicate this segment. Select the curve and one copy of the short segment and do a cut path.
Do it again with the reversed curve and the other copy of the segment. Select both halves of your curve, use the

If the path is closed it's much simpler; just draw the crossing segment, cut path and join the nodes. No duplicates or reverses.
Sorry to offer such a clunky workaround, but there it is. Is it really worth it?

Your mind is what you think it is.
Re: Add a new node in a path using the snapping tools
Oh, I apologize for misunderstanding. Now that I understand the question, I wonder if you could place the node first, and then snap the circle's center to it?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design