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

you can add a second path to StepUp config file

[prefix3D]
;; put here your kisys3dmod path or 3d model prefix path or 3d alias
;; only two prefixs are allowed; must finish with slash or backslash
prefix3d_1 = C:\Program Files\KiCad\share\kicad\modules\packages3d
prefix3d_2 = D:\extra3Dpackages

and then add a new var to configuration path for kicad, to match this prefix
http://docs.kicad.org/4.0.7/en/kicad.html#_configuration_of_paths

For github repo you can use the $KIPRJMOD var, as i.e. in this repo:
Icezum kicad portable project

from your screenshots and from your files, you have scaled your STEP models to 1/2.54 … that is not the way to work with StepUp… you need to have STEP model in scale 1:1, and you need to scale only wrl models.
Moreover you have offset and rotation in your footprint which is not suggested (supported but not suggested)

To check your models you can:

  1. load your footprint in FreeCAD (if you have installed StepUp as WB you are allowed to open a footprint directly in FC)
  2. import your STEP model
  3. check scale, orientation and position and when everything is fine, export STEP and wrl using the StepUp export button

Please have a look at
kicadStepUp-cheat-sheet.pdf
for further details

1 Like

The scaling in 3D viewer seems wrong to me. In FreeCad, I see the original MFG files and the exported step and vrml files all measure in FreeCad as the datasheet for this device claims they should measure. However when I insert this WRL into KICAD, with a 1:1 scale, it shows up like this.

If I clone / scale before I export the WRL, such that when I open the WRL file in FreeCad, it measures to be very small, it then shows just fine in the KICAD 3D viewer. It seems the KICAD viewer is confused and is scaling between metric and ANSI measurements. I guess for now I’ll just have to keep in mind to verify that FreeCad shows the proper measurements, and then scale the WRL accordingly. I expect long term that the WRL thing will go away. So getting the step file correct is the real important thing. For now I’ll just fudge the WRL files to make it work.

I will check my models in FreeCad as you suggest. I suspect that will be much better than checking them in KICAD as I have been doing.

On the cheat sheet, can I suggest a revision number or revision date, as well as a link to the official cheat sheet. Such that if someone copies this users are directed to the most up to date version, as well they’ll have a method for validating that they have a proper copy.

Use freecad stepup to export the 3d models. It takes care of correctly scaling the wrl model for kicad.

kicad 3d viewer uses 1.254 internal scale, so you need to scale the wrl accordingly before use it.

The link is always pointing to the most recent version… I’ll add a release note indeed Thx

It might be worth while to note on the cheat sheet, or similar the below.

Bad
KICAD path setting myLIB = C:\myLibLocation
KICAD 3D settings ${myLIB}3d/myChip.wrl
StepUp prefix3D_2 = C:\myLibLocation

Good
KICAD path setting myLIB = C:\myLibLocation
KICAD 3D settings ${myLIB}/3d/myChip.wrl
StepUp prefix3D_2 = C:\myLibLocation\

I just had a bit of a fight trying to figure out where the /'s should go. I finally got it to work. It would have be handy if the cheat sheet had an example.

1 Like

there are few helping comments inside the default ksu-config.ini file

The issue I was having, is that in my situation, KICAD does not want the back slash, while StepUp does want the backslash. It took me some trail by error to figure that one out.

Another comment, it appears to default save into prefix3D1, which is a standard repo. I’m not typically modifying files in the standard repo. I’m typically modifying files in my project repo. It would be handy if one could choose which location to save them in. It is not a huge thing. However I thought I would provide some feedback.

Using FreeCad to generate the WRL and STEP files is very nice. Thanks for this great effort. I really like StepUp.

use a different repo from the standard one is the suggested behavior.
For an easy start the default repo is configured.
Many users just don’t want to change the defaults.
Leaving the default repo is a way to let the tools works out of the box at the start… then a user can improve his/her configuration when has improved the knoledge of the StepUp tools.

:smiley:

@maui in the code that reads in the ksu file you could simply add the following:

if not (prefix_3d.endswith('/') or prefix_3d.endswith('\\')):
   prefix_3d += os.sep

Or use os.path.join to create the full file path instead of relying on string operations. This should also take care of it.

@Rene_Poschl

the issue is in kicad source code, not in StepUp, I already use this :wink:

1 Like

Good point, I can away change the default location to be my project instead of the kicad project. That change made it much better for me, as the project I’m working on has many files which I got to work on during a snow day.

I made a bunch of progress and I figured I’d share a picture and a link for some shameless self promotion. See below 3D in FreeCad. We have had several people 3D print enclosures or enclosure accessories. This model will likely help those folks make even better enclosures.

This board is for internal engine fuel and spark control. There is a wiki page about it found here.
https://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board

Thanks for the efforts with StepUp.

2 Likes

that’s the reason why StepUp has raised :wink:

PS:

  • you can configure StepUp to use bounding boxes or even to skip module filtering by height or volume… that will help in speeding up the mechanical process… (please refer to cheat sheet)
  • you may consider to switch to FC0.17 (it is in code freezing, so it is near to be the next stable release) … FC0.17 is offering multi-threading in loading STEP models and cutting the PCB holes … you could see a boost in loading the board :smiley:
1 Like

I have hardware drama’s FC0.17 doesn’t support my version of windows any more. At some point I need to get a larger HDD, then turn this HDD into a virtual drive. At that point I could start using a more recent version of Ubuntu, and then when ever I need some of the Windows software on this drive, I could boot the virtual drive. The only reason that has not happened yet, is that life keeps getting in the way. So I endure slower hardware. I agree FC0.17 is a significant improvement.

Hi there, StepUp is awesome and I’ve been using it for more than a year now
I got the latest version and installed it on free cad 0.17 on both windows and linux, and it runs smoothly
on my Mac I’m having some issues for with some library (probably relates to PySide??), here’s the log

FC Version 017-13519
kicad StepUp version 7.1.8.0
tolerance on vertex applied
applying Materials to Shapes
your home path is /Users/sherifeid
ksu file 'ksu-config.ini' exists
materials section present
turntable section present
compound section present
docking section present
constraints section present
font section present
useGridOrigin option present
prefix3D_2 found kicad/share/modules/packages3d/
3D models prefix=C:\Program Files\KiCad\share\kicad\modules\packages3d\
3D models prefix2=kicad/share/modules/packages3d/
pcb color=0.0,0.298,1.0,lightblue (0,76,255)
blacklist modules 
volume 0 heigh 0
bounding box option 0 whitelist 
placement board @ useBaseOrigin #place board @ 0,0,0
idf_to_origin True
last fp path 
last brd path 
virtual models addVirtual
export fusing option nofuse  #default
minimum drill size 0.0mm
export to STEP True
enable materials True
turntable False
compound allowed True
docking mode right
constraints mode all
kicad StepUp version 7.1.8.0
Traceback (most recent call last):
  File "/Users/sherifeid/Library/Preferences/FreeCAD/Macro/kicad-StepUp-tools.FCMacro", line 16461, in <module>
    singleInstance()
  File "/Users/sherifeid/Library/Preferences/FreeCAD/Macro/kicad-StepUp-tools.FCMacro", line 16424, in singleInstance
    for i in app.topLevelWidgets():
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'topLevelWidgets'

any ideas on how to fix it?

Hi,
please consider to use the StepUp WB instead of the simple Macro.
The WB is also available through FreeCAD Tools Menu ‘Addons manager’ as 'kicadStepUpMod’
This is the best way to get updates from StepUp
Have a look also to StepUp CheatSheet for some detail of the new features.

Thanks a lot @maui
it seems to be working now

1 Like

Hi @maui

Running kicad StepUp version 8.4.0.2 on FreeCAD 0.18

When “loading KiCad Board .kicad_pcb”, I have two missing models:

missing models
C:/Program Files/KiCad5/share/kicad/modules/packages3dE:/Mes documents/KiCad_v5/rg-5000-like/libs/rg-5000-like.pretty/MiniCircuits_TT1224.step
C:/Program Files/KiCad5/share/kicad/modules/packages3dE:/Mes documents/KiCad_v5/rg-5000-like/libs/rg-5000-like.pretty/GDT_EC90X.step

enabling ReadShapeCompoundMode
${KIPRJMOD}/libs/rg-5000-like.pretty/MiniCircuits_TT1224.wrl
 error: resetreset values of scale to (xyz 1 1 1)
${KIPRJMOD}/libs/rg-5000-like.pretty/GDT_EC90X.wrl
 error: resetreset values of scale to (xyz 1 1 1)
thread ViewFitting

I actually don’t have the .step files for these two components, but the .wrl files are present in the E:\Mes documents\KiCad_v5\rg-5000-like\libs\rg-5000-like.pretty directory

  • What are the “resetreset values of scale” errors ?
  • The $(KIPRJMOD) variable substitution looks weird in the error message regarding the .step files.

what did you setup the footprint to use?

You should scale the 3d model instead of using kicads hacky scaling option.
And yes there is a word duplication in the error message. should probably be

 error: reset values of scale to (xyz 1 1 1)

wrl is unusable for mechanical design as it is only a surface mesh not a true 3d model. (Short version: wrl is for pretty pictures and step for engineers)

What do you mean ? The board is looking good with the 3D viewer of KiCad, but the complete path to the .step files indicated in the error message looks messy:

C:/Program Files/KiCad5/share/kicad/modules/packages3dE:/Mes documents/KiCad_v5/rg-5000-like/libs/rg-5000-like.pretty/MiniCircuits_TT1224.step

(It looks like $KISYS3DMOD and $KIPRJMOD are concatened)

So, if understand correctly, the step files are required to be get these components displayed in FreeCAD, and the wrl files are useless / ignored ? In that case, why these wrl are mentioned in the StepUp log if they are ignored anyway ?

For legacy reasons all official footprints are setup to use wrl files in kicad internally. Both the kicad step exporter and stepup ignore the file ending and substitute it with step.