Arrowhead touching a line?

Post questions on how to use or achieve an effect in Inkscape.
theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Arrowhead touching a line?

Postby theozh » Tue Jun 27, 2017 7:25 pm

just curious, if anybody has a smart idea about realizing an arrow head just touching a line or an object with some stroke?
The problem is:
when creating the arrow, the path should snap to the black path to have the properly defined length. However, the touching point of the arrow head will depend on the width of the black line. So I guess there is probably no easy solution without manual correction afterwards?! It's clear to me that if I change the black line width afterwards, the arrowhead will not automatically adapt. But at least while creation of the arrow, it would be helpful to already get the proper touch.
A custom marker, e.g. like --->| probably wouldn't help.
Or maybe with Powerstroke or LPEs or Extensions or anything like that...?

ArrowHeadTouch.png
ArrowHeadTouch.png (4.96 KiB) Viewed 1610 times
Win7/64, Inkscape 0.92.2

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

Re: Arrowhead touching a line?

Postby Lazur » Tue Jun 27, 2017 7:56 pm

Consider the following:
the arrow is assigned to the node of the path, which is snapped to that black line
it inherits its rotation from the end node
if there was a gap in between the snapped end node and the arrow head, the rotation and the placement could end up being way off.

If working with curved paths.


Nonetheless you can achieve custom markers that would display shifted arrowheads in inkscape (though the shifting distance wouldn't follow with the stroke widths of the two object -when scaled etc.-, and on the side note in your example the black line is more of a visual cue, what would make inkscape adapt to either a stroked path or a filled path with no stroke),
but then the "gap" of the marker wouln't cover the stroke beneath/above. So that you may need to include a white part in the marker covering the paths's end -which would still be visible due to anti-aliasing and on a dark background etc.

I'd say if you specify a more distinct use an according lpe could be requested, like with a symmetrical dasharray lpe.

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Arrowhead touching a line?

Postby theozh » Tue Jun 27, 2017 8:06 pm

Thank you @Lazur, I see, it's seems to be not so easy...
A workaround which came to my mind is:
1. duplicate the black line
2. do stroke to path
3. let the (visual) bounding boxes of the arrowhead and the black "line" snap to each other
4. delete the duplicated black "line"
Well, a bit click-intense for just a little arrowhead... especially if you have many of them...
Win7/64, Inkscape 0.92.2

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

Re: Arrowhead touching a line?

Postby Lazur » Tue Jun 27, 2017 8:48 pm

If it was for horizontal/vertical arrows and fixed stroke widths I'd try adjusting the steps in the preferences and just use the arrow keys to move the end nodes by a certain px amount.


Return to “Help with using Inkscape”