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

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.

@Efcis
StepUp is already giving all the answers:

  1. you are missing the3D STEP models MiniCircuits_TT1224.step & GDT_EC90X.step
  2. you have used scaling values for your WRL models MiniCircuits_TT1224.wrl, GDT_EC90X.wrl
    it is strongly suggested to use ONLY scale values to (xyz 1,1,1) … they will be ignored during the mechanical conversion.

So, if understand correctly, the step files are required to be get these components displayed in FreeCAD, and the wrl files are useless / ignored ?

Both StepUp and KiCAD accept STEP or WRL as 3D models.
You can use WRL for KiCAD (better aesthetic result) and when you will export your board to MCAD both StepUp or KiCAD will get the file name and search for the same name with STEP or STP extension to build the mechanical counterpart.

EDIT: this procedure should be mentioned in the pcbnew user manual because it is a big issue for new users.

2 Likes

@maui - I was reminded of this by the recent Solidworks post. There is a potential naming issue when using StepUp to create a STEP file for Solidworks.
If you only import 1 board into an assembly, all is well. Adding another board breaks once the assembly is saved / reopened. (Wrong PCB, parts in air because the PCB outline is wrong, etc)
The mechanical engineer and I spent a bit trying to track down the issue.

Apparently, Solidworks assumes that any entity with the same name is identical, even if they come from different files. So once a second PCB created by StepUp is added, one will have at least the wrong board outline, and the wrong tracks/silkscreen (if imported using StepUp), because in both cases the PCB / track / silk bodies have the same name.

The fix appears to be adding a unique prefix (I’ve used the board P/N) to the part / body names, minus the part models - they appear to be unique enough in the first place, since they include the footprint id.

Hopefully this saves someone else several hours of frustration…

1 Like

thanks for the feedback

would you please elaborate it a bit more?
Are you importing a STEP assembly generated by ksu and then adding an other STEP assembly by ksu into SolidWorks, you get a mixed assembly?

In FreeCAD for an object we have Name and Label… Label is directly visible, Name is a property ‘hidden’… I don’t have access to Sw to have the counter part assignment in Sw…

Would you please post a screencast of your issue?

Yes, I gave things another shot after posting this.
1 - Create an assembly.
2 - Add board one to the assembly, all is well.
3 - Add board two and thing break. In this case, the part models from board two, correctly positioned in relation to each other, showed up on the PCB from board one.

Assuming the “Label” is what shows up in the FreeCAD model tree, i.e the PCB shows up as a body called “Pcb”, under a part called “Board_Geoms”, then this is also what shows up in the model tree and gets used as the part name in Solidworks. It seems to treat each body or part in the imported STEP file as a separate part.

I’ll see what I can do with photos or a screencast after the holidays - I’m off until Jan 2 and don’t have access to SW from home.

Probably in Sw there are options to choose in which way you want to add/merge a STEP file (assembly) into a document… May be this can be solved just tweaking those options…

In FC if you just open a KiCAD board with kSU, and then you will open a new one, two different docs will be created… copying the second board into the first doc FC will automatically adapt the Names avoiding identical Name for the doc objects…
Then if you will export Board_1 and Board_2 from the same doc, you shouldn’t have any interference with the two Pcbs in Sw, also within your actual import setting.

Thanks, when I’ll have more data, I will be able to see how I could avoid your issue…

When i use my KiCAD-PCB Models in SW i first open the exported Step as a Multi-body part, then combining it to one solid chunk. If i remember correctly, this can be a pain because all parts are floating above the PCB. I think a layer is not imported correctly. On easy shapes it’s a quick fix, create a sketch on the pcb surface and extrude it like .2mm into the direction of the parts. After that you can combine everything. That said i haven’t used a multi pcb setup in SW so far.

I have a valid license for SW19, let me know if i can help somehow.

@gsocker
I’ve updated StepUp WB adding the following features:

  • allowing Opening or Importing a kicad_pcb file inside a FreeCAD file
  • generating uid for pcb & containers-
  • full support fo App::Part Links
  • full Hierarchy allowed for importing & assembling a pcb
  • pcb as solid instead of compsolid
  • multiple pcb allowed
  • apply Transparency option (from .wrl model materials)
  • added a warning message for GridOrigin missing on pcbnew file

Please update the WB and test if your issue is solved.

.

@Detzi I haven’t received any similar issues on SW…
Anyway, would you please update the WB and test if your issue is solved?

2 Likes

Sorry @maui i’d totally forgotten you :sweat:
I do not use the workbench or am not aware of that. What i do is i click on File->Export->Step in PCBnew (Kicad Version: (5.1.4)-1, release build ) the output is this file:
sample.7z (448.1 KB) i had to compress it, it’s bigger than the filesize limit.

If you look closely you can see that there is a gap between components and PCB presumably its the copper layer thats missing. I don’t think its tied to solidworks either since Freecad does display the same thing:

Then this might be the wrong thread to post to. After all this is a thread for announcing improvements made with the freecad extension “kicad-stepup”. That extension can directly import a kicad pcbnew file. (You do not go through the export stp step within kicad when using stepup)

I posted here in the first place to describe a general workflow to @gsocker as an answer to his question.
The other post i made today has the only purpose to give feedback to @maui since he asked for it. So i actually think its the right place, isn’t it?

I’ve updated StepUp WB adding the following features:

  • allowing Opening or Importing a kicad_pcb file inside a FreeCAD file
  • generating uid for pcb & containers-
  • full support fo App::Part Links
  • full Hierarchy allowed for importing & assembling a pcb
  • pcb as solid instead of compsolid
  • multiple pcb allowed
  • apply Transparency option (from .wrl model materials)
  • added a warning message for GridOrigin missing on pcbnew file

Please update the WB and test if your issue is solved.

@maui
Yes, it does fix the issue. I was doing the equivalent of the UID additions using the part number. Multiple boards now import correctly with no additional steps.
Thanks

1 Like

Hi @maui
Not sure if I’m doing something wrong. Let me explain

In FC (0.19 appimage on Ubuntu), I imported the ver 5.1.6 .kicad_pcb file to work on making the enclosure.
Then, I decided that the push button switch needs to be 13mm tall instead of 5mm.
Went back to KiCad, in push button properties, 3D settings, I replaced the 5mm tall 3d model with the 13mm tall one.
But now I can’t figure out how to update this change in FC.
I tried various ways but nothing worked.
If I delete the .kicad_pcb file in FC project, and try importing it again, it opens up in a new FC project, instead of being added to the current one I’m working on.
So I end up with one FC project file containing the unfinished enclosure but without the .kicad_pcb and a second FC project file containing the updated .kicad_pcb file, but not the FC enclosure part.

Got any tips ?

Hi @Anool

In FC, instead of using ‘File Open’ menu, use ‘File Import’ menu… this will load the kicad_pcb inside the same active document you are working on.
Moreover, if you have changed only some model, you can just pull only those inside your FC document updating the design (but this requires a bit more work).

1 Like

use ‘File Import’ menu…

duh, facepalm !!!

pull only those inside your FC document updating the design (but this requires a bit more work).

I’d like to know how this works.

‘File Import’ feature for ksu has been added not so long time ago, before it was simply working as ‘File Open’; before the only way was to copy and paste the loaded pcb.

this is available through push-pull FC-KC collaboration.
If a fp has been changed in KC, you need to sync the 3D model with the Ref & TimeStamp in KC
some tips here:


Hi Maui
since you introduced me to this workbench, I’m using it. although I noticed that it doesn’t import the footprints from the kicad PCB file nor any 3D models of the used components.

So:
I click on “Load Board” and I import the KiCAD PCB and it returns hese errors.
I think it’ because it goes to check on C:\program files\kicad while everything is on K:\Kicad
How can I change it?

Moreover: each time it pops up the window that tells the suggested Import/Export STEP FreeCAD Preferences that I already set up as suggested.

here below the error message and the final result.

Version 10.20.3
FreeCAD 0.21.1
image

EDIT ok found. I added the new path on Preferences. it worked partially out. It’s not necessary to remove the default one. Just by adding as alternate, solved the adding of components. Still all the footprints are missing (except for one and I have not clue why)

image

here the one not found but there is:
image