|
|
@ -508,14 +508,23 @@ export namespace Production
|
|
|
|
let ep = nail.Position.add(nor).applyMatrix4(br.OCSInv);
|
|
|
|
let ep = nail.Position.add(nor).applyMatrix4(br.OCSInv);
|
|
|
|
let [z0, z1] = sp.z < ep.z ? [sp.z, ep.z] : [ep.z, sp.z];
|
|
|
|
let [z0, z1] = sp.z < ep.z ? [sp.z, ep.z] : [ep.z, sp.z];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let face = !equalv3(nail.Normal, brNormal, CanDrawHoleFuzz) ? FaceDirection.Front : FaceDirection.Back;
|
|
|
|
|
|
|
|
let depth = Math.min(z1, br.Thickness) - Math.max(z0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
Math.max(z0, 0) < Math.min(z1, br.Thickness) - 1e-6
|
|
|
|
Math.max(z0, 0) < Math.min(z1, br.Thickness) - 1e-6
|
|
|
|
&& br.ContourCurve.PtInCurve(sp.setZ(0))
|
|
|
|
&& br.ContourCurve.PtInCurve(sp.setZ(0))
|
|
|
|
&& modelings.every(m => !m.shape.Outline.Curve.PtInCurve(sp))
|
|
|
|
//层板钉中心点不在造型槽内
|
|
|
|
|
|
|
|
&& modelings.every(m =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m.dir !== face && (depth + m.thickness) < br.Thickness)//不相交
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (m.shape.Holes.some(h => h.Curve.PtInCurve(sp))) return true; //层板钉在孤岛内 现实中应该不会有
|
|
|
|
|
|
|
|
return !m.shape.Outline.Curve.PtInCurve(sp);
|
|
|
|
|
|
|
|
})
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let face = !equalv3(nail.Normal, brNormal, CanDrawHoleFuzz) ? FaceDirection.Front : FaceDirection.Back;
|
|
|
|
|
|
|
|
let depth = Math.min(z1, br.Thickness) - Math.max(z0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.frontBackHoles.push({
|
|
|
|
data.frontBackHoles.push({
|
|
|
|
type: nail.Type,
|
|
|
|
type: nail.Type,
|
|
|
|