I’m looking for a way to round the corners of my non square PCB. I feel like once upon a time I knew a trigonometry equation for finding a circle tangent to two intersecting lines, but can’t recall or find it online now… Anyone know the proper way to do this? I know I can switch to the new OpenGL tools and get closer to accurate, but never quite right.
The shape of the board is dictated by existing parts it has to work with. The desire for the rounded corners is so that the board isn’t sharp from the PCB fab.
Use OpenGL mode + a reasonably fine raster. Or do you need sub 100µm accuracy for the board edge? Choose a diameter for the rounding, draw an arc, rotate + shift the arc for best match… fiddly work, but no issues.
I know that the math should work out, so I was just hoping to learn something instead of brute force it. I think I’ll resort to the brute force method as your suggested until I learn better. “Perfect” or “better” is the enemy of “good enough”.
If a future reader has insight, feel free to skool me
In OpenGL mode, if you click on the straight line segment does it only overlap the curve in one spot, I had a similar issue with one of mine (cannot recall complete error message however) which resulted in the board not being able to be exported correctly as a gerber, and it was completely wrong in the viewer I use.
This was caused by the overlap of the corners and the sides being too long. When they were correctly aligned, only the end point (the curved end of both segments) was overlapping.
Update! Found a site called GeoGerba and made geometry work. Move the circle center point to change the radius and move points A, X, C to mimic the coordinates of your PCB edges and BOOM, it outputs all the data to draw an arc in Kicad: center point, start point on circle, and an arc length.
Another option is to draw the outline in libreCAD (qcad) and export as DXF then import that DXF as the edge cuts layer. Maybe a fillet tool might be of some use but I’m too lazy to code one. The maths is very simple; first you set the radius R of the fillet. Let’s say the angle of a vertex is A. Since the fillet is tangent to both edges the angle between a radius and an edge is 90 deg. Since a line from the vertex to the fillet center bisects the angle, you know your triangle has angles 90, A/2, and 90 - A/2. Now solve for the length along a filleted edge and calculate the start point and end point as they appear on those edges and calculate the center point.
I’m sorry to bump such an old topic.
There still isn’t an auto-fillet in the new KiCad, but I found quite a simple method and wanted to share.
Lets assume I want the top left of my pcb to be rounded:
Create a graphic circle to be used as a guide. Diameter to be 2* the radius you want your corners to be (for example, 3mm diameter).
Move the circle so it snaps to the top left corner of your pcb
Then shift the circle +x by 1.5mm, +y by 1.5mm. You’ll see the top left quarter of the circle looks like a rounded PCB edge.
Now draw an arc to be your rounded corner. Snap the arc center point to the middle of your guide circle. Then 2nd point to the 12oclock point (snaps), 3rd point to the 9oclock point (snaps).
Move/delete the guide circle, and you’re left with the round corner arc.
Now pick the end handle of the graphic lines and move them back till they snap to the ends of the arc.
And you have your rounded corner!
Long to explain, but very quick once you get the hang of it.
Too complicated.
Just draw an arc with the radius you want, and approx the included angle and shift it around a bit untill “good enough”.
Then move the end points of the straight lines to line up with the end points of the arc. This is the most important step because you’ll get yourself into trouble if the PCB outline is not a closed loop.
You can drag the square control points around, and when end points meet Pcbnew gives feedback by drawing a withe circle around the control points.
This works best when you zoom in very far.