Author Topic: SVG to DXF workflow?  (Read 330 times)

ccooksey

  • Newbie
  • *
  • Posts: 14
    • View Profile
SVG to DXF workflow?
« on: October 31, 2016, 08:12:34 PM »
I have a bunch of SVG files from when I used to use Inkscape plugins/extensions to go straight to G code before I started using PWM. 

I've tried numerous methods to save them as DXF; saving them as DXF from Inkscape, using an extension in Inkscape that supposedly worked better, online converters, even imported the SVG as a sketch into the latest version of Autodesk Fusion 360 and saved as a DXF. 

I think it worked once, but every other time I get the " .DXF File Too Old" error when I try to bring them into BCL.  Do I need to try some other CAD program? 

Cory
now: 17x20cm 500mW engraver with Eleks L7 board. 
30x40cm 40W CO2 Chinese laser with bad PS (replacement PS on the way)
future: maybe a 30x40cm 2500mW from Banggood if Black Friday/Cyber Monday deals are good?  :-)

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
  • Pilot Instructor
    • View Profile
Re: SVG to DXF workflow?
« Reply #1 on: October 31, 2016, 08:42:42 PM »
Hi Cory and welcome to the forum...!!!

Yes, if you can get them into a .dxf file, you can use almost any CAD program do a save as to save them to a new version of dxf.

@Agastar has a converter utility he is working on to convert .svg into .dxf. He has a board in the Software section called Convert2Dxf (I think that's the name). He will probably see this post and jump in to give us his status on his .svg to .dxf converter status  :)

I'm attaching a QCAD screen shot showing its options to save under various R versions.
« Last Edit: October 31, 2016, 08:44:38 PM by Administrator »

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: SVG to DXF workflow?
« Reply #2 on: November 01, 2016, 05:43:31 AM »
Hi, I also use Inkscape which is why I started working on the converter utility. I have not added the support for svg files yet but what I do currently is to export from Inkscape to a pdf file. The conversion utility can convert the PDF to a DXF file both BCL can work with.

You can download the windows application or the command line app and use it to convert to DXF and then load the DXF file into any cad program or go straight to BCL. In the application you can pick BCLMode or T2LMode and the only real difference between the two is that BCLMode will attempt to convert the splines to arcs and circles where it can as well as attempt to convert connecting lines to LwPolylines. T2LMode simply leaves everything as lines and splines. Either option will work for BCL but BCLMode will reduce the number of objects you have to work with which can be helpful.

Hope that helps.

ccooksey

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: SVG to DXF workflow?
« Reply #3 on: November 02, 2016, 08:25:23 PM »
Agastar,

I have been trying what you said.  I have my default document on Inkscape set to 150mm by 150mm.  I import an SVG and reduce size to something I can work with that fits inside the borders of my default document.  I then save as a PDF.  I use Convert2DXF to convert it.  I use the BCLMode setting.  But when I go to load it into BCL, I get errors/warnings, sometimes it's "Drawing Scale Warning". 

I had an SVG that was 130x140mm and BCL says the "Drawing Height and/or Width is 1026.20344543457 MM"  I have gotten the same Warning ( and the same 1026.20344543457 MM ) on several different files.  I also sometime gets a warning that my object is in the negative space, -X or -Y and needs to be moved in my CAD program.  I'm not using a CAD program, and my object in the SVG is within my 150x150mm document boundaries when I save as PDF. 

Any insights on this?  Is it Inkscape, Convert2DXF or BCL that is holding me back here?  If any of you want, I can upload some sample images, in the original SVG, after I save as PDF, and the DXF output from Convert2DXF if you want to try to re-create it. 

Cory
now: 17x20cm 500mW engraver with Eleks L7 board. 
30x40cm 40W CO2 Chinese laser with bad PS (replacement PS on the way)
future: maybe a 30x40cm 2500mW from Banggood if Black Friday/Cyber Monday deals are good?  :-)

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
  • Pilot Instructor
    • View Profile
Re: SVG to DXF workflow?
« Reply #4 on: November 02, 2016, 10:22:36 PM »
Cory,

Post your files here and I will take a look at them.

Thanks...

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: SVG to DXF workflow?
« Reply #5 on: November 03, 2016, 09:51:35 AM »
It has been a few versions back since I tested it with BCL so let me do some tests and make sure it is still playing nice with BCL. Also, you can ignore the negative space message if "visually" nothing is in the negative space.

Anything you want to upload, I'll take a look at and see what might be going on.

ccooksey

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: SVG to DXF workflow?
« Reply #6 on: November 03, 2016, 07:18:41 PM »
I did some tests and have attached 4 files.  The test1.dxf works fine, no problems, but it is a very simple file.  I had one that shows negative coordinates, but I didn't include it after seeing Agastar's comment about that. 

The 3 butterfly files, seems to convert to pdf nicely, shows up fine in Adobe Acrobat DC and Microsoft Edge.  After using Convert2DXF and bringing in to BCL I get both "Warning! Drawing Has Negative Coordinates" AND "Drawing Scale Warning; Warning Notice Only!; Drawing Height and/or Width is 3266310.75 MM."  BCL loads everything, but I can't see the drawing on screen.  Probably because if it thinks the Height and Width are so big, with the image originally only being 166x167mm, the scale is way too large and I can't seem to find it as I scroll and adjust zoom.

I'm wondering if the butterfly SVG was possibly originally a raster image and converted to paths at some point before I got it?  The lines are rather thick and thickness isn't consistent.

Cory

now: 17x20cm 500mW engraver with Eleks L7 board. 
30x40cm 40W CO2 Chinese laser with bad PS (replacement PS on the way)
future: maybe a 30x40cm 2500mW from Banggood if Black Friday/Cyber Monday deals are good?  :-)

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
  • Pilot Instructor
    • View Profile
Re: SVG to DXF workflow?
« Reply #7 on: November 03, 2016, 07:38:42 PM »
The following BCL warnings:

1. "Drawing Scale Warning; Warning Notice Only!; Drawing Height and/or Width is 3266310.75 MM."

This is simply telling you that you need to double check your Units of Measurement in your CAD drawing...it's 99.99% wrong when loaded into BCL. This type of message really means you probably want your drawing in Inches vs MM or vice-versa, depending on the BCL message. So check you Units in your CAD drawing and make sure it's what you want to use. This is a warning...nothing bad will happen if you're happy with the length of a part being 57 feet long or 32,000 MM wide.

2. "Warning! Drawing Has Negative Coordinates"

This is only a warning message. You can put your drawing in your CAD program any where you want but why in minus X axis space? and/or why in minus Y axis space? When you see this warning, you will want to move your drawing in your CAD program into positive space. Do you have to? No, you can put your entire drawing in negative space if that's what you want. BCL will just give you a warning about it and that's all, nothing bad will happen.

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 1532
  • Pilot Instructor
    • View Profile
Re: SVG to DXF workflow?
« Reply #8 on: November 03, 2016, 08:02:06 PM »
Since BCL can only read .dxf files, I can't comment on two of the three files you have provided for downloading.

Test1.dxf is a perfect .dxf file...it loads fine in BCL and I can generate perfect gcode for it and run it perfectly fine in the BCL Virtual Laser Machine.

butterfly_cleaned.dxf looks OK in QCAD and loads in BCL but does not show in the main canvas for some reason. Let me take a deeper look at this .dxf file and I'll come back with a reply. I'll figure out if the .dxf file is somehow corrupted or if the problem is with BCL not being able to parse it correctly.

As a side note about this file: It breaks down into 1081 drawing objects. Even if it were perfect, that's not an efficient file to be working with in BCL. I recommend trying to keep the drawing objects count to under 500. If you are trying to engrave this design, you should use T2 Laser. If you are trying to cut it out, once I figure out what's wrong with it or with BCL, you will be able to cut it with BCL but that's a hard way to go. I'd strongly advise creating at least 4 toolpath files (8 would be better) so you can work on multiple toolpath file parts individually rather than on all 1081 objects in one shot. Just my advice on how to work with this kind of drawing in BCL.
« Last Edit: November 03, 2016, 08:03:11 PM by Administrator »

Agastar

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1878
    • View Profile
Re: SVG to DXF workflow?
« Reply #9 on: November 04, 2016, 04:13:46 AM »
Butterfly is definitely a trace of a bitmap and if you want the filled in areas to be engraved then you are going to want to run this as a raster. If you want just the outline then you might want to convert this as T2LMode since BCLMode is not converting it correctly.

T2LMode loads fine in BCL but it is going to be a ton of splines and it will be a lot of work to get this to run right without taking forever to engrave.

My recommendation would be to do this one as a raster engraving.

Zax

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2879
    • View Profile
    • T2Laser
Re: SVG to DXF workflow?
« Reply #10 on: November 04, 2016, 05:10:01 AM »
They all work with T2Laser, for the SVG I just saved as a PNG and that could be raster engraved. The PDF loads using Agastar's utility, if you use the DXF Optimizer it reduces the engraving time from over 8 minutes to 5 minutes.

Raster engraving it will take significantly longer (40 minutes at 0.1 resolution and 1000 speed) but of course you can fill it which may be the desired result.