!1110 优化:拆单侧孔 z改为从上到下

pull/1110/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent ad67d8abd5
commit 12afcfec71

@ -470,6 +470,8 @@ export namespace Production
return new Polyline().RectangleFrom2Pt(new Vector3, new Vector3(size.spliteWidth, size.spliteHeight)); return new Polyline().RectangleFrom2Pt(new Vector3, new Vector3(size.spliteWidth, size.spliteHeight));
return null; return null;
} }
/**孔信息,侧孔的z 均为 从上到下距离 */
export function GetBoardHolesData(br: Board, offsetTanslation: Vector3): IBoardHoleInfo export function GetBoardHolesData(br: Board, offsetTanslation: Vector3): IBoardHoleInfo
{ {
let drillList = br.DrillList; let drillList = br.DrillList;
@ -570,6 +572,11 @@ export namespace Production
return data; return data;
} }
/**拆单那边需要把侧孔 z 坐标转换为从上到下 */
function InvertPosition(pos: Vector3, thickness: number)
{
pos.z = thickness - pos.z;
}
/**分析常规排钻 */ /**分析常规排钻 */
function ParseCylHoles(d: CylinderHole, br: Board, offsetTanslation: Vector3, data: IBoardHoleInfo, outline: ExtureContourCurve) function ParseCylHoles(d: CylinderHole, br: Board, offsetTanslation: Vector3, data: IBoardHoleInfo, outline: ExtureContourCurve)
{ {
@ -626,6 +633,9 @@ export namespace Production
isPush = true; isPush = true;
depth = position.distanceTo(endPt); depth = position.distanceTo(endPt);
angle = undefined; angle = undefined;
InvertPosition(position, br.Thickness);
InvertPosition(endPt, br.Thickness);
} }
else if (d.Type === GangDrillType.Wood) else if (d.Type === GangDrillType.Wood)
{ {
@ -743,6 +753,10 @@ export namespace Production
if (!endPt) if (!endPt)
return; return;
let depth = position.distanceTo(endPt); let depth = position.distanceTo(endPt);
InvertPosition(position, br.Thickness);
InvertPosition(endPt, br.Thickness);
data.sideHoles.push({ data.sideHoles.push({
type: GangDrillType.Ljg, type: GangDrillType.Ljg,
endPt, endPt,

Loading…
Cancel
Save