I’m having some troubles exporting a Kicad project to step files. I have previously gotten it to work with other projects that have used the same component library, but now it just refuses to work. The error message i get is “Unable to create STEP file. Check that the board has a valid outline and models”, which isn’t really helping that much. I do have a lot of arches in the edge.cuts layers, so it wouldn’t surprise me if this is some numeric rounding error that creates a non-continuous outline, but with no debugging data it’s hard to tell. I tried to find some logs to check exactly where the export fails, but to no avail. Does anyone have a good method of debugging this, or know where I can find the logs ?
I’m running a nightly build from the 5th of november on a windows 7 machine.
Both the 3d viewer and the dsn exports completes just fine with no errors.
When i replace my current outline with just a simple square the step export works, so this is definitely outline related. I double checked the design for dublicated lines, and couldn’t find any, that would also throw an error in the 3d viewer.
My outline comes from a solidworks DXF export, with endpoint merging enabled.
Since you are using a nightly, it might be new enough that it has an additional menu item to show graphic items in sketch mode. This is under Preferences / Display and Hide.
You might see something wrong with the lines that you can’t otherwise see.
I started a new project and added only the outline, and it fails to export, 3d viewer and dsn export works just as before
Kiki: I have the same settings as you, but with the endpoint merging option enabled, with an error setting of 0.1 in this case. This means that all points that are within 0.1mm of each other will be merged.
Sprig: I enabled outline mode and verified every arc and line, they have the same start and end coordinates down to rounding of the last digit displayed in kicad, i.e. +/- 0.000001. I checked the source code for kicad2step, and two points within 0.0001 of each other are considered to be the same. I see absolutely no reason to why this shouldn’t work. All coordinates are double precision so they should be fine.
kicad2step does post logs with wxLogMessage( “%s\n”, ostr.str().c_str() ); but I have no idea on how to access that from the kicad ui, i tried running kicad2step.exe in cmd but that gives me nothing at all either.
I tried to upload the DXF file containing the outline, but since I’m a new user I’m not allowed
Ok, so i found what was causing it. Seems like there is an issue for short lines/arcs or small features. The endpoints of all segments does have the same coordinates, and the lengths of the segments are orders of magnitude bigger than the MIN_LENGTH2 defined in oce_utils.cpp, which decides how small features are allowed, but kicad2step still fails for some reason.
Maybe one of the moderators can help out with the status issue. If you can post the sldprt and/or dxf I’d be willing to see if I can recreate the error.
Because I see no others joining,
I tested this with the StepUp exporter:
here the kicad_pcb that doesn’t export from internal exporter (created importing the main_pcb.DXF in Kicad dev) main_pcb.kicad_pcb (6.4 KB)
and the corresponding STEP model created with StepUp in FC0.17 main_pcb_ksu.step (62.8 KB)
If I import the DXF it looks good using the OpenGL canvas but the legacy canvas shows some discontinuities. I don’t see the discontinuities in any other programs.
I encountered a similar problem with STEP export in version 5. I downloaded the MKRWAN1300 Eagle files and imported them into KiCAD (https://store.arduino.cc/usa/mkr-wan-1300). They import fine. When I try to export the STEP file, I get the following error:
_Executing '"/Applications/KiCad/kicad.app/Contents/MacOS/kicad2step" -f -o "/Users/me/Library/Mobile Documents/com~apple~CloudDocs/Kicad/MKRWANV1.1/MKRWANV1.1.step" "/Users/me/Library/Mobile Documents/com~apple~CloudDocs/Kicad/MKRWANV1.1/_autosave-MKRWANV1.1.kicad_pcb"'_
_Warning: 11:09:49 AM: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: addEdge: 1482_
_Warning: * added an auxiliary segment from 180.687,-92.5036 to 180.687,-92.5036_
_Warning: 0x113d17fcb : Standard_Failure: BRepAdaptor_Curve::No geometry_
_Error: Unable to create STEP file. Check that the board has a valid outline and models._
I noticed something weird with the corners of the board edge. When I zoom in and look at the corner top right corner (note all corners have this anomaly) where the edge is curved, the curve stop and end points are offset by a couple degrees. Might be an Eagle import issue? Not sure if this is causing the issue with exporting the STEP file or not. Here is a screen shot.