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


#81

Got it working, just had to rename ksu-config.ini.
FOund the file in a folder named SPB-Data. When I use the export feature from stepup-tools to VMRL and STEP, files are stored in SPB-Data.
Is it a way to set the export folder to the same as the same folder I opened the footprint?


#82

good! :smiley:

If you start modeling or Save your Part in FC format .FCStd your export will be in the same folder of your FC file; starting from a STEP model, not saved as FC file, the export will be in the folder configured as the prefix of your 3D models… (in your case it should be the SPB-Data folder I suppose)
Maurice


#83

Have one more question.

is it possible to not have Stepup-tools window be set to “always on top”?
A bit annoying when you switch between programs and that windows is blocking parts of the screen.


#84

if you just minimize it it will not “stay on top”…

I’m working on a dockable version… but it will take a bit … (working on it on spare time :wink: )


#85

Hey Maurice

once again thanks for the awesome job
since I have quite a few board outlines made as a footprint (I know its not officialy supported by Kicad)
I was wondering if it could be supported in Stepup
I have been trying to play around with your macro and got it to read the edge cut, simply by adding “or ‘fp_line’” in the routineDrawPCB function. but I cant figure where you read the position and rotation of the footprint in the code.

Cheers
Frank Severinsen


#86

Hi @Shack
following this conversation


I’ve already implemented cutout for footprints (also if it is not officially supported in kicad), so it should work also for the all board outline as footprint :smiley:
If you want you can send me, by message or uploading here, a bare board cutout as footprint to let me do some more checking …
I should be able to deploy the new release in few days (doing some checking now)…
still in development the docking option (that will be probably added during XMas :smiley: )


#87

thats is so beautiful! I have PM’ed my board outline footprint
does your code figure out if the edgecut is inside another edgecut aka if its the board outline or a hole?
please let me know if I can be helpful somehow :slight_smile: I would especially like to do some beta testing.

thanks for your awesome work!

Cheers Frank Severinsen


#88

it should…
here is the board inserted in kicad as module and loaded in FreeCAD by StepUp :smiley:


EDIT:
it does :smiley:


#90

Hi @maui your project is amazing!!!

I am using it, I just tried with a little project and it works prefect :slight_smile:. But I try with a big project and always when I load the the *.kicad_pcb stay in start cuting. Maybe you could help me with it.

Thanks :slight_smile:


#91

I get more information:


#92

Hi @kdpatino
from the errors I see it seems you have a board with some pads without layers …
I’ve tried to create a similar situation with the kicad footprint editor, but I cannot reproduce the case…
(tested with th, smd, connector and npth pads)
have you tweaked in some way one or some models in your board?
(i.e. editing the kicad_pcb file by a text editor)

would you mind to share the pcb board or to send it privately by message to see if I can find the prob?
Maurice


#93

Hi, Maurice,
I’ve installed new v0.16 FreeCAD and StepUp stopped working.
StepUp’s path is “C:\Program Files\KiCad-Stepup\demo”,
new FreeCAD’s “C:\Program Files\FreeCAD 0.16”.

Bat files (e.g. C:\Program Files\KiCad-Stepup\demo\launch-kicad_StepUp-Tools.bat) had contained …\FreeCAD 0.15 path, so I modified batch file to …\FreeCAD 0.16.
It then succesfully fired FreeCAD, FreeCAD started to run macro, but it ended up “Exception while processing file: kicad-StepUp-tools.FCMacro [No option ‘last_pcb_path’ in section: ‘last_pcb_path’]” error.

If I start FreeCAD manually, load “C:\Program Files\KiCad-Stepup\demo\kicad-StepUp-tools.FCMacro” and run macro with Ctrl-F6, I got a
“Traceback ˙(most recent call last): File “C:/Program Files/KiCad-StepUp/demo/kicad-StepUp-tools.FCMacro”, line 1309, in cfgParsRead(configFilePath) File “C:/Program Files/KiCad-StepUp/demo/kicad-StepUp-tools.FCMacro”, line 745, in cfgPar”… message. Message should continue: this much is what I see on my display. The message was on-screen only for a couple seconds: I needed a printscreen to grab the message. Is this traceback saved to file?

I had one guess: changed directory name from “C:\Program Files\FreeCAD 0.16” back to “…FreeCAD 0.15”, but couldn’t help.

Deleting both FreeCAD and StepUp, then reinstalling FreeCAD 0.15 and StepUp probably could solve the situation, or do you have any proposal what to do?


#94

Hi @novaktamas
Your problem is probably related to an issue that ConfigParser has with utf-8 … Do you have some path with utf-8 characters in?
To solve your issue, ATM, just delete your ksu-config.ini and after starting stepup tools just edit the new generated ksu-config.ini file to adapt your 3D folder path…
Kicad StepUp works fine up to latest FC 0.17…
I’m working to overcome that utf-8 prob just substituting ConfigParser with my own parser… But this is taking a bit…
Maurice
PS to view error messages just enable Report View in FreeCAD …


#95

Hello @maui

I had run again your script with some debugging info and I realized what was the component with troubles, so now It works perfect… its amazing!!!. thanks for your support .

Regards,

Kevin


#96

Hi Maurice,
I don’t have any ksu-config.ini file. I think you mean ksu-config.cfg in “C:\Program Files\KiCad-Stepup\demo\old-script”. I deleted this .CFG file but got the same message when run FreeCad and executed the macro “C:\Program Files\KiCad-Stepup\demo\kicad-StepUp-tools.FCMacro”.
I also tried …old-script: “C:\Program Files\KiCad-Stepup\demo\old-script\kicad_StepUp.FCMacro”, got “list index out of range” error.
I also tried to uninstall FreeCad 0.16 and re-install 0.15: no success.

My Win7 is Hungarian version where we have some acuted characters over English 26 letter alphabet, but I never use special characters in paths (not even spaces, except in “Program Files”, only “-” and underscores):

Stepup: C:\Program Files\KiCad-Stepup\demo\old-script
KiCad: C:\Program Files\KiCad-7409\bin
Kicad work: D:\MUNKA\Tekinvest\RGB-keyb\RGB-kbd-128\KiCad
packages3d: D:\MUNKA\KiCAD\packages3d

Any idea what to do next?

Thanks,
Tommy


#97

Hi @novaktamas
I see you are using a recent release of kicad StepUp ‘kicad-StepUp-tools.FCMacro

then your config file is not anymore ksu-config.cfg but it is ksu-config.ini that you can find in

NB the new config file is in home user dir
Linux and OSX:
~/ which is $HOME
Windows:
%HOMEPATH%
Click kicad-StepUp-tools.FCMacro Config Button to display the ksu-config.ini file
and Help button for a quick Help
In case of any problem, just delete ksu-config.ini file and restart the kicad StepUp
tools… a new ini file will be generated
edit your 3D prefix and re-run the tools

kicad StepUp is working fine with FC 0.15, 016 and latest 0.17
Please consider to download latest release:
just recently updated for new features…
Latest Enhancements:
STEP multi-part allowed (creating compound)
EdgeCuts allowed for footprint that will generate Cuts in Board
Pcb Edge as footprint allowed
edge tolerance on vertex coincidence for easier designing

KiCad: C:\Program Files\KiCad-7409\bin Kicad work: D:\MUNKA\Tekinvest\RGB-keyb\RGB-kbd-128\KiCad packages3d: D:\MUNKA\KiCAD\packages3d

so just use:
C:\Program Files\KiCad-Stepup\demo\kicad-StepUp-tools.FCMacro
and adjust your prefix in ksu-config.ini (that you will find in Windows %HOMEPATH%) to:
[prefix3D] prefix3d_1 = D:\MUNKA\KiCAD\packages3d\ prefix3d_2 =
your %HOMEPATH% should be something like:
C:\Users\your_username

Thank you for using my StepUp tools since its first release :smiley:
Please feel free to ask any further advice you may require
Maurice

PS Don’t use scripts from old-scripts DIR
Stepup: C:\Program Files\KiCad-Stepup\demo\old-script
they are there just for reference


#98

A huge step forward :grin:

  • switched back to FreeCAD 0.16
  • deleted ksu-config.ini, then edited .ini just recreated
    Now FreeCAD+script runs, but my project is not perfect yet:

My workflow is for a custom connector:

  • download STP from manufacturer (e.g Molex)
  • I load STP into Creo 3. When loading I can choose loading as an assembly (more parts) or a single part. I must select single part (or resulting WRL won’t be accepted). Then I save single-component model again as STP.
  • I load the modified (single component) STP into FreeCAD then export from FreeCAD to WRL.
  • Copy both single-component STP and new WRL to my packages3D directory (both the same name, and rename STP->STEP)
  • I start KiCad Footprint Editor and load connector’s footprint (I created previously)
  • set Footprint properties/3D settings to my WRL (not with full path, but like ${KISYS3DMOD}/Connect.3dshapes/…WRL)
  • set scale/rotation/offset experimentally to look good
  • save footprint
  • change footprint to the new one in pcbnew.

Now 3d viewer shows the board perfectly (well aligned).

Then I want to export board to STEP for MCAD.

  • I start script in FreeCAD
  • Load kicad Board *.kicad_pcb
    Script slowly draws components one-by one (abt 20 minutes!! is it normal?), but new component is not well positioned. Finally I got lots of “…WRL error: reset values of scale to (xyz 1 1 1 )” errors, which is an explanation to bad positioning.
    Do you know what is the problem with my WRL’s?

Thanks again…I mean to create a new, more detailed workflow of using StepUp for you. I see much better, what a rookie doesn’t know/where are the traps:)))

Tommy


#99

Hi
You should use stepup to align the model to the footprint before exporting it to vrml
The position in kicad should be all zeros and the scale should be 1 1 1
Edit: shown here https://youtu.be/O6vr8QFnYGw


#100

Hi @novaktamas
that will be a long reply :smiley:

NB scale to 1,1,1 is MANDATORY for any mechanical conversion/collaboration

it highly depends on your models… I can assembly a board with hundred parts in about 30s…
Do you have the exportFusing = fuseAll option in your ksu-config.ini file? This is a time consuming option…

you don’t need to rename STP to STEP… the StepUp tools will search for .step, .stp, .iges, .igs

  1. I would suggest to start easily with i.e. a single square board with a single footprint
  2. with the recent StepUp release (since v3116) it is possible to align models in kicad pcbnew and assembly them correctly, but I would suggest to use this alternative workflow:
    a) download STP from manufacturer (e.g Molex)
    b) load STP into FreeCAD
    c) analyze your 3D model to see if it is a SOLID or a collection of SURFACES
    c1) if it is a SOLID just use the solid model
    c2) if it is a collection of SURFACES make a compound of surfaces (Part WorkBench, Make compound)
    d) load footprint in FreeCAD as @Shack suggested (‘Load kicad Footprint module’ button)
    d1) NB footprint must have
    (model path/yourModel.wrl (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) )
    ‘z’ rotation is allowed if needed
    That is what is also recommended for kicad library
    e) align your model (SOLID or COMPOUND) using i.e. the StepUp tools to the footprint in FreeCAD
    (That will allow you to align the model to your footprint in a mechanical environment… For most SMD models typically is enough to click on Rotate X if needed, Center X, Center Y , Put on Z buttons)
    f) when aligned, click on the button ‘Export to kicad: STEP & scaled VRML
  3. copy both STEP and WRL models to your 3D DIR PATH
  4. check if your model is fine both in footprint editor and pcbnew in kicad
  5. run the script/macro
  6. load the board using the ‘Load kicad PCB board’ button
  7. check if everything is fine
  8. if everything went fine, iterate the process for all the new models you need to add

Hoping to giving you the right road to obtain your pcb 3D model result :slight_smile:
Maurice


#101

How to decide if solid or surfaces?

In MCAD there are “part” and “assembly”. Parts may be solid or may consist of surfaces. It seems my STEP is an assembly: it contains multiple solid parts.
See printscreen of FreeCAD:

Yes, the problem is surely with model complexity. I exported STEP from KiCAD, and it resulted a 700MB stp file…hard to swallow for my poor box:-). Stp downloaded from part manufacturer can be highly detailed. E.g. I have a stp for a switch where even internal metal and plastic structures are 100% detailed!! Is there a way to simplify those over-complicated models?