fix: B.Cu footprint Flip() in SWIG path + J2-on-B.Cu prompt note + pin-1-at-top schema hint

This commit is contained in:
Tom
2026-03-06 20:51:52 +01:00
parent b43c63edca
commit f3078b7a02
2 changed files with 10 additions and 5 deletions

View File

@@ -125,10 +125,15 @@ class ComponentCommands:
angle = pcbnew.EDA_ANGLE(rotation, pcbnew.DEGREES_T)
module.SetOrientation(angle)
# Set layer
layer_id = self.board.GetLayerID(layer)
if layer_id >= 0:
module.SetLayer(layer_id)
# Set layer — for B.Cu the footprint must be flipped (mirrored),
# not just layer-assigned. Flip() handles layer + mirror in one step.
if layer == "B.Cu":
if not module.IsFlipped():
module.Flip(module.GetPosition(), False)
else:
layer_id = self.board.GetLayerID(layer)
if layer_id >= 0:
module.SetLayer(layer_id)
# Add to board
self.board.Add(module)