I’m trying to export a PCB to a 3D step model so a housing can be designed for it. I’ve tried creating this outline in several different ways but I keep on getting an error in the “Export STEP”: “Unable to create STEP file: Check that the board has a valid outline and models”.
So the 3D viewer has no problems recognizing the outline (Edge.Cuts) nor does the DSN or VRML export give any errors. Only the STEP does.
I’ve tried creating this outline with arcs in Pcbnew -> error, afterwards trying to zoom and correct it manually -> error, next this outline was drawn from scratch in LibreCAD, Solidworks, FreeCAD… all failed with the same type of error.
Warning: 14:59:41: Exception caught: BRep_API: command not done
Warning: 14:59:41: C:/Jenkins/workspace/windows-kicad-msys2-stable/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: MakeShape: 1424
Warning: * failed to add an edge: arc center: 0,-22.75 radius: 1.50083 angle: -176.182
Warning: * last valid outline point: -1.5,-22.7
Warning: 14:59:41: C:/Jenkins/workspace/windows-kicad-msys2-stable/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: CreatePCB: 780
Warning: * could not create board extrusion
Warning: 14:59:41: ** C:/Jenkins/workspace/windows-kicad-msys2-stable/src/kicad/utils/kicad2step/pcb/kicadpcb.cpp:ComposePCB:510
Warning: * could not create PCB solid model
As soon as I replace the outline with a simple circle everything works, so no other issues are in the layout.
The layout is pretty simple but it seems impossible to apply.
Can somebody give me some insight what I am doing wrong here or how I can solve this issue? I have a feeling that the arc conversion to an other element type has some rounding errors in it and therefor the begin and end-point of 2 segments don’t allign exactly. Which causes errors on the export.
Drawing with KiCAD specially with “weird” offset is a pain, you can zoom in very close to make sure that the lines are touching each other since a couple o versions the lines snap to each others end showing a difference in the cursor, that may help you.
However, if you already have the DXF, the easiest way is to import them in kicad as border.
File->import->Graphics
choose the scale (1 if 1:1 in mm otherwise probably 2.54 if 1:1 in inches)
Sorry I read the thread too fast, I mostly use StepUp, but when exporting your STEP file, you can set the “Tolerance” parameter to “Loose” or “Very loose” to export your design, most probably one end point is not perfectly align.
Following the comment of @paulvdh I tested v4 and didn’t export either, I checked the other files: v3 and v1 failed too. v2 however, works as expected with “Loose” tolerance. I was lucky in my previous tests, as I imported all of them and deleted 3, turns out that the only one left was v2. !
Could you tell us what are the differences between all version ?
V2 is created with inkscape. First import a DXF in inkscape with polys in it it. Convert every segment manually to a segment with 32 segments and changed these segments to lines. (Something like interpolation with lines). And export them to DXF.
So a lot of work for a small task. I now notice that in V2 indeed 1 point is more misaligned than the other 3 points connecting the segments.
Still, exact CAD files import result in export errors. I would say there is going something terribly wrong with a conversion.
All others were exports from FreeCAD, LibreCAD or SolidWorks.
This bug was fixed in the development version of 5.1 – I can export all these DXFs to STEP with it (though I had to remove the cross splitting the board in four). So, this bug should be gone once 5.1.10 is released. Below are my results of exporting (numbered in the same order as the DXF input files):
@mwielgus I’m looking forward to that release. For the time being, I’ll use the Inkscape -> Interpolate method.
I would like to point out that drawing this outline with KiCad PCBNew is next to impossible.Although these are only 4 simple arcs they are next to impossible to draw. This is espceially difficult due to the way an arc is defined (centerXY; startXY and arc angle). Even when working on a grid, there seems to be a large amount of, what I gues is, rounding or conversion error.
Yes, but it’s unclear if they cover this use case. Version 5.99 already handles curved traces which are arcs but internally different than graphic arcs AFAIK, and arcs in polygon outlines are coming before v6.0 and they also are probably differently implemented. Also the editing UI will be different, and there is different kind of graphics editing coming for v7 (probably).
This is a well know issue that has been discussed a couple of time, the point of view of the developer is that for the time being, there are many other things that require more attention that the things that are already pretty well done with CAD software.
However @craftyjon has been doing an amazing job with the new dimensioning tool of v5.99