import coordinates from CSV-file

Post questions on how to use or achieve an effect in Inkscape.
newsboost
Posts: 24
Joined: Sun Jul 15, 2012 10:07 am

import coordinates from CSV-file

Postby newsboost » Sun Jul 15, 2012 10:10 am

Hi,

I want to draw an involute gear - I have a text file (can also be made into a CSV-file), describing the coordinates. Is it possible / how do I get all these (maybe 100 points or something) imported and connected together?

There must be a way... Please advice, thanks...

newsboost
Posts: 24
Joined: Sun Jul 15, 2012 10:07 am

Re: import coordinates from CSV-file

Postby newsboost » Mon Jul 16, 2012 3:11 am

Is it possible to make a script that uses the xml-editor to accomplish this?

newsboost
Posts: 24
Joined: Sun Jul 15, 2012 10:07 am

Re: import coordinates from CSV-file

Postby newsboost » Mon Jul 16, 2012 3:15 am

Or shouldn't it be possible to write directly to the svg-file... ?

Please help - inkscape noob.

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: import coordinates from CSV-file

Postby v1nce » Mon Jul 16, 2012 9:40 am

hi,

edit the following file (= replace ENTER CONTENT OF CSV HERE by your actual csv content)
note: coords should be in the following format x,y x,y x,y x,y
(or do it the other way : open you csv ; go to the front and add first part of svg; go to the end and add remaining svg)

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.1"
   width="210mm"
   height="297mm"
   id="svg2">
  <g
     id="layer1">
    <path
       d="M 0,0 L  ENTER CONTENT OF CSV HERE  "
       id="path2991"
       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
  </g>
</svg>


Return to “Help with using Inkscape”