Fix pads python api compatibility

* Add GetCustomShapeAsPolygon() to swig wrapper
* Make shared_ptr<SHAPE_POLY_SET> usable for GetEffectivePolygon()

Fixes #4999
This commit is contained in:
qu1ck 2020-07-27 19:59:16 -07:00 committed by Seth Hillbrand
parent 265c6fa3b7
commit 1bb6d4e22c
2 changed files with 10 additions and 0 deletions

View File

@ -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 <geometry/shape.h>
%include <geometry/shape.h>

View File

@ -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
%}
}