|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import * as THREE from 'three';
|
|
|
|
|
import { Matrix4, Mesh, MeshNormalMaterial, Object3D, Vector3 } from "three";
|
|
|
|
|
import { Matrix4, Mesh, MeshNormalMaterial, Object3D, Vector3, LineSegments } from "three";
|
|
|
|
|
import { equalv3, isParallelTo, MoveMatrix } from '../../Geometry/GeUtils';
|
|
|
|
|
import { SweepGeometry } from '../../Geometry/SweepGeometry';
|
|
|
|
|
import { RenderType } from "../../GraphicsSystem/RenderType";
|
|
|
|
@ -10,6 +10,9 @@ import { PhysicalMaterialRecord } from '../PhysicalMaterialRecord';
|
|
|
|
|
import { IsPointInPolyLine } from '../PointInPolyline';
|
|
|
|
|
import { Polyline } from '../Polyline';
|
|
|
|
|
import { Solid3D } from "./Solid3D";
|
|
|
|
|
import { EdgesGeometry2 } from '../../Geometry/EdgeGeometry';
|
|
|
|
|
import { ColorMaterial } from '../../Common/ColorPalette';
|
|
|
|
|
import { DisposeThreeObj } from '../../Common/Dispose';
|
|
|
|
|
|
|
|
|
|
@Factory
|
|
|
|
|
export class SweepSolid extends Solid3D
|
|
|
|
@ -104,21 +107,31 @@ export class SweepSolid extends Solid3D
|
|
|
|
|
swpGeo.applyMatrix(this.m_Contour.OCS);
|
|
|
|
|
return new SweepGeometry(this.m_Contour, this.m_PathCurve);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InitDrawObject(renderType: RenderType): Object3D
|
|
|
|
|
private GetObject3DByRenderType(renderType: RenderType)
|
|
|
|
|
{
|
|
|
|
|
if (this.materialId && this.materialId.Object)
|
|
|
|
|
if (renderType === RenderType.Wireframe)
|
|
|
|
|
{
|
|
|
|
|
let material = this.materialId.Object as PhysicalMaterialRecord;
|
|
|
|
|
return new Mesh(this.CreateGeomtry(), material.Material);
|
|
|
|
|
let geo = new EdgesGeometry2(this.CreateGeomtry(), 2);
|
|
|
|
|
return new LineSegments(geo, ColorMaterial.GetLineMaterial(this.ColorIndex));
|
|
|
|
|
}
|
|
|
|
|
else return new THREE.Mesh(this.CreateGeomtry(), new MeshNormalMaterial());
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (this.materialId && this.materialId.Object)
|
|
|
|
|
{
|
|
|
|
|
let material = this.materialId.Object as PhysicalMaterialRecord;
|
|
|
|
|
return new Mesh(this.CreateGeomtry(), material.Material);
|
|
|
|
|
}
|
|
|
|
|
else return new THREE.Mesh(this.CreateGeomtry(), new MeshNormalMaterial());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
InitDrawObject(renderType: RenderType): Object3D
|
|
|
|
|
{
|
|
|
|
|
return new Object3D().add(this.GetObject3DByRenderType(renderType));
|
|
|
|
|
}
|
|
|
|
|
UpdateDrawObject(type: RenderType, en: Object3D)
|
|
|
|
|
{
|
|
|
|
|
let obj = en as THREE.Mesh;
|
|
|
|
|
obj.geometry.dispose();
|
|
|
|
|
obj.geometry = this.CreateGeomtry();
|
|
|
|
|
DisposeThreeObj(en);
|
|
|
|
|
en.add(this.GetObject3DByRenderType(type));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|