!1176 优化:加强排钻碰撞检测

pull/1176/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent ff0b059bc6
commit 741effc669

@ -35,8 +35,9 @@ export class CheckHoles implements Command
{ {
if (ds.some(d => !d?.Object || (d.Object instanceof CylinderHole && d.Object.Type === GangDrillType.TK))) if (ds.some(d => !d?.Object || (d.Object instanceof CylinderHole && d.Object.Type === GangDrillType.TK)))
continue; continue;
if (ds.length > 0) let ds2 = ds.filter(d => d && !d.IsErase);
drills.push(ds); if (ds2.length > 0)
drills.push(ds2);
} }
} }
b2boxMap.set(b, drills); b2boxMap.set(b, drills);

@ -607,7 +607,7 @@ export class DrawDrillingTool extends Singleton
let refYmjEnt = (arrayLast(refDrill).Object as CylinderHole); let refYmjEnt = (arrayLast(refDrill).Object as CylinderHole);
let p2 = refYmjEnt.Position; let p2 = refYmjEnt.Position;
let vec = p2.sub(p1); let vec = p2.sub(p1);
if (equaln(vec.length(), this.m_Face.LocalBoard.Thickness)) if (equaln(vec.length(), this.m_Face.LocalBoard.Thickness, 1e-2))
{ {
isThought = true; isThought = true;
isThoughtDrillsSet.add(refDrill); isThoughtDrillsSet.add(refDrill);
@ -668,18 +668,12 @@ export class DrawDrillingTool extends Singleton
} }
GetDrillsBox(ids: ObjectId[], OCSInv: Matrix4) GetDrillsBox(ids: ObjectId[], OCSInv: Matrix4)
{ {
let box = new Box3(); let boxes: Box3[] = [];
let boxes: Box3[] = [box];
for (let id of ids) for (let id of ids)
{ {
let d = id.Object as CylinderHole; let d = id.Object as CylinderHole;
if (!d) continue; if (!d) continue;
if (d.Type === GangDrillType.Pxl) boxes.push(d.GetBoundingBoxInMtx(OCSInv));
{
boxes.push(d.GetBoundingBoxInMtx(OCSInv));
}
else
box.union(d.GetBoundingBoxInMtx(OCSInv));
} }
return boxes; return boxes;
} }

Loading…
Cancel
Save