Replacing default KiCad (?) 3D model with an external model

Hi everyone,
I am trying to replace a standard (I believe default 3D model offered by KiCad) 3D model available in KiCad lib by a 3D model imported from an external source. For this I have attempted the following steps:

  1. select device in KiCad Pcbnew and enter edit mode by pressing “E”
  2. Select 3D settings tab
    One can now see the deafult 3D model available in Kicad lib. However, this model cannot be removed or deleted.
    And, if one proceeeds (still in 3D settings window) with:
    • –> enter file path --> select the relevant step file --> OK
      one can get the new imported 3D model but it overlaps the existing 3D model. I can’t get just the imported 3D model.

My question: How can one remove the existing (default?) 3D model please?

For ease of understanding, I have attached a word file here with two screenshots.
200124 3D-model issue.docx (353.5 KB)

Thanks for your help in advance.
Best regards
starter99

You shouldn’t modify the default KiCad libraries. Rather you should copy them to your personal libraries and make modifications to them.

Depending on your system the default libraries may have been installed to a location where you don’t have write priviledges. Then you can’t even save your modifications to the library. It’s still possible to modify the footprint directly on the board.

You have opened the footprint directly from the board and it’s possible to delete the 3d model. Select the row and click the trashcan icon.

image

@eelik
Thanks for your quick response.
I had already tried what you have suggested i.e. select the file path of the default 3D model in 3D settings and hit the trash can.
The only effect it has is that there is no 3D model path available (visible) anymore but the 3D model remains as it is. Undeleted!

So, unfortunately I am back to square one.
Best regards

“Works for me”. What’s you KiCad version, copied by clicking Copy Version Info in Help->About.

@eelik,
My KiCad version info is as follows:


Thanks for your help.
Best regards

I’m not sure but it looks like you have misunderstood what you see. This here

image

is not the model of the part. It’s 3D view of the example piece of a board with the footprint. Maybe you didn’t see a model there to start with and thought this was the model? In the official footprint library every footprint has the corresponding 3D model name even if there’s not such 3D model file in the 3D model library.

Then you have added the external model which isn’t rotated correctly for the purposes of KiCad. You have to rotate it yourself and set the offset. The board/footprint of course helps with it.

Even better option is to use FreeCAD with StepUp workbench, open your model, open your footprint, rotate and move the model and export it to wrl + step models which can then be used in KiCad without rotating or moving. But this needs some learning.

2 Likes

I did this recently for a LED display. I found a suitable model on GrabCAD. Rene’s FAQ explains the process. That looks like a barrel socket so you should be able to find a 3D model easily.

1 Like

I did this recently for a 3mm KiCad LED model. My footprints for LEDs have the origin in center and not at pin 1 just to have the same position for LED as the hole position in box.
I did that because I have read that it is better to have all 0s in 3D model parameters in KiCad. Don’t know yet why.

That’s just part of KLC requirements. If you want your footprint to be accepted to official library you will have to supply correctly scaled model that has all 0s in offsets and all 1s in scale.
But for your own libraries you can do whatever you want.

1 Like

Thanks eelik. This certainly was a misunderstanding on my part. Thanks for clarification. This brings me a step further.

Actually I have tried to rotate the model on every possible axis and at various angles - but to no avail.
I can only rotate the whole “overlapped structure” with left mouse click but this is certainly not the goal.
Rotation attempt on any axis is just as fruitless as trying to delete the default KiCad model. I wonder if instead od deleting the default 3D model, in future an option to deselct it by unclicking the checkbox is under planning?

B.t.w, did my KiCad version information give you any clue as to why deleting default 3D model works for you but not in my case?

Anyway, I will now try to read and understand Rene’s FAQ as mentioned by Kenyapcomau first and then attempt the 3D model integration again. After all 3D model is a nice feature to see how the populated PCB may look like but it is not mandatory to complete the design and have the PCBs made.

Thanks again and best regards

FreeCAD takes some getting used to. Make sure that only the imported model is selected in the LHS, not both components. I used the control panel to rotate in XYZ axes rather than mouse actions, as I only needed 90° steps, and FreeCAD supports various bindings and you have to know which set is in use.

This was the result I got:

You rotate by first selecting the 3D model file path line and then modifying the values.

I have to object to the “never modify” part. I generally have to apply inch to mm scaling due to some inconsistencies. Tried to use mm for export but somehow things get weird and I can’t even scale properly let alone 1:1.

So sometimes you may have to apply 0,3937 scale to these values. Just keep it in mind for imperial/metric problems.

Edit: I see this on VRML files. Never had a problem with STEP.

Yes, that’s true, .wrl files may need scaling. It should never be done to step files.

1 Like

I think you missed what @eelik pointed out.

You may have your footprint in a read-only folder.

On the other hand, you may have missed what was pointed out in the rest of the discussion. There was no real problem with removing the model - there wasn’t a model to start with. But it’s not clear to me if @Starter99 confirmed that or not.

Let’s go through this again.

  1. There was a file path line in the dialog giving an impression there’s a 3D model attached.
  2. There was a 3D “model” visible, but it was only the green board, copper pads and silkscreen lines.
  3. That visible “model” was interpreted as the model pointed to by the file path, although it was not that.
  4. Deleting the file path deleted the file path but nothing in the view.
  5. Therefore it was thought there’s something wrong.

But there’s nothing wrong. The file path may point to a non-existing file, in which case only the board and the footprint are visible in the 3D view.

@Rene_Poschl may say what he wants, but having non-existing 3D models in the footprints is confusing and counterintuitive. However, it would be OK if there was some indicator telling that the model doesn’t exist.

Because whining doesn’t help, I added a bug report: https://gitlab.com/kicad/code/kicad/issues/3815.

I fear this is a confusion users will need to live with. I know of no better option (with the current KiCad feature set) that allows us to serve 3d models as it is unreasonable that any model addition would also require changes to footprints (We simply do not have the resources to manage that).

In the past there was an error message reporting any missing 3d files. This resulted in a weekly bug report on the library repo where we needed to explain that yes footprints are prepared for a model but the model is not provided. So i doubt having an error message is the way to go as it causes a similar confusion.


I would argue that the KiCad footprint settings for scaling should not even be used for wrl files. The correct way to do it is to scale the model correctly inside the CAD software used to create it. (freecad stepup does this already)

Otherwise, you are stuck with wrl and only the possibility to make pictures for your marketing guy instead of having the option to export step for your fellow mechanical engineer

1 Like

Maybe we should step back and look for the cause. Since exporting STEP does not crate a nice looking model, I generally use VRML for visual purposes. Last time, to prevent scaling I’d chosen mm for the VRML export. It was a daughter card and I’d imported it for the base card. Scale was different and using classic inch/mm scale hadn’t worked.

It could be me, but I still feel something could be wrong with VRML export.

And yes, using freecad for scaling could be better, but I think STEP is the way to go for a mechanical engineer. (As I’m both mechanical designer and hardware engineer :slight_smile:

Import the daughter card into freecad with stepup -> reexport the step plus correctly scaled wrl model for kicad. You get a model pair working for both usecases this way.

1 Like