diff --git a/common/swig/kicad.i b/common/swig/kicad.i index be4ee016b3..2508cfd6be 100644 --- a/common/swig/kicad.i +++ b/common/swig/kicad.i @@ -135,6 +135,10 @@ typedef long time_t; // KiCad plugin handling %include "kicadplugins.i" +%shared_ptr(SHAPE) +%shared_ptr(SHAPE_POLY_SET) +%shared_ptr(SHAPE_LINE_CHAIN) + #include %include diff --git a/pcbnew/swig/pad.i b/pcbnew/swig/pad.i index be8c7dda0c..492206fa94 100644 --- a/pcbnew/swig/pad.i +++ b/pcbnew/swig/pad.i @@ -41,5 +41,11 @@ return self.AddPrimitiveCurve(*args) else: raise TypeError("Arguments not recognized.") + + # GetCustomShapeAsPolygon() is the old accessor to get custom shapes + def GetCustomShapeAsPolygon(self): + polygon_set = SHAPE_POLY_SET() + self.MergePrimitivesAsPolygon(polygon_set) + return polygon_set %} }