Errors in Pcbnew's interpretation of P-CAD ASCII files

Bug #1547822 reported by Robin Whittle on 2016-02-20
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Undecided
Eldar Khayrullin

Bug Description

Application: pcbnew
Version: (2016-02-18 BZR 6566, Git c2fd462)-product release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.2.0,wx containers,compatible with 2.8)
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Boost version: 1.57.0
         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

This also applies to 4.0.1 and probably everything in between. Pcbnew can open and convert (effectively import) a P-CAD ASCII file using File > Open with the option on the bottom right of the dialogue box set to: "P-CAD 200x ASCII PCB files (*.pcb)". Bug 1545668 (now apparently resolved in the development branch) concerned this not working under Windows if the filename extension included uppercase. Now this is solved, I can see that the import operation is better than with Kicad 2013-07-07. However, there are problems:

1 - Reference and value fields are set to "invisible".

2 - Text (on copper layers or elsewhere) which is rotated and/or mirrored is placed, with the correct rotation and mirroring, far away from where it should be.

To demonstrate this, the following file was created by importing a Protel Autotrax for DOS file into Altium 16.0.6 (30 day trail version) and exporting it in P-CAD ASCII format:

http://www.firstpr.com.au/temp/kicad-bugs/P-CAD-conversion/S1000MA-1992-09-08-via-Altium-P-CAD-ASCII.pcb

If I import this into Eagle (recent free trial version) and save as an Eagle file, then open this with Pcbnew, I get a pretty good conversion:

http://www.firstpr.com.au/temp/kicad-bugs/P-CAD-conversion/S1000MA-1992-09-08-via-Altium-P-CAD-ASCII-imported-into-Eagle-read-into-Kicad-4-0-1-looks-correct.kicad_pcb

However, the overlaid reference and value text in the above file is largely or entirely due to this being so in the original Autotrax design.

When reading the P-CAD ASCII file into Pcbnew, as described above, the problems are visible in:

S1000MA-1992-09-08-via-Altium-P-CAD-ASCII-read-into-Kicad-4-0-1-ref-&-value-hidden-rotated-&-mirrored-text-shifted.kicad_pcb

The shifted text could be manually fixed, but it would be great if the converter did it correctly. I haven't closely scrutinized the rest of the results, but I think the rest of the conversion looks good.

Related branches

Eldar Khayrullin (eldar) wrote :

Partial fix bug

Changed in kicad:
assignee: nobody → Eldar Khayrullin (eldar)
Robin Whittle (rw-p) wrote :

Hi Eldar,

Thanks for these patches. I have not yet been able to compile Kicad, so I will keep and eye on the code at:

https://github.com/KiCad/kicad-source-mirror/tree/master/pcbnew/pcad2kicadpcb_plugin

and when I see that your patches have been committed, I will wait for a new nightly release and test that.

  - Robin

Eldar Khayrullin (eldar) wrote :

Although mostly working correctly. But patches need fixing. I delete them for fixing

Eldar Khayrullin (eldar) wrote :

Rejected patch from main branch

Eldar Khayrullin (eldar) wrote :

I am looking for good realization of first patch without magic numbers

Eldar Khayrullin (eldar) on 2016-02-22
Changed in kicad:
status: New → Confirmed
Eldar Khayrullin (eldar) wrote :

New patches subset

Eldar Khayrullin (eldar) wrote :
Eldar Khayrullin (eldar) wrote :
Robin Whittle (rw-p) wrote :

Hi Eldar,

Thanks for your speedy response. I had some trouble getting the after-patch.kicad_pcb file from this site, but it works now and the results look good, though this is not my board design so I don't know exactly how it should look.

The latest nightly BZR 6579, Git 8cb1f39 does not seem to have your patches and I am not yet able to compile Kicad myself, so I am not yet able to evaluate your patches with my P-CAD ASCII files exported from Altium.

Robin

Eldar Khayrullin (eldar) wrote :

Not ideal yet but fix a bug

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

Other bug subscribers