Kicad StepUp New exporter for 3D MCAD (feedbacks are welcome)


#21

thanks to Andrea Barisani of [INVERSE PATH][1] for sharing my 3D kicad StepUp script link
The StepUp script has been tested on the nice USB armory board (you can see it on [‘made with kicad’][2] website page) :slight_smile:


I’ve done also a small youtube video of the 3D board exported from kicad to VRML and imported in Blender for an ‘artistic’ render generation

all the 3D models have been done in FreeCAD and exported in VRML and STEP to be used for mechanical collaboration with kicad StepUp script


[1]: https://inversepath.com/usbarmory.html
[2]: http://kicad-pcb.org/made-with-kicad/page/2/


#22

@maui would it be possible to make a block diagram to explain the flow and “workflow” for using your script? So in a unique page people will be able to understand what are the inputs and outputs?
That will help lazy people like me to watch a video or read text :blush:


#23

@kammutierspule, I thought the kicad StepUp starter Guide pdf (and adoc) was for a good start for learning and a video it was for the lazy ones (as I consider myself :slight_smile: )…
Anyway for lazier and techy people I’m going to prepare a block diagram of flow and workflow
the simplest is the best:wink:
I will prepare it in short time…
Thank you for your feedback :sunglasses:


#24

thanks to the guys at Hackaday.com
for the nice review they did on KiCad StepUp 3D MCAD exporter :smile:
KiCad StepUp has landed at Hackaday!!!

Hackaday.com: KiCad


#25

Congrats, saw it the other day.


#26

thanks :smile:
Maurice


#27

@kammutierspule
I made a small workflow …
hoping that now it will be easier to understand which is the StepUp way to MCAD

please let me know if you miss something… :smiley:


#28

Some comments:
Wings3D still can be used as a modeler, since it produces VRML files and KiCad still support it.
Anyway, I suggest that you dont need to explain how it was doing before.

The new flow, I am missing something how it is converted from kicad to CAD… or how are the relations… there is a magic arrow. If I understand, the setup will use the .step files? That is not very clear. What are FCStd files? :slight_smile:


#29
  1. this is not true if you want to have the same result in pcbnew 3d-viewer and in MCAD you have to start from STEP or 3D mechanical models and generate VRML and STEP from the same origin file (that will throw wings3d files and substitute with STEP files, then you need to export STEP to wrl)
    If you don’t throw Wings3D away, you’ll get a minor version of the MCAD conversion…
  1. the ‘magic arrow’ is the kicad StepUp scriptif you just arrange your 3D model lib dir with STEP and wrl files, my script will do the magic! No need to complex configuration or database or configuration GUI pages, just click on the batch / bash script and you’ll get the result in seconds…
    Kicad StepUp script reads the KiCad pcb file and build a mechanical clone of that,
    assembling all mechanical models (STEP) and pcb (IDF board) to obtain a clone of the 3D board with exactly the same aspect and dimensions as in kicad 3d-viewer, but useful for mechanical interchange and collaboration.
    And moreover, the conversion can be bi-directionalif you have an enclosure to use with your board, you can convert it to vrml and use the enclosure also in KiCad to check (in minor precision) your mechanical constrains just directly when working on KiCad in a ‘Altium style’ …
    For that reason my plugin is compatible with all recent version of kicad, “stable included”, without the need to change a single line of kicad’s code
  1. you never approached FreeCAD do you? .FCStd is the extension for FreeCAD files, as .wings is the extension for Wings3D files

  2. Please have a minute to read the Hackaday review… Anool has explained very clearly what is the workflow…
    Hackaday review:kicad-script-hack-for-better-mechanical-cad-export

The Hack is done by switching from Wings3D to FreeCAD as 3D modeler
Instead of starting from VRML model, you just model your parts in
MCAD (or FC) or just get them from 3D STEP libraries and export the
parts to VRML
You can maintain the usual way to work with kicad and the script will assembly all the parts in MCAD

I thought this way of converting the KiCad board to MCAD artwork to let the user focusing on KiCad and not to the tool…
Please give a chance to the script…
just download the self contained demo and launch the batch / bash command to convert the KiCad demo board to MCAD artwork
kicad StepUp demo
I think if you try the demo script, everything will be clearer…
It doesn’t take more then 5 mins to test it… (requirements: recent version of KiCad (stable included) and FreeCAD 0.15 or later installed, working on Windows, OSX, Linux)
looking forward for your feedback… :smile:
Maurice


#30

“Wings3D still can be used as a modeler, since it produces VRML files and KiCad still support it.”

What I mean is, I believe Wings3D still produce VRML files that KiCad can use. I dont mean what is the propose of that usage. In your image you have “KiCad old Wings 3D workflow”, so it looks like that kicad is not supporting anymore files that Wings3D will create? “Wings3D no more used as modeler” From the point of view of Kicad 3d-viewer support, it supports VRML files, doesn’t matter how they are created.

But I understand what you mean from the point of view of “MCAD and SetupUp” so that is why I was suggesting that you may don’t need to explain that i.e: I think that users dont need to know how it was done before but maybe just show what your script can do and how it does it.

  1. so I think it misses some connection in the flow to understand that the script is getting that files from that folders and will compile it in a new CAD file?

  2. no :smile:
    Thanks I know now!

  3. so you just need to add that VRML converted files, without any transformations (rotate,scale, translation) ? Nice…
    If I got 5 minutes I will give it a try.
    I am not doing any board at moment… so I have no much reasons to try it at moment.

So, after get this StepUp script working, what will be your next contribution to kicad?! :smile:
Would it be possible to port that script to C and embedded in kicad? as a tool? (not sure if that would be approved to add this type of tools to kicad because it depends on 3rd part FreeCAD )


#31

@kammutierspule,
in KiCad to MCAD point of view, it is not useful / suggested to use Wings3D models to produce VRML models, that will be valid also for the new 3D plugin that is going to be developed… If the new plugin will integrate iges models, I think the internal visualization will be generated from iges model and NOT from VRML models coming from Wings3D… so, IMO, leaving Wings3D asap is the point
I had a feedback from a user (you can see his comment in the kicad developers mailing list) that pointed out that in terms of MCAD conversion, populating the board with models coming from Wings3D is useless / time loosing…
Regarding documentation, I can tell you what my experience has been. I’ve followed instructions to get a complete 3D model I could view with PCBnew, assuming I was going to be able to export that to Solidworks somehow. For kicad users maybe would be good to know STEP procedure before generating all WRL models, or generating both at the same time.

VRML model is exported without any translation and with a scale of 1/2.54 to be adapted to kicad 1/10inch visualization (still I don’t know why this scale was introduced in 3d-viewer)
this is also Wayne point of view in standardization of 3D models, as in a recent developers discussion
STEP model has to be only aligned to the kicad footprint … that is the only annoying part in building your 3D lib
but I still have an ace up my sleeve… you will see asap :wink:
Anyway I observed, though, that a lot of STEP files from 3DContentCentral have the correct orientation and centering, so in many cases there is little else to do
moreover for most smd 3D models, me and hyozd have created a 3D parametric lib with STEP and VRML models already oriented and ready for kicad

so that is the best moment to spend some little time in trying the script :smile:

[quote=“kammutierspule, post:30, topic:1048”]
So, after get this StepUp script working, what will be your next contribution to kicad?! Would it be possible to port that script to C and embedded in kicad? as a tool?[/quote]
At the moment kicad StepUp can be used already as plugin, and with very small modifications it can also be invoked from kicad pcbnew python console … there are some small improvements in kicad python APIs that I asked for, but at the moment I think the focus is on the stable release…
I’m missing also just a simple button in pcbnew that could be configured to launch a python script from inside pcbnew itself… I will vote for that in a whishlist :smile:

why not? wings3d is a 3rd part and the kicad installer suggests the user to install wings3d beside kicad itself…
python is a 3rd part and it is already packaged with kicad…
FreeCAD will be a big companion of KiCad also because of the new 3d plugin refactoring


#32

I agree and I hope people can start getting theirs models more from CAD files. That is why I started the improvement of the VRML parser… so I could get proper models from 3dcontentcentral and that is why you can now make your plugin work :smile:

but still kicad will support the VRML format… and if someone would like to add a 3D bunny to their PCB modeled by a non CAD software, using VRML format, they are free to do it :smile:

VRML doesn not define / have units scale. So it was an historic decision to use that units scale:

Cheers


#33

I asked to the developers mailing list to add a repository of 3D FreeCAD models (open source 3D models)
everything started from this discussion @ github
and Cirilo seems to agree with that repository
Since FreeCAD has fixed its VRML export enough to be useful to KiCad, I think Maurice’s sugestion to create VRML models from STEP or FreeCAD models is a good idea.
- Cirilo
but probably that will happen after the stable release will come out


#34

@maui I understand what you mean now. But that is related with libraries project of kicad.
Because the old limitations of kicad 3d-viewer to parser VRML files, only VRML files exported by wings3d could be used (the parser was designed only for that) so they forced that suggestion to use wings3d and supply .wings files as the sources of the VRMLs.

If kicad support in future better formats natively so it is indeed a good idea to base the future 3dmodels in that formats.
…but, if kicad supports VRML files you cannot say that it does not support it :smile:


#35

@kammutierspule

I know you have done a great job in improving the VRML 3d render interface and FreeCAD compatibility…
that gave me the chance to create kicad StepUp plugin…

and I don’t want to say that VRML is not supported by kicad anymore, I would just suggest the users to consider preferentially VRML modules coming from a better mechanical design, as the one coming from FreeCAD…

I’m working with hyozd to add also material props to the VRML generated from FreeCAD, that will improve the 3d rendering aspect of models in an aesthetic point of view…
fortunately FreeCAD supports also Materials …
and FreeCAD also supports Texture in VRML … in that case ther is a bit more work to do on kicad side :wink:
"Rule, FreeCAD!"


#36

@aaron @jwpartain1
I’ve done a tool to align 3d model to footprint in a ‘Altium’ style…


No need to reiterate the aligning process or empiric calculate offset and rotation to apply to VRML model.
please have a look at this post:
align 3d model to footprint in a ‘Altium’ style
That tool should make the library building process very smooth and fast! :slight_smile:
Maurice

#37

@maui
That looks like a nice improvement. When I started using StepUp, there were be a few “rotate-export-check kicad view” iterations to verify the step<->vwrl sync. Keep up the good work.

I’m in between board designs at the moment, but next rev I’ll load the new tools and check them out.


#38

Sorry for negative feedback: not working for me. I mean I got PCB pane with holes, but 3d parts are missing. A lot of questions came up:

Editing ksu-config.cfg is not clear: I think all lines starting with # are comments. Lines don’t contain “key=value” structure, so

  • is the order of non-comment lines important? (may any number of comment lines be inserted/cleared anywhere?)

In pcbnew, footpint properties - 3d settings - 3d shape name contains a full path at me (D:/work/…/mypart.wrl).

  • Is it ok to use this path at 1st non-comment line of cfg file? Is a slash compulsory at the end of path? What if there are spaces in path?

I’ve created STP then WRL in Creo. Did anyone tested not-FreeCAD-created STP and WRL files?

What you mean KISYS3DMOD? There is no “KISYS3DMOD” env.variable set at my Windows.

Thanks for the effort…it will be very useful tool.

Tommy


#39

ksu-config.cfg is a text file, because the all exporter is in python, I assumed that using ‘#’ as comment was clear… too bad programmer habit :wink:
[edit] I may add this to the doc
you need to configure your path to 3D models as you do in kicad…

yes, the exporter parses the parameters in order as in the ksu file…

have a look here
http://seriouslyembedded.com/custom-kicad-libraries-under-windows/
KISYS3DMOD is the prefix that kicad uses for 3D packages

every STEP file coming from CAD software would be fine… but you have to save with ‘.step’ extension NOT .stp
[edit] I may add both extensions to the exporter
I used many models coming from on-line libs without any prob…
You can check if your model will open in FreeCAD, then it will be fine also for the exporter, which is based on FC…


#40

@novaktamas
did you have time to go further?

to see which is your 3D model path you could open the .kicad_pcb file (make a copy before as backup) with a text editor and search for ‘.wrl’
then you should see something like:

(model shapes/cap_0603.wrl
  (at (xyz 0 0 0))
  (scale (xyz 1 1 1))
  (rotate (xyz 0 0 0))
) 

this means that your KISYS3DMOD should be already set
or

(model C:/kicad/3Dmodels/smd_cap/cap_0603.wrl
  (at (xyz 0 0 0))
  (scale (xyz 1 1 1))
  (rotate (xyz 0 0 0))
) 

then you are using absolute path (which should be already supported)