Associating 3D shapes by default

Hello!

I’m trying to experiment with the 3D shapes right now. It works fine, but is there a way to associate a footprint with a 3D shape by default?
I mean: having a separation between the logical and physical domains make sense. There are many parts in TSSOP8, for instance, and it’s great not to have to define for all of them what is a TSSOP8.
Hovever, between package and 3D shape, I suppose there is a 1 to 1 matching in most of the cases, except maybe in rare situation where the thickness of the chip may vary. And I think it would make sense to have the 3D model directly associated with the footprint.
Right now I have a board with 16 op amps. And I had to set the 3D model for all of them, which is a pain.

I have another question: is it possible to change the default solder mask color of the PCBs? Would be better than to redefine it for every single circuit.

Thanks,

Pascal

Many of the standard library footprints already do this. The path (using the KISYS3DMOD path variable) to a 3D file is an attribute set in the footprint.

The color for the solder mask is defined when you order the boards. It isn’t an attribute that is set in KiCad. Or do you mean the color in the 3D view? Last time I checked that is a persistent setting. I set mine to purple (because I usually order from OSHPark) in the 3D viewer a long time ago and it is still purple.

Colours can be changed in

3D Viewer | Preferences | Choose Colors

1 Like

There is a special section about 3d models in the Tutorial: How to make a footprint in KiCad 5.1.x (From scratch)?

And also in Library management in KiCad version 5

1 Like

I interpret roboya’s post as that he has made a 3D shape and knows how to work with it, but his problem is that he has to add the 3D settings to each of his 16 opamps separately.

In Eeschema there is:

Eeschema / Tools / Edit Symbol Fields

spreadsheet to easily copy attributes from one object to the other, and there is no equivalent for this in Pcbnew. (Hopefully it will come someday…)

At the moment the best workflow for this is to put the 3D setting for your component into the library of that object, and then:

Pcbnew / Tools / Update Footprins from Library.

It is important to realise that each component in Pcbnew is COPIED from some library into the PCB file, and from thereon it is a separate entity.
If your board has 100 resistors, and you move the silkscreen text of a resistor, it changes only for that resistor.
If you move or modify a pad on one of the resistors, only that resistor is effected.
This makes it pretty easy to make small modifications to Footprints, without having to bother with library management. Those small changes are often very specific for a project and not usefull to put in a library.

Another way to change the 3D settings of all your opamps is to simply edit the project.kicad_pcb file with a text editor, and copy the settings from one opamp to all the others. All KiCads files are text based and weird hacks can often be done relatively simply in a text editor. In a text editor, the complete definition of a (THT) resistor looks like:

  (module Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical (layer F.Cu) (tedit 5AE5139B) (tstamp 5C9BC78F)
    (at 180.078494 101.341256 180)
    (descr "Resistor, Axial_DIN0204 series, Axial, Vertical, pin pitch=2.54mm, 0.167W, length*diameter=3.6*1.6mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf")
    (tags "Resistor Axial_DIN0204 series Axial Vertical pin pitch 2.54mm 0.167W length 3.6mm diameter 1.6mm")
    (path /5C69C2AF)
    (fp_text reference R9 (at 1.27 -1.528744 180) (layer F.SilkS)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (fp_text value 4.7k (at 1.27 1.92 180) (layer F.Fab)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (fp_text user %R (at 1.27 -1.92 180) (layer F.Fab)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (fp_line (start 3.49 -1.05) (end -1.05 -1.05) (layer F.CrtYd) (width 0.05))
    (fp_line (start 3.49 1.05) (end 3.49 -1.05) (layer F.CrtYd) (width 0.05))
    (fp_line (start -1.05 1.05) (end 3.49 1.05) (layer F.CrtYd) (width 0.05))
    (fp_line (start -1.05 -1.05) (end -1.05 1.05) (layer F.CrtYd) (width 0.05))
    (fp_line (start 0.92 0) (end 1.54 0) (layer F.SilkS) (width 0.12))
    (fp_line (start 0 0) (end 2.54 0) (layer F.Fab) (width 0.1))
    (fp_circle (center 0 0) (end 0.92 0) (layer F.SilkS) (width 0.12))
    (fp_circle (center 0 0) (end 0.8 0) (layer F.Fab) (width 0.1))
    (pad 2 thru_hole oval (at 2.54 0 180) (size 1.4 1.4) (drill 0.7) (layers *.Cu *.Mask)
      (net 30 SCL))
    (pad 1 thru_hole circle (at 0 0 180) (size 1.4 1.4) (drill 0.7) (layers *.Cu *.Mask)
      (net 8 VCC1))
    (model ${KISYS3DMOD}/Resistor_THT.3dshapes/R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical.wrl
      (at (xyz 0 0 0))
      (scale (xyz 1 1 1))
      (rotate (xyz 0 0 0))
    )
  )

Even without looking at the documentation of the file format
https://kicad.org/help/file-formats/ it’s pretty trivial to identify most things. The 3D settings are on the bottom, with a filename, and settings for offset, scale and rotation.

Hello!
Thanks for your reply.
Yes, I was talking about the color of the 3D rendering.
I set it up to blue, but if I make another project, then it will be back to default green.
I know how to set the color, now how do I make it permanent?
Thanks,
Pascal

It has always been a persistent setting for me. I even just created a new project from scratch, opened up PCBNew and threw down a quick outline. I checked the 3D viewer and there was a purple board.

Maybe we are using different versions? I’m using 5.1.0-1 on Win10 64bit. What is your version and platform?

Hello!

Thanks for your reply.
The version I used when I made my first boards was 5.0, Then I switched to 5.1 when it was released.
So this was possibly changed by the new version, or my setup was crushed by the new install.
Thanks,

Pascal

Hello!

Thanks for your reply. I modified my 3D settings in the specific chips (opto QFN), and I’ll see what happens next time. But this means that for regular footprints, except the happy few, resistors, etc… the 3D models are not set. I was using plain op amps like LMV258.

Thanks,

Pascal

The LMV358 opamp (I don’t believe there is an LMV258) seems to come on a SOIC-8 package. If you are using a standard SOIC-8 footprint from the KiCad library, there is a linked 3D model for this - you can check the state of play for current 3d library models here - https://kicad.github.io/packages3d/. There are certainly more than a ‘happy few’. Placing that footprint should link that 3d model by default. If you are using your own footprint you obviously need to include a path to a 3d model if you expect it to be available.

If you are not seeing a 3d-model for a standard KiCad footprint, it suggests something could be wrong with your library setup. If you place a default footprint (for instance a SOIC-8) and look at the ‘footprint properties’ (e) what do the 3d settings say? Also @Rene_Poschl linked to some helpful advice in the FAQs previously.

You say you have modified your 3d setting for specific chips. You can do this at the board level which is tedious if you have lots of components or within the library. However if you make modifications within the library you need to be sure these footprints are saved in your own library with appropriate links and you are not modifying the default library. Otherwise your changes will disappear next time you update your libraries.

Hello John!

Tanks for your reply. It was indeed a typo: LMV358, not 258.
OK, things are getting better. There were path issues.
Yes, I try not to modify the default libraries.

Thanks,

Pascal

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.