my first experiments creating solder mask openings revealed “unexpected behavior”:
def circle(x, y, d):
circle = pcbnew.PCB_SHAPE()
circle.SetShape(pcbnew.S_CIRCLE)
circle.SetWidth(1413) # nanometers
circle.SetCenter(pcbnew.VECTOR2I(pcbnew.FromMM(x), pcbnew.FromMM(y)))
circle.SetRadius(pcbnew.FromMM(d/2))
circle.SetFilled(True)
circle.SetLayer(pcbnew.F_Mask)
pcbnew.GetBoard().Add(circle)
pcbnew.Refresh()
seems to work as expected: I get a round shape in F.Mask which I can select, move, delete.
But if I change F_Mask to B_Mask, I get the following when I click the circle:
Regardless of my selection, the doubled circle is selected. I can’t delete it, and the systems seems to get unstable.
Using “circle.SetLayer(38)” shows no problems.
What could be the difference between “circle.SetLayer(pcbnew.B_Mask)” and “circle.SetLayer(38)”?
And why does it happen only with pcbnew.B_Mask and not with pcbnew.F_Mask?