The master's thesis addresses the development of two Python plugins that serve to connect the FreeCAD and KiCAD programs. Such a connection solves the problem of synchronizing programs for electronic computer-aided design (ECAD) and mechanical computer-aided design (MCAD).
Both ECAD and MCAD are used when designing electronic devices. Switching between ECAD and MCAD programs and exporting and importing printed circuit boards (PCB) can be very time-consuming. Certain solutions for ECAD-MCAD synchronization already exist. One such solution is Altium CoDesigner, which is a plugin for an MCAD program. The plugin allows the transfer of the PCB to the MCAD program from the server via the Git tool. The geometry of the PCB can be changed in the MCAD program and the modified PCB is uploaded back to the server. In the ECAD program Altium, changes are then transferred from the server, achieving synchronization between the two programs.
The plugins developed as part of the master's thesis do not use a server but rather a direct connection of programs via a network socket. On the KiCAD side, a data structure is obtained which describes the PCB with the board geometry and footprints. The data structure is sent to the FreeCAD plugin, where the circuit is sketched and extruded as a 3D body, and the footprints are represented with imported 3D models.
The plugins supports changes in the board geometry and the position and orientation of footprints in both programs. First, data structures describing new changes in both programs are obtained. These data structures are merged to a single structure. When resolving conflicts, changes in KiCAD take priority for footprints, while changes in FreeCAD take priority for board geometry. The PCBs in both programs are updated based on the merged changes, achieving synchronization.
In the case of an unsuccessful synchronization, the connection between plugins is terminated. This forces a new PCB to be sketched and extruded in FreeCAD upon reconnection. If the PCB already exists in the FreeCAD document, the existing PCB is removed, and the new PCB is moved to its place.
Multiple instances of the plugin can be opened in a single FreeCAD document. Each instance can be connected to exactly one instance of the KiCAD plugin. This allows working on multiple PCBs at the same time, facilitating easier design of a more complex assembly of the electrical device.
|