!56 更新依赖的npm包版本

Merge pull request !56 from ChenX/update_npm
pull/712061/MERGE
ChenX 7 years ago
parent b264576acc
commit e9fffdc9f5

@ -16,7 +16,6 @@ const vendors = [
"react-dom", "react-dom",
"stats.js", "stats.js",
"three", "three",
"verb-nurbs-web",
"xaop" "xaop"
]; ];
@ -39,4 +38,4 @@ module.exports = {
context: __dirname, context: __dirname,
}) })
], ],
}; };

File diff suppressed because one or more lines are too long

4103
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -18,63 +18,62 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@types/blueimp-md5": "^2.7.0",
"@types/dat-gui": "^0.6.3", "@types/dat-gui": "^0.6.3",
"@types/jest": "^22.1.1", "@types/jest": "^22.2.2",
"@types/jquery": "^3.3.0", "@types/jquery": "^3.3.1",
"@types/lodash": "^4.14.98", "@types/lodash": "^4.14.106",
"@types/node": "^9.4.0", "@types/node": "^9.6.2",
"@types/react": "^16.0.35", "@types/react": "^16.3.5",
"@types/react-dom": "^16.0.3", "@types/react-dom": "^16.0.4",
"@types/stats.js": "^0.17.0", "@types/stats.js": "^0.17.0",
"@types/three": "^0.89.10", "@types/three": "^0.91.3",
"@types/webpack": "^4.1.3", "@types/webpack": "^4.1.3",
"@types/webpack-env": "^1.13.4", "@types/webpack-env": "^1.13.4",
"add-asset-html-webpack-plugin": "^2.1.2", "add-asset-html-webpack-plugin": "^2.1.3",
"awesome-typescript-loader": "^3.4.1", "awesome-typescript-loader": "^3.4.1",
"css-loader": "^0.28.9", "css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6", "file-loader": "^1.1.11",
"html-loader": "^0.5.5", "html-loader": "^0.5.5",
"html-webpack-plugin": "^2.30.1", "html-webpack-plugin": "^3.2.0",
"jest": "^22.1.4", "jest": "^22.4.3",
"less": "^2.7.3", "less": "^3.0.1",
"less-loader": "^4.0.5", "less-loader": "^4.1.0",
"mobx-react-devtools": "^4.2.15", "mobx-react-devtools": "^5.0.1",
"open-browser-webpack-plugin": "0.0.5", "open-browser-webpack-plugin": "0.0.5",
"required-loader": "^1.3.16", "required-loader": "^1.3.16",
"shader-loader": "^1.3.1", "shader-loader": "^1.3.1",
"source-map-loader": "^0.2.3", "source-map-loader": "^0.2.3",
"style-loader": "^0.20.1", "style-loader": "^0.20.3",
"ts-jest": "^22.0.2", "ts-jest": "^22.4.2",
"ts-node": "^5.0.1", "ts-node": "^5.0.1",
"typed-css-modules": "^0.3.1", "typed-css-modules": "^0.3.1",
"typescript": "^2.7.1", "typescript": "^2.8.1",
"typings": "^2.1.1", "typings": "^2.1.1",
"typings-for-css-modules-loader": "^1.7.0", "typings-for-css-modules-loader": "^1.7.0",
"url-loader": "^0.6.2", "url-loader": "^1.0.1",
"wallaby-webpack": "^3.9.3", "wallaby-webpack": "^3.9.5",
"webpack": "^3.10.0", "webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1" "webpack-dev-server": "^2.11.1"
}, },
"dependencies": { "dependencies": {
"@blueprintjs/core": "^1.35.2", "@blueprintjs/core": "^1.35.2",
"@types/blueimp-md5": "^2.7.0",
"blueimp-md5": "^2.10.0", "blueimp-md5": "^2.10.0",
"css-element-queries": "^1.0.1", "css-element-queries": "^1.0.2",
"dat.gui": "^0.7.0", "dat.gui": "^0.7.1",
"expr-eval": "^1.2.1", "expr-eval": "^1.2.1",
"golden-layout": "^1.5.9", "golden-layout": "^1.5.9",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"lodash": "^4.17.5", "lodash": "^4.17.5",
"mobx": "^3.4.1", "mobx": "^4.1.1",
"mobx-react": "^4.4.0", "mobx-react": "^5.0.0",
"react": "^16.2.0", "react": "^16.3.1",
"react-addons-css-transition-group": "^15.6.2", "react-addons-css-transition-group": "^15.6.2",
"react-color": "^2.13.8", "react-color": "^2.14.0",
"react-dom": "^16.2.0", "react-dom": "^16.3.1",
"stats.js": "^0.17.0", "stats.js": "^0.17.0",
"three": "^0.89.0", "three": "^0.91.0",
"verb-nurbs-web": "^2.1.3",
"xaop": "^1.3.2" "xaop": "^1.3.2"
}, },
"jest": { "jest": {

@ -32,8 +32,8 @@ export class Command_Array implements Command
if (keyWord.StringResult == "矩形(R)") if (keyWord.StringResult == "矩形(R)")
{ {
//获取点组 //获取点组
let center = unionBoxs.getCenter(); let center = unionBoxs.getCenter(new Vector3());
let boxSize = unionBoxs.getSize(); let boxSize = unionBoxs.getSize(new Vector3());
let basePts = recArrayPts(center, boxSize) let basePts = recArrayPts(center, boxSize)
basePts.map(function (val) basePts.map(function (val)
{ {

@ -1,3 +1,4 @@
import { Vector2 } from 'three';
import { app } from '../ApplicationServices/Application'; import { app } from '../ApplicationServices/Application';
import { Vec3DTo2D } from '../Common/CurveUtils'; import { Vec3DTo2D } from '../Common/CurveUtils';
import { Arc } from '../DatabaseServices/Arc'; import { Arc } from '../DatabaseServices/Arc';
@ -72,8 +73,8 @@ export class Command_Extend implements Command
} }
else if (s instanceof SelectBox) else if (s instanceof SelectBox)
{ {
startPtDist = s.Box.getCenter().distanceTo(Vec3DTo2D(sp)); startPtDist = s.Box.getCenter(new Vector2()).distanceTo(Vec3DTo2D(sp));
endPtDist = s.Box.getCenter().distanceTo(Vec3DTo2D(ep)); endPtDist = s.Box.getCenter(new Vector2()).distanceTo(Vec3DTo2D(ep));
} }
if (startPtDist < endPtDist) if (startPtDist < endPtDist)
{ {

@ -23,7 +23,7 @@ export class Command_PtInCu implements Command
if (p2Res.Status != PromptStatus.OK) return; if (p2Res.Status != PromptStatus.OK) return;
let box = new Box3().setFromPoints([p1Res.Value, p2Res.Value]); let box = new Box3().setFromPoints([p1Res.Value, p2Res.Value]);
let size = box.getSize(); let size = box.getSize(new Vector3());
for (let i = 0; i < size.x; i++) for (let i = 0; i < size.x; i++)
{ {
for (let j = 0; j < size.y; j++) for (let j = 0; j < size.y; j++)

@ -59,7 +59,7 @@ export function registerCommand()
commandMachine.RegisterCommand("u", new Undo()) commandMachine.RegisterCommand("u", new Undo())
commandMachine.RegisterCommand("redo", new Redo()) commandMachine.RegisterCommand("redo", new Redo())
commandMachine.RegisterCommand("ze", new ZoomE()) commandMachine.RegisterCommand("ze", new ZoomE())
commandMachine.RegisterCommand("rec", new DrawRect()) commandMachine.RegisterCommand("RECTANG", new DrawRect())
commandMachine.RegisterCommand("c", new DrawCircle()) commandMachine.RegisterCommand("c", new DrawCircle())
commandMachine.RegisterCommand("el", new DrawEllipse()) commandMachine.RegisterCommand("el", new DrawEllipse())
commandMachine.RegisterCommand("spl", new DrawSpline()) commandMachine.RegisterCommand("spl", new DrawSpline())
@ -101,7 +101,7 @@ export function registerCommand()
commandMachine.RegisterCommand("open", new Open()); commandMachine.RegisterCommand("open", new Open());
commandMachine.RegisterCommand("a", new DrawArc()); commandMachine.RegisterCommand("arc", new DrawArc());
commandMachine.RegisterCommand("ent", new Entsel()); commandMachine.RegisterCommand("ent", new Entsel());

@ -148,7 +148,7 @@ export class GetPointServices implements EditorService
preView.ScreenPointToViewerPoint(startP); preView.ScreenPointToViewerPoint(startP);
geo.vertices[0] = startP; geo.vertices[0] = startP;
geo.vertices[1] = endP; geo.vertices[1] = endP;
geo.computeLineDistances(); line.computeLineDistances();
geo.lineDistancesNeedUpdate = true; geo.lineDistancesNeedUpdate = true;
geo.verticesNeedUpdate = true; geo.verticesNeedUpdate = true;
preView.UpdateScreen(); preView.UpdateScreen();

@ -1,13 +1,15 @@
import * as THREE from 'three'; import * as THREE from 'three';
import { Object3D } from 'three'; import { Object3D, Vector2, Vector3 } from 'three';
import * as verb from 'verb-nurbs-web'; import { Vec2DTo3D } from '../Common/CurveUtils';
import { Entity } from '../DatabaseServices/Entity'; import { Entity } from '../DatabaseServices/Entity';
import { Line } from '../DatabaseServices/Line';
import { GripScene } from '../GraphicsSystem/GripScene'; import { GripScene } from '../GraphicsSystem/GripScene';
import { IntersectOption } from '../GraphicsSystem/IntersectWith';
import { PreViewer } from '../GraphicsSystem/PreViewer'; import { PreViewer } from '../GraphicsSystem/PreViewer';
import { Viewer } from '../GraphicsSystem/Viewer'; import { Viewer } from '../GraphicsSystem/Viewer';
import { SelectSetBase, SelectType } from './SelectSet'; import { SelectSetBase, SelectType } from './SelectSet';
/** /**
* *
* ,. * ,.
@ -20,7 +22,7 @@ export class SelectBox extends SelectSetBase
{ {
private m_SelectBox: THREE.Box2 = new THREE.Box2(); private m_SelectBox: THREE.Box2 = new THREE.Box2();
private m_RectLines = new Array<verb.core.PolylineData>(); private m_RectLines: Line[] = [];
private m_Frustom: THREE.Frustum = new THREE.Frustum(); private m_Frustom: THREE.Frustum = new THREE.Frustum();
private m_bIsPerCamera; private m_bIsPerCamera;
@ -33,24 +35,22 @@ export class SelectBox extends SelectSetBase
this.m_SelectBox.setFromPoints([p1, p2]); this.m_SelectBox.setFromPoints([p1, p2]);
let px1 = this.m_SelectBox.min.toArray(); let px1 = Vec2DTo3D(this.m_SelectBox.min);
let px3 = this.m_SelectBox.max.toArray(); let px3 = Vec2DTo3D(this.m_SelectBox.max);
px1.push(0); let px2 = new Vector3(this.m_SelectBox.max.x, this.m_SelectBox.min.y, 0);
px3.push(0); let px4 = new Vector3(this.m_SelectBox.min.x, this.m_SelectBox.max.y, 0);
let px2 = [this.m_SelectBox.max.x, this.m_SelectBox.min.y, 0];
let px4 = [this.m_SelectBox.min.x, this.m_SelectBox.max.y, 0];
this.m_RectLines.push(new verb.core.PolylineData([px1, px2], [0, 1])); this.m_RectLines.push(new Line(px1, px2));
this.m_RectLines.push(new verb.core.PolylineData([px2, px3], [0, 1])); this.m_RectLines.push(new Line(px2, px3));
this.m_RectLines.push(new verb.core.PolylineData([px3, px4], [0, 1])); this.m_RectLines.push(new Line(px3, px4));
this.m_RectLines.push(new verb.core.PolylineData([px4, px1], [0, 1])); this.m_RectLines.push(new Line(px4, px1));
//init frustom. //init frustom.
let camera = this.m_Viewer.Camera; let camera = this.m_Viewer.Camera;
if (camera instanceof THREE.OrthographicCamera || camera instanceof THREE.PerspectiveCamera) if (camera instanceof THREE.OrthographicCamera || camera instanceof THREE.PerspectiveCamera)
{ {
let size = this.m_SelectBox.getSize(); let size = this.m_SelectBox.getSize(new Vector2());
camera.setViewOffset(view.Width, view.Height, this.m_SelectBox.min.x, this.m_SelectBox.min.y, size.x, size.y); camera.setViewOffset(view.Width, view.Height, this.m_SelectBox.min.x, this.m_SelectBox.min.y, size.x, size.y);
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
@ -139,7 +139,7 @@ export class SelectBox extends SelectSetBase
{ {
let p1 = screenPts[index1]; let p1 = screenPts[index1];
let p2 = screenPts[index2]; let p2 = screenPts[index2];
let line = new verb.core.PolylineData([[p1.x, p1.y, 0], [p2.x, p2.y, 0]], [0, 1]); let line = new Line(p1.clone(), p2.clone());
//如果是透视相机,则需要 裁剪算法. 保证线在视图内部 //如果是透视相机,则需要 裁剪算法. 保证线在视图内部
if (this.m_bIsPerCamera) if (this.m_bIsPerCamera)
@ -155,19 +155,19 @@ export class SelectBox extends SelectSetBase
return false; return false;
else if (!px1InFrusum || !px2InFrusum) else if (!px1InFrusum || !px2InFrusum)
{ {
let intersecPt = nearPlan.intersectLine(new THREE.Line3(px1, px2)); let intersecPt = nearPlan.intersectLine(new THREE.Line3(px1, px2), new Vector3());
this.WorldToScreenPoint(intersecPt); this.WorldToScreenPoint(intersecPt);
if (!px1InFrusum) if (!px1InFrusum)
line.points[0] = [intersecPt.x, intersecPt.y, 0]; line.StartPoint = intersecPt;
else else
line.points[1] = [intersecPt.x, intersecPt.y, 0]; line.EndPoint = intersecPt;
} }
} }
for (let l of this.m_RectLines) for (let l of this.m_RectLines)
{ {
let ins = verb.eval.Intersect.polylines(l, line, 1e-8) let ins = l.IntersectWith(line, IntersectOption.OnBothOperands);
if (ins.length > 0) if (ins.length > 0)
return true; return true;
} }
@ -186,6 +186,7 @@ export class SelectBox extends SelectSetBase
this.WorldToScreenPoint(p); this.WorldToScreenPoint(p);
if (this.ContainerScreenPoint(p)) if (this.ContainerScreenPoint(p))
return true; return true;
p.z = 0;
screenPts.push(p); screenPts.push(p);
} }

@ -1,5 +1,5 @@
import { Vector3 } from 'three';
import { end } from 'xaop'; import { end } from 'xaop';
import { app } from '../ApplicationServices/Application'; import { app } from '../ApplicationServices/Application';
import { InputState } from '../Common/InputState'; import { InputState } from '../Common/InputState';
import { KeyBoard, MouseKey } from '../Common/KeyEnum'; import { KeyBoard, MouseKey } from '../Common/KeyEnum';
@ -13,6 +13,7 @@ import { SelectPick } from './SelectPick';
import { SelectSet, SelectType } from './SelectSet'; import { SelectSet, SelectType } from './SelectSet';
import { TransMode } from './TranstrolControl/TransformServices'; import { TransMode } from './TranstrolControl/TransformServices';
export class SelectControls implements EditorService export class SelectControls implements EditorService
{ {
get IsReady() get IsReady()
@ -57,7 +58,7 @@ export class SelectControls implements EditorService
let mat = obj.matrixWorld; let mat = obj.matrixWorld;
let box = GetBox(obj); let box = GetBox(obj);
if (!box) return; if (!box) return;
mat.setPosition(box.getCenter()); mat.setPosition(box.getCenter(new Vector3()));
this.m_Editor.transCtrl.m_Ents = this.SelectSet.SelectEntityList; this.m_Editor.transCtrl.m_Ents = this.SelectSet.SelectEntityList;
this.m_Editor.transCtrl.Matrix = mat; this.m_Editor.transCtrl.Matrix = mat;

@ -5,8 +5,6 @@ import { CoordinateSystem } from '../CoordinateSystem';
//http://www.cnblogs.com/iamzhanglei/archive/2012/06/07/2539751.html //http://www.cnblogs.com/iamzhanglei/archive/2012/06/07/2539751.html
//https://github.com/Mugen87/yume/blob/master/src/javascript/engine/etc/OBB.js //https://github.com/Mugen87/yume/blob/master/src/javascript/engine/etc/OBB.js
export class OBB export class OBB
{ {
m_CoordinateSystem: CoordinateSystem; m_CoordinateSystem: CoordinateSystem;

@ -1,5 +1,5 @@
import * as THREE from 'three'; import * as THREE from 'three';
import { Vector3 } from 'three';
import { Orbit } from '../Geometry/Orbit'; import { Orbit } from '../Geometry/Orbit';
/** /**
@ -140,7 +140,7 @@ export class CameraControl
//世界坐标系 //世界坐标系
this.m_Target.applyMatrix4(this.Camera.matrix); this.m_Target.applyMatrix4(this.Camera.matrix);
//size //size
let size = box3.getSize(); let size = box3.getSize(new Vector3());
//宽高比 //宽高比
let aspectRatio = size.x / size.y; let aspectRatio = size.x / size.y;

@ -182,8 +182,7 @@ export class PreViewer
material = material || this.m_LineMaterial; material = material || this.m_LineMaterial;
let geometry = new THREE.Geometry(); let geometry = new THREE.Geometry();
geometry.vertices.push(p1, p2); geometry.vertices.push(p1, p2);
geometry.computeLineDistances(); return new THREE.Line(geometry, material).computeLineDistances();
return new THREE.Line(geometry, material);
} }
//绘制十字光标 //绘制十字光标

@ -11,6 +11,7 @@ import { CameraControl } from './CameraControl';
import { RenderType } from './Enum'; import { RenderType } from './Enum';
import { GripScene } from './GripScene'; import { GripScene } from './GripScene';
import { PreViewer } from './PreViewer'; import { PreViewer } from './PreViewer';
import { Vector3 } from 'three';
//导入其他js模块 //导入其他js模块
require("three-CopyShader"); require("three-CopyShader");
@ -207,7 +208,7 @@ export class Viewer
let renderList = this.m_Render.renderLists.get(this.m_Scene, this.m_CameraCtrl.Camera); let renderList = this.m_Render.renderLists.get(this.m_Scene, this.m_CameraCtrl.Camera);
let box = GetBoxArr(renderList.opaque.map(o => o.object)); let box = GetBoxArr(renderList.opaque.map(o => o.object));
if (box) if (box)
this.m_LookTarget = box.getCenter(); this.m_LookTarget = box.getCenter(new Vector3());
else else
this.m_LookTarget = cZeroVec; this.m_LookTarget = cZeroVec;
} }

@ -179,7 +179,7 @@ export class WebCAD
height: 100% height: 100%
`; `;
document.getElementById("Webgl").appendChild(toolbarEl); document.getElementById("Webgl").appendChild(toolbarEl);
let drawCmdList = ['L', 'PL', 'RECT', 'A', 'C', 'EL', 'REG', 'TEXT']; let drawCmdList = ['L', 'PL', 'RECTANG', 'ARC', 'C', 'EL', 'REG', 'TEXT'];
let drawIconIndexList = [0, 2, 4, 5, 6, 9, 16, 18]; let drawIconIndexList = [0, 2, 4, 5, 6, 9, 16, 18];
let modifyCmdList = ['E', 'COPY', 'O', 'ARRAY', 'M', 'RO', 'S', 'TR', 'EX', 'F', 'X']; let modifyCmdList = ['E', 'COPY', 'O', 'ARRAY', 'M', 'RO', 'S', 'TR', 'EX', 'F', 'X'];
let modifyIconIndexList = [0, 1, 3, 4, 5, 6, 8, 9, 10, 14, 16]; let modifyIconIndexList = [0, 1, 3, 4, 5, 6, 8, 9, 10, 14, 16];

@ -70,7 +70,7 @@ let downFiles =
urlPath: "https://raw.githubusercontent.com/FishOrBear/DefinitelyTyped/master/types/three/", urlPath: "https://raw.githubusercontent.com/FishOrBear/DefinitelyTyped/master/types/three/",
files: [ files: [
// "index.d.ts", // "index.d.ts",
// "three-core.d.ts", "three-core.d.ts",
// "three-outlinepass.d.ts", // "three-outlinepass.d.ts",
// "three-smaapass.d.ts" // "three-smaapass.d.ts"
] ]

Loading…
Cancel
Save