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

Thanks Maui. I am working on a new board and updated to KiCAD BZR 6194 (from 5596) and just ran the StepUp 0.532. Things I noticed:

  • KiCAD now renders VRML colors saved from a FreeCAD 0.15 step correctly now
  • An X-Y offset I had between the PCB and populated parts on some boards in FreeCAD went away.

I glanced at the rotation and scale macro, but it looked about like the same parameters and complexity as the FreeCAD placement dialog. I am guessing there is some advantage I am missing?

I generally only export the major components (connectors, large caps, fuses, power modules, etc.) to the MCAD, so as to not bog things down with a step model that contains 100 caps and resistors when it does not affect the top level mechanical assembly. My current part workflow looks like this:

  1. Download vendor’s step model (or hit GrabCAD, etc.)
  2. Create/Open footprint in KiCAD
  3. Open model in Freecad
  4. Make Fusion in FreeCAD
  5. Adjust rotation/size in FreeCAD, export VRML
  6. Add VRML to footprint in KICAD, check rotation (at this point KiCAD shows a ghost of the non-rotated part)
  7. Export adjusted part to new step file in FreeCAD
  8. Open new step file in FreeCAD, and export new VRML (this removes the non-rotated ghost in KiCAD viewer)

It looks long because it’s verbose. Making a part is pretty quick now.

Nice improvements, thanks again.

Aaron

Hi @aaron,

“I glanced at the rotation and scale macro, but it looked about like the same parameters and complexity as the FreeCAD placement dialog. I am guessing there is some advantage I am missing?”
with the new macro you can:

  • open in FC your model,
  • open and run the Macro,
  • select your FC file and click on Create Axis (this will put a reference for your VRML model in kicad)
  • select your STEP model and rotate X,Y,Z as required to align the object with the right axis sequence
  • use center X,Y,Z as required to center your model (typically is the center of your footprint)
  • use put on Z if you want to align the SMD model to plane Z
  • if everything seems aligned correctly, click on ‘scale to kicad VRML’ and get a scaled version of your model to be exported to vrml
  • check in kicad if the model is aligned…
  • if required use Translate X,Y,Z

    Note: this macro resets automatically the object properties, so it is easier to make placement in FC

If you want you can also configure the script to convert parts to bounding boxes, and selectively apply this rule to all except e.g. connectors, obtaining a mixed board with some real 3D models and some bboxes.

Some minor improvements:

  • more FC 016 compatibility
  • ${KIPRJMOD} var support for best 3D model portability

Maurice :smile:
PS: I develop very small boards that require all the models to be correctly located to the container, so that was my need for the 3D repo of parametric parts.

Hey maui, I can get the demo to work, and I’ve had your script working before in the past, but I changed to a new machine and broke my workflow. I’m trying to put it back together, but I’m getting this error after running the script in the command prompt:

Exception while processing file: kicad_SteupUp.FCMacro [could not convert string to float: none]

This is with Freecad 0.16 (5536 Windows 7 64 bit).

This is a great tool by the way! Thanks.

Hi @jwpartain1,
I would need some more info…

  1. which version of kicad StepUp script are you running?
  2. have you tried to download the demo project from
    kicad StepUp site and run it to test?
  3. which command are you using to launch the script and from which folder?
  4. could you post the batch file and the ksu-config.cfg file you are using to configure the script?

Please consider that all the parameters in config files have to be assigned to a right value…
if you comment a parameter without giving it a value, the script will get the next value as the value for the previous parameter… that could give this kind of error…

I’ve tested the script with win 8 64bit and FC 0.16 5560 git without problems.
these are the needed parameters in ksu-config.cfg files:

## put here your KISYS3DMOD path
./
## put here your model names that you don’t want to load (e.g. smallest ones)
none
## pcb color r,g,b e.g. 0.0,0.5,0.0,light green
0.0,0.298,1.0,lightblue (0,76,255)
## bounding box option for existing -bbox modules
bbox off default
## placement options
placement: useBaseOrigin #place board @ 0,0,0
## virtual modules to be or not added to board
noVirtual
## fuse modules to board
## be careful … fusion can be heavy or generate FC crash with a lot of objects
## please consider to use bbox or blacklist small objs
#fuseAll
nofuse #default

keep in touch,
Maurice

Hi maui, thanks for the thorough reply. I did solve it, noticing I had screwed up the ksu-config.cfg yesterday (wrote my KISYS3DMOD path over one of the comments instead of the “./”). One of my components is not placing quite right, but it’s likely something else on my end again.

thanks to the guys at Bitcraze for sharing my 3D kicad StepUp video :smile:

in the video the simple exporting procedure from kicad to 3D mechanical STEP model in just one click!

2 Likes

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:
https://twitter.com/andreabarisani/status/651292782447996929

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]: Inverse Path - USB armory Mk II
[2]: Made with kicad | KiCad EDA

@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:

@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:

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

1 Like

Congrats, saw it the other day.

2 Likes

thanks :smile:
Maurice

@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:

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:

  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

“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 )

@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

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

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

@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: