Attaching a 3D model to a PCB footprint

I’m having trouble getting a pretty simple 3D model to show up in the 3D view.

You can download my model here in both its original SketchUp 2014 format and in the cleaned-up VRML format.

(The VRML put out by SketchUp was utter trash: a pile of disconnected triangles instead of a solid model, flipped normals, etc. It actually crashed Photoshop! I was able to open it in C4D and clean the mess up to give what you see here.)

The model is a rough first pass at a typical Phoenix Contact header block.

I’ve boiled the testing process down as far as I can get it. Basically, I open the PCB footprint editor, create a new component, add a circle to the board to give it some physical dimension, and then try to attach the model. I’ve tried with both absolute and relative paths. No matter what I try, when I go into the 3D view from within the footprint editor, I see nothing but my silkscreen.

I have been able to attach one of the models from the standard KiCad library to the footprint, so I know I’m doing something right.

I don’t think the cleaned-up VRML file is at fault. Blender, C4D, and Photoshop all open it correctly.

I modeled it at real-world scale: 1 3D unit is 1mm, and the object is roughly a 9mm cube.

I assume if I was wildly off on the scale, it would still show the model, but either as a speck in the middle of the footprint, or completely dwarfing the silkscreen outline. Am I wrong about that? Will it instead do something silly like try to draw the model like a kind of “house” around my footprint, so that I’m looking at the inner walls of the model? I don’t see any walls off in the distance in the 3D window, but that could just be because they’re out beyond the clipping plane. Perhaps KiCad should offer to scale the model to the silkscreen dimensions.

I’m using a recent build of KiCad (mid-January) on OS X Yosemite. I built it using this Homebrew tap.

Hi Warren Young,

pleas check my answer two this other thread (link at end)
i have experimented a long time to get a footprint to show up in KiCad -
and finally - i used wings 3D to output the vrml.
that shows up as expected…
the vrml that blender exports and is of a different format or version that what KiCad can read -
so i think your vrml is also ‘to modern’

so what you can try is -
import your model in wings 3D and export it as vrml from there -
this worked for me. (see detailed explanation in other thread)

i have opend your file in blender - exported as obj

  • imported in wings3D - and exported as wrl.
    that worked (added the 3D file to some other component that allready had a other 3D shape for quick test…)

hope that helps.
sunny greetings
stefan

phoenix__Wings3DExport.wrl (10.1 KB)
phoenix__BlenderExport.obj (2.1 KB)

Thanks for the clue about running it through Blender.

I’ve ended up with quite an involved process:

  1. Rough in component hull in SketchUp

  2. Export to something generic for C4D; clean up mesh and add detail

  3. Export to something generic again for Blender, then re-export to something else generic to make Wings3D happy

  4. Export from Wings3D into VRML, since apparently no other VRML creator writes files that KiCad can cope with.

Basically, I’m using Blender and Wings3D purely as translators here. I’m vague about the “somethings” above because it seems to vary from attempt to attempt. Sometimes OBJ will give the best conversion, sometimes 3DS, and less commonly COLLADA. Part of the problem is that Blender and Wings3D don’t import and export the same set of formats, so you often end up chaining multiple file formats to make each leap. A typical conversion chain is SKP → C4D → OBJ → 3DS → WRL.

Yuck-o-matic.

Here’s what the new model file set looks like in a nice GI studio in C4D:

C4D render

Here’s what it looks like after it gets through this meat grinder of a translation process:

KiCad render

It appears to have lost the Phong information along the way somehow, but I’m disinclined to pursue it further, since I’ve already spent a couple of days on this single component.

KiCad devs, take note: this is way harder than it has to be.

I hereby release this model into the public domain. If you want it, take the previous ZIP file link above and change phoenix to phoenix_0006. It’s for a Phoenix Contact 1803277 2-position terminal block. I wanted to include the URL, but this silly web site won’t let me post more than two links, and I decided the pics were more important. (I wanted to put the images inline, but it won’t let me do that, either.)

Hi @WarrenYoung,

I am one of the contributors of 3D viewer. Original KiCad only support VRML files that Wings3D generates, it should support now (tunk version) more different VRML files.
Would you like to share other original VRML models that you first generate with your software? Which software are you using? You VRML file says it was created by “#Created by CINEMA 4D”. Could you provide me different VRML models? It would be nice to see if that software is exporting the things the same way all the time.

Regards,
Mario Luzeiro

I’ll need a goal of some kind. Are there any package types you find yourself missing most?

I seem to recall not being able to find something fairly common, like SOT-23-6 or SOT-143. Are either or both of those still actually missing, and if so, would those serve the goal of testing the new importer?

It doesn’t matter, they are just for test propose. So test you VRML generated by that software. Like the “phoenix” example you provide. It would be nice if you have more complex models.
Thanks.

@s_light did you apply any scale to your conversion?
It looks like the original model is too big. What are the unities of KiCad?

as i explained in the linked topic -
there is some scaling and converting axis…

blender use orig. mm
    'blender2wings3d' :
    op.axis_forward = '-Y'
    op.axis_up = 'Z'
    op.global_scale = 393.6

i think 1/2,54=0,393700787
so the scaling is mm to inch or other way round (point of view question - with 393.6 it worked :wink: )

i design all footprints and 3D-Modells in metric.
(iam from germany - so thats my learned system :slight_smile: )

@WarrenYoung

Would you like to try the latest main trunk version of KiCad? After revision 5544
https://code.launchpad.net/~kicad-product-committers/kicad/product