Hi, if you can share the already created kicad files for this oled (footprint and 3d wrl and step files) I would really appreciate it.
Hello, and thanks for the informative tutorial.
I tried creating a simple connector, and saved it as a *.wrl file, and have gone to the Footprint Properties and added the path to the 3d Shape.
But, when I open the 3d viewer, the new connector does not appear anywhere in the field of view.
I have discovered that, even after using the Footprint Properties and “successfully” saving the footprint to the current / active library, if I…
- choose the connector from pcbnew and then
- open “Properties” of that footprint in Footprint Editor,
the 3d shape file does not appear to be associated (is not shown) in the 3D settings tab.
What am I doing incorrectly?
Appppparrrrrrently, I need a deeper & better understanding of the “library” structure of KiCad.
You missed one step: update the footprint in the layout.
The layout has a copy of the former footprint, the one without the path to the 3D model. Update the footprint with the new version you have saved in the library.
Pedro: Thanks for the suggestion. I am still having issues after having used the dialog panel (below…) and choosing (for the sake of completeness) to Update All Footprints.
The 3d viewer still does not show the image of the component (not even in the wrong place…I could deal with that!).
Also, even after successfully saving the Footprint which had included the link to the 3d image (as a *.wrl file), when I inspect the properties of the Footprint by choosing it from the PCBnew layout, it does not have a 3d image associated with it (even though the entire board’s footprints were Updated).
It seems a misspelling word in the path, the library, etc.
Anyway, if you want to share the footprint and the 3d model I (and anyone in the forum) can take a look to see what’s wrong.
I don’t think that mis-spelling or other typographical errors are the problem. Here is why:
- I was working on a different schematic and board yesterday.
- The new board included ONLY components from the KiCad GitHUB libraries that were installed when I started using KiCad.
- After my first routing, I used the 3d viewer and all the components were displayed. There, I noticed that one of the inductors (a torroidal coil) seemed huge. I had in fact chosen the wrong footprint.
- So I changed / exchanged the footprint by choosing it in PCBNew, and employing the Footprint Editor.
- The outline on the board changed, and so I moved the outline around, then did the export/import routine to apply FreeRouting. So far, so good.
- When I view the newly-autorouted board in “3d Viewer”, the outline is correct but the 3d shape of the torroidal inductor does not appear. Another (smaller) torroidal inductor from the same “3dshapes” folder DOES appear in the 3d view. So it seems that the PATH has been set correctly!
- Reverting to the PCBnew, choosing the footprint and opening the footprint in Footprint Editor, I see from the Properties that the link to the *.wrl (3d image) file is correct.
- I can view the *.wrl image in Solidworks—so it exists and is uncorrupted.
I am guessing—and it is only a guess— that there is some sort of bug such that, if and when the footprint is edited, there is a dangling file association (and so, a file conflict) with the old footprint’s *.wrl file… Not knowing how to resolve the conflict, KiCad’s 3d viewer chooses to display nothing at all.
Does this seem like a logical conclusion?
It has never happened to me.
I don’t use the github repositories for normal use. I have a copy of the libraries in my hard disk. So I can’t help in that way.
Could you send a picture of the Footprint properties->3D settings of the footprint with the issue?
That doesn’t prove anything to be honest. Solid works could simply have a more powerful wrl viewer than kicad. (But then again it is a good indicator that there is at least something there)
There is not really a global searchpath for 3d models. Every footprint sets up its own model in its “3d preferences” section.
The path setup in the footprints settings can use a path variable.
In kicad 4 the use of a path variable is implicit as it takes relative paths to be relative to whatever directory KISYS3DMOD points to. Absolute paths should however always work. (Using path variables “only” add to flexibility. But they also increase the problems you could face.)
The best way to be sure is by opening your footprint in the footprint editor. View it in the 3d viewer. If you see the 3d model there then the model is ok and the footprint is setup correctly.
If not then we can guess that either the model is not ok for use in kicad or the path is incorrect.
Lets investigate the path.
- Open the 3d preferences of the footprint (the 3d settings part of the footprint preferences dialog)
- click the add 3d shape button
- a file browser opens. Navigate to your 3d model and select it.
- double click or single left click on name followed by clicking open
- In kicad 4 if you add a model from somewhere below KISYS3DMOD the resulting path will only contain the relative part compared to that variable.
- In kicad 4 if you add one outside of where KISYS3DMOD points to you are asked if you want a relative path. (My suggestion would be to say no here as less can go wrong)
- Click ok on the 3d preferences dialog.
- Check the 3d viewer again. If you still can not see your model then there must be something wrong with the wrl file. (There are multiple standards for wrl. Only one of them is supported by kicad.)
The safest way to generate a valid wrl file is by using freecad plus kicad-stepup. (Meaning export your model as step from solidwors, import that into freecad and export valid files using stepup.)
Hello, Rene:
Thanks for working with me on this issue. There is some new information in this reply-
I should note (for the sake of anybody new to this Thread) that I am using KiCad v4.0.7 on an up-to-date Win7 Pro SP1 64-bit platform.
When reading through your reply, I tried to follow the instructions…
“Open the 3d preferences of the footprint (the 3d settings part of the footprint preferences dialog)”
It took some time to figure out that the '“footprint preferences dialog” referred to is in fact the Footprint Properties dialog (accessed via the Edit drop-down menu). [* see related footnote, at end of this Reply]
I have, In fact, been using the Footprint Properties dialog as you suggested. Last night (prior to receiving your Reply) I was continuing to grind through this problem, and discovered that one can view the PCB footprint and its associated 3d model---- independent of the PCBNew board you are creating---- using “View >>> 3D Viewer” .
That discovery was a big step in troubleshooting.
Having said that, I checked some of the 3d *.wrl models and their associated footprints I was having problems with. Viewed independently of the PCBNew project, the footprints and the *.wrl models were properly associated (but, alas, not always correctly scaled and oriented in 3d-space; the latter are details that I am not primarily concerned with in this Thread).
I also went so far as to create a dummy {footprint + *.wrl} association, created an entirely new KiCad project, a simple KiCad EEschema, and converted that into a dummy PCBNew.
At this point, I was able to autoroute the PCBnew using FreeRouting, import the *.ses Session file, and successfully view the routed board with models in place.
So far, so good…
I then fiddled around with the PCBnew project by selecting a footprint (right click; “Footprint on…” >>> Edit with Footprint Editor" .
This is when the process go sour (from my perspective). Let me elaborate:
-
If I make any edits to the Footprint in this way, save the changes using Close >> Save and Exit, and revert to PCBNew those Footprint Editor changes are NOT reflected in PCBNew when I view the entire board in 3d Viewer.
-
Returning to the Footprint >> Edit with Footprint Editor dialog, I discover that my changes have not, in fact, been saved – even though there have been no indications of any error in the SAVE process, and even though I am choosing to Edit the footprint that I am seeing locally in this particular PCBNew.
-
If, having saved the Footprint as I previously noted, I return to any of my other KiCad Projects which use this footprint, the saved changes that I made to the footprint are not reflected in the models. From all indications (paths show during the Edits), I am editing the footprint in my Custom library, which is the path to ALL of the footprints used in each of the KiCad projects where the part changes are not reflected by Footprint Editor changes.
So, what am I missing here?
[ Footnote * : From PCBNew, when selecting a Footprint using right-click, Footprint…>> Footprint Parameters brings up a dialog box titled Footprint Properties (not ‘Parameters’). I know that KiCad is a non-commercial, community project with limited development resources, but I’d say that inconsistencies in terminology such as this add steepness to the learning curve, and contribute to a lot of confusion in the Forum discussions]
I should note that I am not using the KiCad libraries on GitHUB directly. To be clear: I am using those GitHub libraries that were copied over to my hard-drive during the KiCad installation process. What I was trying to refer to in this case are libraries which I, as the end-user, did not create myself.
I think your main problem has been already hinted at above.
Pcb new creates a “cached” footprint inside its file header for every footprint added to the pcb. So if you change a footprint in the library it does not affect any of your projects. (This is on purpose to protect old projects from future library changes.)
The “edit with footprint editor” stuff opens the footprint from the pcb cache. But saving it to a library does not change it in the pcb. For that you would need to use the “update footprint in current board button”.
If you however want the footprints of all your projects updated then the suggested way to do this is by opening the footprint editor from the kicad main menu. In the footprint editor then open the footprint you want to edit. First set the library containing your footprint as active then use the open footprint button to load the footprint from the library. (use list all or the browser option for that.)
Make your changes and save the footprint to the library.
Now for every project where you want to update the footprint you need to do the following. Hover your mouse above the footprint in question, press e (or right-click preferences) -> click change footprint -> select “change footprints [the footprint name]” -> select apply. (In kicad 5 this will be more intuitive as there is a separate dialog to update footprints from the library.)
I assumed you will be doing your changes inside the footprint editor. There it is called Footprint properties.
Ahhhh…
OK, it certainly was not obvious that there is a Cache inside of each project that protects that project from outside influences (such as changes to the footprints and *.wrl files that were made in other Projects, or even at the Library level). I can understand why this might be the case (falling under the general topic of “version control”).
With this new perspective (…thanks for your patience…) I should be able to get my head wrapped around the work-flow for these editorial changes.
It does sound like the ‘soon-to-be-released’ V5 will have significant improvements in many different aspects. Hopefully, the work I’ve put into learning V4 will set me up for a better grasp of V5 (?).
To clear something up: The wrl files are not cached. only the footprints are. This means if you change the wrl file and after that look at an old project, the 3d view might be broken.
You’ve hit the nail squarely on the head; that is precisely what seems to be happening.
I think the confusion here results from another example of loose terminology, which I will elaborate here:
In the Footprint Editor, the user can associate and edit the 3d model associated with the 2-d footprint and so, in this sense, “the Footprint” implicitly and functionally includes the 3d model.
Now that you’ve explicitly revealed that the cached “Footprint” only contains the 2d information (silkscreen perimeter, hole dimensions, and pad diameter and so forth ---- totally excluding the 3d model that is implicitly & functionally part of the Footprint via application of the Footprint Editor), it is clear that “Footprint” has different definitions, depending on context!
Just to make absolutely clear that you did not misunderstand something again:
Only the 3d model it self is not cached. (The wrl or step file) The settings (path to the model, scaling, offset and rotation) are part of the cached footprint.
It might even be worse with the 3d settings when compared with other parts of the footprint definition. I had problems in the past to get pcb_new to update the footprint if i only changed the 3d settings. The solution then was to also change something else. (Example: Move the reference field by a small amount)
Meaning the wrl file is not part of the footprint. It is completely separate. (Similar to how symbols are separate from footprints.) In fact multiple footprints can reference the same 3d model. And a footprint can also have multiple 3d models assigned.
“Oh, what a tangled web we weave…”
I working on my footprint and notice that:
-
With STEP file:
- Not importable by wings
- FreeCAD seem to not allow to fix the appearance color of the STEP part (make pin look like metal, plastic look like plastic)
- FeeCAD export to OBJ, STL seem to remove all the appearance color of part, but openable by wings --> fix the appearance from there.
-
With STL file:
- I can import to wings, and apply material into part
- FreeCAD can open it, Solidwork can open it
-
With wings file:
- I can edit, or change apperances of part
- Export to STL, OBJ and openable by FreeCAD, Solidwork
- Cannot correctly create STEP file from FreeCAD.
-
wrl file:
- Is a deadend file, cannot do anything with it - event with FreeCAD
So it is still very confuse to me what is the best 3D format I should keep in my repository! But wings format files seem to be the best choice for regenerate/export back to OBJ, STL which will accepted by FreeCAD, Solidworks.
Of course it can. But it might be a bit of work if you have a single solid. (For such a part you would need to assign colors to surfaces. Which is quite a lot of work but doable for simple models.)
For assigning colors to faces right click on the solids name in the tree view (models and labels) and select “set colors”. A “dialog” should spear in the task list. Select the faces you want to color with left click (crtl+click for selecting multiple faces.)
It is much easier if you have one solid per color. Either assign a random color and assign your desired color during exporting with stepup (example select metal gray pins for the pins of an ic package)
Or assign a fitting color directly (right click on solid name -> appearance)
wings format is a tessellated surface model (the surface is represented by a load of triangles.)
The same with stl, obj and wrl (and others)
These formats are of no use for a mechanical engineer.
All information such engineers care about is lost. Example you no longer have nice holes but something that has a crossection of a polygon. So there is no way to use such a hole as the basis for constrains in an assembly. One can also not get a unique position nor a unique radius out of such an approximation. This means you can not create a dimensioned drawing from this model either.
wrl (stl and others) however have their purpose. They have ways to add complex shader material properties. With these properties very nice renderings can be made.
@nhatkhai Wings3D is not a mechanical modeler. It cannot export to any real mechanical format.
STEP AP214 is the only widely used format for mechanical interchange.
there is also a Box selection to allow an easy selection of faces
Yep, see how to assign color now (Thank).
STEP file size is seem to be much bigger than .wings, or .wrl (well what can be do).