Home > PCB_MathPolygon > calculateBBoxHeight
PCB_MathPolygon.calculateBBoxHeight() method
计算多边形源数组的 BBox 高度
Signature
typescript
function calculateBBoxHeight(
complexPolygon: TPCB_PolygonSourceArray | Array<TPCB_PolygonSourceArray>,
): number;1
2
3
2
3
Parameters
Parameter | Type | Description |
|---|---|---|
complexPolygon |
Returns
number
Example
javascript
// 1. 单个矩形源数组(宽 100、高 50),BBox 高度为 50
console.log('rectHeight:', eda.pcb_MathPolygon.calculateBBoxHeight(['R', 0, 0, 100, 50, 0, 0]));
// 2. 单个圆源数组(圆心在原点、半径 50),BBox 高度为直径 100
console.log('circleHeight:', eda.pcb_MathPolygon.calculateBBoxHeight(['CIRCLE', 0, 0, 50]));
// 3. 多块组合:矩形 Y 范围 0~50,圆 Y 范围 170~230,整体跨度 230
console.log('multiHeight:', eda.pcb_MathPolygon.calculateBBoxHeight([
['R', 0, 0, 100, 50, 0, 0],
['CIRCLE', 200, 200, 30],
]));1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11