Inkscape.org
Using Inkscape with Cutters/Plotters How do I import DXF file without transforming coordinates.
  1. #1
    fredholm fredholm @fredholm

    I am trying to convert DXF files to SVG files using inkscape from the command line. The coordinates in the drawing are scaled and moved for some reason so the output is unusable for me. I need to later add elements to the svg but the coordinates for this is relative to the original coordinates.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Is it successful when using the GUI?

     

  3. #3
    fredholm fredholm @fredholm

    No, when i open a dxf file in GUI-inkscape its the same thing. When the original drawing is a square from (0, 0) to (200,200) when I open in GUI its a square but from (0, 370) to (748, 1118).
    I see now that if I change the document properties back to mm from px the size is right but not the position.

    Can i set the document properties from the command line?

    I tried saving a default template with mm but i didn't seem to take effect.

  4. #4
    Tyler Durden Tyler Durden @TylerDurden

    I'd try two settings in the GUI before using the CLI:

    • Ensure only one instance of Inkscape is open
    • In the Preferences>Interface, UN-check the box for Origin at upper left.
    • In the document properties dialog, set the units to mm and the scale to 0.264583, then save the document as the default template.

    Close Inkscape before running the CLI.

  5. #5
    fredholm fredholm @fredholm
    *

    I think most of the problems originate from the svg and dxf y axis beeing inverted.

    I was able to make this work as expected (by me) by making a copy of /usr/share/inkscape/extensions/dxf_outline.py elimination the unwanted transformations under the comment about  "top_level_transformation".

    I am also looking into converting from DXF to SVG trying to keep the axis but havn't been able to make the same changes in dxf_input.py i guess the transformation here is more internal to Inkscape and harder to change.

Inkscape Inkscape.org Inkscape Forum Using Inkscape with Cutters/Plotters How do I import DXF file without transforming coordinates.