|
|
|
@ -612,7 +612,7 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
|
let b1 = g.ContourCurve.BoundingBox;
|
|
|
|
|
b1.max.add(new Vector3(0, 0, g.Thickness));
|
|
|
|
|
const diffMat = ocsInv.clone().multiply(g.OCS);
|
|
|
|
|
const diffMat = ocsInv.clone().multiply(g.OCSNoClone);
|
|
|
|
|
b1.applyMatrix4(diffMat);
|
|
|
|
|
let isBoxInt = b1.intersectsBox(box);
|
|
|
|
|
let isRotate = !equaln(diffMat.elements[0], 1);
|
|
|
|
@ -765,7 +765,6 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
}
|
|
|
|
|
private ParseHolesisThrough(ents: CylinderHole[] | ExtrudeHole[], refEnts: CylinderHole[] | ExtrudeHole[])
|
|
|
|
|
{
|
|
|
|
|
let nor = this.m_Face.LocalBoard.Normal;
|
|
|
|
|
for (let en of ents)
|
|
|
|
|
{
|
|
|
|
|
if (!en) continue;
|
|
|
|
@ -779,6 +778,8 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
else
|
|
|
|
|
radius = en.Radius;
|
|
|
|
|
|
|
|
|
|
let enOcsInv = en.OCSInv;
|
|
|
|
|
|
|
|
|
|
for (let refEn of refEnts)
|
|
|
|
|
{
|
|
|
|
|
let refRadius: number;
|
|
|
|
@ -791,8 +792,8 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
else
|
|
|
|
|
refRadius = refEn.Radius;
|
|
|
|
|
|
|
|
|
|
let p2 = refEn.Position.applyMatrix4(en.OCSInv);
|
|
|
|
|
let p2End = refEn.Position.add(refEn.Normal.multiplyScalar(refEn.Height)).applyMatrix4(en.OCSInv);
|
|
|
|
|
let p2 = refEn.Position.applyMatrix4(enOcsInv);
|
|
|
|
|
let p2End = refEn.Position.add(refEn.Normal.multiplyScalar(refEn.Height)).applyMatrix4(enOcsInv);
|
|
|
|
|
|
|
|
|
|
if (equaln(radius, refRadius, 1e-2)
|
|
|
|
|
&& isParallelTo(p2, ZAxis, 0.01)
|
|
|
|
@ -882,15 +883,16 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
|
let isCollsion = false;
|
|
|
|
|
|
|
|
|
|
let faceOcsInv = this.m_Face.OCSInv;
|
|
|
|
|
for (let i = 0; i < drills.length; i++)
|
|
|
|
|
{
|
|
|
|
|
const ds = drills[i];
|
|
|
|
|
if (this.IsTk(ds)) continue;
|
|
|
|
|
let bs1 = this.GetDrillsBox(ds, this.m_Face.OCSInv);
|
|
|
|
|
let bs1 = this.GetDrillsBox(ds, faceOcsInv);
|
|
|
|
|
for (let refDr of refDrillList)
|
|
|
|
|
{
|
|
|
|
|
if (this.IsTk(refDr)) continue;
|
|
|
|
|
let bs2 = this.GetDrillsBox(refDr, this.m_Face.OCSInv);
|
|
|
|
|
let bs2 = this.GetDrillsBox(refDr, faceOcsInv);
|
|
|
|
|
//#I1FFNB
|
|
|
|
|
if (bs1.some(b => bs2.some(b2 => this.DrillIsCollsion(b, b2))))
|
|
|
|
|
{
|
|
|
|
@ -1104,7 +1106,7 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
}
|
|
|
|
|
DrillIsCollsion(b1: Box3Ext, b2: Box3Ext)
|
|
|
|
|
{
|
|
|
|
|
if (b1.clone().intersect(b2).isSolid(1e-2))
|
|
|
|
|
if (b1.intersectsBox(b2, 1e-2))
|
|
|
|
|
{
|
|
|
|
|
if (b1.TempData && b2.TempData)
|
|
|
|
|
{
|
|
|
|
@ -1116,8 +1118,9 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
|
if (!isParallelTo(h1.Normal, h2.Normal)) return true;
|
|
|
|
|
|
|
|
|
|
let p1 = h1.Position.applyMatrix4(h1.OCSInv).setZ(0);
|
|
|
|
|
let p2 = h2.Position.applyMatrix4(h1.OCSInv).setZ(0);
|
|
|
|
|
let ocsInv = h1.OCSInv;
|
|
|
|
|
let p1 = h1.Position.applyMatrix4(ocsInv).setZ(0);
|
|
|
|
|
let p2 = h2.Position.applyMatrix4(ocsInv).setZ(0);
|
|
|
|
|
|
|
|
|
|
let len = p1.distanceTo(p2);
|
|
|
|
|
|
|
|
|
|