|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import * as THREE from 'three';
|
|
|
|
|
import { ExtrudeGeometry, Matrix4, Mesh, MeshNormalMaterial, Object3D, Vector3 } from 'three';
|
|
|
|
|
import { ExtrudeGeometry, Matrix4, Mesh, MeshNormalMaterial, Object3D, Vector2, Vector3 } from 'three';
|
|
|
|
|
import { Box3Ext } from '../Geometry/Box';
|
|
|
|
|
import { rotatePoint, equaln } from '../Geometry/GeUtils';
|
|
|
|
|
import { equaln, rotatePoint } from '../Geometry/GeUtils';
|
|
|
|
|
import { RenderType } from '../GraphicsSystem/Enum';
|
|
|
|
|
import { BoardProcessOption } from '../UI/Store/BoardInterface';
|
|
|
|
|
import { Factory } from './CADFactory';
|
|
|
|
@ -9,9 +9,9 @@ import { CADFile } from './CADFile';
|
|
|
|
|
import { Circle } from './Circle';
|
|
|
|
|
import { Contour } from './Contour';
|
|
|
|
|
import { Entity } from './Entity';
|
|
|
|
|
import { Line } from './Line';
|
|
|
|
|
import { ObjectId } from './ObjectId';
|
|
|
|
|
import { DbPhysicalMaterial } from './PhysicalMaterial';
|
|
|
|
|
import { Polyline } from './Polyline';
|
|
|
|
|
import { Shape } from './Shape';
|
|
|
|
|
|
|
|
|
|
export enum BoardType
|
|
|
|
@ -76,19 +76,14 @@ export class Board extends Entity
|
|
|
|
|
this.m_Width = width;
|
|
|
|
|
this.m_Thickness = thickness;
|
|
|
|
|
|
|
|
|
|
let p1 = new Vector3();
|
|
|
|
|
let p2 = new Vector3(width, 0);
|
|
|
|
|
let p3 = new Vector3(width, length);
|
|
|
|
|
let p4 = new Vector3(0, length);
|
|
|
|
|
|
|
|
|
|
let l1 = new Line(p1, p2);
|
|
|
|
|
let l2 = new Line(p2, p3);
|
|
|
|
|
let l3 = new Line(p3, p4);
|
|
|
|
|
let l4 = new Line(p4, p1);
|
|
|
|
|
|
|
|
|
|
this.m_Shape = new Shape(
|
|
|
|
|
Contour.CreateContour([l1, l2, l3, l4])
|
|
|
|
|
)
|
|
|
|
|
let pl = new Polyline([
|
|
|
|
|
{ pt: new Vector2(), bul: 0 },
|
|
|
|
|
{ pt: new Vector2(width, 0), bul: 0 },
|
|
|
|
|
{ pt: new Vector2(width, length), bul: 0 },
|
|
|
|
|
{ pt: new Vector2(0, length), bul: 0 },
|
|
|
|
|
]);
|
|
|
|
|
pl.CloseMark = true;
|
|
|
|
|
this.m_Shape = new Shape(Contour.CreateContour([pl]));
|
|
|
|
|
}
|
|
|
|
|
static CreateBoard(length: number, width: number, thickness: number, boardType: BoardType = BoardType.Layer)
|
|
|
|
|
{
|
|
|
|
|