Wishlist: quick extrusion of 3d models for footprints

Having spent some time dealing with 3D models in KiCad, there is something I would really, really like to see in KiCad.

I’d like to have an option to quickly add a simplistic 3D model by extruding a closed shape from the PCB to a given height and assigning the resulting 3d shape a single color (by default: black). The way I’d implement it is by adding another layer in the footprint editor, call it “Extrusion”. A closed shape painted in that layer can be extruded to given height with a given color.

That way people could automatically fulfill 95% of 3d model needs: most of the time you just need simple extruded forms for chips and capacitors. And it would be very, very quick — just draw the outline, specify the height and your 3d model is already positioned.

Hi @jwr

I am one of co-authors of 3d-viewer. I had a similar idea like yours too. However I didn’t make any propose to the development mailing list because I know that feature will need to add information in the kicad footprint files. Kicad developers are at this stage very conservative to make any changes in their file format, that I understand.

However, you have already a (not so elegant) way of doing something similar. If you do not want model something you maybe just add a dummy unitary size 3D box and in the 3d model transformations you can scale it to the size of your footprint (so it will be a rectangular box with your chosen weight)

If you dont like / know how to model, you can also create by hand a VRML file. It is an easy way for a developer to add vertices and materials to it.

Maybe you can ask @maui to develop a script to generate it from the board footprints :wink:

1 Like

@jwr
I remember I asked something similar to the dev mailing list, before starting to develop my exporter…
kicad already can generate bounding boxes for 3d models, but those data are not easily available for the exporting routines…

so I started to develop my way to MCAD :smile:

@jwr @kammutierspule
kicad StepUp can generate already bounding boxes of the models;
moreover it is possible to tell the exporter to skip model with a volume less then a desired value
so you can have the board with ‘real’ connectors, bounding boxes of big models and skipped the smal ones…


in all this exporting process, the key is the STEP model library…
I asked already to the developers to add a repository with 3D models generated from FreeCAD or just in STEP and VRML, and it seemed they were positive, but nothing happened…
library of 3D FreeCAD models
Consider that probably, when the new 3d refactoring will be ready, all VRML models will be useless (in term of mechanical exporting) and kicad devs will have to start a repository of 3D mechanical models (probably in iges format)…

Just one more info on kicad StepUp script…
If you need only board and connectors, you can add to the 3D lib only those parts, and the kicad StepUp exporter will do the job, skipping missing parts.
here you can see Arduino Uno board and enclosure exported from kicad to freeecad by kicad StepUp, for 3D collision detection

Well — it’s not that I don’t know how to model — I do quite a bit of work in Solidworks. But my time is not infinite. The current way of attaching 3d models to footprints works, but is very time-consuming. I won’t use it for most of the parts, because it’s too much hassle.

As for adding to footprint files, I’d say it wouldn’t change or add much. You’d get some additional fp_line/fp_arc/fp_circle entries on a layer (say, Extrude.User, or Model.Extr). The only other piece of information is an alternate model specification, where instead of specifying a .wrl file with at/scale/rotate you only specify (model-extruded (thickness 1.4) (color “#000000”)).

Really simple, and really useful.

@maui if I understood correctly @jwr we wants to generate from the footprints, not the 3d models. So at that point there are still not 3d models to generate bounding boxes.

If you mean the bounding boxes 3d-viewer, those are the bounding boxes of the 3dmodels, not from the footprint information.
Actually what @jwr request was to generate that information from a new layer where he draws a 2d shape that can be extruded.

I was thinking that would be easier to get automatic information from a footprint (pad shapes) and extrude it to 3D…
I believe Altium have some kind of add simple 3D shapes to it… but I am not sure if that would be useful in relation of the development efforts :
http://techdocs.altium.com/display/ADRR/PCB_Obj-3DBody((3D+Body))_AD
http://documentation.circuitmaker.com/display/CMAK/PCB_Dlg-3DBody((3D+Body))_CM
extruded(box?) Cylinders…Sphere…

I know that was his approach, I just wanted to say that internally kicad already knows everything (bounding boxes) without having to add anything …

I could get some info from silk screen of the part, but I wouldn’t rely a lot on that and moreover I would miss model height…

anyway, all the basic models can be reached or on my 3D libs, or on on-line libs and then the main focus, IMO, is to build a reliable lib of 3D models usable also for mechanical purposes… as I already pointed out, a 3D mechanical lib would be necessary also for the new 3d refactoring approach…
I would stay on STEP 3D mechanical lib :smile:

I don’t think that would work in the general case. Let’s take an example of a footprint I’ve just created yesterday:

The pads won’t tell you much, but if I could draw the 3x3mm chip outline in addition to the current silkscreen markings and tell KiCad to just extrude it to 1.2mm above board, I’d be done.

This could probably be automated with OpenSCAD to a large extent.

Now compare this to the current process of creating and adding a 3d model. In this particular case, I just used an existing 3x3mm QFN model, where the pin layout doesn’t match mine, but then I have the height wrong.

Actually, as I thought about this more — if only KiCad would let me draw things in one of the Dwgs.User, Cmts.User, Eco1. User or Eco2.User layers and actually store the result in the footprint file, I think I could McGyver the rest of the solution myself.

E.g. write a script that would parse the footprint file, generate OpenSCAD input, use OpenSCAD to produce a 3d model, convert it to whatever is required, modify the footprint file to reference the newly created model.

But I do need a way to draw an outline that will be extruded and that outline needs to go in the footprint file.

Unfortunately what you describe can’t be done within KiCad at the moment. Discussions about assigning more technical layers for specific purposes rarely result in something useful; typically you need a very good plan to have any hope of changing something. I couldn’t even get agreement to make the Edge.Cuts layer an ‘outline’ layer and add a ‘cutouts’ layer.

At the moment the closest you can get are:
(a) use LibreCAD to create the outline and run the ‘dxf2idf’ tool to create an IDF outline which you can associate as a 3D model.
(b) create the outlines manually via scripts or the idfrect and idfcyl tools

What you describe would enable IDF support within kicad itself but it requires the addition of metadata to the file (extrusion height) and I think it would be a challenge convincing the devs to add that to the file format. Anyway, if you want such a feature you should discuss it on the dev list; if you filed it as a wishlist item on the bug tracker it would likely never be discussed.

Yeah I know… that would be just a guess.
Anyway that would be a non standard design flow.
I maybe one day could suggest that (similar to altium) you can add some automatic 3d shapes (boxes/cylinders/etc) and it will create a model file (ex: VRML…etc) to your project folder and associate that file with the selected footprint. This will not need any change in current kicad format.
Maybe what you suggest could be implemented also in 3d-viewer selector, so you can draw your rectangle and select the extruded height.
But we are sill far way from could implement this :blush:

Anyway(2), I think you have at moment already some quick ways to archive the same results. As I suggest you can create a dummy box and add it to models, then you can scale it to fit the footprint the way you want. You can use the @maui script and freeCAD… or maybe spend a bit of time selecting the proper models to your footprints :wink:

1 Like

This is pretty simple, elegant and fast and works right now without any changes to KiCAD. Cool Idea!

Feel free to use where ever you see fit:
_box.wrl (8.6 KB)

Test on a usb FP I just opened with an added 3.4x3.4 silkscreen to see if it fits (and that I had the _box.wrl scale right in the file):

1 Like

That’s it! … it will work same way for cylinders

Wow, this is a spectacularly good idea. It gets me 80% of what I need without any work at all!

Thank you!

I’m repeating myself, BUT — this idea works really, really well. It took me several minutes to update all of my new components with these simplistic 3d models. If your footprint is well aligned (as it should be) with the origin right in the middle, adding a 3d model is just a couple of clicks and entering the three dimensions, which are easily found in the datasheet.

This is how I’m going to add 3d models for simple parts from now on. I wish things like this will make it someday into the official KiCad software. Simplifying things is important, especially for people who do not live in KiCad everyday and only have limited time to deal with it.

Thanks again!

Since you liked this tip so much, I will give you another one: you can add multiple model entries in kicad footprint… so you can “extrude” multiple blocks (with different xy scale… z… ) so you can better optimize with blocks your 3d footprint. … Something like a castle in minecraft game :smile:
http://www.minemaarten.com/wp-content/uploads/2013/08/PCB-Recipe.png

I used to add a cube with dimensions as the edge to export pcb bare board when vrml export didn’t export the body to get some mechanical result…
kicad can be tricked usefully! :wink:

@jwr
recently I added to kicad StepUp the feature to create boxes or cylinders using dimensions as in scale values of wrl model

This feature will be triggered only if the wrl models have the following names:

  • box_mcad.wrl
    
  • cylV_mcad.wrl
    
  • cylH_mcad.wrl
    

if the kicad StepUp tools will parse these special names, correspondent models will be generated in FreeCAD using the dimensions as per the scale values indicated in the kicad_pcb file.
the 3 special wrl models are in the “shapes” folder of the demo project, or just download them from here
cylV_mcad.zip (2.8 KB)
cylH_mcad.zip (2.7 KB)
box_mcad.zip (407 Bytes)
that is adding the ability to use simple generic shapes to generate parametric bounding box models both in ECAD and MCAD environment…
then it is possible to export to STEP the board with its 3D parametric simplified models
Maurice

2 Likes

thanks mates :wink: this is a very quick and easy solution. The only thing that bothers me is that the 3D shape offset can only be set in inches :weary: hope this can be changed

@suckiden
in the new 3d that Mario is going to merge to the main branch, the offset can be assigned in inches or millimeters, just depending on what unit is selected to route the board…
anyway you may consider to use this tool to visually align the 3D model to footprint

Moreover the alignment would be in a MCAD environment where you can
align the model to the footprint with i.e. plain or circular constrains
as in a MCAD manner…with kicad StepUp tools you can also use FreeCAD
assembly2 WB to align the model to the footprint getting all the benefit
of MCAD constraints tools…
Maurice

1 Like

This ‘simple 3D’ pathway came up again here, and as mentioned above, adding new layers to KiCad is not trivial or quick.

However, I remembered seeing someone who encoded height in linewidths, (nifty) and I tested PcbNew, and find it can store and plot to 6 decimal digits mm.
That allows (eg) first 2 digits for real linewidth, and the remaining 4 digits can encode height, to maybe 99.99mm fixed point, for simple extrude outlines. (More complex shapes use the usual 3D flows.)

Libraries are backward compatible, and plot fine in 2D with the hidden 3D essentially ‘lost in the noise’ if not extracted.

PcbNew also can use Gerber Plot Dark & Plot Clear commands to remove silk outlines from Pads, which permits outlines on Silk layers to be extruded via 3D gerber viewers, like ZofZPCB.