DXF import messes up some files (some objects scaled differently)

Bug #1594607 reported by PCB Wiz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

Importing 3 different CAD Saves of the _same_ original DXF, gives 3 differing outcomes in DXF import.

DXF loaded and saved by Double CAD imports ok, with Arcs, Circles and Text.

DXF flat export from PADS loads, but drops the Circle and Arcs

DXF full export from PADS, loads, but more mangled - looks to lose origin info, as well as Circles and Arcs.

DXF load/save from A9CAD seems to scale wrong - DXF import may need a scale choice added, as I think not all DXF files have explicit units included ?
millimeters is a a global standard, but inch and mils are also common in PCB design areas.

LibreCAD I tested, but it has a bug in release 2.1.0 that prevents full DXF testing.

Tags: dxf
Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :
Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

Another test case, this from QCAD,
Here, the older format DXF (POLYLINE) fails (drops ARC & Circle), but the newer choice (LWPOLYLINE) is ok.

This may be easier to debug, as this is the same CAD export, of slightly differing file standards.

This fails :
  8
2DLINES_1
  0
POLYLINE
  8
2DLINES_1
 66
     1
 70
     1
  0
VERTEX
  8
2DLINES_1
 10
75.95
 20
3.429
 40
0.5
 41
0.5
 42
1.0
  0
VERTEX
  8
2DLINES_1
 10
76.45
 20
3.429
 40
0.5
 41
0.5
 42
1.0
  0
SEQEND

This is OK

  0
LWPOLYLINE
  5
48
330
8C
100
AcDbEntity
  8
2DLINES_1
100
AcDbPolyline
 90
        2
 70
     1
 43
0.5
 10
75.95
 20
3.429
 42
1.0
 10
76.45
 20
3.429
 42
1.0
  0
LWPOLYLINE

Looking at that more closely, if this uses the LibreCAD DXF reader, it is around that multiple vertex handling that LibreCAD has issues.

Revision history for this message
Jon Neal (reportingsjr) wrote :

Can you provide version info on Kicad?

I think you at least aren't using the nightlies which I am pretty sure fixes most of these issues. At a minimum I believe the arcs/circles issue is gone and units are now set so scaling should be correct.

I'm going to mark as incomplete until this is tested on nightlies. If you already did that feel free to mark as new again.

Changed in kicad:
status: New → Incomplete
PCB Wiz (1-pcb-wiz)
Changed in kicad:
status: Incomplete → New
Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

oops, yes, that test was on June 18th nightly build, I have since downloaded june 20th r6943,
( to confirm Excellon reading in GerbView is fixed, & it looks to be fixed)

and I can confirm, the DXF behaviour in KiCad remains exactly as the screen shot & notes above.
ie only _one_ DXF file imports with correct ARC/Circles.
All imports target F.Silk

Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

This attached A9CAD DXF imports, but with incorrect scaling.

Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

LibreCAD have just fixed their issue with dots on some DXF imports, in LibreCAD-Installer-2.2.0-alpha-45-g69fe247 so attached here are 3 x import/save-as to DXF 2007/R14/R12 versions.

Of these 2007 & R14 load as per width-removed images above, but R12 loads fine into LibreCAD and DoubleCAD, but loses ARCS/Circles when imported into KiCad.
ie the info seems to be in the DXF, as other CAD packages load ok, but kiCad either does not see it, or chooses to ignore it.

All LC saves seem to have correct scaling, but non display with line width preserved.

Given not all kiCad layers can support ARCs, it would be useful for DXF import to have an option to rebuild ARC as segments, with a Segment count choice (& _not_ just 6 or 32 ).

tags: added: dxf
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Please copy the version information from KiCad so we can see if this bug has been fixed. I just ran into a dxf import issue with the footprint editor which may be related to this bug report but I cannot tell because there is no version information.

Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

Kicad import issue with arcs is still a problem with that first ZIP file.
Most DXFs provided fail to keep ARCS, but surprisingly one does manage it.

BoardOnly_mm_W1_Flat_DCr14.dxf imports with ARCs intact.

Same original drawing, saved from various CAD pgms.

Application: pcbnew
Version: (2016-08-17 BZR 7066, Git 5f2099f)-product, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.46.0 OpenSSL/1.0.2d zlib/1.2.8 libidn/1.32 libssh2/1.6.0 librtmp/2.3
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.57.0
Curl: 7.46.0
KiCad - Compiler: GCC 5.2.0 with C++ ABI 1009
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  USE_FP_LIB_TABLE=HARD_CODED_ON
                  BUILD_GITHUB_PLUGIN=ON

There was also a bug with LibreCAD DXF imported (mis)handling AutoCAD comment lines [999], that has been recently fixed.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I think this is a different issue. The footprint editor dxf import was completely broken. Nothing was being imported. You may want to test a more recent nightly build to see if this import issue has been resolved. If you want import dxf into the footprint editor, your are going to have to use a commit f14dc8f2 or later. Please let me know if this has been fixed when you get a chance.

Revision history for this message
PCB Wiz (1-pcb-wiz) wrote :

File BoardOnly_mm_W1_Flat_DCr14.dxf imports with ARCs intact, into FootPrint editor.

Other test files supplied, import the same as into PCB - ie they do lose the ARC info.

ie Footprint import behaves the same as main PCB import.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

I believe it has been fixed recently, see: https://bugs.launchpad.net/kicad/+bug/1627422

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1594607] Re: DXF import fails on some DXF files(footprint Editor)

This is a different bug. Thanks for the feedback.

On 10/7/2016 10:50 PM, PCB Wiz wrote:
> File BoardOnly_mm_W1_Flat_DCr14.dxf imports with ARCs intact, into
> FootPrint editor.
>
> Other test files supplied, import the same as into PCB - ie they do lose
> the ARC info.
>
> ie Footprint import behaves the same as main PCB import.
>

Revision history for this message
Jeff Young (jeyjey) wrote : Re: DXF import fails on some DXF files(footprint Editor)

The arc/circle issues seem to have been fixed.

The scaling issue with BoardOnly_mm_W1_Flat_A9.dxf still exists.

BoardOnly_mm_Full.dxf still comes in jumbled, but MacDraft also has problems with this file (MacDraft loses the position of all the texts while we lose the positions of all the text and the circle and square -- but not the rest of the outline).

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
Jeff Young (jeyjey)
summary: - DXF import fails on some DXF files(footprint Editor)
+ DXF import messes up some files (some objects scaled differently)
Revision history for this message
Nick Østergaard (nickoe) wrote :

As mentioned by Jeff, there are still issues. The square, circle and text are not positioned correctly for BoardOnly_mm_Full.dxf.

Application: pcbnew
Version: (6.0.0-rc1-dev-253-g8cb94f09c-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.17.11-arch1 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 8.1.1 with C++ ABI 1012

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

This appears to be fixed by the Import Graphics patch. Please re-open if you still see issues.

Changed in kicad:
milestone: none → 5.1.0
status: Triaged → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.