Home > PCB_ImageTool > startPlaceVectorImage
PCB_ImageTool.startPlaceVectorImage() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Warning: This API is now obsolete.
临时接口(插入图片 PCB 迁移打通流程用):等统一放置接口重构落地后删除替换,请尽快迁移,勿在新功能中继续依赖
开始放置矢量图片(将描摹好的路径交给内核,触发十字光标放置)
Signature
typescript
function startPlaceVectorImage(options: {
path: string;
width: number;
height: number;
unit?: 'mm' | 'mil';
}): Promise<boolean>;1
2
3
4
5
6
2
3
4
5
6
Parameters
Parameter | Type | Description |
|---|---|---|
options | { path: string; width: number; height: number; unit?: 'mm' | 'mil' } | .unit - 单位,默认 |
Returns
Promise<boolean>
放置工具是否成功触发
Remarks
ADD since EDA v5
Example
javascript
// 1. 描摹图片得到矢量路径
const traced = await eda.pcb_MathPolygon.traceImage({ imageBlob, quality: 'high' });
if (!traced) {
console.log('空描摹:无图可放置');
return;
}
// 2. 触发放置(用户点哪放哪)
const ok = await eda.pcb_ImageTool.startPlaceVectorImage({
path: traced.path,
width: 50,
height: 30,
unit: 'mm',
});
console.log('矢量放置已触发:', ok);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15