From 9ed3474a5b287bf921baa7683db18243247c99ef Mon Sep 17 00:00:00 2001 From: Jon Evans <jon@craftyjon.com> Date: Sat, 16 Nov 2024 13:04:27 -0500 Subject: [PATCH] Add more SWIG compatibility shims --- pcbnew/python/swig/footprint.i | 7 ++++++- pcbnew/python/swig/pad.i | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pcbnew/python/swig/footprint.i b/pcbnew/python/swig/footprint.i index 01fe3166b9..576c60c3f0 100644 --- a/pcbnew/python/swig/footprint.i +++ b/pcbnew/python/swig/footprint.i @@ -97,8 +97,13 @@ """ Sets footprint fields map. """ for k, v in fields.items(): self.SetField(k, v) - %} + + // Compatibility shim + const BOX2I GetBoundingBox( bool aIncludeText, bool includeHiddenText ) const + { + return ( $self )->GetBoundingBox( aIncludeText ); + } } diff --git a/pcbnew/python/swig/pad.i b/pcbnew/python/swig/pad.i index 79de6b4e89..e1e9118199 100644 --- a/pcbnew/python/swig/pad.i +++ b/pcbnew/python/swig/pad.i @@ -34,6 +34,18 @@ const int PAD_DRILL_SHAPE_OBLONG = (const int)PAD_DRILL_SHAPE::OBLONG; VECTOR2I GetOffset() { return $self->GetOffset( F_Cu ); } void SetOffset( VECTOR2I aOffset ) { $self->SetOffset( F_Cu, aOffset ); } + double GetRoundRectCornerRadius() { return $self->GetRoundRectCornerRadius( F_Cu ); } + void SetRoundRectCornerRadius( double aRadius ) { $self->SetRoundRectCornerRadius( F_Cu, aRadius ); } + + double GetRoundRectRadiusRatio() { return $self->GetRoundRectRadiusRatio( F_Cu ); } + void SetRoundRectRadiusRatio( double aRatio ) { $self->SetRoundRectRadiusRatio( F_Cu, aRatio ); } + + double GetChamferRectRatio() { return $self->GetChamferRectRatio( F_Cu ); } + void SetChamferRectRatio( double aRatio ) { $self->SetChamferRectRatio( F_Cu, aRatio ); } + + int GetChamferPositions() { return $self->GetChamferPositions( F_Cu ); } + void SetChamferPositions( int aPositions ) { $self->SetChamferPositions( F_Cu, aPositions ); } + %pythoncode %{