Edge.Cuts error

That is the effect of the “tolerance” in STEP export. It sets how far away equal is.

@dbpodrasky, Yes I was able to export using the Loose tolerance and your original file. I was using the lastest master but I don’t think that we’ve modified the kicad2step utility. Do you get the same error when exporting with Loose tolerance or a different one?

1 Like

With an most likely internal numerical 32 bit representation there is a massive difference between those two numbers!

When joining ends there is a white circle with a cross inside showing which appears to mean a dead centre match of two ends.

When I have had this issue in the past with a line end point not quite mating to an Arc end point, I will add a small line segment to guarantee closure. Your line segment ends at 190.0, 140.0. The Arc ends at 189.998288, 139.998631. I would create a new line and manually edit the end points to be 190.0, 140.0 and 189.998288, 139.998631.

2 Likes

OK. In KiCAD 5.1 I can also successfully export the test case to a STEP file by using the ALT-drag placement method and setting the tolerance to anything greater than tight.

My production board requires the intersection of two arc segments. This is not working with any tolerance settings. I don’t know how much more precise I can be with the placement of the arc ends.

KiCAD seems to be a bit confused in how arc segments are defined: the center point of the arc is named the “start” point and the “end” point is one of the two arc segment end points at a distance of the arc radius from the “start” point.

I have attached the board outline layer for my PCB with two intersecting arcs.

Prod.kicad_pcb (2.5 KB)
KiCad5TestNew.pro (688 Bytes)

This is a good suggestion, but it will only reliably work on one arc segment end point as KiCAD does not explicitly define, such that it can be manually edited, the cartesian coordinates of both arc segment end points.

It might be a good idea to use freecad plus stepup for such a complex outline (from your description i have not bothered to look at the files).

Arc-to-arc is hard in the step export. I will usually make the line thickness very thin to see the offset. Then close the last gap with a small segment.

Prod.kicad_pcb (2.7 KB)

@dbpodrasky, following @Rene_Poschl suggestion…
here you go
Prod.step (5.6 KB)

Did you generate this STEP file by pulling in the Edge.Cuts layer from my PCB file?

I’m not a big fan of FreeCAD, yet, but if the shoe fits…

This is correct, the arc origin end point is explicitly defined and should be easily connected to by a line segment. The arc terminating end point is calculated by Kicad and is arbitrary in relation to the Cartesian coordinates. Therefore, I select the arbitrary end point to get its real location (189.998288, 139.998631 in this case) and make sure I edit any connecting line segment to terminate at that point to guarantee board outline closure.

1 Like

Eureka! Thanks, Aaron.

This works, but seems unnecessarily tedious. By that I mean if the arc segments were defined by two cartesian end points, a radius and a center point then users could simply edit the location of both end points to achieve precise intersection. There is also a balancing act between the length of the short linear segments connecting the two arcs and the tolerance setting when exporting to STEP:

Warning: 10:15:54 AM: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: AddOutlineSegment: 260
Warning: * rejected a zero-length line start: -17.46,-17.23 end: -17.48,-17.2503
Warning: 10:15:54 AM: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: AddOutlineSegment: 260
Warning: * rejected a zero-length line start: -23.6291,-6.49408 end: -23.6814,-6.50488
Warning: 10:15:54 AM: Exception caught: BRep_API: command not done
Warning: 10:15:54 AM: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: MakeShape: 1424
Warning: * failed to add an edge: arc center: 0,-0 radius: 24.5586 angle: -330.738
Warning: * last valid outline point: -23.6293,-6.49321
Warning: 10:15:54 AM: /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/oce_utils.cpp: CreatePCB: 780
Warning: * could not create board extrusion
Warning: 10:15:54 AM: ** /vagrant/build/kicad/src/kicad/utils/kicad2step/pcb/kicadpcb.cpp:ComposePCB:513
Warning: * could not create PCB solid model

I think it would be a big improvement if the tolerances for intersections, at least regarding cuts, were quite a bit more loose. There is really no practical justification for such tight tolerances on the outline of a PCB. A more explicit definition of the arc segments would alleviate most of these issues. Any way to get this in the ear of the appropriate dev(s)?

Thanks to all, this is really helpful for my current and future projects.

yes, directly opening ‘kicad_pcb’ board in FreeCAD

That is a pity… If you are a KiCAD fan, you should be also a FreeCAD fan.

They are companions not only to export a board to STEP, but also for creating complex footprints, aligning 3D models to footprints, push and pull board edge and footprint position between ECAD and MCAD environments.

No other MCAD software can allow this kind of collaboration with KiCAD ATM.

2 Likes

I would like to like FreeCAD, but I have too many stability issues on macOS.

Note that this is mathematically impossible outside of 90 degree steps (maybe 45?). You can curve an arc with defined radius through two Cartesian points, but the center point will probably be something fractional. Or set the center, radius and start point resulting in a fractional end point depending on the arc length.

I would argue that Kicad has it correct. For most cases (even in my own work), arcs end up being 90, 180, 270 degrees on PCB outlines. In these majority cases, both end points are well defined. For the other cases, I use this hack.

I use Kicad and FreeCAD on MacOS and use @maui’s FreeCAD workbench exclusively for producing PCB assembly STEP files. Like Kicad, there are occasions where a given nightly build of FreeCAD can be buggy. I would recommend giving it another go. The workbench isn’t as complicated as it looks.

I don’t agree that this is mathematically impossible. But, I don’t think I was very clear in my previous post. You just have to allow any two of the parameters to be free. Definition of two endpoints and a center point describes a unique arc with an implicit radius and arc angle. Or, you can choose a center point (and angular origin, i.e. +x-axis), radius and arc angle and these implicitly define the two arc segment end points. What KiCAD does is sort of half way between these two.

I am suggesting that users be able to define arcs using angle and radius or start and end points (both require a center point definition) and have the effect on the other two parameters displayed. Maybe it could be possible to switch between the two definitions of the arc(s).

I haven’t given up on FreeCAD, I’ll keep checking back.

Your suggestion only has a solution in the real numbers not in fixed point arithmetic. So there would need to be some form of rounding involved meaning the file format would need to be made with only one of these and the other version would need to have a unique mapping defined in the GUI to this file format representation. -> meaning nothing will be truly better than now as the precision simply is not there.

This is a good point, but it already applies to the current method by which KiCAD defines arcs, with a center point, single end point and subtended angle.

I also didn’t communicate the issue clearly, I agree with your and @Rene_Poschl’s analysis. There are a number of vector drawing programs that do allow you to draw the arc in reverse. You pick the two end points first, then are free to move the center point around for final placement.