Browse Source

Add padstack copper offset to API

pcb_db
Jon Evans 11 months ago
parent
commit
b44015e204
  1. 3
      api/proto/board/board_types.proto
  2. 2
      pcbnew/padstack.cpp

3
api/proto/board/board_types.proto

@ -250,6 +250,9 @@ message PadStackLayer
// The difference in side length between the short and long pads in a trapezoid. Only one of x or y may be nonzero.
// Only used for PSS_TRAPEZOID
kiapi.common.types.Vector2 trapezoid_delta = 10;
// The offset of the center of this shape from the center of the pad (which is defined as the hole center)
kiapi.common.types.Vector2 offset = 11;
}
enum SolderMaskMode

2
pcbnew/padstack.cpp

@ -163,6 +163,7 @@ bool PADSTACK::unpackCopperLayer( const kiapi::board::types::PadStackLayer& aPro
SetSize( kiapi::common::UnpackVector2( aProto.size() ), layer );
SetShape( FromProtoEnum<PAD_SHAPE>( aProto.shape() ), layer );
Offset( layer ) = kiapi::common::UnpackVector2( aProto.offset() );
SetAnchorShape( FromProtoEnum<PAD_SHAPE>( aProto.custom_anchor_shape() ), layer );
SHAPE_PROPS& props = CopperLayer( layer ).shape;
@ -378,6 +379,7 @@ void PADSTACK::packCopperLayer( PCB_LAYER_ID aLayer, kiapi::board::types::PadSta
stackLayer->set_layer( ToProtoEnum<PCB_LAYER_ID, BoardLayer>( aLayer ) );
kiapi::common::PackVector2( *stackLayer->mutable_size(), Size( aLayer ) );
kiapi::common::PackVector2( *stackLayer->mutable_offset(), Offset( aLayer ) );
stackLayer->set_shape( ToProtoEnum<PAD_SHAPE, PadStackShape>( Shape( aLayer ) ) );

Loading…
Cancel
Save