← Back to team overview

kicad-developers team mailing list archive

VRML assembly tool

 

I have created a tool "vrmlstitch" which is part of my parametric VRML model kit.  The tool takes an input file which contains the following:

+ base output filename
+ global transform parameters
+ input VRML model filename (part filename)
+ part transform parameters
+ ... more part filename + transform parameters

The tool then writes out an assembly which can be used as a  component within KiCAD. For a trivial example, a DIP socket + DIP chip can be combined into a single assembly to use in KiCAD. Such an assembly would allow a user to specify a single model file for the 3D model rather than adding the socket model and DIP model along with separate transform parameters for each instance in the PCB.

There are a few caveats of course:
- to ensure that the KiCAD 3D viewer works with the assembly, the entire contents of each model file are written into the assembly file.
- copying is inefficient; for example, if you included 10 DIP8 chips, the DIP8 model will be copied 10 times. This is done to keep the KiCAD 3D viewer happy (the 3D viewer does not like actual transform parameters in a model file)
- *very important* The tool has no concept of copyright so for each assembly produced, the comments at the start of the VRML file must be checked and edited if necessary to show any copyrights.

I have only tried the tool with a few of my own models and a few models from the KiCAD distribution.  If any bugs are encountered, please let me know. If you try the tool on some models and do not get the expected results, please describe the problem and provide information such as the input file and models used.

A sample file created by this tool is on my project's SourceForge download page:
http://sourceforge.net/projects/kicad3dmodels/files/models_v0.3/

file:  CCR_0W25_J_I400H_1R_20121105.tar.bz2

At the moment the source code is only tested on Linux, but the vrmlstitch code should be 100% portable (some tools in my project use GNU getopt and are not portable). The code can be pulled via git; I have not released any source tarballs:

git clone git://git.code.sf.net/p/kicad3dmodels/code


The only dependency for building the tool is the availability of CMake.

A sample input file can be found within the source code in the directory scripts/vrml/resistor/stitch/

- Cirilo