fix #ILS5N 板类型都不成对时进行正确得空间分析

pull/113/head
Zoe 6 years ago
parent 57d9a748fb
commit 674b009f9e

@ -36,11 +36,10 @@ export class DrawClosingStrip implements Command
let spaceParse = new SpaceParse(boardCus);
spaceParse.ParseTotalSpace();
let rot = new Matrix4().extractRotation(spaceParse.SpaceOCS);
let totalSpace = spaceParse.TotalSpace;
while (true)
{
this.buildClosingStrip(totalSpace, rot);
this.buildClosingStrip(totalSpace, spaceParse.SpaceOCS);
state = await app.m_Editor.m_ModalManage.Wait();
if (state !== ModalState.Ok)
{

@ -40,9 +40,20 @@ export class GeneralSpaceParse extends SpaceParse
spliteBoxes.push(box);
}
}
let spaces = this.MergeSpaces(unionBoxes) as Box3Ext;
spaces && this.SpliteBoxs(spaces, spliteBoxes);
if (unionBoxes.length > 0)
{
let spaces = this.MergeSpaces(unionBoxes) as Box3Ext;
spaces && this.SpliteBoxs(spaces, spliteBoxes);
}
else if (spliteBoxes.length > 0)
{
//获得总空间后用除第一个空间以外得空间进行切割
let box = new Box3Ext()
spliteBoxes.reduce((b1, b2) => <Box3Ext>b1.union(<Box3Ext>b2), box);
this.SpliteBoxs(box, spliteBoxes.slice(1));
}
}
/**

@ -6,9 +6,6 @@ import { Box3Ext } from "../Box";
/**
*
*
* 1
* ,2,
* //TODO:暂不考虑名称,排钻,封边.....
* @export
* @class SpaceParse
@ -78,9 +75,7 @@ export class SpaceParse
{
this.m_Boards.forEach(br =>
{
let b = br.Clone() as Board;
b.ApplyMatrix(new Matrix4().extractRotation(b.BoardOCSInv))
let box = b.BoundingBox;
let box = br.GetBoardBoxInMat(this.SpaceOCSInv);
this.m_TotalSpace.union(box);
})
}

Loading…
Cancel
Save