3D new library for Mechanical CAD exporting and enclosure design

@s_light @Joan_Sparky
if you want to hide enclosure parts,
like in

at the moment there is a nice trick :smile:

just export your enclosure that you need to hide as
wrl with 100% of transparency
then enabling/disabling Material Properties you can hide/show your enclosure

2 Likes

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

2 Likes

Hey :slight_smile:
i have made some footprints and 3d-models for my last project.
they are all in separate git repositories… easiest way to have an overview is to use the search:
3dshapes:


footprints:

and libs for the components:

the 3d models are exported in wrl and step. (with the help of the great FreeCAD addon from @maui )

i have licenced theme as MIT.

  • i think the design exception thing for GPL & KiCad is not ready jet?

for the Samtec connectors there are missing 3D files. i will create them if i have time to look in the automatic creation things / scripts but if you need theme Samtec has models on there website…
eventually i will move the Samtec Series to one combined repository - (don’t know jet what i find nicer :wink: )

i think i have mainly followed the KLC guide -
only at the repository / footprint and lib names i think i have not get it right…
have to review this some time…

@Joan_Sparky the USB-Connectors are build with a Metall-Sheet-Working-Tools or?
if i want to create theme with FreeCAD i would only have solid tools… and that would make it very difficult to get these details…

sunny greetings
stefan

2 Likes

have you tried at
http://forum.freecadweb.org/viewtopic.php?t=11303


I think that could be a nice tool for that kind of objects :smiley:

@maui thanks :slight_smile: that looks promising!!
i will try it out with the next sheet-metal-part i have to do :wink:

Nice @s_light ! Did you use @maui VRML exporter?

Mind also the materials:

:slightly_smiling:

@s_light, @kammutierspule
I’m going to work on it :wink:
I have already started something quite easy to use…
I will keep you informed :smiley:

uhmm ya maybe you can add something nice to your exporter… but… it would be better if it was integrated from the options from FreeCAD… so it would be more general (and future supported)

FreeCAD already supports materials properties
The problem is that it is not supported for fused objects, but only for single shapes
So all the STEP models coming from manufacturers or on-line libs will be missing that option
Moreover the FC wrl exporting routines will generate a very big wrl file, compared to my exporting routines, and you said that the format of the standard exporter it is also not ‘clean’ to be represented in kicad, if I remember well
Attached a sample of FC file with 2 shapes with Material Properties and the wrl file exported by the standard FC routines
Gold-Aluminum-shapes.FCStd (3.7 KB)
Gold-Aluminum-shapes.wrl (29.5 KB)

I understand that. I have any proposal to solve that :confused: I dont know how STEP / FreeCAD deal with that…

It could be possible to parse the generated VRML and learn what are the common materials and convert it to other structure… but… that would be a wast of time :confused:

In any case… it should be always possible to assign materials to already vertex colors on the vrml shapes…
but the difuse will come from color per vertex.

No, I didn’t use a sheet metal tool for them as then I would have needed to built an assembly from sheet metal and solid parts and the export/conversion to STEP/VRML will come out with separate parts then. I avoid that at the moment (the last parts I did as an assembly were the SMD LEDs and my EC2/3 connectors as there the transparent parts need to be physically separate from the opaque ones, for Inventor to be able to make them transparent).
:sunglasses:

chapeau! :rocket: very good job!

I used the cadquery script (https://github.com/easyw/kicad-3d-models-in-freecad/tree/master/cadquery/FCAD_script_generator) to generate models for JST-XH Connectors.
They can be found at:
https://github.com/poeschlr/KiCadMCAD/tree/master/Connector_JST_XH

@Maui: i have a question regarding licensing of your script.
Within the repos readme you use GPLv3 or CC v3.0, but in the script files you use lgpl v2
Which one should i use for my derivative work?

1 Like

@Rene_Poschl
thanx for contributing to MCAD library and using my FreeCAD MCAD scripts to generate new models :smiley:


I would ask you if you could share also the kicad_mod file, if you have done it, for the 3D models you have scripted…

I tested some of them and the geometry are fine (I use DesignSpark Mechanical under windows to check STEP geometry)
I just found some color issues on pins, probably during the fusion process…


One more thing, VRML models are exported with on old version of VRML exporter … i.e. the wrl of JST_XH_B02B-XH-A_02x2.50mm_Straight is 165KB and with the new exporter is 30KB more then 5 times smaller! :wink:
I didn’t catch time to implement this new exporter that is included in kicad StepUp tools also in the cadquery scripts…
you can have a look at the new routines here:


and here with the materials association
https://github.com/easyw/kicad-3d-models-in-freecad/blob/master/exportVRMLwColors/exportPartToVRMLwMaterials.FCMacro
Please let me know if you are including that exporter in the cadquery scripts, that I will update my scripts accordingly :slight_smile:

thanks for reminding me that… I would use GPL2 or Affero GPL3 (which is aligned to GPL2)…
there is still some license aspects to define for the 3D models libraries
http://www.mail-archive.com/kicad-developers@lists.launchpad.net/msg16679.html
I’m still waiting for Wayne to adopt an official license for kicad libraries, probably something like gEDA symbol library (GPL font exception)

As a special exception, if you create a design which uses this symbol, and embed this symbol or unaltered portions of this symbol into the design, this symbol does not by itself cause the resulting design to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the design itself might be covered by the GNU General Public License. If you modify this symbol, you may extend this exception to your version of the symbol, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version

1 Like

Yes the color issues come from the fusion. (I forgot to ask about it in my original post.)
This problem is the reason for the larger wrl’s. I exported them without fusing them. (And used the freecad internal export functionality.)

I will look at your export script later this week. If I get it to run, i will inform you.

The footprint files are the original files included within the kicad library.
(Connectors_JST.pretty)
In the near future i will also include the compact (e.g.: S03-XH-A-1) footprints.
Currently they do not exist within the library.

1 Like

for the fusion problems have a look here
http://forum.freecadweb.org/viewtopic.php?t=8451#p69489
sometimes it is enough to have a small overlap to remove a fusion/color probs
keep in touch :wink:
Maurice

Ok one followup:
I used your original script to export the DIP_8_300 package and get a similar color problem as i have with my files.
Which versions of FreeCAD and cadquery are you using. (Or did i miss something else?)
I tried FreeCAD 0.15 and the nightly builds (0.16). The screenshot is from version 0.16. For cadquery, i use plugin version 0.3.0

I used CadQuery 2.0, never tested on 3.0…
FC 0.15-0.16 should be fine
are you on debian or ubuntu?

tested with CQ 030 (removing close_CQ_Example(App, Gui) from my script) and the dip8 is fine

edit
I also tested your scripts in FC 0.16 windows with CQ 030 (removing close_CQ_Example(App, Gui) from script) and the fusion with color is fine


try: close_CQ_Example(App, Gui) except: # catch *all* exceptions print "CQ 030"
would solve 0.20 and 0.30 compatibility but for color fusion probs I think it could be Debian distribution of FreeCAD … I know there were some library license issues for Debian… I could test it on Ubuntu on VM if you need

edit: I have an issue on building QFP models with CQ 0.30 … I may consider to investigate on it :slight_smile:

1 Like

I’m on Fedora 23.
I will investigate it a bit within the next days.
(Something tells me this is gonna take more time than i originally planned.)