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


#102

Load them in FreeCAD and delete the parts you don’t want.

If that still doesn’t work you have to remake it yourself as you can’t get rid of details in an automated way that I would know of for MCAD.


#103

I use DesignSpark Mechanical to open the original STEP file and see if there are SOLIDS or SURFACES


yes in fact… the best option would be to make a union of parts to obtain a single object fused … FC has some issues in fusing objects when they are coplanar and don’t have any common parts… sometimes is sufficient to move a part i.e. 10um (0.01mm) to be able to make a usable union of parts… or just try with PTCreo and check the result in FC
Anyway the latest release is supporting multi-part STEP models … to align those just use Part Make compound and align the compound… this it will be a bit time consuming when assembling the board, because the multipart, reloaded in FC will have to be re-elaborated as compound… so the fused object is the best option

as @Joan_Sparky pointed out the simplest is to delete the sub-parts you don’t want in your MCAD sw
An other option is to use bounding boxes and i.e. height or volume constraint for parts you don’t consider useful for your mechanical design… then kicad StepUp will assembly only relevant parts and will substitute a part with its bounding box

Here an example of a board with small volume parts discarded, bounding boxes on internal parts, and connector as real STEP models

The result will have a much lighter file size for STEP


#104

Hi Maurice,
Firt of all, congrats for your KiCAD StepUp

I’m trying the wrl export feature and I like to add my materials
How can I do it?

I think the wrl file created by KiCAD StepUp has all material available included it.

my test file:
Terminais.wrl (18.7 KB)

Jorge


#105

The materials in stepup are hardcoded. if you want to add more materials you need to add them to the code.


#106

Hi @Tech_JA
you can select the materials among the available using the combo box

If you want to add or modify the materials, you need, as @Rene_Poschl pointed out, to add/modify the code inside the ‘py’ or ‘FCMacro’ file


#107

You can also use a text editor to edit your WRL file and manually edit your materials.
I made this guidelines that will help understand how materials work:


#108

Hi Mario @kammutierspule
would you mind to post the two Materials documents in LibreOffice format? ATM we linked the pdf, but then tey are not modifiable to add new materials :wink:
Then we could include them at the packages3D GH repo


#109

thanks for the replies
I will check the python code to add more materials

Hi Mário,
yes, I know I can edit the wrl file to edit the materials but it will more simple if I can choose the correct material in KiCAD SteUp

Maurice,
a suggestion:
Could be a nice feature if you add file for user can add owns materials list


#110

Hi @Tech_JA
StepUp has started as a single macro file, so it is still a single file embedded in a FreeCAD workbench…
The idea to include a material list is a nice feature, but it will require to be compatible with both WB and Macro approach…

At the same time, if you have defined some nice materials, please post them here or at GH repo…
I could just add those to StepUp and update the suite for all users…

Thx
Maurice


#111

Well i separated the material definitions for the vrml export used in our cadquery scripts. (Not sure if my implementation is still used.)
It might be possible to use that part for stepup. But it will definitely require some work. I will not be able to look into this until after the v5 release. (And the list of things to do after the v5 release is already quite long.)


#112

Hi, I am new to Kicad and FreeCAD and have much to learn so please be patient!

I am trying to create a PCB with just a DB25 male connector and import it into FreeCAD.

I am using Kicad 4.0.7-e2-6376 and FreeCAD daily (12847 Git) on Ubuntu 16.04.3.

I installed StepUp as a workbench using the new Addon Manager in FreeCAD 0.17. I have followed the YouTube videos, including the maui2kc ones and eapbg’s detailed explanation.

Apart from some difficulties with paths, everything is working well, except for some reason when I view the 3D result in Kicad the connector is offset by its own length.

I obtained the .step model from here: https://grabcad.com/library/db9-db15-db25-db37-connector, opened it in FreeCAD, selected the DB25RA_M part and exported it as DB25RA_M.step.

I am using the PCB footprint DSUB-25_Male_Vertical_Pitch2.77x2.84mm_MountingHoles.kicad_mod from the Github version of Connectors_DSub.pretty.

This is the alignment in the StepUp workbench:

TIA for any advice!


#113

I was only allowed one image in the previous post. Here is the alignment in Kicad 3D viewer:

I should add that everything is ‘0’ in FreeCAD, except “z Axis” which is 1.00.

I should also add that I am sure I saw a post with a similar problem, but I can’t find it for the life of me now!!


#114

may be this one?

or this

Hoping this may help :smiley:
You should check your footprint offset values in the pcbnew file compared to the one of the footprint used to align the STEP model. Moreover be sure to use the newly exported STEP file to be loaded in KiCad and not the original one.


#115

The simplest method is to make sure to reset all 3D offsets and rotation angles to zero before saving the footprint in KiCad and opening it in FreeCad for alignment of the 3Dmodel.


#116

Thank you for the fast response.

Actually, I was using the Ubuntu repo version of Kicad (4.0.7) which I think still used .WRL file rather than STEP. However, I am reasonably sure that I am using either the .WRL or the new STEP file because a) they are in a different folder and b) the Y and Z values are spot on, which they certainly aren’t in the original model.

sometimes the model used in the pcb file (.kicad_pcb) has different x,y,z orientation values compared to the module used for orienting the model file (.kicad_mod)

The .kicad_mod file has this:

  (model ${KISYS3DMOD}/Connectors_DSub.3dshapes/DSUB-26-HD_Male_Vertical_Pitch2.29x1.98mm_MountingHoles.wrl
    (at (xyz 0 0 0))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))
  )

Whilst the .kicad_pcb has this:

(model /home/iwbnwif/Development/kicadtry/libraries/DB25RA_M.wrl
  (at (xyz 0 0 0))
  (scale (xyz 1 1 1))
  (rotate (xyz 0 0 0))
)

But if I look in ${KISYS3DMOD} there is no /Connectors_DSub.3dshapes folder, so I assume that the .kicad_pcb overrides it?

Anyway, I think they are the same orientation.

Reading those two posts, I wondered if it is a mismatch between the current StepUp and the old version of Kicad, so I installed the nightly build but the problem remains.

However,

You should check your footprint offset values in the pcbnew file …

The new (nightly build) version of Kicad is really nice here. The 3D dialog includes a preview and I can force the connector to the correct position by setting the X offset to -1.3000 inches. After that Kicad 3D and StepUp import .kicad_pcb into FreeCAD are perfect!

After the upgrade and adjustment in the Kicad 3D dialog, the .kicad_pcb file looks like this:

(model /home/iwbnwif/Development/kicadtry/libraries/DB25RA_M.step
  (offset (xyz -33.01999950408936 0 0))
  (scale (xyz 1 1 1))
  (rotate (xyz 0 0 0))
)

So, problem is solved by a workaround - thank you :slight_smile: It would be nice to know why I need to offset -1.300 inches, but not essential.


#117

That is because when importing the footprint into FreeCad with StepUp, it will use the KiCad offset and rotation settings to orient the footprint in FreeCad. Because of this I find it easier to have these parameters reset to zero before saving the footprint and importing it with StepUp, so that footprints have the same rotation and offset as displayed in KiCad as a starting point. To understand this, as an experiment try to set the z-rotation to 90° in the KiCad 3D tab, save the footprint and import with StepUp. Notice that the footprint now is rotated 90° in Freecad compared to the view in KiCad.

BTW, you can make use of the exported Step model even in ver. 4.07. When importing the board into FreeCad with StepUp, the WRL model will be substituted with a Step model with the same name if it exists.


#118

otolen, thank you, sorry our posts crossed earlier.

Because of this I find it easier to have these parameters reset to zero before saving the footprint and importing it with StepUp, so that footprints have the same rotation and offset as displayed in KiCad as a starting point.

Hmm, I don’t understand how I can save the footprint from Kicad (the .kicad_mod file). Actually, I am using the footprint directly from the library which seems to be zero’d:

  (model ${KISYS3DMOD}/Connectors_DSub.3dshapes/DSUB-26-HD_Male_Vertical_Pitch2.29x1.98mm_MountingHoles.wrl
    (at (xyz 0 0 0))
    (scale (xyz 1 1 1))
    (rotate (xyz 0 0 0))
  )

To understand this, as an experiment try to set the z-rotation to 90° in the KiCad 3D tab, save the footprint and import with StepUp. Notice that the footprint now is rotated 90° in Freecad compared to the view in KiCad.

If I change the z-rotation in the Kicad 3D tab, it moves the 3D model but the footprint remains the same.

Which file that StepUp imports will have the offset in it? IIUC, I import the .kicad_mod file (which is zero’d) and then a .step file. So my understanding was that StepUp effectively creates a duplicate of the .step file, but with the orientation and offset adjusted so it sits at zero.

Thanks for any further hints :slight_smile:


#119

That what I initially thought, but it is oriented to the current settings in the 3D Tab; it is the mod file that will have the offset and rotation in it if it was non-zero at the time the file was saved [and imported with StepUp].

Note that the z-rotation experiment I was talking about refer to the visual orientation seen in Freecad, not KiCad. When you do the experiment the 3D model preview will also rotate. If I now reorient the 3D model of the resistor to vertical in Stepup and re-export, everything will be aligned again, but only if I kept the 90 rotation in KiCad.

But again, I think things are getting much simpler and less confusing if you reset the 3D settings rotation and offset to zero in the footprint editor before saving it and importing it into FreeCad with Stepup.


#120

Sorry for the delayed response and also for being slow in understanding!

Okay, I think I am starting to understand. If I open the library part in the footprint editor, I get this:

But on my pcb layout, I have this:

So somehow, when I placed the component I must have mirrored it, or the footprint has changed between Kicad library versions. I think the problem is that I was aligning the 3D part to the non-mirrored version, but this is obviously not correct for the (unintentionally) mirrored version.

So, I think problem solved - thank you to both for the help, and thanks for a really great tool! :clap:


#121

Not between versions. If you have the default setup, kicad v4 downloads the footprints on the fly. (The github plugin downloads the current head of the master branch.)

My suggestion is to setup a local footprint library.

Either by using the "save local copy to" option of the library wizard (still downloads the current head of master. more details in this tutorial by @bobc)

Or use the library download script found in the kicad-library-utils repo.
This does use git to clone all repos. It has an option to checkout a specific tag for the libs. (you can for example clone all libs and then checkout the commits tagged as 4.0.7)
But it does not setup your fp-lib-table. So you still need to add the cloned libs using the footprint library wizard.

This will be a lot easier in v5. (What will be harder in v5 is having a daily updated version of the lib because the github plugin can not handle the new setup of one large repo holding all the libs.)