diff --git a/src/Production/Product.ts b/src/Production/Product.ts index 368d24147..509de20fa 100644 --- a/src/Production/Product.ts +++ b/src/Production/Product.ts @@ -480,7 +480,7 @@ export namespace Production for (let h of holes) { if (h instanceof ExtrudeHole) - ParseExtrudeHoles(h, br, offsetTanslation, data, sealedContour, true); + ParseExtrudeHoles(h, br, offsetTanslation, data, sealedContour, true, true); else ParseCylHoles(h as CylinderHole, br, offsetTanslation, data, sealedContour); } @@ -701,8 +701,14 @@ export namespace Production }); } - /**分析自定义圆柱排钻 */ - function ParseExtrudeHoles(d: ExtrudeHole, br: Board, offsetTanslation: Vector3, data: IBoardHoleInfo, outline: ExtrudeContourCurve, isCheckGroove = false) + /**分析自定义圆柱排钻 + * + * isRelativeHardware 关联的五金使用此类型误差 + * CanDrawHoleFuzz)//区间交集必须大于CanDrawHoleFuzz + * CanDrawHoleFuzz)//区间交集必须大于CanDrawHoleFuzz + * + */ + function ParseExtrudeHoles(d: ExtrudeHole, br: Board, offsetTanslation: Vector3, data: IBoardHoleInfo, outline: ExtrudeContourCurve, isCheckGroove = false, isRelativeHardware = false) { if (!d.isHole) return; @@ -770,8 +776,8 @@ export namespace Production if (sp.z > -cir.Radius && sp.z < br.Thickness + cir.Radius - && Math.max(minX, 0) < (Math.min(br.Width, maxX) - CanDrawHoleFuzz)//区间交集必须大于CanDrawHoleFuzz - && Math.max(minY, 0) < (Math.min(br.Height, maxY) - CanDrawHoleFuzz)//区间交集必须大于CanDrawHoleFuzz + && Math.max(minX, 0) < ((Math.min(br.Width, maxX) + (isRelativeHardware ? -CanDrawHoleFuzz : 1e-6)))//区间交集必须大于CanDrawHoleFuzz + && Math.max(minY, 0) < (Math.min(br.Height, maxY) + (isRelativeHardware ? -CanDrawHoleFuzz : 1e-6))//区间交集必须大于CanDrawHoleFuzz ) { sp.setZ(0); @@ -780,7 +786,7 @@ export namespace Production let pt = outline.IntersectWith(line, 0)[0]; if (!pt) { - InteractionLog([{ msg: "警告:" }, { msg: `板件${br.Name}`, entity: [br, d] }, { msg: "的排钻嵌在板件内部,已经跳过!" }], LogType.Warning); + InteractionLog([{ msg: "警告:" }, { msg: `板件${br.Name}`, entity: [br, d] }, { msg: `的${isRelativeHardware ? "五金" : "排钻"}嵌在板件内部,已经跳过!` }], LogType.Warning); return; } let position = pt.clone().setZ(oldZ);