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


#122

My suggestion is to setup a local footprint library.

Thank you, I was thinking of doing that at some point anyway, but will do it straight away.

I think it will help with the path problems I had with StepUp originally (now solved, but I am not entirely sure why).


#123

Maurice,

Thank you for the very, very nice and clear job! It helps me (and others) a lot, saving our time.

And, of course, there are some gimmicks/questions about future of your child:

  • Importing silkscreens. This not only will give more natural look of a PCB assembled, but will provide more usable look of it in documentation. On my hand this is a must;
  • Importing pads/tracks. While this option is not absolutely necessary for many of us, sometimes it will help in constructing shields for RF components and supposing possible interference with metal parts of a box/construction;
  • Importing Dwgs.User (User Drawing) layer. Some thing/marks there will help a lot in a complete project. Without such import aligning already created at this layer info to imported PCB my hands is not a kind of quick task.

And the last not least.

After reading supplied with The Tool (kiCAD StepUp for FreeCAD) documentation, I not understand the fact I must to have both VRML and STEP libraries for parts. I does it only by the way of import. So, it must be clear in docs:

  • For importing PCB from kiCAD you must to have libraries in STEP, VRML is possible to create by the way.

Sincerely,
Eugenijus
[just switched from Eagle to kiCAD]


#124

Hi,
you need both WRL and step if you use kicad 4, the next release will support directly both.

In general if you need to have detailed 3d view of your board including technical layers, the best option is to export the kicad_pcb to wrl.
Step export is most suitable for mechanical integration.


#125

Thank you for quick answer!

How it can be done? Is it somewhere at KiCAD, at StepUp or I need some additional plug-in or WB?

While mechanical view is my main target, and it is solved trough your StepUp (TNX x 100), sometimes “designer” view is welcome, esp. for documentation.

Sincerely,
Eugenijus.


#126

In pcb_new: file->export->vrml


#127

[smiling]

Oh, RTFM… I promise.
It is too easy to learn KiCAD, but distribution of some menu things and new shortcuts ideology for new user are sometimes confusing.

Your and Maui made my day. Today.


#128

After testing such export (.wrl) from KiCAD, I found that is sometimes is empty, sometimes not.
If I will found how to reproduce collision, I’ll report it.


#129

How can I define new materials in StepUp? I specifically need:

  • a shiny black plastic (surface like glass, but opaque), e.g. for TSOP-IR-receivers
  • The typical grey-LED-color for IR-diodes
  • orange and green glass/plexiglass for relais

Best,
JAN


#130

For stepup or for the scripts? For the scripts there is a shaderColors.py file in the _tools directory.

For stepup it is hardcoded in kicadStepUptools.py starting at around line 1500 (plus or minus a bit depending on version. But you could simply search for the line as_is="")

Defining the color values is a bit harder but there is a tutorial out there.
Edit: found the tutorial: Tutorial and guidelines for better materials on 3D models


#131

Hello guys. I have a trouble with the app.
I have downloaded the StepUp, opened the demo with KiCad, I can see the PCB and everything is fine.
Next, I installed Freecad for Windows x64 and when I started the Macro, it just doesnt work.
Here I send you an image with the error. I have reinstalled it and nothing happen.
I really dont know why

It says:
Traceback (most recent call last): File “C:/Users…/kicad-StepUP-tools.FCMacro”. line 39555, in ini_content=cfg_read_all() File “C:/…/kicad-StepUP-tools.FCMacro”, line 3679, in cfg_read_all with codecs.ope(ksu_config_fname’w’, encoding=‘utf-8’) as cfg_file: File …


#132

First of all I would suggest to remove all your StepUp files, included the configuration one in your user dir (c:\Users\brian)
Then install StepUp using FC tools menu (FC 0.17) or FC add-on installer if you are on FC 0.16
To have a more detailed error reporting, enable ‘Report’ Panel in FC.
Please refer to


#133

Thank you for the reply!
Ok, I installed it in that way too but the error persist.
This is what Ive got in Report Panel in FC.

PoM not present
FC Version 016-6712
kicad StepUp version 7.1.6.7
tolerance on vertex applied
applying Materials to Shapes
your home path is C:\SPB_Data
ksu file doesn’t exist
making default
Traceback (most recent call last):
File “C:/Users/brian/AppData/Roaming/FreeCAD/Macro/kicad-StepUp-tools.FCMacro”, line 3955, in
ini_content=cfg_read_all()
File “C:/Users/brian/AppData/Roaming/FreeCAD/Macro/kicad-StepUp-tools.FCMacro”, line 3679, in cfg_read_all
with codecs.open(ksu_config_fname,‘w’, encoding=‘utf-8’) as cfg_file:
File “C:\Program Files\FreeCAD 0.16\bin\lib\codecs.py”, line 878, in open
file = builtin.open(filename, mode, buffering)
<type ‘exceptions.IOError’>: (2, ‘No such file or directory’, ‘C:\SPB_Data\ksu-config.ini’)


#134

You still use the macro instead of the workbench :wink:

The hint is in [quote=“Briansan, post:133, topic:1048”]
C:/Users/brian/AppData/Roaming/FreeCAD/Macro/kicad-StepUp-tools.FCMacro
[/quote]

If you download the latest version of stepup you should nto get a FCMacro file any more. You should only get a folder called “kicadStepUpMod”.
Copy that folder into “C:/Users/brian/AppData/Roaming/FreeCAD/Mod/”

Stepup should then appear in the workbench selector. (drop down menu in the top toolbar or under view->workbench)

If you already installed it with the addon manager you should already be able to start stepup that way.


If the problem with the ksu-config.ini file persists, you can try and copy the default ksu-config.ini (3.3 KB) file to the location given in the error message [quote=“Briansan, post:133, topic:1048”]
C:\SPB_Data\ksu-config.ini
[/quote]


#135

Now the workbench works. But the error is the same.

However, I donwloaded the ksu-config.ini, put it in the location:
C:\SPB_Data\ksu-config.ini
and the error dissapeared.

I dont know if it is a new version with some kind of bug, but now it works!

Thank you so much Rene!


#136

It seems freecad (or the python interpreter that comes with it) is for some reason not allowed to create files in that location for your system. This might be because you use a non standard location for your user data. My guess would be that some MS safeguard does protect that location from write access by freecad. (As you where able to create the file yourself.)


#137

Are you able to change some settings now? (i.e. changing the checkbox of ‘Material Properties’)?
Closing and re-opening FC, is this setting remaining as per your choice?


#138

It is working perfectly! No worries…
Thank you! To all!

Cheers!


#139

Hello,

I’ve used StepUp before, and it’s great. Awesome work and thanks for doing this. I’m currently using it as part of an open source PCB project, which is triggering me to ask some questions.

At the moment I’m hitting some problems with scale, and some questions about how I should be using the file names.

My first question is if there is a way to deal with the file names on repositories not found in the KISYS3DMOD location. In this case the repository structure is like this.
./KICAD
./KICAD/3D
./KICAD/project_1
./KICAD/project_2

Lets assume the PCB repository was checked out to C:\ . In KICAD under 3D setting when you add your file with a relative link to KISYS3DMOD it looks like this.
…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.wrl

The …/…/…/…/…/…/ is because the windows default for KISYS3DMOD is

C:\Program Files\KiCad\share\kicad\modules\packages3d\

Of course if you local repository is something more like “C:\my_personal_file_structure\library\3D” and you have to divulge your personal file structure, which is not desirable. Is there a way to provide links without divulging your personal file structure? As well is there a way to provide these links in a portable fashion, as my personal file structure is not going to be the same for someone else who checks out this repository. Right now someone who checks out this open repository needs to either re-create my personal file structure, or they need to update the links to what ever their personal structure is? Can I create a path for something like LOCALREPO which can be used by both KICAD and StepUp such that my repo does not need to rely on links with my personal file structure? How does KICAD and / or StepUp expect me to link my repo, such that these great tools function together harmoniously?

My other problem and questions is about scaling.

This is how it looks in KICAD 3D viewer.

After running StepUp, this is how it looks in FreeCAD R0.16
See below post. Apparently new users can only post one picture per post. So I’ll have to include pictures in separate posts.

If I scale the PCB by 1 / 2.54 = 0.393, It looks like this.
See below post. Apparently new users can only post one picture per post. So I’ll have to include pictures in separate posts.

The link below includes the FreeCAD files which generated the step and wrl files. The c-172319-1-k3-3d.FCStd file is fairly basic. I imported a file from the MFG, which is then scaled such that KICAD is 1:1. The KICAD does rotation and offset.

https://cp.sync.com/dl/882b2e040#ba9ctzgr-w5ab4gt5-aca8u7fu-jszd9by8

Here is a copy of the reports view log.

PoM not present
FC Version 016-6706
kicad StepUp version 7.1.7.9
tolerance on vertex applied
applying Materials to Shapes
your home path is C:\Users\Vista_64_D630
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
3D models prefix=C:\Program Files\KiCad\share\kicad\modules\packages3d
3D models prefix2=
pcb color=1.0,0.1,0.0,red (255,25,0)
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 C:/KICAD/172319-1_52pin-connector
virtual models noVirtual
export fusing option nofuse #default
minimum drill size 0.0mm
export to STEP True
enable materials True
turntable True
compound allowed True
docking mode right
constraints mode all
kicad StepUp version 7.1.7.9
export to STEP True
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
3D models prefix=C:\Program Files\KiCad\share\kicad\modules\packages3d
3D models prefix2=
pcb color=1.0,0.1,0.0,red (255,25,0)
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 C:/KICAD/172319-1_52pin-connector
virtual models noVirtual
export fusing option nofuse #default
minimum drill size 0.0mm
export to STEP True
enable materials True
turntable True
compound allowed True
docking mode right
constraints mode all
kicad StepUp version 7.1.7.9
opening C:/KICAD/172319-1_52pin-connector/172319-1_connector.kicad_pcb
my file path C:\KICAD\172319-1_52pin-connector
Failed to TuneWindowsGestures. Error: DLL entry point for SetGestureConfig not found in user32.dll. Could not tune Windows gestures.
PCB Loader
pcb thickness 1.6002mm
kicad_pcb version 4
board area [60.134499, 98.234499, 184.975501, 132.270501]
aux_axis_origin[0, 0]
2d circle closed path
2d circle closed path
2d circle closed path
2d circle closed path
2d closed path
max Length=124.46 index=4
running time: 0sec
start cutting
generating flat holes
cutting time 3
Shape already removed
running time: 4sec
FC Version 016-6706
placing board @ -122.555,115.2525
building up pcb time 4
start adding constraints to pcb sketch
adding constraints time 0
running time: 5sec
VBO status False
ReadShapeCompoundMode status False
…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.wrl
adjusting Relative Path
step-module-replaced C:/KICAD/172319-1_52pin-connector…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.wrl
model name c-172319-1-k3-3d
opening C:/KICAD/172319-1_52pin-connector/…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.step
c-172319-1-k3-3d
module C:/KICAD/172319-1_52pin-connector/…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.step
…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.wrl
adjusting Relative Path
step-module-replaced C:/KICAD/172319-1_52pin-connector…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.wrl
model name c-172319-1-k3-3d
opening C:/KICAD/172319-1_52pin-connector/…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.step
c-172319-1-k3-3d
module C:/KICAD/172319-1_52pin-connector/…/…/…/…/…/…/KICAD/3d/c-172319-1-k3-3d.step
running time: 34sec
exporting to MCAD
C:/KICAD/172319-1_52pin-connector_72319_1_connector.FCStd
Board Placed @ 0.0;0.0;0.0
kicad pcb pos: (122.555;-115.252;0.00)
running time: 41sec
running time: 41sec

Why is this scale coming in wrong, and how do I get it to scale properly?

KICAD version is 4.05, this is on a Vista 64 bit platform, with FreeCAD R0.16. StepUp is launched via workbench pull down.


#140

After running StepUp, this is how it looks in FreeCAD R0.16


#141

If I scale the PCB by 1 / 2.54 = 0.393, It looks like this.