background
Refer to github's open source svg generation code, the white squares in the running picture have gray edges, changing the lower edge parameters is useless, so I have to search for the cause and solution
reference
solution
The reason for finding this gray edge is that when the pixels cannot be completely aligned in integers, there will be anti-aliasing problems in the overlapping parts of the two patterns, and such a black edge will appear when the edges overlap. The solution is to try a few more The option of edge configuration, I finally chose to change it like this:
self.drawing = svgwrite.Drawing(path,
size=(width*mm, height*mm),
profile='full', shape_rendering="crispEdges")
In this way, the image that ran out has no gray edges, and the zoom-in is also very fine.