← Back to team overview

kicad-developers team mailing list archive

update on IDF tools and patch

 

Hi folks,

 The latest IDF code has been checked for coding style and tested
for bugs. The patch I created will only make changes to the
utils/idftools directory, so it's safe to include in the main branch
and won't affect the rest of KiCad at all.

 The code is currently used only for the various IDF tools, but I
intend to rewrite the IDF export code and VRML export code to make
use of this new(er) codebase; among other things this newer codebase
fixes a number of bugs which I have found in the VRML and IDF
export code.

 I would appreciate some comments on what to do with this code in
the future. I would like to see it compiled as a shared library so that
the VRML and IDF exporter as well as the IDF tools can make use of it
without the bloat of static libraries.  Since the code will only be
common to the pcbnew exporters and the IDF tools, I thought that the
IDF framework code would be best placed in an 'idf' directory in the
top of the source tree if/when it is finally included in KiCad.

 In principle the new IDF code will also make it pretty easy to add an
IDF importer, but since no one has requested such a tool and I don't
need it, I haven't bothered to write such a thing.

 I tried to build and link the IDF code as a shared library but the
linking of idf2vrml failed with undefined references; after banging my
head on the desk wondering why cmake wasn't doing what I expected it to,
I gave up and built as STATIC. If anyone can see what I've been doing
wrong I'd appreciate some feedback on that.

 The patch, which includes 3 IDF files to demonstrate the idf2vrml
converter tool, is available at:

github.com/cbernardo/kicad-patches

 The patch file is kicad_idftools.patch

Features of the new IDF code:
+ full support for reading and writing IDFv3 files; exported files are
  strictly compliant with the standard, with the possible exception that
  blank lines are allowed for human readability (the standard is
  silent on this).
+ the IDF object is structured so that it's relatively easy to create
  IDF elements from KiCad elements and vice-versa.
+ IDFv3 support only. If anyone required IDFv2 support, it is in principle
  possible to extend the IDFv3 code to support this as well.
+ can stand alone: in principle this means that anyone else (gEda for
  example, or FreeCAD) can use the IDF code to implement IDF support in
  their software.

The idf2vrml converter:
+ can convert IDFv3 files into VRML files for visual inspection by the
  user. This allows ECAD users to check the files before sending them
  to MCAD users.
+ can write out VRML files which can be used as input to KiCad

- Cirilo



Follow ups