Hi there,
I'm new to using Inkscape. I've tried some things and I very impressed by the possibilities. I'm using Inkscape mainly to draw chemistry equipment and drawings for physics (for example refraction of light).
With physics drawings I'm experiencing some difficulties. I've searched the web for tutorials etc, but haven't found what I'm looking for.
I'm drawing an vector representing a force of 100 Newtons, so I draw a line of 100 pixels and the I add a arrow marker at the end. New my vector is not 100 pixels anymore? I adjusted this and the I wanted to draw another arrow meting the first one. Thus I drew a line meeting the end node of the firts line and added a arrow marker. All of you experts guessed it: the arrow heads don't meet exactly.
How can I fix this?
Thank you very much for helping me
Marker and length
Re: Marker and length

Welcome to InkscapeForum!
Hhhmm....interesting! Let me do some testing and I'll come back with what i learn

Edit
I tried several different markers. Of the arrows, they extended beyond the end of the path by anywhere from 1 to 2 px. There's one called Triangle Out where a triangle appears to be centered on the end node, and for a 1 px stroke wide, extends 5 px beyond the end node. In reading the manual info (http://tavmjong.free.fr/INKSCAPE/MANUAL ... ke-Markers) I learned that the size of the marker varies with stroke width. Certainly not an ideal situation, for those needing precision with arrows and arrowheads!
But I also found in the manual, instructions for making custom markers (http://tavmjong.free.fr/INKSCAPE/MANUAL ... es-Markers). It appears that you can adjust the offset of the marker origin from the node. So that might be the best option for you

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: Marker and length
For example:

I drew two lines of which the nodes overlap and added endmarkers.

I drew two lines of which the nodes overlap and added endmarkers.
Re: Marker and length
This is a miter limit issue if you know what that is. In the fill and stroke dialog you can set the miter limit to something shorter, but then it will just get cut off at the tip of the arrow.
Your best option is to manually move the end nodes back so that the arrow tips are where you want them to be.
Your best option is to manually move the end nodes back so that the arrow tips are where you want them to be.
Your mind is what you think it is.
Re: Marker and length
Yes, this is very annoying indeed! I've thought about ways how to improve Inkscape's code to handle this properly, but there doesn't seem to be an easy way to do this. You might want to experiment with the custom markers as suggested by Brynn, and combine this with Druban's advice and see if that helps. If so, then we should make these markers default I guess!
Re: Marker and length
I'm proud! I altered code for the first time.
It didn't solve the problem completely thought.
I copied the code of my favorite marker, changed the name to my own marker and edited the offset.
The result is that the marker now end EXACTLY at the end of my line. Now I have this problem (I changed the line color):

I tried druban's advice of "miter limit". At least I think I did, because I'm working with a Dutch version of Inkscape. Is "miter limit" the value that's default on 4,00 in the same windows where I can add a marker? I tried several values, but I didn't see any effect...
Is it maybe possible to add a button with a different line end? Now I've got three choices: "Chopped", "Rounded" and "Square" (I translated back from my Dutch version)
If there is a pointy end, maybe the problem is solved? The slope of the point has to match the slope of the marker...
It didn't solve the problem completely thought.
I copied the code of my favorite marker, changed the name to my own marker and edited the offset.
The result is that the marker now end EXACTLY at the end of my line. Now I have this problem (I changed the line color):

I tried druban's advice of "miter limit". At least I think I did, because I'm working with a Dutch version of Inkscape. Is "miter limit" the value that's default on 4,00 in the same windows where I can add a marker? I tried several values, but I didn't see any effect...
Is it maybe possible to add a button with a different line end? Now I've got three choices: "Chopped", "Rounded" and "Square" (I translated back from my Dutch version)
If there is a pointy end, maybe the problem is solved? The slope of the point has to match the slope of the marker...
Re: Marker and length
You can take this one step further, by drawing additional white areas. These white areas then overlap with the triangular pieces of stroke you want to hide:
The result has been attached below. However, this will only work on a perfectly white background
. What we'd want is to clip the stroke of the line itself, or to stop the line shortly. But as I understand from the specifications the markers are drawn simply on top of the stroke and only after the stroke has been drawn, and there's no way to affect that.
Code: Select all
<!-- 1 LARGE with tip aligned with node -->
<marker style="overflow:visible" id="Arrow1LstartAligned" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1LstartAligned">
<path transform="scale(0.8) translate(12.5,0)" style="fill-rule:evenodd;fill:#000000;stroke-width:0.0pt" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
<path transform="scale(0.8) translate(12.5,0)" style="fill-rule:evenodd;fill:#FFFFFF;stroke-width:0.0pt" d="M 5.0,-5.0 L -12.5,-5.0 L -12.5,0.0 L 5.0,-5.0 z "/>
<path transform="scale(0.8) translate(12.5,0)" style="fill-rule:evenodd;fill:#FFFFFF;stroke-width:0.0pt" d="M 5.0,5.0 L -12.5,5.0 L -12.5,0.0 L 5.0,5.0 z "/>
</marker>
<marker style="overflow:visible;" id="Arrow1LendAligned" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="Arrow1LendAligned">
<path transform="scale(0.8) rotate(180) translate(12.5,0)" style="fill-rule:evenodd;fill:#000000;stroke-width:0.0pt;" d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "/>
<path transform="scale(0.8) rotate(180) translate(12.5,0)" style="fill-rule:evenodd;fill:#FFFFFF;stroke-width:0.0pt" d="M 5.0,-5.0 L -12.5,-5.0 L -12.5,0.0 L 5.0,-5.0 z "/>
<path transform="scale(0.8) rotate(180) translate(12.5,0)" style="fill-rule:evenodd;fill:#FFFFFF;stroke-width:0.0pt" d="M 5.0,5.0 L -12.5,5.0 L -12.5,0.0 L 5.0,5.0 z "/>
</marker>
The result has been attached below. However, this will only work on a perfectly white background

- Attachments
-
- marker.png (131.16 KiB) Viewed 7072 times
Re: Marker and length
I tried changing the miter limit too, but apparently it does not affect the markers.
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: Marker and length
This illustrates the remaining problem, with the white areas that should in fact be transparent. I've tried fixing this with a filter, but haven't succeeded yet. Not that that would not be an attractive workaround anyway, because of the computational cost of the filter (which can make Inkscape crawl). I've attached the original file and the markers.svg file, should anyone be interested
- Attachments
-
- Arrow_with_custom_marker.svg
- (4.04 KiB) Downloaded 203 times
-
- markers.svg
- (30.54 KiB) Downloaded 203 times
Re: Marker and length
How about this for a solution:
I use my costum marker and then convert my line to a path. The two corners sticking out from under the marker become nodes, which I can move back a little, without changing the location of the marker.
Still I think it shouldn't be this hard...
I use my costum marker and then convert my line to a path. The two corners sticking out from under the marker become nodes, which I can move back a little, without changing the location of the marker.
Still I think it shouldn't be this hard...
Re: Marker and length
My mistake. although it is a miter limit thing, the miter limit on that arrowhead is not editable until you do a stroke to path.... by then you could just remove the stroke and move the arrow anyway
Your mind is what you think it is.
Re: Marker and length
Someone from the SVG working group is looking into this!
See this blog: http://tavmjong.free.fr/blog/?p=646
See this blog: http://tavmjong.free.fr/blog/?p=646
Marker Clipping: At the moment, in order to avoid the path from showing under the tip of an arrowhead, the arrowhead must extend past the end of the path. In Inkscape, this prevents things like snapping the arrow tip to a line since the path end is not at the same place as the arrow tip. One of the SVG group members is going to work out a way to specify a clipping region for a marker that would apply to the path below thus eliminating this problem.
Re: Marker and length

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