Does Inkscape have a way to put points on a curve or line so the coordinates of the points will be written to the svg file? I seem so close to doing this, but perhaps I need a different program.
The example image shows a Bezier curve (using c
in the svg) with two nodes, markers on each of the two nodes (but no more), and a dotted stroke between the nodes.
I think if each of the "dots" of the stroke could be written out as coordinates, my objective might be reached. I have been able to add nodes, and I could add them to each of those dots and it will work, but will be difficult for large drawings. If nodes are the only way to get coordinates it would be good to know, and if the nodes can be evenly spaced, that will be ideal.
I am omitting the svg file contents for brevity, but I have made some progress on my objective of getting circles centered on the points describing a curve by editing the svg file (see this post for example). I have discerned some relationships between x,y coords of nodes, circle, m, c, z
records in the svg, but that is in progress. So far - not always straight forward. Processing will ultimately need to be done with command-line tools such as awk,bash,sed
when the number of points is large enough.
UPDATE : I just found this SO post which will help - I just started working on this though :
How to extract the cartesian coordinates (x,y) of an svg image?
the curve in svg
format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg5"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="inkscape_curve_01_23feb23a.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="397"
inkscape:cy="560.5"
inkscape:window-width="1680"
inkscape:window-height="986"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 53.049246,151.83874 c 2.08256,-72.783154 80.316864,-35.42292 80.316864,-35.42292"
id="path857"
sodipodi:nodetypes="cc" />
</g>
</svg>