3D new library for Mechanical CAD exporting and enclosure design

I export them from Inventor as STEP… those files are in the repo as well (end in stp instead of wrl).
Those are then imported in FreeCAD and exported as VRML, per script, automatically, one after the other…
Really no idea where the difference in treatment comes from, especially as the original files for those two models are the same, just different parameters for dimensions that should not affect basic file/mesh/etc. properties that would cause stuff like this (IMHO).
I don’t know if there are other more detailed STEP model viewers out there that allow some sort of examination of the data that is in them…

Another thing I couldn’t find in FreeCAD was a way to reduce the numbers of segments that are being used to approximate circles/round surfaces… there are a couple of those in there that could easily do with just 8-6 segments per 90 degrees.
I naturally have no idea how STEP models are defined and if this kind of optimization is even possible…

Vrml in FreeCAD is exported directly by the Coin3D viewer
Pivy is the python binding library for Coin3d in FreeCAD
may be there you can get some info

https://github.com/JoanTheSpark/KiCAD/blob/master/3D-shapes/Modules.zip

Bosch BME280
Bosch BMP280
Telit SL869
XBee 868LP

No idea where the u.fl connector on the XBee module is placed at… nothing in the datasheet about it. EM-shield size/position also by Augenmass

EDIT:
I wonder how long it will take for KiCAD to accept STEP models directly… filse sizes for the VRML stuff are just ridiculous.

In page 14, Mechanical drawings.

Thanks very much.

Ya! If it was that easy… :wink:

2 Likes

at the moment using a library for 3D models based on MCAD models (FreeCAD or STEP in general) is a good compromise for kicad to have a native and realistic/parametric 3D rendering (with VRML exported with FreeCAD) and an exact representation of your physical board in 3D PCB mechanical environment (through my kicad StepUp)

@Joan_Sparky I think that our effort in doing a 3D MCAD library for kicad is in the right direction

what I would like to see, as I asked already at developer’s list, is a 3D MCAD library composed with FreeCAD/STEP 3D parametric models and 3D VRML models aligned to the kicad model footprints…

may be @Ricardo_Crudo could ask the developers to create an official kicad repo with FreeCAD/STEP and VRML 3D models
That will help all the users that need 3D models both for realistic rendering and mechanical ECAD MCAD collaboration in finding these resources easier…
and moreover that official repo may incentive other people to collaborate and improve the lib :smile:
Maurice

1 Like

Well STEP is the undisputed king of standards specification complexity. With the plugin system I am working on it should be possible for KiCad to directly support STEP via OpenCascade but of course that’s a matter of someone doing the actual coding. Maurice’s scripts have pushed the priority of such coding down the list somewhat since the devs are all busy with so many things and the scripts are a good compromise. In the long term I’d like kicad to have its own minimal engine for displaying and producing STEP assembly models (and IGES as well - so far I can produce IGES but can’t display it) but that’s looking like a 2-year full-time job to me, which means I can probably finish the task in 10 years. The only objection some devs (including me) have to OpenCascade is that it’s a huge library - that’s inevitable since it is a 3D MCAD geometry kernel. However, kicad only needs extremely basic geometry support to be able to create a PCB solid model (as demonstrated in my libIGES project) and to add other models to an assembly model. At any rate my new plugin system allows us to make OpenCascade an optional requirement which can be installed separately - this arrangement keeps all devs happy while not eliminating the possibility of native STEP support via a custom lib in the future.

2 Likes

With all this great work on modelling SMD components, are there any THT components like resistors?
I’ve generated and used cbernardo’s resistors as WRML files, but would like to use Maurice’s script to model my enclosure with the multiple PCBs inside. However, it’s all through-hole stuff and I’m having difficulty finding appropriate resistors…

I noticed another thread which allows parametric creation of various components. Is there one like Cyril did in WRML that would generate STEP models?

you can always try to download some TH models in STEP format at 3dcontentcentral o grabcad
then you can align the footprint with


and export with kicad SteUp tool to vrml aligned to your footprint
Maurice
PS feel free to ask for support if needed in using my MCAD script :smile:

2 Likes

Thanks Maurice. I’ve had a look, but all seem to be horizontal TH models, none of them are vertical. I’ve tried taking one and then modifying it in my CAD (we use Creo / ProE), but no real luck…

The great thing with @cbernardo’s scripts for VRML is that I was able to modify a few parameters such as the pitch so I could get them perfectly matching my PCB design.

I did see a guide somewhere to convert VRML models to STEP but it was rather convoluted and involved using many different programs (Blender, FreeCAD, etc) so seems a rather tedious step if I have many components to convert.

It might be easier for me to make one from scratch if I can’t find something suitable already out there :smile:

@xavierw
if you like to code a bit, have a look at


this are some script to generate STEP and VRML models starting from a parametric table as in component’s data sheet
If you would like to play with the code, cadquery is a nice framework to let you generate parts with parametric scripts in python
here is a very simple example for a smd chip cap

may be you can have a look and create some script to generate TH resistors, than the other users could have a benefit :slight_smile:
I found that, after playing a bit with cadquery, for me it is easier to create parts in python than manually :smiley:
PS use cadquery-freecad-module 2.0

Ahh, damn, just noticed your reply.
In the end, I drew my own up…

However, I’ll have a look at that. It would be quicker than manually selecting each of the colour rings to generate a series of values. :slight_smile:

3 Likes

@xavierw
good-o :smile:
please keep me informed about the conversion with my StepUp script :slight_smile:

Holy cow that resistor looks awsome! What did you use to draw it?

from an earlier post of @xavierw:

I’d say it’s what you get inside ProE when you render the model, won’t look as nice in KiCAD or FreeCAD, but maybe in blender after you played with the materials a bit after using @maui’s StepUp tool to get the pcb assembly over there.

@xavierw
You don’t want each value on those, unless you’re insane or a genius. :wink:
What is the STEP file size for that resistor btw? Looks marvelous… I wage a guess, the VRML file will come in at 800kB+ unless you find a way to control the amount of segments being used for round surface approximation - I had no luck so far :worried:
Doesn’t ProE have some kind of facility where you can code behaviors of model parameters according to some table? I know it exits in Inventor… never used it though.

The footprints are generic and there currently is no way of transferring values from the symbols over to the 3D models in an automated fashion in KiCAD… which means you’d need one resistor symbol, footprint and model per value… which E-series do you had in mind? :open_mouth:

Not even this is possible in KiCAD for now, which is way simpler:

@SBW
I cheated a bit: the photo attached was actually from a Keyshot render.
In Creo, it looks fine, just not as realistic as it’s just the model, not the render.

In FreeCAD, the STEP model is ok:

BTW, the STEP file is 120KB in size. Not too large, but not practical if you have several different values.
In all fairness, I went to model something that looks realistic rather than simple: the colour rings are actually a “thickness” so emulate a band of paint on top of the actual resistor rather than just changing the colour of a section of the resistor’s body.

@Joan_Sparky
I need to investigate what scripting / lookup is possible with Creo. If I could assign a text file and associate that with different colours, I could then write a simple macro to generate a list of values, much like @cbernardo has done with VRML. Alternatively, I’ll try to get my head around Python (I’ve never done that, my last scripting goes back to Turbo Pascal when I was a university!) and see if I can generate a script with @maui’s FreeCAD scripting stuff.

Zip file of step model attached.
res.zip (20.0 KB)

1 Like

ran the STEP model through my FreeCAD/python script to get the VRML model: 2.8 MB
You really don’t want to make every value… a couple different ones of these on a single board and the 3D viewer will have a stroke :smile:

Resistor_0.25W_TH.wrl.zip (346.6 KB)

Can you tell Creo how many segments per 360deg it uses for the surfaces?
I can’t find any settings for this in Autodesk Inventor, nor in FreeCAD (after importing the STEP model)… but maybe your CAD has got an option for that to get the file size down?

One more thing, you might want to realign your modeling planes to fit KiCADs world (Z-axis is away from pcb, Y upward) as otherwise you have to realign every single one of them models (and you really don’t want that):

2 Likes

Thanks.
Regarding segments, the one I posted earlier has 24 - I just counted them in FreeCAD. Maybe there’s the option to make less. I think the added complication comes from making it look nice. If I were to simplify, the STEP version ends up being around 60KB and resulting conversion to VRML would be a lot smaller too I guess.

You can trial&error yourself as you got freecad already… just load the python script from github that is linked in my last post and open it in freecad (edit scripts button), modify some bits and then run it (run button).
This way you get scaled components for KiCAD from STEP files by clicking on a button in FreeCAD only - couldn’t get it to work outside of FreeCAD unfortunately…
You can change the license text to any other if you want, shouldn’t fault if you stick to the layout that is there. The license will be added to both the VRML and the STEP file, as both are needed for StepUp.

1 Like

I (nor anyone else I guess) really need the VRML version of TH resistors (as well as other TH components) as they’re already available from @cbernardo’s scripts - I’ve generated all the various components and they work fine with the built-in 3D viewer in KiCAD.

I really wanted to have a STEP version of the models so I can use the new scripts allowing 3D modelling outside of KiCAD. The examples here use FreeCAD, but of course you can use any other 3D CAD/CAM package that can read STEP files.

With a 3D model of the PCB in STEP, I can then do my case design and ensure everything fits as well as generating any marketing material :slight_smile: