Wrong Gerber Flashing (Wrong pad geometry)

Issue #92 resolved
Денис Железняков created an issue

Windows 8.1 64 bit

bug.PNG

err.png

Bug 2 (Top2)

err2.png

Comments (9)

  1. Juan Pablo Caram repo owner

    Denis, could you please post a screenshot showing coordinates? This will make it easier to find the problem in the Gerber.

    Did the problem exist in previous versions of FlatCAM?

  2. Денис Железняков reporter

    Updated screenshots. In previous versions of even more errors. They need to show?

  3. Juan Pablo Caram repo owner

    Confirmed bug. Details on G-code:

     12  %ADD25R,1.05X0.65*%
    
    234  Y15113D3*
    235  D25*
    236  X15875Y17145D3*
    237  Y15245D3*
    238  X18175Y16195D3*
    239  X20955Y13018D3*
    

    Line 238 is the feature that is rendered incorrectly. It's using tool 25 which is clearly a rectangle. Interestingly, all the other flashes, lines 235, 236, 237 and 239 are rendered correctly.

  4. Juan Pablo Caram repo owner

    Linear interpolation to (18.175 16.195) happens on line 179. Then a flash to that point happens on 182 to that same point even though the coordinates changed in 181. Note: There is a double flash (181 and 182) which is an error of the CAD program.

    [DEBUG] 178 X15084Y16195D1*
    [DEBUG] 179 X18175D1*
    [DEBUG] 180 D29*
    [DEBUG] Line 180: Aperture change to (29)
    [DEBUG] {'type': 'C', 'size': 1.2}
    [DEBUG] 181 X13176Y17304D3*
    [DEBUG] Flashing @POINT (13.176 17.304), Aperture: {'type': 'C', 'size': 1.2}
    [DEBUG] 182 D3*
    [DEBUG] Flashing @POINT (18.175 16.195), Aperture: {'type': 'C', 'size': 1.2}
    [DEBUG] 183 X8258Y17621D3*
    [DEBUG] Flashing @POINT (8.258000000000001 17.621), Aperture: {'type': 'C', 'size': 1.2}
    [DEBUG] 184 D3*
    [DEBUG] Flashing @POINT (18.175 16.195), Aperture: {'type': 'C', 'size': 1.2}
    
  5. Juan Pablo Caram repo owner

    Bug corrected here (camlib.Gerber.parse_lines()):

    ### Operation code alone
    # Operation code alone, usually just D03 (Flash)
    # self.opcode_re = re.compile(r'^D0?([123])\*$')
    match = self.opcode_re.search(gline)
    if match:
        current_operation_code = int(match.group(1))
        if current_operation_code == 3:
    
            ## --- Buffered ---
            try:
                log.debug("Bare op-code %d." % current_operation_code)
                # flash = Gerber.create_flash_geometry(Point(path[-1]),
                #                                      self.apertures[current_aperture])
                flash = Gerber.create_flash_geometry(Point(current_x, current_y),
                                                     self.apertures[current_aperture])
                poly_buffer.append(flash)
            except IndexError:
                log.warning("Line %d: %s -> Nothing there to flash!" % (line_num, gline))
    
        continue
    

    Coordinates taken from path will be incorrect when doing more than one flash at a time.

  6. Log in to comment