Home > IPCB_PrimitivePour > getCopperRegion
IPCB_PrimitivePour.getCopperRegion() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取铺铜区域覆铜填充图元
签名
typescript
function getCopperRegion(): Promise<IPCB_PrimitivePoured | undefined>;1
返回值
Promise<IPCB_PrimitivePoured | undefined>
覆铜填充图元,如若不存在关联的覆铜填充图元则返回 undefined
示例
javascript
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
const x = 2000 + Math.floor(Math.random() * 100000);
const y = 2000 + Math.floor(Math.random() * 100000);
// 2. 创建一个覆铜边框(刚创建还没有生成填充)
const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
const pour = await eda.pcb_PrimitivePour.create('', 1, polygon, 'solid', false, '嘉立创示例_查填充', 5, 10, false);
// 3. 查询关联的覆铜填充图元
const copperRegion = await pour.getCopperRegion();
const hasFill = copperRegion !== undefined;
// 4. 清理测试图元(查询类需要清理)
await eda.pcb_PrimitivePour.delete([pour.getState_PrimitiveId()]);
console.log('hasCopperRegion:', hasFill);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16