Non-Rectangular Board Cutouts

Issue #215 closed
Tyler Sisk created an issue

As far as I know, right now there is not a one-click tool that can create a non-rectangular board cutout from a edge cut file. This has been brought up in the discussion group and I have been able to do it by generating isolation geometry and then deleting the inside path, but that took me quite a while to figure out as a new user (really just how to delete the inside path). I am using FlatCAM version 8.5. I am also very willing to work on this myself but wanted to post about it first to make sure I am not missing anything.

FlatcamIssue1.PNG

Comments (15)

  1. Juan Pablo Caram repo owner

    What is it that you are proposing? A truly 1-click solution or an update to the manual?

    On the command line it is very simple:

    isolate my_outline -outname oline ...
    exteriors oline
    

    You are very welcome to contribute to the code. Just check with we often because I'm not clear about what you are planning.

  2. Tyler Sisk reporter

    Ok the command line method is very easy, I just tried it thanks. What I am proposing is a truly one click solution where the Generate Geometry button in the Board cutout section would be able to account for non-rectangular geometries and generate the correct path.

    At first I suppose the new functionality would not have to be able to generate gaps in the path but this would be a good option in the future as it was something I was looking to do when I originally made this board. I know I could have done this manually using small rectangles and subtracting them from the cutout path, however I didn't think it was completely necessary for my router setup.

  3. Juan Pablo Caram repo owner

    I think a good starting point is to come up with a clear definition of a cutout. I suspect it can be a little abstract to have a Gerber and expect the program to know what you expect as the the cutout for it. If the Gerber is just an outline for the cutout, then the problem is simplified. If not, it might still be possible to come up with a cutout close to what the user expects. This is what we have to agree about. In the Gerber outline case, it might be as simple as calling the functions behind isolate, exteriors and geocutout. In the more general case, there is a multitude of geometrical operations we could use.

  4. Tyler Sisk reporter

    Ok my definition of a cutout would be: The path that will create the final edges of the PCB and thus separate the final board from the rest of the stock copper-clad board. This path is usually cut with a roughing endmill and is generally the final operation preformed on the circuit router.

    As far as I am aware there are two different ways that geometry representing the edges of the board can be imported: A board outline gerber (which is pictured above), or a filled solid shape which represents the entire board. If you know of any other common ways of importing edge cut geometry I am all ears. But yes I agree I think that in most cases where there is a board outline, just calling the existing functions would work.

  5. Igor Martinovski

    I think the most sensible way is to provide a seperate gerber of the board outline and use that for a cut out. At which point you can simply use the isolate command to generate the cutout. 'Follow' would also be good for this.

    When you panelize PCBs you generally provide a mill gerber for milling slots or breakaway tabs. Somethng similar can be used for a cut out.

  6. Juan Pablo Caram repo owner

    Maybe I'm overcomplicating things and we should stick to the simpler cases for now. That might cover 99% of use cases.

    Anyhow, here are some diagrams describing some potential ambiguities: outline_problem.png

    Case (a) is the simplest one we've been talking about. Case (b) is similar, but would require to remove the isolation routing resulting from the inner polygons. You can also intersect the bounding box with everything else and you should get just the outer polygon. (c) is just like (a) or (b). (d) gets complicated because you don't know what to do with the gap on the bottom. (e) is a similar problem, slightly more complicated.

  7. Tyler Sisk reporter

    Yes I agree that we should stick to the simpler cases for right now and that should cover the vast majority of all cases. I will check out those documents, Thanks!

  8. Juan Pablo Caram repo owner

    Tyler, could you also take a look at #175? They also want the outline to be at the center of the drawn trace. This could be a little more complicated because after parsing the Gerber, the trace becomes a polygon and the information about where the center was is lost. See also the shell command open_gerber -follow 1. I'm going to close #175 and consolidate everything here.

  9. Eliot Phillips

    Tyler, the hack I use to this day is to subtract the line width of the board outline geber from the width of my endmill. I enter that value as the tool width when generating outlines, that way the edge of the endmill ends up landing directly on the centerline of the gerber board outline (like it would at a PCB house).

  10. Tyler Sisk reporter

    Ok just took a look at it and it seems like it does fit right in with this issue. Thanks for explaining how you do it now, Eliot. I will start implementing solutions soon hopefully.

  11. Tyler Sisk reporter

    Hey guys, I just wanted to update you on my progress. So far I have been focusing on the non-rectangular aspect of the issue. I have basic functionality where there is now an option for non rectangular cutout where it uses a modified version of the isolate method to create the exterior geometry for the cutout. Here is a snapshot of the GUI in its current state and a completed non-rectangular cutout. That centerline checkbox was placed there temporarily and doesn't do anything. I will take it out soon.

    FlatcamIssue1_2.PNG

    I am finding myself really wanting to focus on the most common case where the edge cuts are represented by lines (This should be the case for KiCad and Eagle output). My next goal is to create an algorithm that can handle slots/interior cutouts. This would only work for the case that I just stated and would probably fail if the board is represented by a solid shape.

    As for the centerline side of the issue. I believe it would be most straightforward to create another import option for edge cuts. This would allow us to generate the correctly sized polygons based on the center of the line that represents the edge of the board when the gerber is parsed. Again this would not work for the solid shape case.

    I have been working in my own branch on my machine. Please let me know if you want to test the code.

  12. Juan Pablo Caram repo owner

    Tyler, let's discuss the architecture of this... where are you adding your code in the file structure, what methods are you calling, are you using threads, etc?

    Please also create a clone of the FlatCAM repository in Bitbucket so I can see your code.

  13. Log in to comment