10 Replies Latest reply on Dec 30, 2017 6:25 PM by truhlik_fredy

    [SOLVED] Ratsnets desition make based on different layer

    truhlik_fredy

      Hello everybody,

       

      I'm wondering if following is possible. I need to have a ratsnets being made based on top layer, but the polygon itself needs to be stored in a different layer. I need to automate process with cam and I need to have it stored under different layer to apply different settings to the job. But the ratsnets needs to be decided on the top layer.

       

      Thanks in advance for any hints or ideas.

       

      PS: if it's possible in any specific version I don't mind upgrading/downgrading.

        • Re: Ratsnets desition make based on different layer
          rachaelp

          Hello,

           

          I'm not really sure where to start with this, maybe I am missing something. Do you actually mean ratsnest? That function generates an optimal set of airwires and processes the polygons and it's not run from the CAM processor it's run from the board. If you tell us exactly are you trying to achieve somebody might be able to point you in the right direction.

           

          Best Regards,

           

          Rachael

            • Re: Ratsnets desition make based on different layer
              truhlik_fredy

              I think I need what I exactly I'm asking for. My CAM process is very custom and not to a typical setup so that's why probably that confusion. But I need a polygon which will be filled in but it will avoid the traces, like ratsnets does. But ratnests avoids only the traces which are on his layer, I need the ratsnets to avoid traces from the top layer, while being in different layer.

              • Re: Ratsnets desition make based on different layer
                rachaelp

                Hi Anton,

                 

                I think the initial confusion was caused by you referring to referring to ratsnest when you are really just talking about processing polygons. Ratsnest is exactly as I said it was above in my other post, it has a side effect that it triggers the processing of polygons which uses the DRC defined clearances as well as the properties specified for the polygon to fill the polygon without violating any defined rules.

                 

                So, what you are asking for is if there is a way to ensure that a particular polygon has gaps corresponding to traces on another layer, in this case the top layer. Unfortunately traces on the top layer aren't going to violate any rules defined in the DRC or the polygon so it's not going to be able to automatically clear the area of the polygon from underneath the traces. The only way to do this is to manually add additional polygons defined as "cut out" on the same layer as your polygon, underneath the traces you wish to avoid having your polygon fill underneath.

                 

                Best Regards,

                 

                Rachael

                1 of 1 people found this helpful
              • Re: Ratsnets desition make based on different layer
                CadSoft Guest

                Anton Krug wrote:

                I'm wondering if following is possible. I need to have a ratsnets

                being made based on top layer, but the polygon itself needs to be

                stored in a different layer. I need to automate process with cam and I

                need to have it stored under different layer to apply different

                settings to the job. But the ratsnets needs to be decided on the top

                layer.

                 

                you could use an ulp to copy the polygons, redraw them in the target

                layer.

                 

                Something like the following:

                 

                |  board(BRD) {

                |    string s, cmd = "change layer 100;";

                |    BRD.signals(SIG) {

                |      if (SIG.name == "TEST") {

                |        SIG.polygons(POL) {

                |          if (POL.layer == 1) {

                |            sprintf(s, "change width %fmic;", u2mic(POL.width));

                |            cmd += s;

                |            POL.contours(FIL) {

                |              sprintf(s, "wire (%fmic %fmic) (%fmic %fmic);", u2mic(FIL.x1), u2mic(FIL.y1), u2mic(FIL.x2), u2mic(FIL.y2));

                |              cmd += s;

                |            }

                |            POL.fillings(FIL) {

                |              sprintf(s, "wire (%fmic %fmic) (%fmic %fmic);", u2mic(FIL.x1), u2mic(FIL.y1), u2mic(FIL.x2), u2mic(FIL.y2));

                |              cmd += s;

                |            }

                |          }

                |        }

                |      }

                |    }

                |    exit(cmd);

                |  }

                 

                it redraws the polygons of signal "TEST" in the top layer into layer

                100 using wires.

                 

                Thats quick and dirty 8-)  but seems to do the job

                --

                 

                Lorenz

                 

                4 of 4 people found this helpful
                  • Re: Ratsnets desition make based on different layer
                    truhlik_fredy

                    Hi Lorenz, Thank you very much,  it's almost doing it perfectly.

                     

                    It's bit rough around the edges, which probably I could live with, or maybe is there a way to make the line much thiner?

                    But there is an issue and it's creating some artifacts where it is crossing traces (see attached picture), this layer will be fed into cam job to do isolation routing on a CNC so the artifacts would damage traces, while I need to remove only copper around the traces. The isolation routing is heavily time consuming, while there is an easier way to do it on the whole PCB, with a polygon fill / ratsnest I would have the freedom to select only desired parts where I really need to do it.

                     

                    When I was doing chemical process, everything worked fine I worked with output which described the traces which need to stay.

                    While with mechanical CNC routing process I do the oposite, I concentrate not on traces, but on their outlines, because that needs to be removed, So the result looks like I would have polyfil on whole board enable. Which is problem if there is for example USB connector on a PCB or something where polyfill is undesired. And the polygon fill can be done in flatcam but it needs to know all the places to avoid already in the polygon, if I would leave the polygon there without conflict avoidance then the router would mill away whole polygon. So this way it will turn into an outline which then can be safely filled in flatcam into gcode which will mill away all the copper safely without damaging the traces.

                    With chemical process the polyfill added more copper on the result, while now with the polyfil I want to remove copper in the mechanical process, because without anything the results look like this:

                    https://i.ytimg.com/vi/g7A0pnUetRY/maxresdefault.jpg

                    It just mills around the outlines of traces so it isolates the traces from each other and leaving large chunks of copper present.

                     

                    Here is the artifact of the script:

                     

                     

                    You think it could be fixed?  Thank you very much again, with this I could have the process automated, while now I waste lot of time doing it by hand on every single export

                     

                    Best regards,

                    Anton

                      • Re: Ratsnets desition make based on different layer
                        CadSoft Guest

                        Anton Krug wrote:

                        Hi Lorenz, Thank you very much,  it's almost doing it perfectly.

                         

                        It's bit rough around the edges, which probably I could live with, or maybe is there a way to make the line much thiner?

                         

                        change the line

                         

                        |  string s, cmd = "change layer 100;";

                         

                        into

                         

                        |  string s, cmd = "change layer 100; set wire_bend 2;";

                         

                        that should get rid of the rough edges on sloping lines. I didn't see

                        this here because I had set the wire_bend beforehand.

                        --

                         

                        happy new year

                         

                        Lorenz

                         

                        3 of 3 people found this helpful
                          • Re: Ratsnets desition make based on different layer
                            truhlik_fredy

                            Hi Lorenz,

                             

                            This is excellent, I made a handful of ULP scripts many years ago, but they were not close to your skill. How did you learn to be so brilliant at it?

                             

                            The wire_bend fixed both issues the outline stroke was there to smooth the edges, but without bend it was forced to use perpendicular lines wich caused the second issue. If you will be in Dublin at some point, give me shout, I will take you for a lunch/dinner or few pints (whatever you prefer).

                             

                            Too bad this is not directly supported in the eagle (collisions referencing different layer than the original object), it would allow some interesting scripting in CAM. The ULP it looks bit heavy (maybe because the lines are hardcoded), but they are static so they can move around layers, which is excellent. I was hoping there would be bundled feature, or if not a brute force ULP script which will mimic the results, which this is exactly that This will save me so much time, in practice I will use it on very small portions on PCB, but it was human labor heavy to create the polygons for every iteration of the board.

                             

                            I added the cleaning of the 100 layer so it's safe to re-run the script multiple times when the design changes and I will need to refresh the layer 100.

                             

                             

                              string s, cmd = "change layer 100; set wire_bend 2;";

                            cmd += "DISPLAY NONE 100; GROUP ALL; DELETE (C> 0 0);DISPLAY 1 16;";

                              BRD.signals(SIG) {

                             

                            BTW: I edited the tile as solved, but is there a way to highlight your reply as the solution answer?

                        • Re: Ratsnets desition make based on different layer
                          rachaelp

                          Nice solution Lorenz! I've learned something, I did not know about the contour() and fillings() loop members in polygons. Thank you!

                           

                          Anton, if you set the line width of your polygon in your design thinner this should translate to a thinner line in your new polygons.

                           

                          If you see this line:

                           

                          sprintf(s, "change width %fmic;", u2mic(POL.width));

                           

                          This sets the line width based on the width specified for the polygon (which it needs to do). So you should just be able to reduce the polygon line width down and hopefully that will solve some of your remaining issues.

                           

                          Best Regards,

                           

                          Rachael

                          2 of 2 people found this helpful