Skip to content

How to import a SVG drawing

svenhb edited this page Aug 5, 2016 · 10 revisions

If the color information of a SVG drawing should be used to select a tool number, the SVG Color should match a Color in the given Palette.

###Preset in Inkscape: Copy my individual GIMP-palette "Stabilo_25sort.gpl" (Stabilo Fineliner colors) to the Inkscape folder e.g. C:\Program Files\Inkscape\share\palettes
Open Inkscape and load the new Palette (Little black triangle on right side of Palette-color-bar)
Load a SVG drawing and change color of objects to a Color, given in the Palette, or make a new drawing.

###Preset in GRBL-Plotter: Inside the Setup Dialog 'SVG Import':

  • Check 'Get pen index from Color palette' to handle stroke-color of SVG object.
  • Apply a valid GIMP Palette file (which is readable by Inkscape) to assign SVG Colors to tool numbers. Palette Color 1 results to tool number 0. Example:
    GIMP Palette
    Name: STABILO 88
    Columns: 3
    #
    108 194 227 eisgrün (13) - tool 0
    35 24 72 nachtblau (22) - tool 1
    etc...
    Otherwise the Default Colors 'black', 'red', 'green' and 'blue' will be used.
  • Check 'Sort objects by pen index' to sort GCode by ascending tool number (otherwise tool order is same as Color occurance in SVG file).
  • Check 'Add Tool Change command' to insert M6 Tx command to the GCode.

Import SVG by drag and drop file on GUI (except text editor area) Color difference will be calculated via Distance in RGB-Space:
Math.Sqrt((c1.R - c2.R) * (c1.R - c2.R) + (c1.G - c2.G) * (c1.G - c2.G) + (c1.B - c2.B)*(c1.B - c2.B)); }

palette-color (= tool nr) with lowest difference will be taken to draw a SVG path

Tools are sorted by tool nr in ascending order (Tool with lowest number first)

Clone this wiki locally