Hello all,
I’m trying to import a DXF for a board outline. I tried the simple.dxf file from another thread here and it show up as expected in the layout as a rectangle 1" x 2". The file I have should be approx. 1.7" x 1.6". When I import that file the board outline shows up super tiny. I’m assuming something is not setup correctly in my DXF file. I’m using LibreCAD to view the DXF and it all looks OK, I think?
I know nothing about mechanical drawing packages so I’m assuming I could be doing something wrong that is really simple. I’ve attached the DXF file that I’m trying to use.
bsd_bus_outline_2_r12.dxf (62.4 KB)
Libre cad has no concept of units. When importing a dxf to kicad it thinks it is in mm. (FreeCAD also interprets the unitless measurements of Libre CAD as mm)
I don’t know how to tell kicad, that the dxf is in inches.
Maybe just scale it up in Librecad
1 Like
The problem is with the units. What unit settings did you use in LibreCAD when you exported the file? Open the file, set to “mm” and try again. KiCad “stable” makes the assumption that units are always mm. I fixed this issue when I added LWPolyline support but I don’t believe the changes were backported. I’ll ask on the dev list to see if I can get those specific changes ported.
1 Like
I tried setting LibreCAD to mm and exporting but that didn’t make any difference.
What did work was to create the drawing in LibreCAD with the idea that everything is millimeters. Then when I saved the File in DXF R12 and imported into KiCAD it scaled correctly.
Thanks so much for the help!
I just played around with it.
I set the application unit to mm, and drawing unit to inch. (Then saved the file under a new name)
When i import this dxf into kicad, it seems to have the right size.
(I have LibreCAD V2.09 and the current nightly build of kicad.)
The only problem i observe is that the line thickness is very high. So maybe your workaround is the best solution for the time beeing.
@cbernardo: when importing a dxf, there is a disabled unit selection. Maybe there is some way to get it enabled?
Forgot to include the versions for the software I’m running:
KiCad 4.0.2
LibreCAD 2.0.2
So it looks like this has changed with the KCAD nightly build.
The changes have been put into the Stable branch as well:
http://bazaar.launchpad.net/~stambaughw/kicad/4.0/changes/6261?start_revid=6261
Kicad 4.0.3 should be released within the next few weeks.
The “unit” seems to be applied if you use the “Default” canvas but not the GL canvas. I’ll look into this. The unit selection really makes no sense unless no unit has been specified in the DXF file; if a unit is given then it would be strange to override it.
I had a look at the code and the help text for the “Unit” dropdown states “Grid Units” - this affects the positioning of the DXF outline on the PCB grid. (I put that menu in but forgot about it.) I will change the name so it is not so confusing.
There is still an issue with DXF files which do not have a design unit specified; at the moment this defaults to “mm” and there is no option to override that.
I have access to autocad, i will export a test dxf from there.
I’m curious if it is a problem related to LibreCADs unit system or if it is only a problem of KiCad.
I currently use Inventor 2015 sheetmetal module and then DXF export with ‘AutoCAD 2004 DXF’ as export setting and have no complaints (I work in mm) - works every time (Inventor 2010 worked as well) for all KiCAD versions I had so far.
I just didn’t had the need yet to find out which coordinate in the DXF file is being used as the ‘anchor’ in KiCAD for placement (= it didn’t annoy me too much yet).
