!2926 优化:绘制缺口单板时,添加至空间模块最底层

pull/2924/MERGE
林三 2 months ago
parent aba165950e
commit 0fff614283

@ -1,6 +1,8 @@
import { app } from '../../ApplicationServices/Application';
import { Entity } from '../../DatabaseServices/Entity/Entity';
import { TemplateLayerBoard } from '../../DatabaseServices/Template/ProgramTempate/TemplateLayerBoard';
import { SetTemplatePositionAndSetParent } from '../../DatabaseServices/Template/TempateUtils';
import { JigUtils } from '../../Editor/JigUtils';
import { LayerBoardStore } from '../../UI/Store/BoardStore';
import { LayerBoardOption } from "../../UI/Store/OptionInterface/IOptionInterface";
import { BuildLayerBoards } from './BuildBoardTool';
@ -21,17 +23,25 @@ export class DrawLayerBoard extends DrawBoardTool
temp.UseBoardProcessOption = this.store.BoardProcessOption.useBoardProcessOption;
temp.BoardProcessOption = this.store.BoardProcessOption;
let effectBoards: Entity[];
if (this.store.m_Option.cuttingProtrudingPart)
{
temp.IntersectSpaceEntitys = this.IntersectSpaceEntitys;
effectBoards = Array.from(this.IntersectSpaceEntitys).map(objectId => objectId?.Object as Entity);
}
app.Database.TemplateTable.Append(temp);
await SetTemplatePositionAndSetParent(this.space, temp);
await SetTemplatePositionAndSetParent(this.space, temp, true, undefined, effectBoards);
}
else
{
//BuildLayerBoards()的时候cuttingProtrudingPart会被修改
let cuttingProtrudingPart = this.store.m_Option.cuttingProtrudingPart;
let brs = await BuildLayerBoards(this.store.m_Option as LayerBoardOption, this.space);
if (this.store.m_Option.cuttingProtrudingPart)
if (cuttingProtrudingPart)
CuttingProtrudingPart(this.IntersectSpaceEntitys, brs);
brs.forEach(br => JigUtils.Draw(br));
}
}
}

@ -1,7 +1,9 @@
import { app } from '../../ApplicationServices/Application';
import { BoardType } from '../../DatabaseServices/Entity/BoardInterface';
import { Entity } from '../../DatabaseServices/Entity/Entity';
import { TemplateVerticalBoard } from '../../DatabaseServices/Template/ProgramTempate/TemplateVerticalBoard';
import { SetTemplatePositionAndSetParent } from '../../DatabaseServices/Template/TempateUtils';
import { JigUtils } from '../../Editor/JigUtils';
import { VerticalBoardOption } from "../../UI/Store/OptionInterface/IOptionInterface";
import { BuildVerticalBoards } from './BuildBoardTool';
import { CuttingProtrudingPart } from './CuttingProtrudingPart';
@ -20,18 +22,25 @@ export class DrawVerticalBoard extends DrawBoardTool
temp.BoardProcessOption = this.store.BoardProcessOption;
temp.GrooveOption = this.store.grooveOption;
let effectBoards: Entity[];
if (this.store.m_Option.cuttingProtrudingPart)
{
temp.IntersectSpaceEntitys = this.IntersectSpaceEntitys;
effectBoards = Array.from(this.IntersectSpaceEntitys).map(objectId => objectId?.Object as Entity);
}
app.Database.TemplateTable.Append(temp);
await SetTemplatePositionAndSetParent(this.space, temp);
await SetTemplatePositionAndSetParent(this.space, temp, true, undefined, effectBoards);
}
else
{
//BuildVerticalBoards()的时候cuttingProtrudingPart会被修改
let cuttingProtrudingPart = this.store.m_Option.cuttingProtrudingPart;
let brs = await BuildVerticalBoards(this.store.m_Option as VerticalBoardOption, this.space);
if (this.store.m_Option.cuttingProtrudingPart)
if (cuttingProtrudingPart)
CuttingProtrudingPart(this.IntersectSpaceEntitys, brs);
brs.forEach(br => JigUtils.Draw(br));
}
}
}

@ -3,11 +3,11 @@ import { Box3, Matrix4, Vector3 } from "three";
import { app } from "../ApplicationServices/Application";
import { arrayLast } from "../Common/ArrayExt";
import { Draw } from "../Common/Draw";
import { inflateBase64 } from "../Common/inflate";
import { KeyWord } from "../Common/InputState";
import { JigMoveEntity } from "../Common/JigMove";
import { UpdateDraw } from "../Common/Status";
import { readClipboardText } from "../Common/Utils";
import { inflateBase64 } from "../Common/inflate";
import { CADFiler } from "../DatabaseServices/CADFiler";
import { Database } from "../DatabaseServices/Database";
import { Curve } from "../DatabaseServices/Entity/Curve";

@ -1591,7 +1591,17 @@ function IsEqualBH(parent: TemplateRecord, target: TemplateRecord): boolean
return bh2.value === bh1.value;//父节点已经计算出值
}
export async function SetTemplatePositionAndSetParent(spaceParse: ISpaceParse, template: TemplateRecord, isAddDeepNode = true, option?: IGetRoomInfo)
/**
*
*
* @export
* @param {ISpaceParse} spaceParse
* @param {TemplateRecord} template
* @param {boolean} [isAddDeepNode=true]
* @param {IGetRoomInfo} [option]
* @param {Entity[]} [effectBoards=[]]
*/
export async function SetTemplatePositionAndSetParent(spaceParse: ISpaceParse, template: TemplateRecord, isAddDeepNode = true, option?: IGetRoomInfo, effectBoards: Entity[] = [])
{
if (spaceParse instanceof ClampSpaceParse)
{
@ -1603,7 +1613,7 @@ export async function SetTemplatePositionAndSetParent(spaceParse: ISpaceParse, t
template.RYParam.expr = spaceParse.Rotation.y;
template.RZParam.expr = spaceParse.Rotation.z;
let reqTemplates: TemplateRecord[] = GetDeepestTemplate(spaceParse.Boards);
let reqTemplates: TemplateRecord[] = GetDeepestTemplate(effectBoards.concat(spaceParse.Boards));
if (reqTemplates.length && isAddDeepNode)
{
let templateSource = reqTemplates[0];

Loading…
Cancel
Save