|
|
|
@ -618,32 +618,31 @@ export namespace Production
|
|
|
|
|
InvertPosition(position, br.Thickness);
|
|
|
|
|
InvertPosition(endPt, br.Thickness);
|
|
|
|
|
}
|
|
|
|
|
else if (cyHole.Type === GangDrillType.Wood)
|
|
|
|
|
else if (cyHole.Type === GangDrillType.Wood)//木销
|
|
|
|
|
{
|
|
|
|
|
if (!outline.PtInCurve(position.clone().setZ(0))) return;
|
|
|
|
|
face = position.z > 0 ? FaceDirection.Front : FaceDirection.Back;
|
|
|
|
|
position.sub(offsetTanslation);
|
|
|
|
|
|
|
|
|
|
//#region 求得真实的求交范围
|
|
|
|
|
let z0 = position.z;
|
|
|
|
|
let z1 = pos2.z;
|
|
|
|
|
if (z0 > z1) [z0, z1] = [z1, z0];
|
|
|
|
|
|
|
|
|
|
let i1 = Math.max(z0, 0);
|
|
|
|
|
let i2 = Math.min(z1, br.Thickness);
|
|
|
|
|
if (i2 - i1 < CanDrawHoleFuzz) return;//相交范围小于0.1
|
|
|
|
|
|
|
|
|
|
if (equaln(i1, 0, CanDrawHoleFuzz)) face = FaceDirection.Back;
|
|
|
|
|
else if (equaln(i2, br.Thickness, CanDrawHoleFuzz)) face = FaceDirection.Front;
|
|
|
|
|
else return;//不在正面 也不在反面
|
|
|
|
|
|
|
|
|
|
depth = i2 - i1;//真实的相交范围
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
holes = data.frontBackHoles;
|
|
|
|
|
if (position.z > 0)
|
|
|
|
|
{
|
|
|
|
|
let z1 = position.z - cyHole.Height;
|
|
|
|
|
if (z1 > 0 && z1 < br.Thickness)
|
|
|
|
|
{
|
|
|
|
|
depth = br.Thickness - z1;
|
|
|
|
|
isPush = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
let z1 = position.z + cyHole.Height;
|
|
|
|
|
if (z1 > 0 && z1 < br.Thickness)
|
|
|
|
|
{
|
|
|
|
|
depth = z1;
|
|
|
|
|
isPush = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
position.sub(offsetTanslation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (isParallelTo(cyHole.Normal, brNormal, CanDrawHoleFuzz))
|
|
|
|
|