Home > IPCB_ComplexPolygon > getSource
IPCB_ComplexPolygon.getSource() method
Get Polygon data
Signature
typescript
function getSource(): TPCB_PolygonSourceArray | Array<TPCB_PolygonSourceArray>;1
Returns
TPCB_PolygonSourceArray | Array<TPCB_PolygonSourceArray>
Single polygon or complex polygon data
Remarks
If it only contains a single polygon, the outermost array will be simplified
Example
javascript
// 1. 用单个单多边形构建:getSource 会化简最外层数组
const single = eda.pcb_MathPolygon.createComplexPolygon(['R', 1000, 1000, 500, 300, 0, 0]);
// 2. 用多个单多边形构建:getSource 返回二维数组
const multi = eda.pcb_MathPolygon.createComplexPolygon([
['R', 2000, 1000, 500, 300, 0, 0],
['CIRCLE', 3000, 1150, 100],
]);
console.log('singleSource:', JSON.stringify(single.getSource()));
console.log('multiSource:', JSON.stringify(multi.getSource()));1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11