!203 修复板件拉伸后空间分析错误问题

Merge pull request !203 from ZoeLeeFZ/fixbrbug
pull/203/MERGE
ChenX 6 years ago
parent 790ef71349
commit f8dd0302a8

@ -4,7 +4,7 @@ import { arrayRemoveIf } from '../Common/ArrayExt';
import { UpdateDraw } from '../Common/Status'; import { UpdateDraw } from '../Common/Status';
import { ObjectSnapMode } from '../Editor/ObjectSnapMode'; import { ObjectSnapMode } from '../Editor/ObjectSnapMode';
import { Box3Ext } from '../Geometry/Box'; import { Box3Ext } from '../Geometry/Box';
import { equaln, MoveMatrix, rotatePoint } from '../Geometry/GeUtils'; import { equaln, MoveMatrix, rotatePoint, equalv3 } from '../Geometry/GeUtils';
import ThreeBSP from '../Geometry/ThreeCSG'; import ThreeBSP from '../Geometry/ThreeCSG';
import { RenderType } from '../GraphicsSystem/RenderType'; import { RenderType } from '../GraphicsSystem/RenderType';
import { BoardProcessOption, ComposingType, DrillType, LinesType, PXLFaceType } from '../UI/Store/BoardInterface'; import { BoardProcessOption, ComposingType, DrillType, LinesType, PXLFaceType } from '../UI/Store/BoardInterface';
@ -542,7 +542,7 @@ export class Board extends Entity
} }
gripShape.MoveGripPoints(indexList, vl); gripShape.MoveGripPoints(indexList, vl);
this.UpdateModelShape(); this.UpdateBoardShape();
this.UpdateBoardSize(); this.UpdateBoardSize();
this.Update(UpdateDraw.Geometry); this.Update(UpdateDraw.Geometry);
} }
@ -636,7 +636,7 @@ export class Board extends Entity
outlen += count; outlen += count;
} }
this.UpdateModelShape(); this.UpdateBoardShape();
this.UpdateBoardSize(); this.UpdateBoardSize();
this.Update(UpdateDraw.Geometry); this.Update(UpdateDraw.Geometry);
} }
@ -649,7 +649,7 @@ export class Board extends Entity
/** /**
* , * ,
*/ */
private UpdateModelShape() private UpdateBoardShape()
{ {
let deleteModel: Set<IModeling> = new Set(); let deleteModel: Set<IModeling> = new Set();
@ -695,6 +695,22 @@ export class Board extends Entity
} }
arrayRemoveIf(this.m_BoardModeling, m => deleteModel.has(m)); arrayRemoveIf(this.m_BoardModeling, m => deleteModel.has(m));
//源形状min应在0点
let min = this.m_Shape.BoundingBox.min;
if (!equalv3(min, new Vector3()))
{
let matVec = MoveMatrix(min.clone().negate());
this.m_Shape.ApplyMatrix(matVec);
this.m_BoardModeling.forEach(m =>
{
m.shape.ApplyMatrix(matVec);
})
this.ApplyMatrix(
MoveMatrix(min.applyMatrix4(new Matrix4().extractRotation(this.OCS))));
}
} }
InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D
{ {

Loading…
Cancel
Save