3D new library for Mechanical CAD exporting and enclosure design


I get the following errors:

C:/kicad-wb-1602/msys64/home/userC/kicad_git/plugins/3d/oce/loadmodel.cpp: In function ‘bool readIGES(Handle_TDocStd_Document&, const char*)’:
C:/kicad-wb-1602/msys64/home/userC/kicad_git/plugins/3d/oce/loadmodel.cpp:401:9: error: ‘wxString’ was not declared in this scope
wxString ifile( wxString::FromUTF8Unchecked( fname ) );
C:/kicad-wb-1602/msys64/home/userC/kicad_git/plugins/3d/oce/loadmodel.cpp:402:55: error: ‘ifile’ was not declared in this scope
IFSelect_ReturnStatus stat = reader.ReadFile( ifile.wc_str() )

I would suggest you to use kicad winbuilder to set up a windows building environment … otherwise I think this cannot be debugged without a local building environment…


As far as i know the following script generated connectors
JST XH, EH; Molex 53261 and 53398; Phoenix MC and MSTB should be ok.
(I tested them with the current footprints. For the phoenix connectors both the footprints and 3d models are script generated by myself. The other footprints are script generated by @SchrodingersGat )
But maybe it is not a bad idea if someone else also checks them.

Maybe i will find time to make a pull request sometime this week. (But i would like to see my current footprint pull request to be merged first.)


I just did a quick test, so I suppose the footprints have been updated since the script :slight_smile:
(your model on the left, molex original step on the right)

but I gotta say its a prett damn beautiful model you made! kudos on that!
should I fix it or do you feel like it? :slight_smile:
would be really nice to get them in the official repo before 4.0.6 release :slight_smile:
@maui did you mention something about the VRML exporter needed to be updated on the connector scripts?


Yay the last update moved the footprints.
(The origin of the y axis was at the center of the mounting pads. Now it is somewhere in the center of the part i guess?)
I will look into the footprint generator scripts by @SchrodingersGat and find out where exactly y=0 is located now. (My 3d shapes scripts will get an option for y offset. This way they are a bit more future proof. And i can still generate the files for my personal library.)


sounds like a brilliant idea :slight_smile:

you could consider adding a kicad_naming_params section with the new offsets and with the official footprint names.
thats at least how we did it with all the other scripts which has been merged in the official libraries


I have the naming specified in my params named tuble. Would this be sufficient?
Or can you give an example how you implemented it? I can’t find it in this mess of a repo. (We really should clean up the cadquery directory. Maybe make a sub-directory for each equivalent footprint library?)


+1 to cleaning up the 3d-model-generator repo. So hard to navigate!


+1 from my side, but please check that every family will build after any change… I had to revert few times in the past just because of the need of a cleaner structure, but not working… :sweat_smile:


indeed a cleanup could be needed

the way we specified it in the other scripts is like this
all_params = {
“0271” : make_params( 2, ‘Molex_53261_0271’),
“0371” : make_params( 3, ‘Molex_53261_0371’),
“0471” : make_params( 4, ‘Molex_53261_0471’),
“0571” : make_params( 5, ‘Molex_53261_0571’),
“0671” : make_params( 6, ‘Molex_53261_0671’),
“0771” : make_params( 7, ‘Molex_53261_0771’),
“0871” : make_params( 8, ‘Molex_53261_0871’),
“0971” : make_params( 9, ‘Molex_53261_0971’),
“1071” : make_params(10, ‘Molex_53261_1071’),
“1171” : make_params(11, ‘Molex_53261_1171’),
“1271” : make_params(12, ‘Molex_53261_1271’),
“1371” : make_params(13, ‘Molex_53261_1371’),
“1471” : make_params(14, ‘Molex_53261_1471’),
“1571” : make_params(15, ‘Molex_53261_1571’),
“1771” : make_params(17, ‘Molex_53261_1771’)
kicad_naming_params = {
“0271” : make_params( 2, extraoffset, ‘Molex_PicoBlade_53261-0271_02x1.25mm_Angled’),
“0371” : make_params( 3, extraoffset, ‘Molex_PicoBlade_53261-0371_03x1.25mm_Angled’),
“0471” : make_params( 4, extraoffset, ‘Molex_PicoBlade_53261-0471_04x1.25mm_Angled’),
“0571” : make_params( 5, extraoffset, ‘Molex_PicoBlade_53261-0571_05x1.25mm_Angled’),
“0671” : make_params( 6, extraoffset, ‘Molex_PicoBlade_53261-0671_06x1.25mm_Angled’),
“0771” : make_params( 7, extraoffset, ‘Molex_PicoBlade_53261-0771_07x1.25mm_Angled’),
“0871” : make_params( 8, extraoffset, ‘Molex_PicoBlade_53261-0871_08x1.25mm_Angled’),
“0971” : make_params( 9, extraoffset, ‘Molex_PicoBlade_53261-0971_09x1.25mm_Angled’),
“1071” : make_params(10, extraoffset, ‘Molex_PicoBlade_53261-1071_10x1.25mm_Angled’),
“1171” : make_params(11, extraoffset, ‘Molex_PicoBlade_53261-1171_11x1.25mm_Angled’),
“1271” : make_params(12, extraoffset, ‘Molex_PicoBlade_53261-1271_12x1.25mm_Angled’),
“1371” : make_params(13, extraoffset, ‘Molex_PicoBlade_53261-1371_13x1.25mm_Angled’),
“1471” : make_params(14, extraoffset, ‘Molex_PicoBlade_53261-1471_14x1.25mm_Angled’),
“1571” : make_params(15, extraoffset, ‘Molex_PicoBlade_53261-1571_15x1.25mm_Angled’),
“1771” : make_params(17, extraoffset, ‘Molex_PicoBlade_53261-1771_17x1.25mm_Angled’)

this way it can be changed quite easy at

def generate_part(part_key):
pins = generate_pins(all_params[part_key])
body = generate_body(all_params[part_key])
#pins = generate_pins(kicad_naming_params[part_key])
#body = generate_body(kicad_naming_params[part_key])
return (pins, body)

this way there is always the parameters used for generating the files for kicad and users can use the other ones for adding non kicad compliant parameters


When i first answered i looked at my jst scripts. This scripts are done in the way you did.

But now that i looked at my molex script i must say i like it more if the name is generated using a format string.
This way one can’t make a mistake in one of the models. If one model has the correct name, all of them have. (You then only need to check the one with the lowest pin count and the one with the highest count.)

file_name="Molex_PicoBlade_53261-"+ ('%02d' % num_pins) +"71_" + ('%02d' % num_pins) + "x" + ('%.2f' % pin_pitch) +"mm_Angled",

Also just think how much information you need to enter for my phoenix scripts. There are more than 500 connectors generated.


Hehehehehehehe… :+1:


For now i will reorganize my own scripts. This way there is no danger in destroying anything that is not under my control. edit: or better worded: I don’t like the probability of destroying the work of someone else.
(Also i’m not 100% sure everything that has been done recently has been merged into your repository. I don’t want to move files that have already changed in someones personal repo.)


perhaps we should consider moving the script talk over to

this way does ofcourse make much better sense for the connector scripts
the other more “manual” way was mainly ment for the other packages with more changing parameters and names than pin numbers :slight_smile:


it wasn’t you and none on this thread :wink:
Moreover sometimes the scripts are working fine with a specific release of FC and release of cadquery, but with different FC (OCC) or CQ they don’t fully build…


going back to 3D models… new PR for QFP

First Board, First Post, .wrl File Hack

I noticed that nearly none of my scripts work under freecad 0.17.
There seems to be a problem with the cadquerry selectors in this version.
But freecad 0.17 is a nightly build so some bugs are to be expected.


Pull request for Molex connectors:


It’s like a bee-hive in here with all that action.
Anyhow - cool work guys (& gals).


All that was needed was a go for adding step files :slight_smile:


@Rene_Poschl these models are great (and so much better than the official Molex models!)

Can’t wait for more connector models to be added.

The work you guys have done on material modeling and step file-size reduction is really awesome :slight_smile: