LED colour other than red?

Just curious, not expecting a solution, and it’s not essential. I see all my LEDs are red in 3D. Any chance of having them in other colours? Not even sure how to specify this without an explosion of variants for multiple colours. Are parametric models a solution? I have no idea how the colour parameter could be passed to the renderer.

Sure!
The 3d model is linked to the footprint by the path in the 3d settings tab of the footprint properties.
Then, download or create a 3d model of the LED with the colour you want, save it in the 3d models library (in fact any folder in your system will do) and change the path of the footprint accordingly to the location of this new 3d model.

Yes, but “how to specify this without an explosion of variants for multiple colours” as I asked? Just for example I have 3mm and 5mm round LEDs in red, green, amber, blue, and clear, that makes 10 variants I have to create (well, 8).

As far as I know, step or wrl models don’t support multiple variants in the same file. I use 6 files for the same LED in green, red and yellow, 3 step models and 3 wrl models.

Maybe someone more expert has the solution you like.

Well the alternative would be to make KiCad smart enough to assign colors to models with default materials… so you might have an LED be black and grey, and KiCad would recolor the grey LED to whatever color you wanted arbitrarily. And that would cut you down from several step/wrl models down to just the wrl/step pair and an RGBA value in your schematic/netlist.

I have a number of coloured LEDs in my library - you only need a .wrl formal file to benefit from the rendering. Thanks to @maui - using his StepUp workbench in FreeCad making alternative coloured versions is pretty easy - but it doesn’t reduce the number of models you need.
Now, you will need to have the coloured LEDs you propose to have functional SPICE representations - so that they blink nicely too when simulated :slight_smile:

1 Like

Is the use of through hole parts usage dropping to the point where we can’t ask for color coded resistors? :wink:

What, like these from @kammutierspule ?

2 Likes

Hi Ken!
The most elegant way of doing this with KiCad, is the following:

  • create one single base LED model without the color (eg without the color glass volume), only body and pads, etc.
  • create multiple simple models for the glass color (eg a cube or something colored), for each color you want. This can be easier with WRL as you can easily manually change (editing the file with a text editor) the color (I guess its the same for STEP too).
  • create a footprint file for each color variant. assign the 3D common model of the LED base. assign the glass color for the LED. Duplicate the file (with your explorer system) and text edit the file to change to other glass colors you created.

The main idea of this process is just to save space (EDIT: and KiCad 3D cache load speed!) and work by creating a single body and then just add simpler models with the color. Also if you are not a 3D software or KiCad expert, you can easily text edit the 3D files and footprint to make the variants

Please let us know what solution did you get!

I would do it slightly differently. My technique would work because one can have multiple 3D model files on an individual footprint. Similarly to yours I would have a base LED model, probably including the lead frame, silicon wafer and bonding wire. Then have a set of secondary models with different colors, shapes, sizes, and transparancies. The base LED footprint will only have the base model, and then either based on a script or by hand add the appropriate lens model to the footprint on the board.

One could also do something similar for resistors by adding the color-band models to the footprints on the board based on the value.

Sadly, I have neither the 3D modelling skills, nor the scripting skills to pull this technique off.

1 Like

It would be nice to have the following implemented, so to behave similar to other ECADs:
Link multiple 3D models to one footprint (kicad bugs)
Visibility control of 3D shapes in footprint (kicad bugs)
and a related discussion at GH
https://github.com/KiCad/kicad-packages3D/issues/388

and some proposal at GH
opacity option (FR)

and kicad launchpad bugs
Add Opacity property for 3D models

1 Like

I think I proposed the same thing :slightly_smiling_face:
I mean it when I said create a kicad footprint and “assign” the base model and lens colour to the footprint 3D shapes lists.

So in summary, there are two options: create the variants on the KiCad footprint (the one we described) , or create the variants on 3D files.
This last case, the variants on 3D files, works best with WRL files because you can include external files to it, as I did on my resistors as refer by

Please let us know what solution did you get!

I’m not going to do anything, nor do I have the skills to do so, it’s just cosmetic. I’m the only person who admires my 3D renditions, and I’m a lazy person. But I do think the idea of being able to pass parameters to 3D models because of the DRY principle is worth looking into as evidenced by you and other people working on it.

Sometimes there are simple to implement and nice ideas to have in KiCad.
The things is that this kind of things will need some structural changes in the KiCad features and perhaps sourcecode. ie. the way it must be implemented and work (for user), it must be supported forever in all future KiCad version without break compatibility.
So this would need lots of thinking and discussion until a lot of people are happy and secure to approve what would be the best way future proof solution.

I admire all 3D renders created with KiCad :stuck_out_tongue: please share with us!

Here’s one I provide only because it illustrates other issues I didn’t mention. In actual fact I’m not assembling this on a Kicad produced board, I’m using perfboard. That’s why it’s missing a lot of things normal for PCBs. I used Kicad only to draw the schematic and did dummy placements and routing to determine the best positions for the chips for minimal wiring.

The top row of LEDs is supposed to be green, the middle row of LEDs red, and the lone 1 Hz LED at the bottom amber. This is why I wanted different colours.

The rectangular LEDs are supposed to be the colour for the row as above. Their shapes came out more like buttons. Another glitch in the models?

Why perfboard? The ICs in question are DTL chips made about 50 years ago. The design is a binary clock. I have only enough chips for one clock so I just need one board.

1 Like

thanks for sharing!
looks you are using another 3D model shape for it…

Hmm, looks like you’re right. I thought flat top meant the rectangular area was flat, but it’s the top of the cylinder that’s flat. I’ve found a better footprint for it.

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