Suspicious Gerber parser code for D2
Issue #155
new
elif current_operation_code == 2:
if len(path) > 1:
## --- BUFFERED ---
if making_region:
geo = Polygon(path)
else:
if last_path_aperture is None:
log.warning("No aperture defined for curent path. (%d)" % line_num)
width = self.apertures[last_path_aperture]["size"] # TODO: WARNING this should fail!
#log.debug("Line %d: Setting aperture to %s before buffering." % (line_num, last_path_aperture))
if follow:
geo = LineString(path)
else:
geo = LineString(path).buffer(width / 2)
if not geo.is_empty: poly_buffer.append(geo)
path = [[current_x, current_y]] # Start new path
The else
statement should only reset the current coordinates, but seems to be adding a path.