kiplot icon indicating copy to clipboard operation
kiplot copied to clipboard

Filling zones

Open arikrupnik opened this issue 6 years ago • 1 comments

@johnbeard , thank you for writing this extremely useful piece of software, and for wading through the spartan documentation on the Python API. Your code is the best documentation I've found for many aspects of the API!

One issue in particular has been a stumbling block for me: filling copper pour zones. Going by this comment in your code, it has been an issue for you, too. https://github.com/johnbeard/kiplot/blob/f1c85dbdba44a417a0f42d5a209381e569764b78/src/kiplot/kiplot.py#L65

Seth Hillbrand over at the KiCAD forum has been able to answer my question, and I imagine you might find his answer relevant: https://forum.kicad.info/t/filling-zones-copper-pours-inside-the-python-api/19814

In my own code, I have it as a single line:

pcbnew.ZONE_FILLER(board).Fill(board.Zones())

If you still want to check whether zones are filled (instead of unconditionally filling them as I do), you can use something like this:

for idx in range(0, board.GetAreaCount()):
    zone=board.GetArea(idx)
    print "zone:", zone.GetNetname(), "isFilled:", zone.IsFilled()

arikrupnik avatar Nov 14 '19 01:11 arikrupnik

Very good idea @arikrupnik I was using a weaker strategy in my fork: https://github.com/INTI-CMNB/kiplot Now I'm using your suggestion: INTI-CMNB/kiplot@0d9256fb244d4f08c890be9b720308b90051920c Thanks!

set-soft avatar Jun 14 '20 18:06 set-soft