!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)))
continue;
if (ds.length > 0)
drills.push(ds);
let ds2 = ds.filter(d => d && !d.IsErase);
if (ds2.length > 0)
drills.push(ds2);
}
}
b2boxMap.set(b, drills);

@ -607,7 +607,7 @@ export class DrawDrillingTool extends Singleton
let refYmjEnt = (arrayLast(refDrill).Object as CylinderHole);
let p2 = refYmjEnt.Position;
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;
isThoughtDrillsSet.add(refDrill);
@ -668,19 +668,13 @@ export class DrawDrillingTool extends Singleton
}
GetDrillsBox(ids: ObjectId[], OCSInv: Matrix4)
{
let box = new Box3();
let boxes: Box3[] = [box];
let boxes: Box3[] = [];
for (let id of ids)
{
let d = id.Object as CylinderHole;
if (!d) continue;
if (d.Type === GangDrillType.Pxl)
{
boxes.push(d.GetBoundingBoxInMtx(OCSInv));
}
else
box.union(d.GetBoundingBoxInMtx(OCSInv));
}
return boxes;
}
CheckCollision(drills: ObjectId[][], refDrillList: ObjectId[][], woodPinss: ObjectId[][])

Loading…
Cancel
Save