@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?
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!
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:
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
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.
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
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
For me it would be faster to use one of our MS pc in our office.
(Develop on fedora, publish with MS. Yes it is painfull, but maybe this will safe me some time.)
btw:
I don’t have the exception under 0.3 but i get one under 0.2
(‘int’ object has no attribute ‘getitem’)
Is it normal that cq version 0.2 prints version 0.1.8 in the console?
(I downloaded the release v0.2.0 from the cadquery github site.)
edit: if there are licensing problems, fedora is at least as bad as debian. (if not worse.)
Ok thanks for this detailed information. I will stick to CQ version 0.3
Today i can’t do anything about the color problem. (I’m already at home and don’t want to install a new os on my machine.)
If I have time, i will investigate what exactly causes the problem under Fedora (Find out which lib is at fault.) Maybe it can be fixed.
I will export the XH files on a windows machine tomorrow. If this fixes the color problems i will update my repo.
Regarding your export routine i will use them for my next models. (Probably Molex PicoPlade) If it works there, I will update the XH script and send you the modified scripts.
Thx @maui for the new VRML export script - got it working.
File sizes of the VRMLs are 10 times smaller now compared to the old way, incredible!!
Still need to get used to the new look of the VRMLs, as their indentation/bracket order is not cleaned up, but it works and that counts.
Absolutely fantastic.
Really cool starting the script and seeing it go through a folder full with STEP files and making the VRMLs… a breeze.
new method: 40MB
old method: 361MB
Now I can wade through the models again and get them up to date and do a fresh export of all of them + a couple of new ones I made in the last 2 weeks for myself.
@Rene_Poschl - those are some nice scripted XH connectors you got there.
It sounds like it didn’t take you long to adapt the CQ scripts to make those, very nice work.
Will have to look into this myself it seems as my current workflow lacks this automation for high pin count/repetitive pattern parts that more or less look the same, ignoring the pins.
Thx for the inspiration!
what I didn’t get working is an automated process to create nice previews/renders of the part(s).
I installed both POVray and LUXrender and they seem to work (luxrender output looks nicer on standard settings, but takes longer) - the problems are the colors, they aren’t communicated - I guess they weren’t ‘real’ materials to begin with, as the (single) part only got one material, a brownish ‘shape’ color.
Anyone got an idea how to solve this?
The FreeCAD 3D viewer seems to be able to deal with part-sub-material definitions… the piece of code that translates the FreeCAD model to a POVray scene not so much. I have a feeling that this kind of concept doesn’t even exists in FreeCAD. FreeCAD to the left, POVray to the right, materials how they come out of Inventor, didn’t use the script where one applies the standardized materials (will try that next):
[EDIT]
…tried with the standardized materials, but it didn’t help - or I didn’t do it correctly.
I think the problem is the single part… will have to do some reading I guess.
OK… having a go with PoseRay I get this preview for the VRML files (STEP isn’t supported) in the hope of being able to use it as a converter to get the sub-surface-material color information communicated through to POVray I see this:
modify/fixing the povray-export code in FreeCAD to be able to get sub-part-materials communicated > FreeCAD > POVray
pro: future proof (no need for VRML models)
con: more work involved I guess and will take longer
adopt your VRML-creation-code to output meshes the way PoseRay expects it > FreeCAD > VRML > PoseRay > POVRay
pro: probably fast solution to problem
con: needs VRML models
something else entirely > …
[EDIT]
just for reference the new method VRML model in KiCAD:
still there are some probs with the camera position but it is something usable PS many VRML parser often just implement a subset of VRML format protocol… (kicad itself does it), so that is way there are some issues on different way to create a vrml… best and complete vrml viewer/parsers are IMO FreeCAD and view3dscene PPS this new compact VRML exporting routines are good for KiCad but also for Blender (the FC exported ones where not Blender compatible)
I have updated the macro to add material properties to VRML in a more polished way… I added the materials at the top of the VRML file, and the I added USE “Material Name” inside the VRML … https://github.com/easyw/kicad-3d-models-in-freecad/blob/master/exportVRMLwColors/exportPartToVRMLwMaterials.FCMacro
adding Material Properties to VRML will add a small 10% on size but will give you a nicer view, particularly in the new VRML raytracing 3d-viewer that Mario @kammutierspule is developing and that will be (hope) merged quite soon in the main dev-branch of kicad (this branch has also pivot center of rotation selectable)
VRML in OpenGL view of KiCad
i.e. look at the reflective shiny metal
It is possible to add Material Properties to the new VRML exporter in an automatic way, most of the materials are described at the top of the macro, following the material guidelines that Mario posted Module_AI-Thinkerer-ESP07.wrl (184.8 KB)
I was about to say that it is a bit shiny…
but I found this picture and it looks very close!
Nice render!
Would be possible to render (blender?) a similar shot to compare?
With one directional light on the top at 0.7 intensity (and if possible) a front omni light (without shadows) on the front
Ok, will have a go with that one.
If I scale the object again (after exporting it to VRML) I can size them relative to the camera/light position and make them all appear the same… so all I would have to do find a camera/light position that works and scale the models accordingly…
Sounds like a plan, he?
I might need to adjust my material properties down the road to get those additional attributes in there, but I’ll see how I go first.