|
|
@ -11,7 +11,6 @@ import { Entity } from './Entity';
|
|
|
|
import { Line } from './Line';
|
|
|
|
import { Line } from './Line';
|
|
|
|
import { DbPhysicalMaterial } from './PhysicalMaterial';
|
|
|
|
import { DbPhysicalMaterial } from './PhysicalMaterial';
|
|
|
|
import { Shape } from './Shape';
|
|
|
|
import { Shape } from './Shape';
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export enum BoardType
|
|
|
|
export enum BoardType
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -173,9 +172,13 @@ export class Board extends Entity
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return this.m_Name;
|
|
|
|
return this.m_Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Explode()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return this.m_Shape.Explode().map(cu => cu.ApplyMatrix(this.OCS));
|
|
|
|
|
|
|
|
}
|
|
|
|
GetSnapPoints(): Array<THREE.Vector3>
|
|
|
|
GetSnapPoints(): Array<THREE.Vector3>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let pts = this.m_Shape.GetSnapPoints();
|
|
|
|
let pts = this.m_Shape.Outline.Curve.GetSnapPoints();
|
|
|
|
pts = pts.concat(pts.map(p =>
|
|
|
|
pts = pts.concat(pts.map(p =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let vec = this.Normal.applyMatrix4(new Matrix4().extractRotation(this.OCSInv)).multiplyScalar(-this.m_Thickness);
|
|
|
|
let vec = this.Normal.applyMatrix4(new Matrix4().extractRotation(this.OCSInv)).multiplyScalar(-this.m_Thickness);
|
|
|
@ -197,26 +200,26 @@ export class Board extends Entity
|
|
|
|
return i;
|
|
|
|
return i;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let cur = this.m_Shape.Outline.Curve;
|
|
|
|
|
|
|
|
|
|
|
|
let vl = vec.clone();
|
|
|
|
let vl = vec.clone();
|
|
|
|
|
|
|
|
|
|
|
|
vl.applyMatrix4(new Matrix4().extractRotation(this.OCSInv));
|
|
|
|
vl.applyMatrix4(new Matrix4().extractRotation(this.OCSInv));
|
|
|
|
|
|
|
|
|
|
|
|
let refAxis = new Vector3(1);
|
|
|
|
let refAxis = new Vector3(1);
|
|
|
|
let derv = this.m_Shape.Outline.Curve.GetFistDeriv(pts[indexList[0]]);
|
|
|
|
let derv = cur.GetFistDeriv(pts[indexList[0]]);
|
|
|
|
|
|
|
|
|
|
|
|
if (vl.angleTo(refAxis) < Math.PI / 4 || vl.angleTo(refAxis) > Math.PI * 3 / 4)
|
|
|
|
if (vl.angleTo(refAxis) < Math.PI / 4 || vl.angleTo(refAxis) > Math.PI * 3 / 4)
|
|
|
|
vl.setY(0);
|
|
|
|
vl.setY(0);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
vl.setX(0);
|
|
|
|
vl.setX(0);
|
|
|
|
|
|
|
|
|
|
|
|
if (indexList[0] & 1)
|
|
|
|
if ((indexList[0] & 1) &&
|
|
|
|
|
|
|
|
!equaln(vl.angleTo(derv), Math.PI / 2))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!equaln(vl.angleTo(derv), Math.PI / 2))
|
|
|
|
return;
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.m_Shape.MoveSnapPoints([indexList[0]], vl);
|
|
|
|
cur.MoveSnapPoints(indexList.slice(0, indexList.length / 2), vl);
|
|
|
|
|
|
|
|
|
|
|
|
this.Update();
|
|
|
|
this.Update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|