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

Hi Andrew,
at the moment the script does not read WRL orientation, only footprint orientation…
may be I will take in care those options in future

the right solution is number 1)
open the STEP module in FreeCAD and just offset and rotate it in a way that will fulfill the footprint orientation and position…
if you want to do it easily just use this FreeCAD macro
http://www.freecadweb.org/wiki/index.php?title=Macro_CloneConvert
or just Place and Rotate the solid in FreeCAD using the Property Data Tab
and save the modified model
I don’t see any problem in just eventually offsetting and moving the origin of the STEP model…
you don’t scale or change any dimension…
the nbr 2 option is not to be used…

please let me know if that way is fine for you or you think there are some inconvenience in using it…
Maurice

Hi Cirilo and Andrew,
now the script can manage also wrl offset and orientation.
I’ve done a test with this module that I found at the official repository,
Displays_7-Segment.3dshapes/Cx56-12.fcstd
generated in FreeCAD, exported to VRML with the offset to be complaint the footprint values.
Cx56-12.wrl
Cx56-12.kicad_mod
then I applied the same offset before export the STEP model and everything became aligned…
same 3D view in kicad and in MCAD!
attached the STEP model Cx56-12.step (850.2 KB) to be used with the script
So I wouldn’t see any limitation in using the script… just the base would be a STEP or FreeCAD model (not wings3D)
:smile:

I seem to have an issue running the demo that might be Windows related. Opening the Demo.pro and pulling up pcbnew, I do not see the WRL models populated in the 3D view. However, the FreeCAD step conversion works beautifully with all the STEP models properly shown. If I edit a footprint in pcbnew to set the WRL model to an absolute path (i.e. ‘C:<somepath>\shapes\c_tant_D.wrl’ instead of the defualt ‘././shapes/c_tant_D.wrl’) the pcbnew 3D looks good but the FreeCAD STEP model throws a file not found error. I noted that error shows the correct path and filename.

Anything I am missing running on Windows?

I’m running Freecad 0.15 and KiCAD r5596 on Windows 8.1.

Aaron

Ok, after some digging, I have found two things in my case:

  1. For the WRL to render in pcbnew, I have to remove and re-create the links in the footprints. I assume this is a Windows vs Linux path issue.

  2. The FreeCAD macro will throw a file not found error if the WRL relative link is more than five sub-directories deep. I verified this was not a whitespace or path length issue. Also, oddly, a direct link with spaces doesn’t work.

So, I seem to have to use direct links without white space in the path to get both the WRL to show up in pcbnew and the FreeCAD Macro to work on Windows.

Aaron

Hi Aaron,
I use the script in windows 8 with dir with spaces and more then 5 levels without any issues.

Try to cd to the project folder and then launch kicad by command line
(e.g. cd C:\Users\your user name\Downloads\demo and launch kicad demo.pro )
so the path will be fine to the demo models and then you should see the .wrl models
Or just launch the demo.pro double-clicking on the file …

The problem of non displaying wrl models is just a path problem for kicad demo project…
The script doesn’t have anything to do with the displaying of wrl models in 3d-viewer.
The demo.pro has been done to be moved to any location, so you need to follow exactly the readme instructions to have all in the right mode.

There is also a config file for the script (ksu-config.cfg), so the user can adjust the path for its own designs/preferences.

Thank you for trying the script and for your feed back
Maurice

Maurice,

You are correct. Launching from the command line fixes the WRL display issue.

I have StepUp working now on a new board design and updated a previous design. The workflow is straight forward after walking it once. Currently, I am exporting boards into Inventor as part of a larger product assembly. The previous workflow was to export the IDF, then populate the major component STEP models on the MCAD side.

This works great, thanks for all your effort on this. Between this effort and CERN’s differential routing features, I have been able to move to KiCAD instead of a much more expensive option.

Aaron

3 Likes

Hi @aaron,
I’ve updated the script


adding a starter user guide
kicadStepUp-starter-Guide.pdf
and a FreeCAD macro to easily align and convert to vrml, manufacturer’s 3D STEP models
move-rotate-scale.FCMacro
plus some minor improvements.
hyOzd and me have also done a new repository with parametric STEP models for:
SOIC, SSOP, TSSOP, SOT, QFP (all gullwings in general), QFN ICs, DIP ICs, Chip Resistors, Chip Capacitors, Tantalum smd capacitors, Aluminum Radial smd and TH capacitors, Pin Headers.

The models can be parametric generated or just downloaded in STEP and VRML format.
Maurice

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: