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:
parent
265c6fa3b7
commit
1bb6d4e22c
|
@ -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>
|
||||
|
||||
|
|
|
@ -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
|
||||
%}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue