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

Since I am not able to use FreeCAD (any 3D modelling program except for Sketchup) right now I have no chance to try it out but as I understand this script makes some mandatory things possible, I have some ideas to improve it in the future.

If we combine a realtime communication infrastructure (like ours, aktos-dcs) with FreeCAD and Kicad, we can build a multiplayer game like development environment.

For example, one will start drawing schematic, other(s) will draw the device in FreeCAD at the same time with the mechanical related electronic components (like connectors, LEDs, etc) which are automatically imported via reading the net list. Then, some other or others will start drawing the nets and placing the rest of the components into the pcb where the edge cuts layer is gathered (and updated in realtime) from the 3D drawing.

From the point of view of pcb designer (who is using Kicad) some components (which are placed in 3D drawing) will be placed automatically.

From the point of view of 3D designer, the nets and the rest of the components will be placed in realtime.

If a collision is detected, both users will be notified in realtime. An interactive 3D scene of the collision area will be shown to the Kicad users.

We will start coding as soon as we finished our current works :wink:

Hi to all,
I just updated my kicad StepUp adding a GUI
I’ve moved all the script on the kicad StepUp tools Macro, giving the project 3 flavors:

  1. a script interface (as before)
    freecad kicad-StepUp-tools.FCMacro demo
  2. a Macro GUI
    freecad kicad-StepUp-tools.FCMacro
  3. a FreeCAD WorkBench
    just open a ".kicad_pcb" or ".emn" or ".kicad_mod" file from the File Menu of FreeCAD

The news on the GUI are:

  • ability to load directly the .kicad_pcb board and parts in FreeCAD
  • ability to load directly the .emn board and parts in FreeCAD
  • ability to load directly the .kicad_mod in FreeCAD to align the STEP model
  • ability to export the model aligned directly to VRML and STEP format
  • VRML exporting format much smaller and cleaner compared to the previous one

With this GUI it is possible to do most of 3D MCAD interaction with kicad EDA without a big knowledge in FreeCAD… So anyone can be focused on its own MCAD software :smile:

Please note that the config file has moved to a new config file
‘ksu-config.ini’
in home user path:
linux: ~/ ($HOME)
OSX: ~/ ($HOME)
Windows: %HOMEPATH%
you have to configure your [prefix3D] to
KISYS3DMOD path or 3D model prefix path

and here the new video tutorial

4 Likes

Sounds intriguing, but the complexity of that makes me shiver…

Maui great work!!
I really hope this step up support can be merged into the main code one day to provide native .step support.

2 Likes

The StepUp made by @maui is a script developed for and to be used with FreeCAD

1 Like

Hi @mangelozzi
kicad devs are working for a direct integration of STEP using the same approach I did with FreeCAD:
converting STEP to VRML and display natively the STEP->VRML model in kicad…
This part is almost done using OCE, which is the main MCAD library engine of FreeCAD…
Then there will be the part to export pcb board and models to STEP… this will take longer I think…

my kicad StepUp tools are available now and they probably will cover the STEP exporting process until a full integration will be done…
kicad StepUp is covering:

  • kicad_pcb to STEP exporting
  • kicad_mod visual align 3D model over footprint
  • generation of STEP model for pcb and parts configuring ‘bounding boxes’ and ‘minimum volume’ of 3D parts
  • collisions detect for enclosure and footprint design
  • exporting of VRML models with Material Properties (almost public feature)
    Many of these features will remain in FreeCAD (MCAD) environment anyway…

Moreover the direction is the same: leaving VRML files coming from Wings3D or similar modeler and get only STEP 3D mechanical models library as the source for kicad 3D :smile:

That is the reason I’m calling for an official repository for 3D mechanical models

The StepUp made by @maui is a tool GUI and script developed for kicad ECAD MCAD collaboration and to be used with FreeCAD :smiley:

4 Likes

Yes, unfortunately much longer. At the moment I’m thinking 1-2 years because of the API which needs to be developed to create plugins to manage PCB data. I should be working on the design of that API, but it makes no sense to start until the initial 3D work has been merged. If I didn’t care about the API and didn’t care about making the kicad code an even more unmanageable mess I could put in an IGES exporter in only 2 days - and maybe a STEP exporter using OCE in only 1 or 2 weeks.

3 Likes

Hi @all
I’ve added to kicad StepUp tools an external macro to export STEP to VRML with material properties, also if the model comes as a STEP multi-color fused part (i.e. coming from manufacturers or on line libs)
https://github.com/easyw/kicad-3d-models-in-freecad/blob/master/exportVRMLwColors/exportPartToVRMLwMaterials.FCMacro
this macro can be used after having aligned your STEP model to footprint and exported to STEP and VRML for kicad… if you desire an improved VRML model with not only diffused properties, but also with nice more material properties, you can select your part and run the macro… you will be asked to associate each color of the 3D MCAD model to a preset list of materials (i.e. metal grey pin, gold pin, black body, led blue etc…) aligned to @kammutierspule material list


Many thanx to Mario (@kammutierspule) for his useful work! :smiley:

Please note that method will give you a small difference in color appearance for exported VRML models compared to your original STEP models, but it will add nice reflective effect to be used in raytracing view, available with the new 3D refactoring coming soon :wink:

Maurice

2 Likes

Hi Maurice,

Great tool, the demo looks great! Unfortunately I have some issues running the thing on my side.

I have a board and three components with 3D models, which I found online. I had the option at download to specify which format, so I got the VMRL and STEP versions. For simplicity, I am using the default KISYS3DMOD path (C:\Program Files\KiCad\share\kicad\modules\packages3d). I placed both files for each component in a subfolder at the path: boardAD/(files go here…).

The models needed some scaling and offsetting which I did in KiCad manually. When I ran the script, several errors are displayed. It properly loads the board, then add some components (not all) then displays the following:
boardAD/myfirstconnector.wrl error: reset values of scale to (xyz 111)
boardAD/mysecondconnector.wrl reset values of scale to (xyz 111)
boardAD/mysecondconnector.wrl reset values of scale to (xyz 111)
(… as many times as this connector is present …)
boardAD/mythirdonnector.wrl reset values of scale to (xyz 111)
(… as many times as this connector is present …)

Basically, for all the components. The script did:

  • load one connector with proper scale and offset
  • load the second type of connector but wrong scaling and offset
  • did not load the third type (not visible in the object list in FreeCAD)

For the third connector, the STEP file opens correctly in FreeCAD in standalone.

Any advice?
Cheers and thanks

Hi @bananabread

you are trying to achieve a mechanical representation of your pcb and components
so scale is mandatory 1:1 for all the 3D models
please spend some time reading the starter guide…
https://sourceforge.net/projects/kicadstepup/files/kicadStepUp-starter-Guide.pdf/download
there is a paragraph about “Create your own Library” which is very useful

All good library model should have
(model shapes/your3Dmodel.wrl (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) )
kicad StepUp tools can take care of offset and rotation, but I still would suggest you to use them only for enclosures or mechanical spaces or screws…

you can align and check if your model will fit the footprint, loading the footprint itself inside FreeCAD and align there the 3D model in MCAD way
have a look at this thread

Also have a read at this thread from the first post… you will see that someone found the same doubts and did some steps to improve the ECAD to MCAD collaboration…
also this thread may be very useful

Maurice

Hi Maurice - this looks really promising.

I have come across a small problem with importing a slightly odd shaped board. This is a curved board - sort of 'C" shaped but all that imports is a ‘D’ shaped segment of approximately half of the board.


It is correctly populated (or at least the part that I can see is correctly populated). Also I have only been able to import it as an .enl file.

Any advice?

John

Hi @John_Pateman
would you mind to share the board?
just the pcb edge would be fine or by a pm as you prefer…
your board edge segments create a closed path? (edge cuts layers had to be contiguous)


thank you for feedback
Maurice

He may check if he is getting any popup messages,
but I believe it is ok, otherwise, the board will be rendered as a square/rectangle.

Also overlapping is not allowed for mcad but it seems to me it is fine for 3d rendering…
Anyway, having the pcbedge in kicad format would solve the riddle :slight_smile:

My fault - you were right Maurice - the board edge was not joined although even at max zoom I had difficulty seeing where the problem was. I think the sensitivity for detecting closure must be different between the 3d render and the StepUp macro? I originally got a rectangular board in 3D view until I adjusted the outline. When I tried to import the file in StepUp I got the segment but the board rendered properly in 3D view. Sorry!
John

1 Like

MCAD needs precision… if you want a square you need a real closed path :wink:

I discovered on my road to MCAD that there is a nice function in pcbnew:
Edit Item” segment properties…
there you can discover exactly the start and end of a segment and fix it properly :smiley:

1 Like

I always end up doing this to set an exact board outline. It would be nice if there was a more direct way of entering a board outline as numerical coordinates of a polyline. As it is importing a dxf is the most direct method

1 Like

The problem with relying on the edit box is that the board i was having problems with is composed of arcs. Whilst using straight lines it would be easy to check the start and end points. The arc edit box gives a centre position and starting point accurate to 2decimals.

however the line segment is accurate to 5 or 6 decimals…

I think davidsrsb makes a good point - the ability to enter dimensions/starting points directly would be quite helpful in this sort of situation or indeed whenever designing to a specific size. I will try the dxf route another time.

I agree very much, but you could get a request from developers to code it by yourself :confused:


Kicad is an amazing community with many different point of views that I often don’t understand, considering that is an open source project aimed to be widely spreaded

The hardware fraternity at CERN believes that KiCad can do to PCB
design what the GCC compiler did to software, letting design and
development knowledge flow more freely in the open hardware community.


Anyway, apart some jokes, dxf import is a very good option to avoid those issues … :smiley:

Hello,

first thanks for a great plugin.
All of a sudden I can no longer open the newest plugin.
I have attached the error message from Freecad.

1.3.2.6 still opens without any problems