diff --git a/package.json b/package.json index 57e38c0..17730fd 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "author": "cx", "license": "ISC", "devDependencies": { + "@types/three": "^0.92.25", "@types/hard-source-webpack-plugin": "^0.9.0", "@types/node": "^10.11.7", "@types/uglifyjs-webpack-plugin": "^1.1.0", @@ -39,7 +40,6 @@ }, "dependencies": { "three": "^0.95.0", - "@types/three": "^0.92.25", "wolfy87-eventemitter": "^5.2.5" } } diff --git a/src/PlaneExt.ts b/src/PlaneExt.ts index c47fe69..5a6ecff 100644 --- a/src/PlaneExt.ts +++ b/src/PlaneExt.ts @@ -1,9 +1,9 @@ import * as THREE from 'three'; -import { Vector3, Line3 } from "three"; +import { Vector3, Line3, Plane } from "three"; -export class PlaneExt extends THREE.Plane +export class PlaneExt extends Plane { - constructor(normal?: THREE.Vector3, constant?: number) + constructor(normal?: Vector3, constant?: number) { super(normal, constant); } diff --git a/src/Text.ts b/src/Text.ts index 5c6ca84..a37f69c 100644 --- a/src/Text.ts +++ b/src/Text.ts @@ -1,4 +1,4 @@ -import { Font, FontLoader, Mesh, ShapeGeometry, Vector3 } from "three"; +import { Font, FontLoader, Mesh, ShapeGeometry, Vector3, Shape } from "three"; import { ColorMaterial } from "./ColorPalette"; import { MoveMatrix } from "./GeUtils"; @@ -30,7 +30,7 @@ export class DbText extends Mesh { let font = FontLoaderUtil.Load(); - let shapes: THREE.Shape[] = font.generateShapes(str, height, 0.1); + let shapes: Shape[] = font.generateShapes(str, height, 0.1); let geometry = new ShapeGeometry(shapes); geometry.computeBoundingBox(); diff --git a/src/Utils.ts b/src/Utils.ts index 16cbfc8..d4ea5c9 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1,4 +1,4 @@ -import { Object3D } from "three"; +import { Object3D, Mesh } from "three"; import { createTemplateBoard, DrawDimension, Viewer, selectMaterial } from "."; function dispose(m: Object3D) @@ -12,7 +12,7 @@ function dispose(m: Object3D) } -let blockMeshs: THREE.Mesh[]; +let blockMeshs: Mesh[]; let dataRelations: { blockMeshMap: Map, meshBlockMap: Map