!434 fix #IZQJT 优化排钻在造型里时的情况

pull/434/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 8460b66973
commit 8e924f0baa

@ -16,6 +16,8 @@ import { equaln, MoveMatrix, ZAxis } from "../../Geometry/GeUtils";
import { FaceDirection } from "../../UI/Store/BoardInterface";
import { DrillingOption, SpacingType } from "../../UI/Store/drillInterface";
import { begin } from "xaop";
import { IsPointInPolyLine } from "../../DatabaseServices/PointInPolyline";
import { Polyline } from "../../DatabaseServices/Entity/Polyline";
export class DrawDrillingTool extends Singleton
@ -231,7 +233,9 @@ export class DrawDrillingTool extends Singleton
{
if (this.CheckModelingCollision(this.m_Face.m_InterBoard, this.drillEnts[0], dist))
continue;
//检测排钻是否在板件内
if (userConfig.openExactDrill && !this.CheckDrillInBoard(this.m_Face.m_InterBoard, this.drillEnts[0], dist))
continue;
if (this.drillEnts.length === 3)
{
if (this.CheckModelingCollision(this.m_Face.m_LocalBoard, this.drillEnts[2], dist))
@ -273,6 +277,12 @@ export class DrawDrillingTool extends Singleton
}
return false;
}
private CheckDrillInBoard(br: Board, en: GangDrill, dist: number)
{
let cu = br.ContourCurve;
let p = en.Position.setX(dist).applyMatrix4(this.m_Face.OCS).applyMatrix4(br.OCSInv);
return IsPointInPolyLine(cu as Polyline, p);
}
// 分析当前排钻
private ParseDrillList(drills: ObjectId[][])
{

@ -329,4 +329,5 @@ export enum StoreageKeys
PlatSession = "platSession",
UserName = "userName",
RenderType = "renderType",
ExactDrill = "openExactDrill",
}

@ -16,6 +16,8 @@ export class UserConfig
@observable private _drillConfigs: Map<string, DrillingOption[]> = new Map();
@observable openDrillingReactor = true;
@observable openAutoCuttingReactor = true;
/**打开将检测排钻是否在板件内*/
@observable openExactDrill = true;
winerackConfig: IWineRackOption;
constructor()
{
@ -26,6 +28,8 @@ export class UserConfig
let type = sessionStorage.getItem(StoreageKeys.RenderType);
if (type)
this._renderType = parseFloat(type);
this.openExactDrill = localStorage.getItem(StoreageKeys.ExactDrill) === "true";
}
set RenderType(t: RenderType)
{

@ -3,6 +3,7 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { app } from '../../../../ApplicationServices/Application';
import { UserConfig } from '../../../../Editor/UserConfig';
import { StoreageKeys } from '../../../../Common/KeyEnum';
interface IConfigProps
{
@ -35,6 +36,15 @@ export class DrawConfigPanel extends React.Component<IConfigProps, {}> {
checked={userConfig.openDrillingReactor}
onChange={this.toggleDrillingReactor}
/>
<Checkbox
label="精确排钻"
checked={userConfig.openExactDrill}
onChange={() =>
{
userConfig.openExactDrill = !userConfig.openExactDrill;
localStorage.setItem(StoreageKeys.ExactDrill, String(userConfig.openExactDrill))
}}
/>
<H5></H5>
<Checkbox
label="自动切割"

Loading…
Cancel
Save