Kicad StepUp STEP to MCAD exporter: Latest version, Faster! support for Env_Var and Alias


#1

Hi,
I’ve released version 3.0.5.2 of Kicad StepUp tools MCAD exporter
kicad StepUp latest
There are three important improvements:

  • load 3D models with caching for a faster conversion
  • more user warnings/checks for improving importing process
  • support for both environment variables and the new ‘alias’ format for 3D models path

and some code cleaning

Thanks to those who have used Kicad StepUp and provided suggestion and test cases to improve it!

Maurice


[solved] Wings VS FreeCad
Tutorial - solidworks to 3D VRML/wrl or STEP/stp component
#2

Hey Maurice
Thanks for the great work on Stepup!
Could it be possible to grab the path of the 3d files for every component from the board file? Possible also grab the paths from kicad, is the alias a Manuel way to add this? Alot of my 3d files are in my git folders and I still haven’t found a good way to add them in stepup

Cheers
Frank Severinsen


#3

I’m pretty sure it already works this way. You have a path pointing to a .wrl in your footprint, StepUp goes and looks for a .step of the same name and imports it into Freecad. You need to set your KISYS3DMOD in ksu-config.ini in your home (or Users/username) folder.


#4

Doesn’t it always look inside kisysmod3d? And is it possible to add more paths than kisysmod3d? Is this what the alias function is about?


#5

Hi @Shack
kicad StepUp has a “.ini” file


in home user path:
linux: ~/ ($HOME) OSX: ~/ ($HOME) Windows: %HOMEPATH%

you need to configure your kisys3dmod in the “ksu-config.ini” file to the field
[prefix3D]

kicad StepUp at the moment doesn’t allow more then one single path
prefix for resolving 3D models location… it is partially intentional
because if you have two models with the same name in two different
search path, which one will be picked and would be the picked one the
right one?
you can always use a full path for 3D models…

at the moment what you configure under the field
[prefix3D] in “ksu-config.ini”
can be your kisys3dmod or one :alias_path:
StepUp will just look for the 3d models in that path.

I would suggest you to have a tree similar to that:

c:\my3Dmodels\github\gh_3dmodels
             \local_3dmodels

and use the prefix
c:\my3Dmodels\
as kisys3dmod or alias
Then you can have a folder for github 3D models and a folder for non github ones…
Both folders can have sub-folders as required
i.e.

c:\my3Dmodels\github\gh_3dmodels\smd
c:\my3Dmodels\github\gh_3dmodels\th
c:\my3Dmodels\local_3dmodels\smd
c:\my3Dmodels\local_3dmodels\th

etc

Maurice


Distributing 3D models with footprints
StepUp configuration and understanding
#6

So having one component path like {kisysmod3d} /resistor3d/
And another one like {DAS-GIT} \radioparts\ in the same PCB file is not possible? Why should it be an issue with multiple files in different locations if the script looks for the path of the 3d file?


#7

at the moment no… StepUp was released before the new alias structure…
moreover the alias is interpreted only with :DAS-GIT: syntax
other environment vars a part KISYS3DMOD and KIPRJMOD are not parsed at the moment

as I already said, if you have two similar models but with the same name in two different
search path, which one will be picked and would be the picked one the
right one?
not always more flexibility means more quality…
you can always put your git-files under a subdir of kisys3dmod

{kisysmod3d} /resistor3d/
{kisysmod3d} /DAS-GIT\radioparts\


#8

@Shack
work in progress to add resolver ability for a second 3D path as ENV VAR…
I left some room in my ini file
[prefix3D] prefix3d_1 =
for a
[prefix3D] prefix3d_1 = prefix3d_2 =
(but still considering the simplest way the best)
Maurice


#9

@Shack
I updated the kicad StepUp tools
Now you can assign two searching path prefix in your .ini file
i.e.
[prefix3D] prefix3d_1 = c:\cad\3dpkg\ prefix3d_2 = c:\extra3d\ ;; 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_1 = kicad/share/modules/packages3d/ ;prefix3d_2 = c:\extra_packages3d\ prefix3d_1 = c:\cad\3dpkg\ prefix3d_2 = c:\extra3d\
typically you can specify your path assigned to
KISYS3DMOD
or a to an ALIAS
:MY3DPATH:
in
prefix3d_1
and a second path assigned to an extra environment var (i.e.)
MYEXTRA3DMODELS
in
prefix3d_2

KIPRJMOD
(design folder) is resolved as before

hoping that would help and not will generate a confusion in retrieving 3D model probs

Maurice


#10

Any chance of a test and warning that a model is duplicated across paths?
Even in a single path for that matter


#11

it is a bit out of scope… not even KiCAD makes this kind of test for schematic libraries… it just takes the first found…
It is a quite delicate process to create a reliable library… but this process has to be made by users themselves or just one has to rely on pre build libraries
You can always make a script to recurse your 3D model paths and search for duplicates…


#12

Adding a second path increases the chance of accidental duplicate names. I have had errors when I copy a project directory containing a local .pretty footprint library and find that I have modified the wrong copy as the path included both versions


#13

so just stay simple as I suggested… don’t use the second prefix… it is on your choice
having a right library is like “building foundation” … you need good foundation to grow up well


#14

Hi @maui
SRR6040A.STP (492.5 KB)

Sometimes (much to often) Freecad can not make a union

You can rotate and translate the individual parts but you cannot export them.

Maybe a save would be enough ?

example step file attached


#15

Hi @nicholas
this is a problem related to the way the model is made… It is a mix of solid and shells

Anyway there are 3 different solution approaches:

  1. make a SOLID model starting from the one you have i.e. projecting the shapes and extrude them etc…
  2. make a fusion (Part Union) of the only SOLID parts of the model … for a best way to have a union when there are co-planar faces it simply easy to slightly move a solid (i.e. 0.01mm) to obtain a small overlap and then fuse
  3. simply use Part Make Compound and export this… it will be a compound of many objects, but it is loadable by the recent release of StepUp

Latest Enhancements: STEP multi-part allowed (creating compound)

The Compound solution is easier but will give you a more complex model, slower in loading and unnecessarily complex
This is why we have started a 3D MCAD library aligned to KiCad footprints here


Hoping that day by day the repo will cover most of models (ATM inductors are not implemented)

Maurice


#16

I was able to export the step parts with freecad native export after a “translate z” of each individual part.

it worked in kicad to import.

seems i use version 4.0.2.6 of your tool.


#17

this is fine for multi-parts objects

then you are using a multi-part (or a compound) of the model…
It easier to just make a compound and then align it to its footprint…
Anyway this is a simplier solution that is not the best when using a lot of parts… The resulting model will be bigger and unnecessarily complex…
Text engraving (as the one on top of the inductor) is producing a bigger model (in file size), so I would suggest not to use it in general…
Anyway I’m glad you solved your issue :smiley:
Maurice


#18

I was unable to remove the engraving as it was part of a part.
possibly i could have edited that sub-part with freecad to remove the text.
i did not want the text.

i have noticed that text is normally a problem when making a union of sub-parts.


#19

I assume you downloaded the 3d model from somewhere. Did you check if the license of the model permits what you want to do? Especially redistribution. (You uploaded the model here. I think this technically counts as redistribution.)
With the exception of the text the model looks quite basic. You could easily create it yourself in freecad. Then you would solve all your problems at once.


#20

probably from here
http://www.bourns.com/engineering/SRR6040A/SRR6040A.STP

it should not be a problem because the model is unchanged AFAICS and the link is public (I found it with G)…
Anyway the problems of the model are related to the pipes of the coil wires that are loaded as shells and not solid in MCAD…
Also DS shows errors in the Pipes

The model is in a nice and huge repo of Bourns
http://www.bourns.com/resources/design-tools/design-files
The strange is that normally Bourns gives SOLID models… But I see that this model is coming from
ZW3D STEP Interface translator and not from PRO/ENGINEER BY PARAMETRIC TECHNOLOGY CORPORATION as many others in this repo are…
But as @Rene_Poschl said the model is quite basic and can be done in MCAD quite easily just getting its bounding boxes…
It would be nice if we could have a script generated Inductor SMD family to fit the KiCad/Inductors_SMD.pretty
in our GitHub repo
:smiley: