|
|
@ -1,5 +1,5 @@
|
|
|
|
import * as THREE from 'three';
|
|
|
|
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 { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { equaln, isParallelTo } from '../Geometry/GeUtils';
|
|
|
|
import { equaln, isParallelTo } from '../Geometry/GeUtils';
|
|
|
|
import { BoolOpeartionType } from '../GraphicsSystem/BoolOperateUtils';
|
|
|
|
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的矩阵
|
|
|
|
* 请注意:该计算会操作otherRegion的矩阵
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -72,7 +84,7 @@ export class Region extends Entity
|
|
|
|
if (this.IsCoplaneTo(otherRegion))
|
|
|
|
if (this.IsCoplaneTo(otherRegion))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
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.m_ShapeManager.BoolOper(otherRegion.m_ShapeManager, boolType);
|
|
|
|
this.Update();
|
|
|
|
this.Update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|