I wondered about this feature (getting curved/smooth corners in traces, instead of sharp 45, 90, or 135 degree corner). I’ve seen discussions on this topic, and it seems like it is not available in KiCAD.
What’s the status? Is this a planned feature? Or did I miss it and it is a currently available feature?
Ok. I thought I’d check before talking about my attempt at an implementation of this.
I have a standalone application that reads the coordinates of two lines (two segments, in KiCAD terminology) that form a corner, and then outputs the coordinates of the series of small segments that form a smooth corner (well, I modified the program I had, so that it outputs the complete segment line for the .kicad_pcb).
I still need to manually copy-n-paste into the .kicad_pcb file in a text editor. But the results are reasonable. See screen capture below:
I changed the original corner to the B.Cu layer and made it slightly wider, just to be able to visually check whether it is working.
What I’d like to do next is create a standalone program that works with the .kicad_pcb file, identifies the corners and smooths them. I can see some “obvious” corner cases (no pun intended!) that the program would need to handle; for example, what happens if the rounded corner now collides/overlaps with other traces or footprints? (I have no answer / action-plan for this one — any help?). Another “obvious” corner case is: corners that are very close to something else (e.g., close to a pad from some footprint). For this, I can detect the condition and just leave it without smoothing it; however, it would be great to handle the situation and smooth those corners as well.
Cal. The biggest corner case your likely to encounter would be a parrellel bus. If so you should keep track of which segments you have smoothed. And if a collision happens with a non smoothed segment. Try that one. And so on until you either intersect a pad at which point the bus is abandoned. Or the first one can be smoothed at which point you can walk back up that tree and smooth them all.
The other one is to allow setting radius and a step walker. E.g. if the larger radius fails. You try the next smallest radii. Until a cutoff where it would not do anything.
And the final would be where you intersect a pads exclusion gap. In such case you can likely pre calculate the best radii that would fit ajacent to that pad. The main issue being 90 degree bends where both segments are within 0.05mm from the pads drc exclusion.
To the op. Try straight line routing mode. Lets you trace out in sudocurves very easily.
Is the plan to add the capability of arc traces? What I was referring to was the feature of getting the corners rounded (with an arc, presumably — although with a bunch of tiny segments works reasonably well). Either the rounding happening as we route (depending on a setting), or as an action triggered by the user. Not sure whether there’s interest for this feature. I would find it a nice feature to have — if only for aesthetic, I’d buy it. But for very high frequency boards, people usually go for that feature.
For the time being, I think I will continue to work on my “corner smoother” standalone program. Should I choose a different forum to post if-and-when I make any progress?
PS: @Seth — are you the same Seth that recently posted the reply to my “grounds” question on electronics.stackexchange?
Eventually, yes. Putting this in KiCad requires getting the pre-requisites right first and making sure that the implementation matches to the larger work plan. Especially with fundamentals like this. With some work it is possible to get this in line for v6. That gets easier with support from our community (wink, wink, nudge, nudge), good bug reports and friendly, engaged users.
This is a good place to post work of this nature. As others have mentioned, implementing in Python as a plug-in will ensure that you have a wider audience for your efforts and more feedback.
As far as i am aware there are multiple implementations that where started but abandoned.
At least one of them got stuck as it was build upon the legacy toolset after it was decided that new features should only be added to the modern one. (It was added to the legacy canvas after the v4 fature freeze. So three years or so ago.)
One i think got stuck because the contributor was not prepared to cooperate with the devs.
Further to the WireIT tool that I mentioned above, this is the code repository
WireIT has Icons, and dialogs, and can seed net names from a selected trace and joins selected pads to named net, or selected trace segment.
You would add a new curved trace icon, and require the user select 2 or more segments (Shift-Clk), or maybe NET.
Then, your splice-in-curve code you show above, goes to work, given some radius property, and maybe a segments or chord count.
This way, that will nicely interact live with Kicad.
I think the more scaleable option is to define some chord-error, which auto-adds more segments on larger radii actions.
It’s a bit more of a boat and everyone has an oar. As long as we’re pulling together we get there I should emphasize that while we’re getting the pre-requisites in place, we haven’t hashed out the UX steps or feature requirements and neither I nor other devs have taken ownership of that bug. After 5.1, we’ll start having more roadmap conversations.
Ben has interesting work. However, it is all in the legacy canvas so sadly there’s not much that is transferable. Were there specific features in his implementation that you’d like to see in KiCad?
The only non directly transferable code is about the Gui interface to activate a context menu (i.e. round a corner or make a solder mask clearance on track). So it shouldn’t a big deal to port even the Gui part.
I have ported his code to kv6 for my needs and I could send you the diff if you are interested in…
It’s not as simple as you think. Before we get rounded traces, the data model of PCBnew must support arcs and so the DRC has to take them into account. Also, I consider the track refinement proposal from Seth a must-have before we do teardrops/miters/etc - with no info what generated these features, editing or even removing them would be a nightmare…