fix #IKO5S 修正布尔运算丢失面域移动的记录,导致撤销错误的问题.

pull/72/head
ChenX 6 years ago
parent 9c6a68b806
commit 9c3182a394

@ -65,7 +65,7 @@ export class Test implements Command
r2 = r2.Clone() as Region;
r2.ShapeManager.SetMatrix4(matrixAlignCoordSys(r2.OCS, r1.OCS));
r2.ShapeManager.ApplyMatrix(matrixAlignCoordSys(r2.OCS, r1.OCS));
r1.ShapeManager.ShapeList.forEach(s => s.Explode().forEach(c => app.m_Database.ModelSpace.Append(c)));
r2.ShapeManager.ShapeList.forEach(s => s.Explode().forEach(c => app.m_Database.ModelSpace.Append(c)));

@ -1,5 +1,5 @@
import * as THREE from 'three';
import { Box3, Group, Object3D, ShapeBufferGeometry } from 'three';
import { Box3, Group, Object3D, ShapeBufferGeometry, Matrix4 } from 'three';
import { ColorMaterial } from '../Common/ColorPalette';
import { equaln, isParallelTo } from '../Geometry/GeUtils';
import { BoolOpeartionType } from '../GraphicsSystem/BoolOperateUtils';
@ -60,6 +60,18 @@ export class Region extends Entity
}
}
/**
* ,.
* .
* @param {Matrix4} m
* @memberof Region
*/
ShaepeApplyMatrix(m: Matrix4)
{
this.WriteAllObjectRecord();
this.m_ShapeManager.ApplyMatrix(m);
}
/**
* :otherRegion
*
@ -72,7 +84,7 @@ export class Region extends Entity
if (this.IsCoplaneTo(otherRegion))
{
this.WriteAllObjectRecord();
otherRegion.m_ShapeManager.SetMatrix4(matrixAlignCoordSys(otherRegion.OCS, this.OCS));
otherRegion.ShaepeApplyMatrix(matrixAlignCoordSys(otherRegion.OCS, this.OCS));
this.m_ShapeManager.BoolOper(otherRegion.m_ShapeManager, boolType);
this.Update();
}

@ -102,8 +102,15 @@ export class ShapeManager
}
}
//设置当前所有轮廓的矩阵,不应用,直接设置.
SetMatrix4(mat4: Matrix4)
/**
* region.ApplyMatrix,.
* .
*
*
* @param {Matrix4} mat4
* @memberof ShapeManager
*/
ApplyMatrix(mat4: Matrix4)
{
for (let s of this.m_ShapeList)
{

Loading…
Cancel
Save