!1167 优化:通孔偏移不再是通孔,原先是通孔手动移动取消通孔

pull/1167/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 637b6a7dda
commit 7bd40e26ab

@ -612,8 +612,12 @@ export class DrawDrillingTool extends Singleton
isThought = true;
isThoughtDrillsSet.add(refDrill);
//预埋件类型改为通孔
ymjEnt.Type = GangDrillType.TK;
refYmjEnt.Type = GangDrillType.TK;
//除了偏移并且不是偏移0的情况均为通孔类型
if (!(this.m_Option.tIsOffset && !equaln(0, this.m_Option.tHoleOffset)))
{
ymjEnt.Type = GangDrillType.TK;
refYmjEnt.Type = GangDrillType.TK;
}
//通孔改小孔半径
if (!this.m_Option.tIsOffset)
{

@ -3,6 +3,8 @@ import { app } from '../ApplicationServices/Application';
import { Command } from '../Editor/CommandMachine';
import { JigUtils } from '../Editor/JigUtils';
import { PromptStatus } from '../Editor/PromptResult';
import { CylinderHole, GangDrillType } from '../DatabaseServices/3DSolid/CylinderHole';
import { Board } from '../DatabaseServices/Entity/Board';
export class Command_Move implements Command
{
@ -47,8 +49,34 @@ export class Command_Move implements Command
if (ptRes.Status === PromptStatus.OK)
{
moveMatrix.setPosition(ptRes.Point.clone().sub(ptBase));
//通孔移动后可能不再是通孔
let tks = app.Viewer.VisibleEntitys.filter(e => (e instanceof CylinderHole) && e.Type === GangDrillType.TK) as CylinderHole[];
let hasBoard = ens.some(en => en instanceof Board);
let cancelTks = new WeakSet<CylinderHole>();
for (let en of ens)
{
if (!hasBoard && en instanceof CylinderHole && en.Type === GangDrillType.TK)
{
for (let tk of tks)
{
if (cancelTks.has(tk)) continue;
if (en.BoundingBox.intersectsBox(tk.BoundingBox))
{
if (!ens.includes(tk))
{
cancelTks.add(tk);
en.Type = GangDrillType.Ymj;
tk.Type = GangDrillType.Ymj;
}
}
}
}
en.ApplyMatrix(moveMatrix);
}
}
}
}

@ -754,6 +754,9 @@ export namespace Production
return;
let depth = position.distanceTo(endPt);
if (equaln(depth, 0))
return;
InvertPosition(position, br.Thickness);
InvertPosition(endPt, br.Thickness);

Loading…
Cancel
Save