|
|
|
@ -24,6 +24,9 @@ import { Entity } from "../../DatabaseServices/Entity/Entity";
|
|
|
|
|
import { Box3Ext } from "../../Geometry/Box";
|
|
|
|
|
import { ExtrudeHole } from "../../DatabaseServices/3DSolid/ExtrudeHole";
|
|
|
|
|
import { Hole } from "../../DatabaseServices/3DSolid/Hole";
|
|
|
|
|
import { ExtrudeSolid } from "../../DatabaseServices/Entity/Extrude";
|
|
|
|
|
import { Shape } from "../../DatabaseServices/Shape";
|
|
|
|
|
import { Contour } from "../../DatabaseServices/Contour";
|
|
|
|
|
|
|
|
|
|
export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
@ -445,9 +448,24 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
|
let mat = b.OCSInv.multiply(this.m_Face.OCS).multiply(MoveMatrix(new Vector3(dist)));
|
|
|
|
|
let bo = box.clone().applyMatrix4(mat) as Box3Ext;
|
|
|
|
|
return b.Grooves.some(g => g.BoundingBox.applyMatrix4(b.OCSInv).intersectsBox(bo));
|
|
|
|
|
return b.Grooves.some(g => this.IsDrillCollisionModeling(g, bo, b.OCSInv));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
private IsDrillCollisionModeling(g: ExtrudeSolid, box: Box3, ocsInv: Matrix4)
|
|
|
|
|
{
|
|
|
|
|
let b1 = g.GetBoundingBoxInMtx(ocsInv);
|
|
|
|
|
let isBoxInt = b1.intersectsBox(box);
|
|
|
|
|
if (g.IsRect && g.Grooves.length === 0)
|
|
|
|
|
return isBoxInt;
|
|
|
|
|
|
|
|
|
|
if (!isBoxInt) return false;
|
|
|
|
|
|
|
|
|
|
let shape = g.Shape.ApplyMatrix(g.OCS).ApplyMatrix(ocsInv).Z0();
|
|
|
|
|
|
|
|
|
|
let rectLine = new Polyline().RectangleFrom2Pt(box.min.setZ(0), box.max.setZ(0));
|
|
|
|
|
let rectShape = new Shape(Contour.CreateContour(rectLine));
|
|
|
|
|
|
|
|
|
|
return rectShape.IntersectionBoolOperation(shape).length > 0;
|
|
|
|
|
}
|
|
|
|
|
// 分析当前排钻
|
|
|
|
|
private ParseDrillList(drills: ObjectId[][], woodPinss: ObjectId[][])
|
|
|
|
@ -611,7 +629,8 @@ export class DrawDrillingTool extends Singleton
|
|
|
|
|
{
|
|
|
|
|
if (isTK(refDr)) continue;
|
|
|
|
|
let bs2 = getDrillsBox(refDr, this.m_Face.OCSInv);
|
|
|
|
|
if (bs1[0].intersectsBox(bs2[0]) || (bs2[1] && bs1[1] && bs1[1].intersectsBox(bs2[1])))
|
|
|
|
|
//#I1FFNB
|
|
|
|
|
if (bs1.some(b => bs2.some(b2 => b2.intersectsBox(b))))
|
|
|
|
|
{
|
|
|
|
|
let offsetDist = this.m_Option.collsionDist;
|
|
|
|
|
this.MoveDrillEnts(ds, offsetDist, this.m_Face.IsPositiveFace ? 1 : -1);
|
|
|
|
|