Work in progress: Native Altium Importer

Hi,

as some already might noticed, I started working on an Altium Board importer, which is integrated in KiCad. This happens more out of curiosity than real need from my side ;). The current code can be found in this PR: https://gitlab.com/kicad/code/kicad/merge_requests/60/

Please note, the current version is in an alpha state (There might be Dragons), and most things do not work yet. Nonetheless, this is a current image of an imported LimeSDR Board:

As well as in 3D (is omitted the Silkscreen):

Known Bugs

  • No NETS assigned (I’m still searching where and how to parse)
  • Footprint sometimes have wrong pads, draw-segments attached
  • Many pad primitives are not correctly parsed
  • Board only has two layers on import (can be manually changed after import)
  • Don’t even think about design rules

If you are curious about the internals of Altium, now is your time to shine and help with the reversing efforts :wink: . I document the binary format using https://kaitai.io and you can find the specification in the PR. I have not started decoding the textual format contained in the *.PcbDoc but this should be easier to acomplish.

11 Likes

I know its not the point of your post but your board looks awesome man :smiley: the RF section looks like a piece of art and also the rest is tightly packed and all nicly in order.
One can see the effort ooze out…

No NETS assigned (I’m still searching where and how to parse)

Why not require the user to add a netlist file to the project first and just use that?

Well, that’s not that usefull if you only get the Altium project, but don’t have Altium.

Awesome! Keep up the good job!

One needs to start somewhere. Ever heard of a minimum viable product prototype? It does not need to fulfil all usecases.

I know that, and it’s amazing somebody started it.

It was meant as an answer to “Why not require the user to add a netlist file to the project first and just use that?”, should be “Why not require the user to add a netlist file to the project first and just use that, for now?” :wink:

1 Like

I don’t think I would build something like importing a netlist file. The idea is to have an importer for people who do not own Altium, like me.

4 Likes

I think the current state of the importer can be seen an minimum viable product prototype. I added support for NETs, Footprint anchor, detect board layercount, simple zones, and some bugfixes.

Bugs you will likely see:

  • Pad shapes “sometimes” wrong
  • No Zones (with exception of some rectangular ones)
  • It seems I missed some internal object handling stuff, because after save + load some UX problems are fixed.

If you want to try it, you need to build the project yourself at the moment: https://gitlab.com/kicad/code/kicad/merge_requests/60

Because I do not own Altium, it would be nice to get reports if things like dimensions and position of the elements are correct. Same with net-names and layer assignment.

4 Likes

Are you planning to import also libraries?
Some of manufacturers are offering footprint libraries in Altium but not in KiCAD format
i.e.

6 posts were split to a new topic: Should we expect manufacturers to provide library assets for KiCad?

Thanks, gonna test it in the next days.

I got first reviews, and the importer improved a bit:

  • support of roundrect and octal pad shapes
  • text improvements (line thickness, alignment, mirroring,…)
  • hide footprint designator / comment if specified in the boardfile
  • initial support for polygons

Next things to tackle:

  • Layer stackup
  • Design rules (at least know some clearances, soldermask,…)
  • supporting Planes?
  • keepout, hatched zones
  • interpolate arc tracks
  • more pad shapes (non-round hole, hole offset, …)
  • basic
  • more via types (blind, burried,… )

Because I do now own any Altium Product, it would be nice to have testfiles created by the community to support reversing. If your are interested, please generate Altium files where a single property is changed (like hole-diameter x/y). In case of the hole diameter example, place 4-5 different sizes on the board, and put a text label next to it denoting the measures. Ideally, also add a screenshot for comparison.

Based on such files, I can do black-box reverse engineering and find out how data is encoded.

2 Likes

Curved tracks is under work by @Seth_h, should you wait for native implementation instead of translating arcs to segments manually?

true. Import of curved tracks works at the moment, but kicad think nets are separated.

For testing, Altium can export PCAD files, which KiCad can import.
You can then compare the results.

Overall, PCAD -> KiCad works quite well, I’ve found issues in more subtle settings like zone fill priority, but the design rules & net names import ok.

An other option is to test the result comparing with the gerber files… often open hardware projects do offer the gerber files beside the altium source file.

1 Like