Skip to content

Chamfer lines and extend lines to meet feature

John Beard requested to merge johnbeard/kicad:chamfer into master

Since I'm a bit out of practice and this isn't a trivial change, I thought I'd do this with a quick MR for sanity. I'll probably extend this a little more here and there, but the general core of it seems to work and I'd like to make sure I'm not off in the weeds.

This is a feature to add chamfering and "extend to meet" for lines in Pcbnew. Primarily these are features I wish for in the FP editor:


The two tools themselves are fairly simple in the end, but there's some complexity in working them into EDIT_TOOL without copy and-pasting the rather large FilletLines function. I have used some object called an ITEM_MODIFICATION_ROUTINE to represent "something that changes PCB_SHAPEs" and plugs back into the EDIT_TOOL world (complete with selections, "is this the FP editor", commits and so on) with callbacks. This allows the ROUTINE to focus just on the modified items and thus be simpler (and this is exactly where you can fumble a COMMIT!)

I'm planning to extend this to some other geometric actions like outsets and extensions of arcs. Currently making an FP like this is a some irritating paper-based trig to figure out where an outset arc should meet an outset line (and would be real pain if that arc weren't conveniently symmetrical!):


Anyway, general comments welcome, please!

Merge request reports