22 Commits
1.2.0 ... 1.5.0

Author SHA1 Message Date
xief
ab59fbe267 移除webpack,替换为vite,删除弃用文件 2023-08-07 14:42:26 +08:00
xief
f60054ca19 修改自定义编号判断 2023-07-31 17:57:16 +08:00
xief
a55986761e 修复autocad显示错误 2023-07-27 11:22:48 +08:00
xief
e5b944539e 修复双面编号问题 2023-07-18 09:19:03 +08:00
xief
27dd548309 替换问题数据源 2023-07-17 16:17:32 +08:00
xief
965ae43070 修复标注错误 2023-07-14 18:00:21 +08:00
xief
36541f1617 更新测试数据 2023-07-14 16:32:07 +08:00
xief
fba276362c 修复自定义编号不显示,添加双面显示 2023-07-14 10:41:41 +08:00
xief
66dbe5869e 修改自定义编号 2023-07-13 14:13:40 +08:00
xief
e70354267b 调整板初始化代码,新增自定义编号 2023-07-13 11:57:28 +08:00
xief
eb736bce84 更新配置 2022-03-04 10:27:23 +08:00
xief
40258eeaf4 Merge branch 'v2' into upgrade 2022-02-16 14:18:01 +08:00
xief
623fa9ac9a 使用新的webcad api进行建模 2022-02-16 13:48:57 +08:00
xief
c586096fe0 更新版本号 2021-04-08 14:56:48 +08:00
xief
0aa70fdb14 新增鼠标选择回调事件 2021-03-17 15:53:32 +08:00
xief
93ac737777 支持材质自定义 2021-03-03 15:07:59 +08:00
xiefan
01110a8858 Merge remote-tracking branch 'origin/master' into select-block 2020-10-20 14:16:22 +08:00
xiefan
77f997b849 更新three版本 2020-10-20 14:16:04 +08:00
xiefan
23fa547a3a 修复类型错误 2020-10-20 14:03:21 +08:00
FishOrBear
e712b7b4e2 同步代码 2020-05-07 10:51:27 +08:00
xiefan
d266b5ac2d Merge branch 'master' into select-block 2020-04-30 17:21:10 +08:00
FishOrBear
85db279fab 更新版本,修复镜像槽问题 2020-04-30 17:12:30 +08:00
33 changed files with 3680 additions and 3203 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
/node_modules
/package-lock.json
.history
/dist

31
.vscode/settings.json vendored
View File

@@ -3,8 +3,10 @@
"typescript.tsdk": "node_modules\\typescript\\lib",
//格式化设置
"editor.tabSize": 4,
"editor.formatOnPaste": true,
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
//格式设置
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
@@ -12,5 +14,30 @@
"javascript.format.placeOpenBraceOnNewLineForFunctions": true,
"javascript.format.enable": true,
"files.insertFinalNewline": true,
"editor.detectIndentation": true,
"typescript.format.semicolons": "insert",
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
//保存时
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
"gitlens.remotes": [
{
"domain": "gitee.com",
"type": "Custom",
"name": "码云",
"protocol": "https",
"urls": {
"repository": "https://gitee.com/cf-fz/${repoPath}",
"branches": "https://gitee.com/cf-fz/${repoPath}/branches",
"branch": "https://gitee.com/cf-fz/${repoPath}/commits/${branch}",
"commit": "https://gitee.com/cf-fz/${repoPath}/commit/${id}",
"file": "https://gitee.com/cf-fz/${repoPath}?path=${file}${line}",
"fileInBranch": "https://gitee.com/cf-fz/${repoPath}/blob/${branch}/${file}${line}",
"fileInCommit": "https://gitee.com/cf-fz/${repoPath}/blob/${id}/${file}${line}",
"fileLine": "#L${line}",
"fileRange": "#L${start}-L${end}"
}
}
],
}

View File

@@ -1,3 +1,6 @@
# 显示板件的控件
使用例子请参照项目:[CADViewSample](http://git.cf/cx/CADViewSample)
删除"@types/webpack-merge" 下的 node_modules/webpack 定义 坑爹导致项目跑不起来

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,37 +0,0 @@
import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
import * as webpack from 'webpack';
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const config: webpack.Configuration = {
devtool: "source-map",
//项目需要解析的文件拓展名称
resolve: {
extensions: [".ts", ".tsx", ".js", "json"]
},
externals: {
'three': "THREE"
},
//模块加载器设置
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
},
{ test: /\.css$/, loader: ['style-loader', 'css-loader'] },
{ test: /\.[(jpg)|(png)|(obj)|(json)]$/, loader: "url-loader" },
]
},
plugins: [
new HardSourceWebpackPlugin(),
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }),
]
}
export default config;

View File

@@ -1,21 +0,0 @@
import * as webpack from 'webpack';
import * as merge from 'webpack-merge';
import common from './webpack.common';
import * as path from 'path';
const config: webpack.Configuration = merge(
common,
{
mode: "production",
entry: "./src/index.ts",
//输出设置
output: {
filename: "cad.js",
path: path.resolve(__dirname, './umd'),
library: "cad",
libraryTarget: "umd"
},
}
);
export default config;

View File

@@ -1,31 +0,0 @@
import * as webpack from 'webpack';
import * as merge from 'webpack-merge';
import common from './webpack.common';
import * as HtmlWebPackPlugin from "html-webpack-plugin";
const config: webpack.Configuration = merge(
common,
{
mode: "development",
entry: "./src/ViewSrc/index.ts",
output: { pathinfo: false },
devtool: "cheap-module-eval-source-map",
devServer: {
contentBase: "./dist/",
port: 7776,
hot: true,
},
plugins: [
new webpack.NamedModulesPlugin(),//Hot
new webpack.HotModuleReplacementPlugin(),//Hot
new HtmlWebPackPlugin({
title: "webCAD",
// template: './src/index.html'
}),
]
}
);
config.externals = {};
export default config;

13
index.html Normal file
View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>CADViewComponent</title>
</head>
<body>
<script type="module" src="/src/ViewSrc/index.ts"></script>
</body>
</html>

4444
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,33 @@
{
"name": "cadview",
"version": "1.2.0",
"description": "",
"main": "src/index.ts",
"private": true,
"scripts": {
"build": "tsc",
"umd": "webpack --config ./config/webpack.umd.ts",
"dev": "webpack-dev-server --config ./config/webpack.view.ts",
"type": "ts-node ./utils/copy_type.ts"
},
"repository": {
"type": "git",
"url": "http://git.cf/cx/CADViewComponent.git"
},
"author": "cx",
"license": "ISC",
"devDependencies": {
"@types/hard-source-webpack-plugin": "^0.9.0",
"@types/node": "^10.11.7",
"@types/uglifyjs-webpack-plugin": "^1.1.0",
"@types/webpack": "^4.4.16",
"@types/webpack-dev-server": "^3.1.1",
"@types/webpack-env": "^1.13.6",
"@types/webpack-merge": "^4.1.3",
"awesome-typescript-loader": "^5.2.1",
"fork-ts-checker-webpack-plugin": "^0.4.8",
"hard-source-webpack-plugin": "^0.12.0",
"html-webpack-plugin": "^3.2.0",
"ts-loader": "^5.2.1",
"ts-node": "^7.0.1",
"typescript": "^3.7.5",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9",
"webpack-merge": "^4.1.4"
},
"dependencies": {
"@types/three": "^0.92.25",
"three": "^0.95.0",
"wolfy87-eventemitter": "^5.2.5"
}
"name": "cadview",
"version": "1.1.9",
"description": "",
"main": "src/index.ts",
"private": true,
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"repository": {
"type": "git",
"url": "http://git.cf/cx/CADViewComponent.git"
},
"author": "cx",
"license": "ISC",
"devDependencies": {
"@types/node": "^13.13.52",
"@types/three": "^0.103.2",
"typescript": "^5.0.2",
"vite": "^4.4.5"
},
"dependencies": {
"@jscad/modeling": "^2.11.0",
"flatbush": "^3.3.0",
"three": "npm:three-cf@0.122.5",
"js-angusj-clipper": "^1.2.1",
"polylabel": "^1.1.0",
"xaop": "^2.0.0",
"webcad_ue4_api": "http://gitea.cf/cx/webcad-ue4-api/archive/3.2.4.tar.gz"
}
}

View File

@@ -56,7 +56,6 @@ export class CameraControls
}
/**
* 窗体失去焦点时.
*
* @memberof CameraControls
*/
onBlur = () =>
@@ -136,7 +135,7 @@ export class CameraControls
//最后一次按中键的时间
lastMiddleClickTime = 0;
//鼠标
//鼠标
onMouseDown = (event: MouseEvent) =>
{
event.preventDefault();
@@ -220,12 +219,11 @@ export class CameraControls
}
/**
* 鼠标滚轮事件
*
*
* @memberof CameraControls
*/
onMouseWheel = (event: WheelEvent) =>
{
event.preventDefault();
event.stopPropagation();
let pt = new THREE.Vector3(event.offsetX, event.offsetY, 0);

View File

@@ -1,21 +1,20 @@
import * as THREE from 'three';
import { Vector3 } from 'three';
import { Box3, Camera, MathUtils, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
import { Orbit } from './Orbit';
/**
*
*
* 相机的控制.
* ->切换相机
* ->设置视口大小
* ->旋转和移动相机.
*
*
* @export
* @class ViewCameraManage
*/
export class CameraUpdate
{
private m_CurCamera: THREE.Camera;
private m_CameraArray: Map<any, THREE.Camera> = new Map<any, THREE.Camera>();
private m_CurCamera: Camera;
private m_CameraArray: Map<any, Camera> = new Map<any, Camera>();
//视口的画布大小
private m_Width: number;
@@ -24,9 +23,9 @@ export class CameraUpdate
private m_ViewHeight: number = 10;
//观察的位置
private m_Target: THREE.Vector3 = new THREE.Vector3();
private m_Target: Vector3 = new Vector3();
//观察向量
private m_Direction: THREE.Vector3 = new THREE.Vector3(0, 0, -1);
private m_Direction: Vector3 = new Vector3(0, 0, -1);
//观察的轨道.
private m_Orbit: Orbit = new Orbit();
@@ -35,12 +34,12 @@ export class CameraUpdate
constructor()
{
this.m_CameraArray.set(THREE.OrthographicCamera, new THREE.OrthographicCamera(-2, 2, 2, -2,
this.m_CameraArray.set(OrthographicCamera, new OrthographicCamera(-2, 2, 2, -2,
-1e6, 1e6));
this.m_CameraArray.set(THREE.PerspectiveCamera, new THREE.PerspectiveCamera(50, 1, 0.01, 10000));
this.m_CameraArray.set(PerspectiveCamera, new PerspectiveCamera(50, 1, 0.01, 10000));
this.m_CurCamera = this.m_CameraArray.get(THREE.OrthographicCamera);
this.m_CurCamera = this.m_CameraArray.get(OrthographicCamera);
this.m_Orbit.UpdateRoValue(this.m_Direction);
@@ -53,7 +52,7 @@ export class CameraUpdate
return this.m_Width / this.m_Height;
}
get Camera(): THREE.Camera
get Camera(): Camera
{
return this.m_CurCamera;
}
@@ -63,7 +62,7 @@ export class CameraUpdate
}
set ViewHeight(height)
{
this.m_ViewHeight = THREE.Math.clamp(height, this.m_MinViewHeight, this.m_MaxViewHeight);
this.m_ViewHeight = MathUtils.clamp(height, this.m_MinViewHeight, this.m_MaxViewHeight);
}
SetSize(width: number, height: number)
@@ -74,11 +73,11 @@ export class CameraUpdate
/**
* 平移相机.
*
* @param {THREE.Vector3} mouseMove
*
* @param {Vector3} mouseMove
* @memberof CameraControl
*/
Pan(mouseMove: THREE.Vector3)
Pan(mouseMove: Vector3)
{
mouseMove.y *= -1;
mouseMove.multiplyScalar(-this.m_ViewHeight / this.m_Height);
@@ -86,7 +85,7 @@ export class CameraUpdate
this.m_Target.add(mouseMove);
this.Update();
}
Rotate(mouseMove: THREE.Vector3, target: THREE.Vector3)
Rotate(mouseMove: Vector3, target: Vector3)
{
this.m_Orbit.RoX -= mouseMove.y * 0.003;
this.m_Orbit.RoZ -= mouseMove.x * 0.003;
@@ -112,9 +111,9 @@ export class CameraUpdate
this.Update();
}
Zoom(scale: number, scaleCenter?: THREE.Vector3)
Zoom(scale: number, scaleCenter?: Vector3)
{
if (this.Camera instanceof THREE.OrthographicCamera)
if (this.Camera instanceof OrthographicCamera)
{
this.ViewHeight *= scale;
if (scaleCenter && this.m_ViewHeight < this.m_MaxViewHeight)
@@ -124,7 +123,7 @@ export class CameraUpdate
this.m_Target.add(scaleCenter);
}
}
else if (this.Camera instanceof THREE.PerspectiveCamera)
else if (this.Camera instanceof PerspectiveCamera)
{
let add = scale > 1 ? 1 : -1;
add *= this.Camera.position.distanceTo(this.m_Target) / 10;
@@ -132,7 +131,7 @@ export class CameraUpdate
}
this.Update();
}
ZoomExtensBox3(box3: THREE.Box3)
ZoomExtensBox3(box3: Box3)
{
if (!box3 || box3.isEmpty()) return;
this.Camera.updateMatrixWorld(false);
@@ -159,7 +158,7 @@ export class CameraUpdate
}
this.Update();
}
LookAt(dir: THREE.Vector3)
LookAt(dir: Vector3)
{
this.m_Orbit.UpdateRoValue(dir);
this.m_Direction.copy(dir);
@@ -173,15 +172,15 @@ export class CameraUpdate
}
/**
* 根据视口大小,设置相机视口范围.
*
* @returns
*
* @returns
* @memberof CameraControl
*/
Update()
{
this.Camera.position.copy(this.m_Target);
if (this.Camera instanceof THREE.OrthographicCamera)
if (this.Camera instanceof OrthographicCamera)
{
this.Camera.left = this.Aspect * this.m_ViewHeight / -2;
this.Camera.right = this.Aspect * this.m_ViewHeight / 2;
@@ -190,10 +189,10 @@ export class CameraUpdate
this.Camera.position.sub(this.m_Direction);
}
else if (this.Camera instanceof THREE.PerspectiveCamera)
else if (this.Camera instanceof PerspectiveCamera)
{
this.Camera.aspect = this.Aspect;
let distens = (this.m_ViewHeight / 2) / (Math.tan(THREE.Math.degToRad(this.Camera.fov) / 2));
let distens = (this.m_ViewHeight / 2) / (Math.tan(MathUtils.degToRad(this.Camera.fov) / 2));
this.Camera.position.sub(this.m_Direction.clone().multiplyScalar(distens));
}
@@ -209,13 +208,13 @@ export class CameraUpdate
SwitchCamera()
{
if (this.Camera instanceof THREE.OrthographicCamera)
if (this.Camera instanceof OrthographicCamera)
{
this.m_CurCamera = this.m_CameraArray.get(THREE.PerspectiveCamera);
this.m_CurCamera = this.m_CameraArray.get(PerspectiveCamera);
}
else
{
this.m_CurCamera = this.m_CameraArray.get(THREE.OrthographicCamera);
this.m_CurCamera = this.m_CameraArray.get(OrthographicCamera);
}
this.UpdateUp();
this.Update();

View File

@@ -1,5 +1,5 @@
import * as THREE from 'three';
import { LineBasicMaterial, MeshBasicMaterial, Color } from 'three';
import { Color, LineBasicMaterial, MeshBasicMaterial } from 'three';
const ColorPalette = [
[255, 0, 0, 255], //----- 0 - lets make it red for an example
//[255, 255, 255, 255],//----- 0 - ByBlock - White
@@ -284,7 +284,7 @@ export class ColorMaterial
{
if (this.m_BasicMaterialMap.has(index))
return this.m_BasicMaterialMap.get(index);
let mat = new MeshBasicMaterial({ color: this.GetColor(index) });
let mat = new MeshBasicMaterial({ color: this.GetColor(index), side: THREE.DoubleSide });
this.m_BasicMaterialMap.set(index, mat);
return mat;
}

View File

@@ -5,7 +5,6 @@ import { MoveMatrix } from "./GeUtils";
/**
* 标注实体
*
* @export
* @class Dimension
* @extends {Group}
@@ -42,12 +41,12 @@ export class Dimension extends Group
if (mirror)
{
let roMat = new Matrix4().makeRotationZ(Math.PI);
text.applyMatrix(roMat);
text.applyMatrix(MoveMatrix(new Vector3(length * 0.5, footLength - textHeight * 0.1)));
text.applyMatrix4(roMat);
text.applyMatrix4(MoveMatrix(new Vector3(length * 0.5, footLength - textHeight * 0.1)));
}
else
{
text.applyMatrix(MoveMatrix(new Vector3(length * 0.5, footLength * 1.1)));
text.applyMatrix4(MoveMatrix(new Vector3(length * 0.5, footLength * 1.1)));
}

View File

@@ -1,12 +1,12 @@
import { Box3, Vector3, Matrix4, Mesh } from "three";
import { Matrix4, Mesh, Vector3 } from "three";
import { Dimension, GetBoxArr } from ".";
/**
* 绘制标注实体
*
*
* @export
* @param {Box3} box
* @param {Box3} box
* @returns 标注实体列表
*/
export function DrawDimension(brList: Mesh[]): Dimension[]
@@ -19,30 +19,30 @@ export function DrawDimension(brList: Mesh[]): Dimension[]
new Vector3(-1, 0, 0),
new Vector3(0, -1, 0),
new Vector3(0, 0, 1)
)
);
mat4.setPosition(box.min.clone().add(new Vector3(size.x, -30)));
let textHeight = 45;
let dimx = new Dimension(size.x, textHeight, true);
dimx.applyMatrix(mat4);
dimx.applyMatrix4(mat4);
let dimz = new Dimension(size.z, textHeight);
mat4.makeBasis(
new Vector3(0, 0, -1),
new Vector3(1, 0, 0),
new Vector3(0, -1, 0)
)
);
mat4.setPosition(box.max.clone().add(new Vector3(30, -size.y)));
dimz.applyMatrix(mat4);
dimz.applyMatrix4(mat4);
let dimy = new Dimension(size.y, textHeight, true, true);
mat4.makeBasis(
new Vector3(0, 1, 0),
new Vector3(-1, 0, 0),
new Vector3(0, 0, 1)
)
);
mat4.setPosition(box.max.clone().add(new Vector3(30, -size.y)));
dimy.applyMatrix(mat4);
dimy.applyMatrix4(mat4);
return [dimx, dimy, dimz];

View File

@@ -1,16 +1,15 @@
import * as THREE from 'three';
import { Geometry, Vector, Vector2, Vector3, Box3 } from 'three';
import { Box3, Geometry, Line, Matrix4, Mesh, Object3D, Vector2, Vector3, type Vector } from 'three';
import { Matrix2 } from './Matrix2';
export const cZeroVec = new THREE.Vector3();
export const cXAxis = new THREE.Vector3(1, 0, 0);
export const cYAxis = new THREE.Vector3(0, 1, 0);
export const cZAxis = new THREE.Vector3(0, 0, 1);
export const cZeroVec = new Vector3();
export const cXAxis = new Vector3(1, 0, 0);
export const cYAxis = new Vector3(0, 1, 0);
export const cZAxis = new Vector3(0, 0, 1);
/**
* 旋转一个点,旋转中心在原点
*
*
* @export
* @param {Vector3} pt 点
* @param {number} ang 角度.
@@ -26,6 +25,12 @@ export function equaln(v1: number, v2: number, fuzz = 1e-3)
{
return Math.abs(v1 - v2) < fuzz;
}
export function equalv3(v1: Vector3, v2: Vector3, fuzz = 1e-8)
{
return equaln(v1.x, v2.x, fuzz) && equaln(v1.y, v2.y, fuzz) && equaln(v1.z, v2.z, fuzz);
}
export function equal<T extends Vector>(v1: T, v2: T)
{
return v1.distanceToSquared(v2) < 1e-8;
@@ -50,13 +55,13 @@ export function fixAngle(an: number, fixAngle: number, fuzz: number = 0.1)
/**
* 按照极坐标的方式移动一个点
*
*
* @export
* @template
* @template
* @param {T} v 向量(2d,3d)
* @param {number} an 角度
* @param {number} dis 距离
* @returns {T}
* @returns {T}
*/
export function polar<T extends Vector2 | Vector3>(v: T, an: number, dis: number): T
{
@@ -76,22 +81,22 @@ export function angle(v: Vector3 | Vector2)
/**
* 求两个向量的夹角,顺时针为负,逆时针为正
*
* @param {THREE.Vector3} v1
* @param {THREE.Vector3} v2
* @param {THREE.Vector3} [ref] 参考向量,如果为世界坐标系则为0,0,1
* @returns
*
* @param {Vector3} v1
* @param {Vector3} v2
* @param {Vector3} [ref] 参考向量,如果为世界坐标系则为0,0,1
* @returns
*/
export function angleTo(v1: THREE.Vector3, v2: THREE.Vector3, ref: THREE.Vector3 = new THREE.Vector3(0, 0, 1))
export function angleTo(v1: Vector3, v2: Vector3, ref: Vector3 = new Vector3(0, 0, 1))
{
if (!ref.equals(new Vector3(0, 0, 1)))
{
//任意轴坐标系. 使用相机的构造矩阵.
ref.multiplyScalar(-1);
let up = getLoocAtUpVec(ref);
let refOcs = new THREE.Matrix4();
let refOcs = new Matrix4();
refOcs.lookAt(cZeroVec, ref, up);
let refOcsInv = new THREE.Matrix4().getInverse(refOcs);
let refOcsInv = new Matrix4().getInverse(refOcs);
v1.applyMatrix4(refOcsInv);
v2.applyMatrix4(refOcsInv);
v1.z = 0;
@@ -103,63 +108,63 @@ export function angleTo(v1: THREE.Vector3, v2: THREE.Vector3, ref: THREE.Vector3
return cv.z === 0 ? v1.angleTo(v2) : v1.angleTo(v2) * cv.z;
}
export function getLoocAtUpVec(dir: THREE.Vector3): THREE.Vector3
export function getLoocAtUpVec(dir: Vector3): Vector3
{
if (dir.equals(cZeroVec))
{
throw ("zero vector")
throw ("zero vector");
}
let norm = dir.clone().normalize();
if (norm.equals(cZAxis))
{
return new THREE.Vector3(0, 1, 0);
return new Vector3(0, 1, 0);
}
else if (norm.equals(cZAxis.clone().negate()))
{
return new THREE.Vector3(0, -1, 0);
return new Vector3(0, -1, 0);
}
else
{
let xv: THREE.Vector3 = new THREE.Vector3();
let xv: Vector3 = new Vector3();
xv.crossVectors(cZAxis, norm);
let up = new THREE.Vector3();
let up = new Vector3();
up.crossVectors(norm, xv);
return up;
}
}
export function createLookAtMat4(dir: THREE.Vector3): THREE.Matrix4
export function createLookAtMat4(dir: Vector3): Matrix4
{
let up = getLoocAtUpVec(dir);
let mat = new THREE.Matrix4();
let mat = new Matrix4();
mat.lookAt(cZeroVec, dir, up);
return mat;
}
export function isParallelTo(v1: THREE.Vector3, v2: THREE.Vector3)
export function isParallelTo(v1: Vector3, v2: Vector3)
{
return v1.clone().cross(v2).lengthSq() < 1e-9;
}
export function ptToString(v: THREE.Vector3, fractionDigits: number = 3): string
export function ptToString(v: Vector3, fractionDigits: number = 3): string
{
return v.toArray().map(o =>
{
return o.toFixed(fractionDigits)
}).join(",")
return o.toFixed(fractionDigits);
}).join(",");
}
export function midPoint(v1: THREE.Vector3, v2: THREE.Vector3): THREE.Vector3
export function midPoint(v1: Vector3, v2: Vector3): Vector3
{
return v1.clone().add(v2).multiplyScalar(0.5);
}
export function midPoint2(v1: THREE.Vector2, v2: THREE.Vector2): THREE.Vector2
export function midPoint2(v1: Vector2, v2: Vector2): Vector2
{
return v1.clone().add(v2).multiplyScalar(0.5);
}
export function midPtCir(v1: THREE.Vector3, v2: THREE.Vector3)
export function midPtCir(v1: Vector3, v2: Vector3)
{
let baseline = new Vector3(1, 0, 0);
let outLine = v2.clone().sub(v1);
@@ -170,11 +175,11 @@ export function midPtCir(v1: THREE.Vector3, v2: THREE.Vector3)
/**
* 获得Three对象的包围盒.
* @param obj
* @param obj
* @param [updateMatrix] 是否应该更新对象矩阵
* @returns box
* @returns box
*/
export function GetBox(obj: THREE.Object3D, updateMatrix?: boolean): THREE.Box3
export function GetBox(obj: Object3D, updateMatrix?: boolean): Box3
{
let box = new Box3();
if (updateMatrix) obj.updateMatrixWorld(false);
@@ -199,7 +204,7 @@ export function GetBox(obj: THREE.Object3D, updateMatrix?: boolean): THREE.Box3
return box;
}
export function GetBoxArr(arr: Array<THREE.Object3D>): THREE.Box3
export function GetBoxArr(arr: Array<Object3D>): Box3
{
let box = new Box3();
for (let o of arr)
@@ -211,9 +216,9 @@ export function GetBoxArr(arr: Array<THREE.Object3D>): THREE.Box3
return box;
}
export function MoveMatrix(v: THREE.Vector3): THREE.Matrix4
export function MoveMatrix(v: Vector3): Matrix4
{
let mat = new THREE.Matrix4();
let mat = new Matrix4();
mat.makeTranslation(v.x, v.y, v.z);
return mat;
}
@@ -225,7 +230,7 @@ export function getProjectDist(v1: Vector3, v2: Vector3)
return {
h: dist * Math.cos(ang),
v: dist * Math.sin(ang)
}
};
}
//获得输入点在2线组成的4个区间的位置
export function getPtPostion(sp: Vector3, ep: Vector3, c: Vector3, inPt: Vector3)
@@ -250,10 +255,10 @@ export function getPtPostion(sp: Vector3, ep: Vector3, c: Vector3, inPt: Vector3
return { sp, ep };
} else if (inputAng > ang1 && inputAng <= ang2)
{
return { sp: c.clone().add(l3), ep }
return { sp: c.clone().add(l3), ep };
} else if (inputAng > ang2 && inputAng <= ang3)
{
return { sp: c.clone().add(l3), ep: c.clone().add(l4) }
return { sp: c.clone().add(l3), ep: c.clone().add(l4) };
} else
{
return { sp, ep: c.clone().add(l4) };
@@ -265,19 +270,19 @@ export function angleAndX(v: Vector3 | Vector2)
}
/**
* 将角度调整为0-2pi之间
*
*
* @export
* @param {number} an
* @param {number} an
*/
export function angleTo2Pi(an: number)
{
an = an % (Math.PI * 2);
if (an < 0) an += Math.PI * 2
if (an < 0) an += Math.PI * 2;
return an;
}
export function updateGeometry(l: THREE.Line | THREE.Mesh, geometry: Geometry)
export function updateGeometry(l: Line | Mesh, geometry: Geometry)
{
let geo = l.geometry as THREE.Geometry;
let geo = l.geometry as Geometry;
geo.dispose();
l.geometry = geometry;
geometry.verticesNeedUpdate = true;

View File

@@ -1,9 +1,9 @@
import * as THREE from "three";
import { MathUtils, Vector3 } from "three";
/**
* 轨道控制的数学类,观察向量和角度的互相转换
* 当x当抬头或者低头到90度时,触发万向锁.
*
*
* @class Orbit
*/
export class Orbit
@@ -20,19 +20,19 @@ export class Orbit
}
set RoX(v)
{
this.m_RoX = THREE.Math.clamp(v, Math.PI * -0.5, Math.PI * 0.5);
this.m_RoX = MathUtils.clamp(v, Math.PI * -0.5, Math.PI * 0.5);
}
/**
* 使用旋转角度 计算观察向量
*
* @param {THREE.Vector3} [dir] 引用传入,如果传入,那么就不构造新的向量
* @returns {THREE.Vector3} 返回观察向量
*
* @param {Vector3} [dir] 引用传入,如果传入,那么就不构造新的向量
* @returns {Vector3} 返回观察向量
* @memberof Orbit
*/
UpdateDirection(dir?: THREE.Vector3): THREE.Vector3
UpdateDirection(dir?: Vector3): Vector3
{
let rtDir = dir ? dir : new THREE.Vector3();
let rtDir = dir ? dir : new Vector3();
rtDir.z = Math.sin(this.m_RoX);
@@ -47,11 +47,11 @@ export class Orbit
/**
* 使用观察向量,计算旋转角度
*
* @param {THREE.Vector3} dir
*
* @param {Vector3} dir
* @memberof Orbit
*/
UpdateRoValue(dir: THREE.Vector3)
UpdateRoValue(dir: Vector3)
{
dir.normalize();
this.m_RoX = Math.asin(dir.z);
@@ -62,30 +62,30 @@ export class Orbit
}
/**
*
*
* 根据观察向量 求头部的向量.
*
*
* @static
* @param {THREE.Vector3} dir
* @param {THREE.Vector3} [up]
* @returns {THREE.Vector3}
* @param {Vector3} dir
* @param {Vector3} [up]
* @returns {Vector3}
* @memberof Orbit
*/
static ComputUpDirection(dir: THREE.Vector3, up?: THREE.Vector3): THREE.Vector3
static ComputUpDirection(dir: Vector3, up?: Vector3): Vector3
{
let upRes = up ? up : new THREE.Vector3();
if (dir.equals(new THREE.Vector3(0, 0, -1)))
let upRes = up ? up : new Vector3();
if (dir.equals(new Vector3(0, 0, -1)))
{
upRes.set(0, 1, 0);
}
else if (dir.equals(new THREE.Vector3(0, 0, 1)))
else if (dir.equals(new Vector3(0, 0, 1)))
{
upRes.set(0, -1, 0);
}
else
{
let xv = new THREE.Vector3();
xv.crossVectors(new THREE.Vector3(0, 0, 1), dir);
let xv = new Vector3();
xv.crossVectors(new Vector3(0, 0, 1), dir);
upRes.crossVectors(dir, xv);
upRes.normalize();
}

185
src/SimpleBoard.ts Normal file
View File

@@ -0,0 +1,185 @@
import { CylinderGeometry, LineSegments, Matrix4, Mesh, MeshBasicMaterial, Vector2, Vector3 } from "three";
import { ExtrudeSolid, Polyline, boardUVGenerator2 } from "webcad_ue4_api";
import { ColorMaterial } from "./ColorPalette";
import { edgeMaterial } from "./Material";
import { DbText } from "./Text";
function getVec(data: object): Vector3
{
return new Vector3(data["x"], data["y"], data["z"]);
}
enum BoardType
{
Layer = 0,
Vertical = 1,
Behind = 2
}
export class SimpleBoard
{
BoardName: string;
boardPts: any[];
boardBuls: any[];
xD: Vector3;
yD: Vector3;
zD: Vector3;
height: number;
width: number;
thickness: number;
pBase: Vector3;
SubBoardLocal: any[];
Drillings: any[];
DataID: number;
_BoardType: BoardType;
_CustomNumber: string;
constructor(boardData: any)
{
this.boardPts = boardData["Pts"];
this.boardBuls = boardData["Buls"];
this.pBase = getVec(boardData["BasePoint"]);
this.xD = getVec(boardData["XVec"]);
this.yD = getVec(boardData["YVec"]);
this.zD = getVec(boardData["ZVec"]);
this.SubBoardLocal = boardData["SubBoardLocal"] ?? [];
this.Drillings = boardData["Drillings"] ?? [];
this.height = boardData["L"];
this.width = boardData["W"];
this.thickness = boardData["H"];
this.BoardName = boardData["BoardName"];
this.DataID = boardData['DataID'];
this._BoardType = boardData['BoardType'];
this._CustomNumber = boardData['CustomNumber'];
}
public Conver2Ext(): ExtrudeSolid
{
let pts: Vector2[] = [];
let buls: number[] = [];
let boardMat = new Matrix4();
let matInv: Matrix4 = new Matrix4();
//InitBoardMat
this.pBase.add(this.zD.clone().multiplyScalar(-this.thickness));
boardMat.makeBasis(this.xD, this.yD, this.zD);
boardMat.setPosition(this.pBase);
matInv.getInverse(boardMat);
if (this.boardPts && this.boardPts.length !== 0)
for (let i = 0; i < this.boardPts.length; i++)
{
let pt = getVec(this.boardPts[i]);
if (this.boardPts[i].z !== undefined)
pt.applyMatrix4(matInv);
pts.push(new Vector2(pt.x, pt.y));
buls.push(this.boardBuls[i]);
}
else
{
pts.push(new Vector2(0, 0),
new Vector2(this.width, 0),
new Vector2(this.width, this.height),
new Vector2(0, this.height),
new Vector2(0, 0)
);
buls.push(0, 0, 0, 0, 0);
}
let ext = new ExtrudeSolid();
ext.OCSNoClone.copy(boardMat);
let pl = new Polyline(pts.map((p, i) => { return { pt: p, bul: buls[i] }; }));
ext.Thickness = this.thickness;
ext.ContourCurve = pl;
if (this.SubBoardLocal.length > 0)
ext.Grooves.push(...this.SubBoardLocal.map(sub => new SimpleBoard(sub).Conver2Ext()));
return ext;
}
createBoard(boardMaterial: MeshBasicMaterial)
{
let ext = this.Conver2Ext();
if (this.BoardName === "地脚线")
Object.defineProperty(ext, "UCGenerator",
{
get: function ()
{
return boardUVGenerator2;
},
});
//板件被镜像时.
// if (!equalv3(xD.clone().cross(yD), ZD))
// {
// for (let f of ext.faces)
// [f.a, f.c] = [f.c, f.a];
// }
//边
let edges: (LineSegments | Mesh)[] = [new LineSegments(ext.EdgeGeometry, edgeMaterial)];
edges[0].applyMatrix4(ext.OCSNoClone);
if (this.Drillings.length > 0)
{
let dris = this.Drillings;
for (let dri of dris)
{
let geo = new CylinderGeometry(dri.r, dri.r, dri.h, 8);
geo.rotateX(Math.PI * 0.5);
if (dri.f === 0) //0正
geo.translate(dri.x, dri.y, -dri.h * 0.5 + this.thickness);
else //1反
geo.translate(dri.x, dri.y, dri.h * 0.5);
geo.applyMatrix4(ext.OCSNoClone);
let mesh = new Mesh(geo, ColorMaterial.GetBasicMaterial(1));
edges.push(mesh);
}
}
let mesh = new Mesh(ext.MeshGeometry, boardMaterial);
mesh.userData = ext.Normal;
edges.forEach(e => e.userData = ext.Normal);
// 自定义编号
if (this._CustomNumber)
{
mesh.add(this.createCustomNo());
}
mesh.applyMatrix4(ext.OCSNoClone);
mesh.updateWorldMatrix(false, true);
return { mesh, edges };
}
private createCustomNo()
{
let text = new DbText(this._CustomNumber?.toString(), 100);
let position = new Vector3(this.width * 0.5, this.height * 0.5, this.thickness * 0.5);
if (this._BoardType === BoardType.Layer)
{
text.applyMatrix4(new Matrix4().makeRotationZ(-Math.PI / 2).setPosition(position));
}
else
{
text.applyMatrix4(new Matrix4().setPosition(position));
}
// text.CreateDoubleMesh(this._BoardType === BoardType.Layer);
return text;
}
}

View File

@@ -1,43 +1,59 @@
import { Font, FontLoader, Mesh, ShapeGeometry, Vector3, Shape } from "three";
import { Font, FontLoader, Matrix4, Mesh, Shape, ShapeGeometry, Vector3 } from "three";
import f from "../resources/fonts/helvetiker_regular.typeface.json";
import { ColorMaterial } from "./ColorPalette";
import { MoveMatrix } from "./GeUtils";
import { XAxis, XAxisN, YAxis, YAxisN, ZAxisN } from "./Utils";
class FontLoaderUtil
{
private static defFont: Font;
static Load(): Font
{
if (!this.defFont)
private static defFont: Font;
static Load(): Font
{
const f = require("../resources/fonts/helvetiker_regular.typeface.json");
let loader = new FontLoader();
this.defFont = loader.parse(f);
if (!this.defFont)
{
let loader = new FontLoader();
this.defFont = loader.parse(f);
}
return this.defFont;
}
return this.defFont;
}
}
export class DbText extends Mesh
{
/**
*
* 构造一个文本对象,8位点(中心点下面)在0点
* @param {string} str 数字字符串
* @param {number} height 文本高度
* @memberof DbText
*/
constructor(str: string, height: number = 5)
{
let font = FontLoaderUtil.Load();
/**
*
* 构造一个文本对象,8位点(中心点下面)在0点
* @param {string} str 数字字符串
* @param {number} height 文本高度
* @memberof DbText
*/
constructor(str: string, height: number = 5)
{
let font = FontLoaderUtil.Load();
let shapes: Shape[] = font.generateShapes(str, height, 0.1);
let geometry = new ShapeGeometry(shapes);
let shapes: Shape[] = font.generateShapes(str, height);
let geometry = new ShapeGeometry(shapes);
geometry.computeBoundingBox();
geometry.computeBoundingBox();
super(geometry, ColorMaterial.GetBasicMaterial(5));
super(geometry, ColorMaterial.GetBasicMaterial(5));
let center = geometry.boundingBox.getCenter(new Vector3());
this.applyMatrix(MoveMatrix(new Vector3(-center.x, 0, 0)));
}
let center = geometry.boundingBox.getCenter(new Vector3());
this.applyMatrix4(MoveMatrix(new Vector3(-center.x, 0, 0)));
}
CreateDoubleMesh(IsFsText: boolean)
{
let mesh2 = new Mesh(this.geometry, ColorMaterial.GetBasicMaterial(5));
//左右视图时应该这样,俯视图是X,-Y,-Z(y+=(xxx)
if (IsFsText)
{
mesh2.applyMatrix4(new Matrix4().makeBasis(XAxis, YAxisN, ZAxisN));
}
else
{
mesh2.applyMatrix4(new Matrix4().makeBasis(XAxisN, YAxis, ZAxisN));
}
this.add(mesh2);
}
}

View File

@@ -71,32 +71,8 @@ export class ThreeBSP
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[2], uvs);
vertex.applyMatrix4(this.matrix);
polygon.vertices.push(vertex);
} else if (typeof THREE.Face4)
{
vertex = geometry.vertices[face.a];
uvs = faceVertexUvs ? new THREE.Vector2(faceVertexUvs[0].x, faceVertexUvs[0].y) : null;
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[0], uvs);
vertex.applyMatrix4(this.matrix);
polygon.vertices.push(vertex);
vertex = geometry.vertices[face.b];
uvs = faceVertexUvs ? new THREE.Vector2(faceVertexUvs[1].x, faceVertexUvs[1].y) : null;
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[1], uvs);
vertex.applyMatrix4(this.matrix);
polygon.vertices.push(vertex);
vertex = geometry.vertices[face.c];
uvs = faceVertexUvs ? new THREE.Vector2(faceVertexUvs[2].x, faceVertexUvs[2].y) : null;
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[2], uvs);
vertex.applyMatrix4(this.matrix);
polygon.vertices.push(vertex);
vertex = geometry.vertices[face.d];
uvs = faceVertexUvs ? new THREE.Vector2(faceVertexUvs[3].x, faceVertexUvs[3].y) : null;
vertex = new Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[3], uvs);
vertex.applyMatrix4(this.matrix);
polygon.vertices.push(vertex);
} else
}
else
{
throw 'Invalid face type at index ' + i;
}

View File

@@ -1,5 +1,12 @@
import { Object3D, Mesh } from "three";
import { createTemplateBoard, DrawDimension, Viewer, selectMaterial } from ".";
import { Object3D, Vector3 } from "three";
import { DrawDimension, Viewer, createTemplateBoard } from ".";
export const XAxis = new Vector3(1, 0, 0);
export const XAxisN = new Vector3(-1, 0, 0);
export const YAxis = new Vector3(0, 1, 0);
export const YAxisN = new Vector3(0, -1, 0);
export const ZAxis = new Vector3(0, 0, 1);
export const ZAxisN = new Vector3(0, 0, -1);
function dispose(m: Object3D)
{
@@ -21,7 +28,7 @@ export function LoadBoard(view: Viewer, data: any[], clear: boolean = true)
if (data.length === 0) return;
//加板
let { meshs, edgesa, relations } = createTemplateBoard(data);
let { meshs, edgesa, relations } = createTemplateBoard(data, view._Settings.boardMaterial);
//加标注
let dims = DrawDimension(meshs);

197
src/ViewSrc/data.json Normal file
View File

@@ -0,0 +1,197 @@
[
{
"DataID": 3996018,
"OrderNo": 20230727027642,
"L": 800,
"W": 600,
"H": 18,
"BoardName": "层板",
"Grain": 0,
"BoardType": 0,
"CustomNumber": "",
"BasePoint": {
"x": 1877.02062480031,
"y": -1.77635683940025e-13,
"z": 823.651271182857
},
"XVec": {
"x": 2.22044604925031e-16,
"y": 1,
"z": 0
},
"YVec": {
"x": -1,
"y": 2.22044604925031e-16,
"z": 0
},
"ZVec": {
"x": 0,
"y": 0,
"z": 1
},
"Pts": [],
"Buls": [],
"SubBoardLocal": [],
"SubBoardAssoc": [],
"Drillings": [
{
"x": 50,
"y": 766,
"r": 7.5,
"h": 13.5,
"f": 0
},
{
"x": 300,
"y": 766,
"r": 7.5,
"h": 13.5,
"f": 0
},
{
"x": 550,
"y": 766,
"r": 7.5,
"h": 13.5,
"f": 0
},
{
"x": 550,
"y": 34,
"r": 7.5,
"h": 13.5,
"f": 0
},
{
"x": 300,
"y": 34,
"r": 7.5,
"h": 13.5,
"f": 0
},
{
"x": 50,
"y": 34,
"r": 7.5,
"h": 13.5,
"f": 0
}
]
},
{
"DataID": 3996019,
"OrderNo": 20230727027642,
"L": 1200,
"W": 600,
"H": 18,
"BoardName": "右侧板",
"Grain": 0,
"BoardType": 0,
"CustomNumber": "",
"BasePoint": {
"x": 1895.02062480031,
"y": 0,
"z": 214.651271182857
},
"XVec": {
"x": 4.93038065763132e-32,
"y": 1,
"z": -2.22044604925031e-16
},
"YVec": {
"x": -2.22044604925031e-16,
"y": 2.22044604925031e-16,
"z": 1
},
"ZVec": {
"x": 1,
"y": 0,
"z": 2.22044604925031e-16
},
"Pts": [],
"Buls": [],
"SubBoardLocal": [],
"SubBoardAssoc": [],
"Drillings": [
{
"x": 550,
"y": 600,
"r": 5,
"h": 13.5,
"f": 1
},
{
"x": 300,
"y": 600,
"r": 5,
"h": 13.5,
"f": 1
},
{
"x": 50,
"y": 600,
"r": 5,
"h": 13.5,
"f": 1
}
]
},
{
"DataID": 3996020,
"OrderNo": 20230727027642,
"L": 1200,
"W": 600,
"H": 18,
"BoardName": "左侧板",
"Grain": 0,
"BoardType": 0,
"CustomNumber": "",
"BasePoint": {
"x": 1077.02062480031,
"y": 0,
"z": 214.651271182857
},
"XVec": {
"x": 4.93038065763132e-32,
"y": 1,
"z": -2.22044604925031e-16
},
"YVec": {
"x": -2.22044604925031e-16,
"y": 2.22044604925031e-16,
"z": 1
},
"ZVec": {
"x": 1,
"y": 0,
"z": 2.22044604925031e-16
},
"Pts": [],
"Buls": [],
"SubBoardLocal": [],
"SubBoardAssoc": [],
"Drillings": [
{
"x": 50,
"y": 600,
"r": 5,
"h": 13.5,
"f": 0
},
{
"x": 300,
"y": 600,
"r": 5,
"h": 13.5,
"f": 0
},
{
"x": 550,
"y": 600,
"r": 5,
"h": 13.5,
"f": 0
}
]
}
]

View File

@@ -1,22 +1,22 @@
// import { Color, Face3, MeshBasicMaterial, Object3D, Vector2, Vector3 } from "three";
// import "./style.css";
import { Vector3 } from "three";
import { Color, MeshBasicMaterial, Vector3 } from "three";
import { CameraControlState } from "../CameraControls";
import { data } from "../data";
import { GetBox } from "../GeUtils";
import { LoadBoard } from "../Utils";
import { Viewer } from "../Viewer";
import data from "./data.json";
let btn = document.createElement("button");
btn.innerHTML = "载入"
btn.innerHTML = "载入";
document.body.appendChild(btn);
let btn2 = document.createElement("button");
btn2.innerHTML = "清理"
btn2.innerHTML = "清理";
document.body.appendChild(btn2);
let btn3 = document.createElement("button");
btn3.innerHTML = "爆炸图"
btn3.innerHTML = "爆炸图";
document.body.appendChild(btn3);
let el = document.createElement("canvas");
@@ -25,7 +25,17 @@ el.style.width = "80%";
el.style.height = "80%";
document.body.appendChild(el);
let view = new Viewer(el);
let view = new Viewer(el, (settings) =>
{
settings.boardMaterial = new MeshBasicMaterial({
color: new Color(0.8, 0.8, 0.8),
polygonOffset: true,
polygonOffsetFactor: 1, // positive value pushes polygon further away
polygonOffsetUnits: 1,
transparent: true,
opacity: 0.5
});
});
//修改这个顺序 改变1 2 3 个触摸点时的触发状态.
view.m_CameraCtrl.m_TouthTypeList = [CameraControlState.Rotate, CameraControlState.Scale, CameraControlState.Pan];
@@ -39,12 +49,12 @@ btn.onclick = () =>
for (let i = 0; i < 1; i++)
LoadBoard(view, data);
console.timeEnd();
}
};
btn2.onclick = () =>
{
// LoadBoard(view, []);
}
};
btn3.onclick = () =>
{
@@ -91,5 +101,5 @@ btn3.onclick = () =>
if (count === 60)
clearInterval(t);
}, 16)
}
}, 16);
};

12
src/ViewSrc/style.css Normal file
View File

@@ -0,0 +1,12 @@
body {
font-size: 11px;
overflow: hidden;
}
html,
body {
background: #5C7080;
height: 100%;
padding: 0;
margin: 0;
}

View File

@@ -1,226 +1,243 @@
import { Mesh, Raycaster, Scene, Vector3, WebGLRenderer, WebGLRendererParameters } from "three";
import { boardMaterial, CameraControls, PointPick, selectMaterial } from ".";
import { Mesh, MeshBasicMaterial, Raycaster, Scene, Vector3, WebGLRenderer, type WebGLRendererParameters } from "three";
import { CameraControls, PointPick, boardMaterial, selectMaterial } from ".";
import { CameraUpdate } from "./CameraUpdate";
import { ColorMaterial } from "./ColorPalette";
import { cZeroVec, GetBox, GetBoxArr } from "./GeUtils";
import { GetBox, GetBoxArr, cZeroVec } from "./GeUtils";
import { PlaneExt } from "./PlaneExt";
export class ViewerSettings
{
boardMaterial: MeshBasicMaterial = boardMaterial;
selectMaterial: MeshBasicMaterial = selectMaterial;
selectByPointCallback: (meshId: number) => void = () => { };
}
export class Viewer
{
m_LookTarget: any;
m_Camera: CameraUpdate = new CameraUpdate();
m_CameraCtrl: CameraControls;
m_bNeedUpdate: boolean = true;
m_Render: WebGLRenderer;//渲染器 //暂时只用这个类型
m_DomEl: HTMLElement; //画布容器
m_LookTarget: any;
m_Camera: CameraUpdate = new CameraUpdate();
m_CameraCtrl: CameraControls;
m_bNeedUpdate: boolean = true;
m_Render: WebGLRenderer;//渲染器 //暂时只用这个类型
m_DomEl: HTMLElement; //画布容器
_Height: number;
_Width: number;
_Height: number = 0;
_Width: number = 0;
m_Scene: Scene = new Scene();
m_Scene: Scene = new Scene();
/**
*
* @param {HTMLElement} canvasContainer 可以传入一个div或者一个画布
* @memberof Viewer
*/
constructor(canvasContainer: HTMLElement)
{
this.m_DomEl = canvasContainer;
this.initRender(canvasContainer);
this.OnSize();
this.StartRender();
this.m_CameraCtrl = new CameraControls(this);
window.addEventListener("resize", () =>
_Settings = new ViewerSettings();
/**
*
* @param {HTMLElement} canvasContainer 可以传入一个div或者一个画布
* @memberof Viewer
*/
constructor(canvasContainer: HTMLElement, setupAction: (settings: ViewerSettings) => void = null)
{
this.OnSize();
});
this.m_Render.domElement.addEventListener("mousemove", (e: MouseEvent) =>
{
this.SelectByPoint(e.offsetX, e.offsetY);
})
}
//初始化render
initRender(canvasContainer: HTMLElement)
{
let params: WebGLRendererParameters = {
antialias: true,//antialias:true/false是否开启反锯齿
precision: "highp",//precision:highp/mediump/lowp着色精度选择
alpha: true//alpha:true/false是否可以设置背景色透明
};
if (canvasContainer instanceof HTMLCanvasElement)
{
params.canvas = canvasContainer;
this.m_Render = new WebGLRenderer(params);
}
else
{
this.m_Render = new WebGLRenderer(params);
//加到画布
canvasContainer.appendChild(this.m_Render.domElement);
}
this.m_Render.autoClear = true;
//如果设置那么它希望所有的纹理和颜色都是预乘的伽玛。默认值为false。
// this.m_Render.gammaInput = true;
// this.m_Render.gammaOutput = true;
// this.m_Render.shadowMap.enabled = true;
// this.m_Render.toneMapping = ReinhardToneMapping;
//设置设备像素比。 这通常用于HiDPI设备以防止模糊输出画布。
this.m_Render.setPixelRatio(window.devicePixelRatio);
this.m_Render.physicallyCorrectLights = true;
//this.m_Render.toneMappingExposure = Math.pow(1, 5.0); // to allow for very bright scenes.
//设置它的背景色为黑色
this.m_Render.setClearColor(0xffffff, 1);
this.OnSize();
}
OnSize = (width?, height?) =>
{
this._Width = width ? width : this.m_DomEl.clientWidth;
this._Height = height ? height : this.m_DomEl.clientHeight;
//校验.成为2的倍数 避免外轮廓错误.
if (this._Width % 2 == 1)
this._Width -= 1;
if (this._Height % 2 == 1)
this._Height -= 1;
this.m_Render.setSize(this._Width, this._Height);
this.m_Camera.SetSize(this._Width, this._Height);
}
StartRender = () =>
{
requestAnimationFrame(this.StartRender);
if (this.m_Scene != null && this.m_bNeedUpdate)
{
this.Render();
this.m_bNeedUpdate = false;
}
}
Render()
{
this.m_Render.render(this.m_Scene, this.m_Camera.Camera);
}
ScreenToWorld(pt: Vector3, planVec?: Vector3)
{
//变换和求交点
let plan = new PlaneExt(planVec || new Vector3(0, 0, 1));
let raycaster = new Raycaster();
// 射线从相机射线向屏幕点位置
raycaster.setFromCamera(
{
x: (pt.x / this._Width) * 2 - 1,
y: - (pt.y / this._Height) * 2 + 1
}
, this.m_Camera.Camera
)
plan.intersectRay(raycaster.ray, pt, true);
}
WorldToScreen(pt: Vector3)
{
let widthHalf = this._Width * 0.5;
let heightHalf = this._Height * 0.5;
pt.project(this.m_Camera.Camera);
pt.x = (pt.x * widthHalf) + widthHalf;
pt.y = - (pt.y * heightHalf) + heightHalf;
}
/**
* 更新视角观测目标(物体中心)
*
* @memberof Viewer
*/
UpdateLockTarget()
{
let renderList = this.m_Render.renderLists.get(this.m_Scene, this.m_Camera.Camera);
let box = GetBoxArr(renderList.opaque.map(o => o.object));
if (box)
this.m_LookTarget = box.getCenter(new Vector3());
else
this.m_LookTarget = cZeroVec;
}
Rotate(mouseMove: Vector3)
{
this.m_Camera.Rotate(mouseMove, this.m_LookTarget);
this.m_bNeedUpdate = true;
}
Pan(mouseMove: Vector3)
{
this.m_Camera.Pan(mouseMove);
this.m_bNeedUpdate = true;
}
Zoom(scale: number, center?: Vector3)
{
this.m_Camera.Zoom(scale, center);
this.m_bNeedUpdate = true;
}
ZoomAll()
{
this.m_Camera.ZoomExtensBox3(GetBox(this.m_Scene, true));
this.m_bNeedUpdate = true;
}
ViewToTop()
{
this.m_Camera.LookAt(new Vector3(0, 0, -1));
this.m_bNeedUpdate = true;
}
ViewToFront()
{
this.m_Camera.LookAt(new Vector3(0, 1, 0));
this.m_bNeedUpdate = true;
}
ViewToSwiso()
{
this.m_Camera.LookAt(new Vector3(1, 1, -1));
this.m_bNeedUpdate = true;
}
oldMesh: Mesh;
SelectByPoint(x: number, y: number)
{
let mesh = PointPick(this, x, y);
if (this.oldMesh)
this.oldMesh.material = boardMaterial;
if (mesh && mesh.material !== ColorMaterial.GetBasicMaterial(1))
{
this.oldMesh = mesh;
mesh.material = selectMaterial;
}
this.m_bNeedUpdate = true;
}
SelectBlock(blockMeshMap: Map<number, number>, dataID: number)
{
if (blockMeshMap.has(dataID))
{
let meshId = blockMeshMap.get(dataID);
if (this.oldMesh)
this.oldMesh.material = boardMaterial;
this.m_Scene.children.forEach(obj =>
{
if (obj instanceof Mesh)
if (setupAction)
{
if (obj.id == meshId)
{
this.oldMesh = obj;
obj.material = selectMaterial;
this.m_bNeedUpdate = true;
}
setupAction(this._Settings);
}
})
this.m_DomEl = canvasContainer;
this.initRender(canvasContainer);
this.OnSize();
this.StartRender();
this.m_CameraCtrl = new CameraControls(this);
window.addEventListener("resize", () =>
{
this.OnSize();
});
this.m_Render.domElement.addEventListener("mousemove", (e: MouseEvent) =>
{
this.SelectByPoint(e.offsetX, e.offsetY);
});
}
//初始化render
initRender(canvasContainer: HTMLElement)
{
let params: WebGLRendererParameters = {
antialias: true,//antialias:true/false是否开启反锯齿
precision: "highp",//precision:highp/mediump/lowp着色精度选择
alpha: true//alpha:true/false是否可以设置背景色透明
};
if (canvasContainer instanceof HTMLCanvasElement)
{
params.canvas = canvasContainer;
this.m_Render = new WebGLRenderer(params);
}
else
{
this.m_Render = new WebGLRenderer(params);
//加到画布
canvasContainer.appendChild(this.m_Render.domElement);
}
this.m_Render.autoClear = true;
//如果设置那么它希望所有的纹理和颜色都是预乘的伽玛。默认值为false。
// this.m_Render.gammaInput = true;
// this.m_Render.gammaOutput = true;
// this.m_Render.shadowMap.enabled = true;
// this.m_Render.toneMapping = ReinhardToneMapping;
//设置设备像素比。 这通常用于HiDPI设备以防止模糊输出画布。
this.m_Render.setPixelRatio(window.devicePixelRatio);
this.m_Render.physicallyCorrectLights = true;
//this.m_Render.toneMappingExposure = Math.pow(1, 5.0); // to allow for very bright scenes.
//设置它的背景色为黑色
this.m_Render.setClearColor(0xffffff, 1);
this.OnSize();
}
OnSize = (width?, height?) =>
{
this._Width = width ? width : this.m_DomEl.clientWidth;
this._Height = height ? height : this.m_DomEl.clientHeight;
//校验.成为2的倍数 避免外轮廓错误.
if (this._Width % 2 == 1)
this._Width -= 1;
if (this._Height % 2 == 1)
this._Height -= 1;
this.m_Render.setSize(this._Width, this._Height);
this.m_Camera.SetSize(this._Width, this._Height);
};
StartRender = () =>
{
requestAnimationFrame(this.StartRender);
if (this.m_Scene != null && this.m_bNeedUpdate)
{
this.Render();
this.m_bNeedUpdate = false;
}
};
Render()
{
this.m_Render.render(this.m_Scene, this.m_Camera.Camera);
}
ScreenToWorld(pt: Vector3, planVec?: Vector3)
{
//变换和求交点
let plan = new PlaneExt(planVec || new Vector3(0, 0, 1));
let raycaster = new Raycaster();
// 射线从相机射线向屏幕点位置
raycaster.setFromCamera(
{
x: (pt.x / this._Width) * 2 - 1,
y: - (pt.y / this._Height) * 2 + 1
}
, this.m_Camera.Camera
);
plan.intersectRay(raycaster.ray, pt, true);
}
WorldToScreen(pt: Vector3)
{
let widthHalf = this._Width * 0.5;
let heightHalf = this._Height * 0.5;
pt.project(this.m_Camera.Camera);
pt.x = (pt.x * widthHalf) + widthHalf;
pt.y = - (pt.y * heightHalf) + heightHalf;
}
/**
* 更新视角观测目标(物体中心)
*
* @memberof Viewer
*/
UpdateLockTarget()
{
let renderList = this.m_Render.renderLists.get(this.m_Scene, this.m_Camera.Camera);
let box = GetBoxArr(renderList.opaque.map(o => o.object));
if (box)
this.m_LookTarget = box.getCenter(new Vector3());
else
this.m_LookTarget = cZeroVec;
}
Rotate(mouseMove: Vector3)
{
this.m_Camera.Rotate(mouseMove, this.m_LookTarget);
this.m_bNeedUpdate = true;
}
Pan(mouseMove: Vector3)
{
this.m_Camera.Pan(mouseMove);
this.m_bNeedUpdate = true;
}
Zoom(scale: number, center?: Vector3)
{
this.m_Camera.Zoom(scale, center);
this.m_bNeedUpdate = true;
}
ZoomAll()
{
this.m_Camera.ZoomExtensBox3(GetBox(this.m_Scene, true));
this.m_bNeedUpdate = true;
}
ViewToTop()
{
this.m_Camera.LookAt(new Vector3(0, 0, -1));
this.m_bNeedUpdate = true;
}
ViewToFront()
{
this.m_Camera.LookAt(new Vector3(0, 1, 0));
this.m_bNeedUpdate = true;
}
ViewToSwiso()
{
this.m_Camera.LookAt(new Vector3(1, 1, -1));
this.m_bNeedUpdate = true;
}
oldMesh: Mesh;
SelectByPoint(x: number, y: number)
{
let mesh = PointPick(this, x, y);
if (this.oldMesh)
this.oldMesh.material = this._Settings.boardMaterial;
if (mesh && mesh.material !== ColorMaterial.GetBasicMaterial(1))
{
this.oldMesh = mesh;
mesh.material = this._Settings.selectMaterial;
if (this._Settings.selectByPointCallback)
{
this._Settings.selectByPointCallback(mesh.id);
}
}
this.m_bNeedUpdate = true;
}
SelectBlock(blockMeshMap: Map<number, number>, dataID: number)
{
if (blockMeshMap.has(dataID))
{
let meshId = blockMeshMap.get(dataID);
if (this.oldMesh)
this.oldMesh.material = this._Settings.boardMaterial;
this.m_Scene.children.forEach(obj =>
{
if (obj instanceof Mesh)
{
if (obj.id == meshId)
{
this.oldMesh = obj;
obj.material = this._Settings.selectMaterial;
this.m_bNeedUpdate = true;
}
}
});
}
}
}
}

View File

@@ -1,25 +1,22 @@
import * as THREE from 'three';
import { CylinderGeometry, Geometry, LineSegments, Mesh, Shape, Vector2 } from 'three';
import { ColorMaterial } from './ColorPalette';
import { EdgesGeometry, Geometry, LineSegments, MeshBasicMaterial, Shape, Vector2 } from 'three';
import { polar } from './GeUtils';
import { boardMaterial, edgeMaterial } from './Material';
import { RotateUVs } from './RotateUV';
import { ThreeBSP } from './ThreeCSG';
import { edgeMaterial } from './Material';
import { SimpleBoard } from './SimpleBoard';
//解析二维圆弧类.
export class Arc2d
{
m_StartAn: number;
m_EndAn: number;
m_StartPoint: THREE.Vector2;
m_EndPoint: THREE.Vector2;
m_Center: THREE.Vector2;
m_StartPoint: Vector2;
m_EndPoint: Vector2;
m_Center: Vector2;
m_Radius: number;
constructor(p1: THREE.Vector2, p2: THREE.Vector2, bul: number)
constructor(p1: Vector2, p2: Vector2, bul: number)
{
this.m_StartPoint = p1.clone();
this.m_EndPoint = p2.clone();
let vec: THREE.Vector2 = p2.clone().sub(p1);
let vec: Vector2 = p2.clone().sub(p1);
let len = vec.length();
let an = vec.angle();
this.m_Radius = len / Math.sin(2 * Math.atan(bul)) / 2;
@@ -44,7 +41,7 @@ export class Arc2d
}
}
//创建轮廓 通过点表和凸度
//创建轮廓 通过点表和凸度
export function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Shape
{
let shape = shapeOut || new Shape();
@@ -57,7 +54,7 @@ export function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Sh
let nextPt = pts[i + 1];
if (buls[i] == 0)
{
shape.lineTo(nextPt.x, nextPt.y)
shape.lineTo(nextPt.x, nextPt.y);
}
else
{
@@ -72,131 +69,13 @@ export function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Sh
}
return shape;
}
export function getVec(data: object): THREE.Vector3
{
return new THREE.Vector3(data["x"], data["y"], data["z"]);
}
//创建板件 暂时这么写
export function createBoard(boardData: object)
{
let pts: THREE.Vector2[] = [];
let buls: number[] = [];
let boardPts = boardData["Pts"];
let boardBuls = boardData["Buls"];
let boardHeight = boardData["H"];
let boardMat = new THREE.Matrix4();
let matInv: THREE.Matrix4 = new THREE.Matrix4();
//InitBoardMat
let xD = getVec(boardData["XVec"]);
let yD = getVec(boardData["YVec"]);
let ZD = getVec(boardData["ZVec"]);
let pBase = getVec(boardData["BasePoint"]);
boardMat.makeBasis(xD, yD, ZD);
boardMat.setPosition(pBase);
matInv.getInverse(boardMat, true);
if (boardPts && boardPts.length !== 0)
for (let i = 0; i < boardPts.length; i++)
{
let pt = getVec(boardPts[i]);
if (boardPts[i].z !== undefined)
pt.applyMatrix4(matInv);
pts.push(new THREE.Vector2(pt.x, pt.y));
buls.push(boardBuls[i]);
}
else
{
let length = boardData["L"];
let width = boardData["W"];
let height = boardData["H"];
pts.push(new Vector2(0, 0),
new Vector2(width, 0),
new Vector2(width, length),
new Vector2(0, length),
new Vector2(0, 0)
);
buls.push(0, 0, 0, 0, 0);
}
let sp = createPath(pts, buls);
let extrudeSettings = {
steps: 1,
bevelEnabled: false,
amount: boardHeight
};
let ext = new THREE.ExtrudeGeometry(sp, extrudeSettings) as Geometry;
ext.computeBoundingSphere();
ext.computeBoundingBox();
ext.translate(0, 0, -boardHeight)
ext.applyMatrix(boardMat);
//外边.
let edges: (LineSegments | Mesh)[] = [createEdge(ext)];
//差集
if (checkObjectArray(boardData, "SubBoardLocal")
|| checkObjectArray(boardData, "Drillings"))
{
let thisCsg = new ThreeBSP(ext);
if (boardData["SubBoardLocal"])
{
let subBoardList = boardData["SubBoardLocal"].map(d => createBoard(d));
for (let br of subBoardList)
{
edges.push(...br.edges);
let subCsg = new ThreeBSP(br.mesh);
thisCsg = thisCsg.subtract(subCsg);
}
}
if (boardData["Drillings"])
{
let dris = boardData["Drillings"];
for (let dri of dris)
{
let geo = new CylinderGeometry(dri.r, dri.r, dri.h, 8);
geo.rotateX(Math.PI * 0.5);
if (dri.f === 0) //0正
geo.translate(dri.x, dri.y, -dri.h * 0.5);
else //1反
geo.translate(dri.x, dri.y, dri.h * 0.5 - boardData["H"]);
geo.applyMatrix(boardMat);
let mesh = new Mesh(geo, ColorMaterial.GetBasicMaterial(1));
edges.push(mesh);
// let edge = createEdge(geo);
// edge.material = new LineBasicMaterial({ color: new Color(1, 0, 0) });
// edges.push(edge);
// let subCsg = new ThreeBSP(geo);
// thisCsg = thisCsg.subtract(subCsg);
}
}
ext = thisCsg.toGeometry();
}
if (boardData["BoardName"] === "地脚线")
RotateUVs(ext);
let mesh = new THREE.Mesh(ext, boardMaterial);
mesh.userData = ZD;
edges.forEach(e => e.userData = ZD);
return { mesh, edges };
}
function checkObjectArray(obj: any, key: string)
{
return obj[key] && obj[key].length > 0;
}
export function createTemplateBoard(brDataList: any[])
export function createTemplateBoard(brDataList: any[], material: MeshBasicMaterial)
{
let meshs = [];
let edgesa = [];
@@ -207,14 +86,15 @@ export function createTemplateBoard(brDataList: any[])
};
for (let d of brDataList)
{
let { mesh, edges } = createBoard(d);
let board = new SimpleBoard(d);
let { mesh, edges } = board.createBoard(material);
meshs.push(mesh);
edgesa.push(...edges);
if (d['DataID'])
if (board.DataID)
{
relations.blockMeshMap.set(d['DataID'], mesh.id);
relations.meshBlockMap.set(mesh.id, d['DataID']);
relations.blockMeshMap.set(board.DataID, mesh.id);
relations.meshBlockMap.set(mesh.id, board.DataID);
}
}
return { meshs, edgesa, relations };
@@ -222,6 +102,6 @@ export function createTemplateBoard(brDataList: any[])
export function createEdge(geo: Geometry): LineSegments
{
let edge = new THREE.EdgesGeometry(geo, 1);
let edge = new EdgesGeometry(geo, 1);
return new LineSegments(edge, edgeMaterial);
}

View File

@@ -1,550 +0,0 @@
export var data =
[
{
"L": 100.0,
"W": 800.0,
"H": 18.0,
"BasePoint": {
"x": 2076.407626150509,
"y": 1942.2104819571228,
"z": 1882.0
},
"XVec": {
"x": 1.0,
"y": 4.930380657631324e-32,
"z": -2.220446049250313e-16
},
"YVec": {
"x": 2.220446049250313e-16,
"y": 2.220446049250313e-16,
"z": 1.0
},
"ZVec": {
"x": 9.860761315262648e-32,
"y": -1.0,
"z": 2.220446049250313e-16
},
"Pts": [
{
"x": 2076.407626150509,
"y": 1942.2104819571228,
"z": 1882.0
},
{
"x": 2876.407626150509,
"y": 1942.2104819571228,
"z": 1881.9999999999998
},
{
"x": 2876.407626150509,
"y": 1942.2104819571228,
"z": 1981.9999999999998
},
{
"x": 2076.407626150509,
"y": 1942.2104819571228,
"z": 1982.0
},
{
"x": 2076.407626150509,
"y": 1942.2104819571228,
"z": 1882.0
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 800.0,
"W": 100.00000000000068,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2876.407626150509,
"y": 1960.2104819571226,
"z": 1900.0000000000005
},
"XVec": {
"x": 4.440892098500626e-16,
"y": 1.0,
"z": 2.2204460492503124e-16
},
"YVec": {
"x": -1.0,
"y": 4.440892098500626e-16,
"z": 2.220446049250314e-16
},
"ZVec": {
"x": 2.220446049250313e-16,
"y": -2.220446049250313e-16,
"z": 1.0
},
"Handle": "293",
"CabName": "1.标准柜上梁1",
"BoardName": "",
"Grain": 0,
"Pts": [
{
"x": 2876.407626150509,
"y": 1960.2104819571228,
"z": 1900.0000000000005
},
{
"x": 2876.407626150509,
"y": 2060.210481957123,
"z": 1900.0000000000005
},
{
"x": 2076.407626150509,
"y": 2060.210481957123,
"z": 1900.0000000000005
},
{
"x": 2076.407626150509,
"y": 1960.210481957123,
"z": 1900.0000000000005
},
{
"x": 2876.407626150509,
"y": 1960.2104819571228,
"z": 1900.0000000000005
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 1899.9999999999998,
"W": 800.0,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2076.407626150509,
"y": 2060.2104819571225,
"z": -1.816324868286756e-13
},
"XVec": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"YVec": {
"x": 0.0,
"y": 4.440892098500626e-16,
"z": 1.0
},
"ZVec": {
"x": 0.0,
"y": -1.0,
"z": 4.440892098500626e-16
},
"Handle": "291",
"CabName": "1.标准柜上梁1",
"BoardName": "背板",
"Grain": 0,
"Pts": [
{
"x": 2076.407626150509,
"y": 2060.2104819571225,
"z": -1.021405182655144e-13
},
{
"x": 2876.407626150509,
"y": 2060.2104819571225,
"z": -1.816324868286756e-13
},
{
"x": 2876.407626150509,
"y": 2060.210481957123,
"z": 1899.9999999999996
},
{
"x": 2076.407626150509,
"y": 2060.210481957123,
"z": 1899.9999999999998
},
{
"x": 2076.407626150509,
"y": 2060.2104819571225,
"z": -1.021405182655144e-13
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 800.0,
"W": 482.0000000000002,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2876.407626150509,
"y": 1578.210481957122,
"z": 97.99999999999999
},
"XVec": {
"x": 4.440892098500626e-16,
"y": 1.0,
"z": 0.0
},
"YVec": {
"x": -1.0,
"y": 4.440892098500626e-16,
"z": 0.0
},
"ZVec": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"Handle": "290",
"CabName": "1.标准柜上梁1",
"BoardName": "底板",
"Grain": 0,
"Pts": [
{
"x": 2876.407626150509,
"y": 1578.210481957122,
"z": 97.99999999999999
},
{
"x": 2876.407626150509,
"y": 2060.2104819571225,
"z": 97.99999999999999
},
{
"x": 2076.407626150509,
"y": 2060.2104819571225,
"z": 97.99999999999999
},
{
"x": 2076.407626150509,
"y": 1578.2104819571226,
"z": 97.99999999999999
},
{
"x": 2876.407626150509,
"y": 1578.210481957122,
"z": 97.99999999999999
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 80.0,
"W": 800.0,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2076.407626150509,
"y": 1578.2104819571223,
"z": 0.0
},
"XVec": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"YVec": {
"x": 0.0,
"y": 4.440892098500626e-16,
"z": 1.0
},
"ZVec": {
"x": 0.0,
"y": -1.0,
"z": 4.440892098500626e-16
},
"Handle": "28E",
"CabName": "1.标准柜上梁1",
"BoardName": "地脚线",
"Grain": 1,
"Pts": [
{
"x": 2076.407626150509,
"y": 1578.2104819571223,
"z": 0.0
},
{
"x": 2876.407626150509,
"y": 1578.2104819571223,
"z": 0.0
},
{
"x": 2876.407626150509,
"y": 1578.2104819571223,
"z": 80.0
},
{
"x": 2076.407626150509,
"y": 1578.2104819571223,
"z": 80.0
},
{
"x": 2076.407626150509,
"y": 1578.2104819571223,
"z": 0.0
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 800.0,
"W": 482.0,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2876.4076261505085,
"y": 1478.210481957122,
"z": 1999.9999999999996
},
"XVec": {
"x": 4.440892098500626e-16,
"y": 1.0,
"z": 0.0
},
"YVec": {
"x": -1.0,
"y": 4.440892098500626e-16,
"z": 0.0
},
"ZVec": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"Handle": "28C",
"CabName": "1.标准柜上梁1",
"BoardName": "顶板",
"Grain": 0,
"Pts": [
{
"x": 2076.407626150509,
"y": 1960.2104819571223,
"z": 1999.9999999999996
},
{
"x": 2076.407626150509,
"y": 1478.2104819571226,
"z": 1999.9999999999996
},
{
"x": 2876.407626150509,
"y": 1478.210481957122,
"z": 1999.9999999999996
},
{
"x": 2876.4076261505085,
"y": 1960.210481957122,
"z": 1999.9999999999996
},
{
"x": 2076.407626150509,
"y": 1960.2104819571223,
"z": 1999.9999999999996
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 1999.9999999999996,
"W": 600.0,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2894.4076261505094,
"y": 1478.2104819571223,
"z": -2.2737367544323197e-13
},
"XVec": {
"x": 4.930380657631324e-32,
"y": 1.0,
"z": -2.220446049250313e-16
},
"YVec": {
"x": -2.220446049250313e-16,
"y": 2.220446049250313e-16,
"z": 1.0
},
"ZVec": {
"x": 1.0,
"y": 0.0,
"z": 2.220446049250313e-16
},
"Handle": "28B",
"CabName": "1.标准柜上梁1",
"BoardName": "右侧板",
"Grain": 0,
"Pts": [
{
"x": 2894.407626150509,
"y": 1960.2104819571228,
"z": 1899.9999999999989
},
{
"x": 2894.407626150509,
"y": 1960.2104819571228,
"z": 1999.9999999999994
},
{
"x": 2894.407626150509,
"y": 1478.2104819571228,
"z": 1999.9999999999994
},
{
"x": 2894.4076261505094,
"y": 1478.2104819571223,
"z": -1.816324868286755e-13
},
{
"x": 2894.4076261505094,
"y": 2078.2104819571225,
"z": -6.274980535181384e-13
},
{
"x": 2894.407626150509,
"y": 2078.2104819571229,
"z": 1899.9999999999973
},
{
"x": 2894.407626150509,
"y": 1960.2104819571228,
"z": 1899.9999999999989
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
},
{
"L": 1999.9999999999996,
"W": 600.0,
"H": 18.0,
"MaterialId": "EE",
"BasePoint": {
"x": 2076.4076261505094,
"y": 1478.2104819571223,
"z": 1.0097419586828951e-28
},
"XVec": {
"x": 4.930380657631324e-32,
"y": 1.0,
"z": -2.220446049250313e-16
},
"YVec": {
"x": -2.220446049250313e-16,
"y": 2.220446049250313e-16,
"z": 1.0
},
"ZVec": {
"x": 1.0,
"y": 0.0,
"z": 2.220446049250313e-16
},
"Handle": "288",
"CabName": "1.标准柜上梁1",
"BoardName": "左侧板",
"Grain": 0,
"Pts": [
{
"x": 2076.407626150509,
"y": 1960.2104819571228,
"z": 1899.999999999999
},
{
"x": 2076.407626150509,
"y": 1960.2104819571228,
"z": 1999.9999999999996
},
{
"x": 2076.407626150509,
"y": 1478.2104819571228,
"z": 1999.9999999999996
},
{
"x": 2076.4076261505094,
"y": 1478.2104819571223,
"z": 1.0097419586828951e-28
},
{
"x": 2076.4076261505094,
"y": 2078.2104819571225,
"z": -4.4586556668946279e-13
},
{
"x": 2076.407626150509,
"y": 2078.2104819571229,
"z": 1899.9999999999978
},
{
"x": 2076.407626150509,
"y": 1960.2104819571228,
"z": 1899.999999999999
}
],
"Buls": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"SubBoardLocal": [],
"SubBoardAssoc": []
}
]

1
src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@@ -1,24 +1,33 @@
{
"compileOnSave": true,
"compilerOptions": {
"sourceMap": true,
"declaration": true,
"outDir": "./dist",
"target": "es5",
"lib": [
"esnext",
"dom"
],
"types": [
"node",
"webpack-env",
"webpack-dev-server"
],
"module": "commonjs",
"sourceMap": true,
"module": "ESNext",
"target": "ES2020",
"noLib": false,
"skipLibCheck": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"verbatimModuleSyntax":true,
/* Bundler mode */
"moduleResolution": "bundler",
"esModuleInterop": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
/* Linting */
// "strict": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
"jsx": "react",
"experimentalDecorators": true
},
"include": [
"./src/**/*",
// "./config/**/*"
"./config/**/*"
]
}

View File

@@ -96,7 +96,7 @@ downloadTypes({
urlPath: "https://gitee.com/BearCAD/DefinitelyType2/raw/master/three/",
files: [
// "index.d.ts",
"three-core.d.ts",
// "three-core.d.ts",
// "three-outlinepass.d.ts",
// "three-smaapass.d.ts"
]

7
utils/rmtype.ts Normal file
View File

@@ -0,0 +1,7 @@
import fs from "fs";
fs.rmdir(".\\node_modules\\@types\\webpack-merge\\node_modules\\webpack", { recursive: true }, (err) =>
{
console.log("删除webpack目录");
if (err) console.log(err);
});

258
yarn.lock Normal file
View File

@@ -0,0 +1,258 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@esbuild/android-arm64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.18.19.tgz#8735b552b8e0b9a943460d37fbc976b9d9cd4b4e"
integrity sha512-4+jkUFQxZkQfQOOxfGVZB38YUWHMJX2ihZwF+2nh8m7bHdWXpixiurgGRN3c/KMSwlltbYI0/i929jwBRMFzbA==
"@esbuild/android-arm@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.18.19.tgz#efd1f33583a893c0cc57f25b1d081af8cdc6bfd9"
integrity sha512-1uOoDurJYh5MNqPqpj3l/TQCI1V25BXgChEldCB7D6iryBYqYKrbZIhYO5AI9fulf66sM8UJpc3UcCly2Tv28w==
"@esbuild/android-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.18.19.tgz#d9f35722701a97a2ef69c7a84f1ee2aef2a306a7"
integrity sha512-ae5sHYiP/Ogj2YNrLZbWkBmyHIDOhPgpkGvFnke7XFGQldBDWvc/AyYwSLpNuKw9UNkgnLlB/jPpnBmlF3G9Bg==
"@esbuild/darwin-arm64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.19.tgz#8cb81b971ee5231acc7de07225f6e18562c359e4"
integrity sha512-HIpQvNQWFYROmWDANMRL+jZvvTQGOiTuwWBIuAsMaQrnStedM+nEKJBzKQ6bfT9RFKH2wZ+ej+DY7+9xHBTFPg==
"@esbuild/darwin-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.18.19.tgz#81024ab64232dd323f03796d449f018b59f04ca9"
integrity sha512-m6JdvXJQt0thNLIcWOeG079h2ivhYH4B5sVCgqb/B29zTcFd7EE8/J1nIUHhdtwGeItdUeqKaqqb4towwxvglQ==
"@esbuild/freebsd-arm64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.19.tgz#9fa91e3b08d10c0adfa71b37372a7627b26e9686"
integrity sha512-G0p4EFMPZhGn/xVNspUyMQbORH3nlKTV0bFNHPIwLraBuAkTeMyxNviTe0ZXUbIXQrR1lrwniFjNFU4s+x7veQ==
"@esbuild/freebsd-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.19.tgz#ef6f5a85c1bb029fb0076da5b223e50b353e615c"
integrity sha512-hBxgRlG42+W+j/1/cvlnSa+3+OBKeDCyO7OG2ICya1YJaSCYfSpuG30KfOnQHI7Ytgu4bRqCgrYXxQEzy0zM5Q==
"@esbuild/linux-arm64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.18.19.tgz#0cef913dcdc1efb1bb04406a8e5f5668b721d89e"
integrity sha512-X8g33tczY0GsJq3lhyBrjnFtaKjWVpp1gMq5IlF9BQJ3TUfSK74nQnz9mRIEejmcV+OIYn6bkOJeUaU1Knrljg==
"@esbuild/linux-arm@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.18.19.tgz#39ea874c8e5177b83903bec1883a43f3c163627a"
integrity sha512-qtWyoQskfJlb9MD45mvzCEKeO4uCnDZ7lPFeNqbfaaJHqBiH9qA5Vu2EuckqYZuFMJWy1l4dxTf9NOulCVfUjg==
"@esbuild/linux-ia32@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.18.19.tgz#283cd3c3d8380e8fab90583fa86ca1fcc9b9ec57"
integrity sha512-SAkRWJgb+KN+gOhmbiE6/wu23D6HRcGQi15cB13IVtBZZgXxygTV5GJlUAKLQ5Gcx0gtlmt+XIxEmSqA6sZTOw==
"@esbuild/linux-loong64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.18.19.tgz#1c69d7928a55b26326398d31d2ac9c82d2297f1b"
integrity sha512-YLAslaO8NsB9UOxBchos82AOMRDbIAWChwDKfjlGrHSzS3v1kxce7dGlSTsrb0PJwo1KYccypN3VNjQVLtz7LA==
"@esbuild/linux-mips64el@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.19.tgz#b25b352e7645885fa1d01182116c506a78fe4733"
integrity sha512-vSYFtlYds/oTI8aflEP65xo3MXChMwBOG1eWPGGKs/ev9zkTeXVvciU+nifq8J1JYMz+eQ4J9JDN0O2RKF8+1Q==
"@esbuild/linux-ppc64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.19.tgz#568b5a051f47af732c4314e697bb559a14b3d811"
integrity sha512-tgG41lRVwlzqO9tv9l7aXYVw35BxKXLtPam1qALScwSqPivI8hjkZLNH0deaaSCYCFT9cBIdB+hUjWFlFFLL9A==
"@esbuild/linux-riscv64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.19.tgz#020729b47ca63321667297d1610bab81cd08a65c"
integrity sha512-EgBZFLoN1S5RuB4cCJI31pBPsjE1nZ+3+fHRjguq9Ibrzo29bOLSBcH1KZJvRNh5qtd+fcYIGiIUia8Jw5r1lQ==
"@esbuild/linux-s390x@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.18.19.tgz#ed5cca8dac130d2f736914f9efad5fa15c238c20"
integrity sha512-q1V1rtHRojAzjSigZEqrcLkpfh5K09ShCoIsdTakozVBnM5rgV58PLFticqDp5UJ9uE0HScov9QNbbl8HBo6QQ==
"@esbuild/linux-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.18.19.tgz#f8023a38ae02b46c60a134ccbc7ae377b3bec66f"
integrity sha512-D0IiYjpZRXxGZLQfsydeAD7ZWqdGyFLBj5f2UshJpy09WPs3qizDCsEr8zyzcym6Woj/UI9ZzMIXwvoXVtyt0A==
"@esbuild/netbsd-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.19.tgz#8fd667c535db0a5b346afa2d74ff1fb53477427f"
integrity sha512-3tt3SOS8L3D54R8oER41UdDshlBIAjYhdWRPiZCTZ1E41+shIZBpTjaW5UaN/jD1ENE/Ok5lkeqhoNMbxstyxw==
"@esbuild/openbsd-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.19.tgz#354d5b54a6bffa381cb513e878880192e07004be"
integrity sha512-MxbhcuAYQPlfln1EMc4T26OUoeg/YQc6wNoEV8xvktDKZhLtBxjkoeESSo9BbPaGKhAPzusXYj5n8n5A8iZSrA==
"@esbuild/sunos-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.18.19.tgz#e2de98bd961e04f76f6acf5970263efc7051def5"
integrity sha512-m0/UOq1wj25JpWqOJxoWBRM9VWc3c32xiNzd+ERlYstUZ6uwx5SZsQUtkiFHaYmcaoj+f6+Tfcl7atuAz3idwQ==
"@esbuild/win32-arm64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.18.19.tgz#9dca55f0dcbbdb50bf36353d1114f5f71c269275"
integrity sha512-L4vb6pcoB1cEcXUHU6EPnUhUc4+/tcz4OqlXTWPcSQWxegfmcOprhmIleKKwmMNQVc4wrx/+jB7tGkjjDmiupg==
"@esbuild/win32-ia32@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.18.19.tgz#db6ea4467e87e6d3fc2177dea35e81f26f7a061d"
integrity sha512-rQng7LXSKdrDlNDb7/v0fujob6X0GAazoK/IPd9C3oShr642ri8uIBkgM37/l8B3Rd5sBQcqUXoDdEy75XC/jg==
"@esbuild/win32-x64@0.18.19":
version "0.18.19"
resolved "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.18.19.tgz#6105755d7097e0d7e22f893c3e62f143d8137bd0"
integrity sha512-z69jhyG20Gq4QL5JKPLqUT+eREuqnDAFItLbza4JCmpvUnIlY73YNjd5djlO7kBiiZnvTnJuAbOjIoZIOa1GjA==
"@jscad/modeling@^2.11.0":
version "2.12.0"
resolved "https://registry.npmmirror.com/@jscad/modeling/-/modeling-2.12.0.tgz#66cdc08316a5c8a922e9f29f8339bf4d64a454f7"
integrity sha512-TeAGX4QPEX+sBfeTMa04HwGL+lpdirqXt9JJKYi0r+UGgcwlsCtOs7dS23WGEAGu5QZgGNF4NJsr9DRPIWoaDQ==
"@types/node@^13.13.52":
version "13.13.52"
resolved "https://registry.npmmirror.com/@types/node/-/node-13.13.52.tgz#03c13be70b9031baaed79481c0c0cfb0045e53f7"
integrity sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==
"@types/three@^0.103.2":
version "0.103.2"
resolved "https://registry.npmmirror.com/@types/three/-/three-0.103.2.tgz#f7d49130001c551941a0ded757def810579aafc4"
integrity sha512-zhtf0Qs5wLJpIn1+VWCpzSgpKayj/GSWZ6woiuz09FW59KEDeLpnBkYz6lbblVpRmGdlnG8nd0unaASshOvcXw==
dependencies:
three "*"
esbuild@^0.18.10:
version "0.18.19"
resolved "https://registry.npmmirror.com/esbuild/-/esbuild-0.18.19.tgz#c763ccfd50b7b1322d13232cd91f2bd36ffde56b"
integrity sha512-ra3CaIKCzJp5bU5BDfrCc0FRqKj71fQi+gbld0aj6lN0ifuX2fWJYPgLVLGwPfA+ruKna+OWwOvf/yHj6n+i0g==
optionalDependencies:
"@esbuild/android-arm" "0.18.19"
"@esbuild/android-arm64" "0.18.19"
"@esbuild/android-x64" "0.18.19"
"@esbuild/darwin-arm64" "0.18.19"
"@esbuild/darwin-x64" "0.18.19"
"@esbuild/freebsd-arm64" "0.18.19"
"@esbuild/freebsd-x64" "0.18.19"
"@esbuild/linux-arm" "0.18.19"
"@esbuild/linux-arm64" "0.18.19"
"@esbuild/linux-ia32" "0.18.19"
"@esbuild/linux-loong64" "0.18.19"
"@esbuild/linux-mips64el" "0.18.19"
"@esbuild/linux-ppc64" "0.18.19"
"@esbuild/linux-riscv64" "0.18.19"
"@esbuild/linux-s390x" "0.18.19"
"@esbuild/linux-x64" "0.18.19"
"@esbuild/netbsd-x64" "0.18.19"
"@esbuild/openbsd-x64" "0.18.19"
"@esbuild/sunos-x64" "0.18.19"
"@esbuild/win32-arm64" "0.18.19"
"@esbuild/win32-ia32" "0.18.19"
"@esbuild/win32-x64" "0.18.19"
flatbush@^3.3.0:
version "3.3.0"
resolved "https://registry.npmmirror.com/flatbush/-/flatbush-3.3.0.tgz#b68c9149107ae86d2bce6373491f404ba4f4534e"
integrity sha512-F3EzQvKpdmXUbFwWxLKBpytOFEGYQMCTBLuqZ4GEajFOEAvnOIBiyxW3OFSZXIOtpCS8teN6bFEpNZtnVXuDQA==
dependencies:
flatqueue "^1.2.0"
flatqueue@^1.2.0:
version "1.2.1"
resolved "https://registry.npmmirror.com/flatqueue/-/flatqueue-1.2.1.tgz#82f501758fc5925742fbeb478637230456157ef2"
integrity sha512-X86TpWS1rGuY7m382HuA9vngLeDuWA9lJvhEG+GfgKMV5onSvx5a71cl7GMbXzhWtlN9dGfqOBrpfqeOtUfGYQ==
fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
js-angusj-clipper@^1.2.1:
version "1.3.1"
resolved "https://registry.npmmirror.com/js-angusj-clipper/-/js-angusj-clipper-1.3.1.tgz#433ad90228a2ade6df1a3befcf5892217bfd0832"
integrity sha512-/qru4QXxN/gBbQjL4WaFl296YSM8kh5XKpNuNqfZhJ4t4Hw3KeLc5ERj3XHAeLi6pBrqeh6o9PFZUpS3QThEEQ==
nanoid@^3.3.6:
version "3.3.6"
resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
picocolors@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
polylabel@^1.1.0:
version "1.1.0"
resolved "https://registry.npmmirror.com/polylabel/-/polylabel-1.1.0.tgz#9483e64fc7a12a49f43e07e7a06752214ed2a8e7"
integrity sha512-bxaGcA40sL3d6M4hH72Z4NdLqxpXRsCFk8AITYg6x1rn1Ei3izf00UMLklerBZTO49aPA3CYrIwVulx2Bce2pA==
dependencies:
tinyqueue "^2.0.3"
postcss@^8.4.26:
version "8.4.27"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.27.tgz#234d7e4b72e34ba5a92c29636734349e0d9c3057"
integrity sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==
dependencies:
nanoid "^3.3.6"
picocolors "^1.0.0"
source-map-js "^1.0.2"
rollup@^3.25.2:
version "3.27.2"
resolved "https://registry.npmmirror.com/rollup/-/rollup-3.27.2.tgz#59adc973504408289be89e5978e938ce852c9520"
integrity sha512-YGwmHf7h2oUHkVBT248x0yt6vZkYQ3/rvE5iQuVBh3WO8GcJ6BNeOkpoX1yMHIiBm18EMLjBPIoUDkhgnyxGOQ==
optionalDependencies:
fsevents "~2.3.2"
source-map-js@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
three@*:
version "0.137.5"
resolved "https://registry.npmmirror.com/three/-/three-0.137.5.tgz#a1e34bedd0412f2d8797112973dfadac78022ce6"
integrity sha512-rTyr+HDFxjnN8+N/guZjDgfVxgHptZQpf6xfL/Mo7a5JYIFwK6tAq3bzxYYB4Ae0RosDZlDuP+X5aXDXz+XnHQ==
"three@npm:three-cf@0.122.5":
version "0.122.5"
resolved "https://registry.npmmirror.com/three-cf/-/three-cf-0.122.5.tgz#d5b5fdbce59aac870983b7dbf2b6f0b8efd008cb"
integrity sha512-GBY8xE/f5AyDWiPqmCjU0xgR052C5IbfTzFfh/lIsIHTt5G9a5QtPzspimlW4Y6jUmyWlrqbxe/ycnY0bGhB/A==
tinyqueue@^2.0.3:
version "2.0.3"
resolved "https://registry.npmmirror.com/tinyqueue/-/tinyqueue-2.0.3.tgz#64d8492ebf39e7801d7bd34062e29b45b2035f08"
integrity sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==
typescript@^5.0.2:
version "5.1.6"
resolved "https://registry.npmmirror.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"
integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==
vite@^4.4.5:
version "4.4.8"
resolved "https://registry.npmmirror.com/vite/-/vite-4.4.8.tgz#31e4a438f8748695c68bd57ffd262ba93540fdf7"
integrity sha512-LONawOUUjxQridNWGQlNizfKH89qPigK36XhMI7COMGztz8KNY0JHim7/xDd71CZwGT4HtSRgI7Hy+RlhG0Gvg==
dependencies:
esbuild "^0.18.10"
postcss "^8.4.26"
rollup "^3.25.2"
optionalDependencies:
fsevents "~2.3.2"
"webcad_ue4_api@http://gitea.cf/cx/webcad-ue4-api/archive/3.2.4.tar.gz":
version "0.3.12"
resolved "http://gitea.cf/cx/webcad-ue4-api/archive/3.2.4.tar.gz#c5901b2d85434f03f8128aa230fd3fe82fe63ab6"
xaop@^2.0.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/xaop/-/xaop-2.1.0.tgz#1d7108c6e2f6bd459dc4f0f64296f0be3cc0f53d"
integrity sha512-/ovWCaQIet3a3VnoVeN1/pNPqCrS/JifF28N7crPhq8BXEWx4Da2o+LYCCxnTWGAjGp5+2W2hd0HIpVESounSQ==