KiCad accepts the VRML format for 3D models and assumes dimensions are in tenths of inches. Wings3D is able to export the VRML format, so it can be used to generate the models. Wings3D is unit-less so the user is free to choose what unit a grid spacing represents. During the export process a scaling factor can be used. If a mm scale is assumed when using Wings3D, then a scaling factor of 1/2.54 (0.3937) is needed for the export to match up to KiCad requirements. KiCad uses the Z-axis as the vertical with X and Y forming an horizontal plane. Wings3D, however, uses the Y-axis as the vertical so it’s necessary to interchange the Z and Y axis during export in addition to any scaling factor. Both of these options can be set in the export dialog window in the Wings3D application.
For Mac users there may be a conflict with Wings3D over the use of the middle-mouse-button (MMB). On Macs the MMB can be used as a short-cut to show the System Dashboard. To clear this conflict right-click on the Dashboard icon in the Dock and set the preferences to stop using the MMB as a short cut.
Panasonic Push Button Switch Example
Use the dimensions from the spec sheet shown on the left to create the 3D image on the right.
To begin open and arrange the Wings3D windows as shown below. Use the scroll-wheel to zoom out to see the entire grid. Use the Window menu to find and show all the sub-windows.
Create the Switch Base
Right-click in the grid area and hover over the Cube selection. Note in the lower-left-corner of the window that 2 options are presented. The “L” option creates the default cube. The “R” option opens a dialog to create a custom cube-shape. Right-click the mouse and enter the dimensions of the switch base. It is 6mm square and 3.4mm in height.
The object center is placed at the 0,0,0 coordinate. Think of the grid plane as the top surface of a PCB. KiCad makes this interpretation. Move the switch base up 1.7mm. Select the cube body by clicking “b” on the keyboard then click anywhere on the cube. After selecting the cube, right-click and choose “Absolute Commands” from the menu and then choose “move”. Enter 1.7 in the “Y” position. Hit the space bar to deselect all objects.
Bevel the 4 corners of the base. Click “e” on the keyboard and select any vertical edge. Click “g” to select all the vertical edges in the ring around the base. Right-click and select “Bevel” from the menu. Take notice of the choices in the lower-left-corner. Click tab and enter 1.3 (this dimension is not critical). Hit the space bar to deselect all objects.
Create a 0.5mm metal ring on top by splitting the base in 2. Click “e” on the keyboard and select any vertical edge. Click “g” to select all the vertical edges in the ring around the base. Click “c” to connect the mid-points of the edges. The newly created horizontal edges are automatically selected. Right-click and choose “Slide” from the menu. Slide the edges close to the top (a side-to-side motion on the mouse is used). Click the space bar to deselect everything. Click “f” on the keyboard to enter face-selection mode. Select the top face. Right-click and choose “Extrude” from the menu. Select “Normal” and hit the tab key. Enter 0.5. Click the space bar to deselect everything.
Create a new color in the Palette. Right-click on the first available Palette location – one of the medium grey boxes. Select edit from the menu. Create a dark grey color by entering .33 in the “V” field.
Color the switch base. Click “b” to enter body-select mode and click anywhere on the base. Now click on the newly created dark grey color in the Palette to simulate the color of black plastic. Hit the space bar to clear all the selections. Using the scroll wheel zoom in on the top. Click “e” to enter edge select mode and select one of the short vertical edges at the top. Click “g” to select the ring of edges around the top. Click “f” to change the selection to adjacent faces. Click on the top face to include it in the selection. In the Palette, select a light-blue, off-white tint to simulate the color of the top metal ring. Hit the space bar. Zoom in on the thin ring just under the top piece. Click “e” and select one of the tiny vertical edges. Click “g” to select the ring of edges. Click “f” to select all the adjacent faces. Select Black from the Palette. Hit the space bar.
Name the switch base in the Geometry Graph window by right-clicking on “cube1” and selecting “Rename” in the menu. Name the object “Base”. Click the “eye” icon to remove the base from view.
Create the Button
Right-click in the grid area, hover over the “Cylinder” menu item and right-click. Create a cylinder with a height of 6.1mm, a top face of 3.3mm and a bottom face of 3.5mm. In the Geometry Graph window, rename “cylinder1” to “Button” and click on the cube icon to the left of its name. Select the dark grey color that was used previously. Right-click and select “Move” from the menu, then “Y”, then hit the tab key and enter 6.45 in the dialog. Hit the space bar and click on the “eye” icon in the Geometry Graph window to remove the Button from view.
Create the Leads
Right-click in the grid area, hover over the “Cube” menu item and right-click. Create a lead for the switch that is .5mm wide, .3mm thick, and 2mm in length. In the Geometry Graph window, change the name of the cube object just created to “Lead_1” and select the cube icon to the left of its name. In the Palette, select a medium orange color to simulate a gold-plated lead. Right-click, choose “Absolute Commands” and then “Move”. Change the Y-postion to -1 and the X-position to 2.65. Right-click on “Lead_1” in the Geometry Graph window and duplicate the object. De-select Lead_1 by clicking the cube icon and select the copy by clicking its cube icon. Rename it “Lead_2”. Right-click, choose “Absolute Commands” and then “Move”. Change the X-position to -2.65. Click on the eye icons of the Base and the Button to restore them to view. Hit the space bar.
Create Colored Material for Export
Click “b” on the keyboard to enter the object-body mode and select all the objects. It’s necessary to be in this particular mode in order to access the Vertex Attributes menu item. Right-click and select “Vertex Attributes” from the menu then select “Colors to Materials”. Materials are an important attribute needed for the VRML format. Without these and their color assignments, the color information will not be conveyed to the VRML export file.
Export the Model
Select Export from the File Menu and click the dialog icon to the right of the VRML selection.
Check yes on the Swap Y and Z axes and put the scaling factor of 0.3937 in the Export scale field. This model was done in a mm scale and Kicad is expecting 0.100 inch scale. There are 2.54mm per 0.100 inches so this model will be 2.54 times too large: 1/2.54 = 0.3937. Name the file “Switch_push_button” and click ok.
Add the Model to the KiCad Library
There is a “packages3d” folder in the KiCad install. Locate the folder and create a new folder in it called “my_models”. Place a copy of “Switch_push_button.wrl” in the new folder. It’s only necessary to place the *.wrl file in the folder but it’s customary to place the wings file there as well. To make use of the model select the applicable footprint and add the pathname of the model file to its 3D settings.
The Final Result