Compare commits
15 Commits
1.2.2
...
add_custom
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f60054ca19 | ||
![]() |
a55986761e | ||
![]() |
e5b944539e | ||
![]() |
27dd548309 | ||
![]() |
965ae43070 | ||
![]() |
36541f1617 | ||
![]() |
fba276362c | ||
![]() |
66dbe5869e | ||
![]() |
e70354267b | ||
![]() |
eb736bce84 | ||
![]() |
40258eeaf4 | ||
![]() |
623fa9ac9a | ||
![]() |
c586096fe0 | ||
![]() |
0aa70fdb14 | ||
![]() |
93ac737777 |
31
.vscode/settings.json
vendored
31
.vscode/settings.json
vendored
@@ -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}"
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
|
@@ -1,3 +1,6 @@
|
||||
# 显示板件的控件
|
||||
|
||||
使用例子请参照项目:[CADViewSample](http://git.cf/cx/CADViewSample)
|
||||
|
||||
|
||||
删除"@types/webpack-merge" 下的 node_modules/webpack 定义 坑爹导致项目跑不起来
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
|
||||
import * as webpack from 'webpack';
|
||||
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
|
||||
const TS_LOADER = [
|
||||
{ loader: 'cache-loader', options: { cacheDirectory: "node_modules/.cache_loader" } },
|
||||
@@ -22,20 +20,74 @@ const config: webpack.Configuration = {
|
||||
//模块加载器设置
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.worker\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{ loader: 'worker-loader', },
|
||||
...TS_LOADER
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: TS_LOADER,
|
||||
},
|
||||
{ test: /\.css$/, loader: ['style-loader', 'css-loader'] },
|
||||
{ test: /\.[(jpg)|(png)|(obj)|(json)]$/, loader: "url-loader" },
|
||||
{
|
||||
test: /\.[(png)|(obj)|(json)]$/,
|
||||
loader: "file-loader"
|
||||
},
|
||||
//样式加载 css
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader']
|
||||
},
|
||||
//样式加载 less
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: [
|
||||
{ loader: "style-loader" },
|
||||
{ loader: 'css-loader', options: { sourceMap: false } },
|
||||
{
|
||||
loader: "less-loader",
|
||||
options: {
|
||||
lessOptions: {
|
||||
strictMath: true,
|
||||
noIeCompat: true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
//字体加载 blueprint
|
||||
{
|
||||
test: /\.(ttf|eot|svg|FBX)$/,
|
||||
use: {
|
||||
loader: 'file-loader',
|
||||
options: { name: 'fonts/[contenthash].[ext]' }
|
||||
}
|
||||
},
|
||||
//字体加载 blueprint
|
||||
{
|
||||
test: /\.(woff|woff2|jpg|png)$/,
|
||||
use: {
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
name: 'fonts/[contenthash].[ext]',
|
||||
limit: 5000,
|
||||
mimetype: 'application/font-woff'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(glsl|vs|fs)$/,
|
||||
loader: 'shader-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new HardSourceWebpackPlugin(),
|
||||
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }),
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import path from 'path';
|
||||
import * as webpack from 'webpack';
|
||||
import * as merge from 'webpack-merge';
|
||||
import merge from 'webpack-merge';
|
||||
import common from './webpack.common';
|
||||
import * as path from 'path';
|
||||
|
||||
const config: webpack.Configuration = merge(
|
||||
common,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import HtmlWebPackPlugin from "html-webpack-plugin";
|
||||
import * as webpack from 'webpack';
|
||||
import * as merge from 'webpack-merge';
|
||||
import merge from 'webpack-merge';
|
||||
import common from './webpack.common';
|
||||
import * as HtmlWebPackPlugin from "html-webpack-plugin";
|
||||
|
||||
const config: webpack.Configuration = merge(
|
||||
common,
|
||||
@@ -11,12 +11,14 @@ const config: webpack.Configuration = merge(
|
||||
output: { pathinfo: false },
|
||||
devtool: "eval-source-map",
|
||||
devServer: {
|
||||
contentBase: "./dist/",
|
||||
// contentBase: "./dist/",
|
||||
static: false,
|
||||
port: 7776,
|
||||
host: "0.0.0.0",
|
||||
hot: true,
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NamedModulesPlugin(),//Hot
|
||||
// new webpack.NamedModulesPlugin(),//Hot
|
||||
new webpack.HotModuleReplacementPlugin(),//Hot
|
||||
new HtmlWebPackPlugin({
|
||||
title: "webCAD",
|
||||
|
158
package-lock.json
generated
158
package-lock.json
generated
@@ -113,6 +113,12 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.7",
|
||||
"resolved": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.7.tgz?cache=0&sync_timestamp=1613378919536&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.7.tgz",
|
||||
"integrity": "sha1-mKmTUWyFnrDVxMjwmDF6nqaNua0=",
|
||||
"dev": true
|
||||
},
|
||||
"@types/mime": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/@types/mime/download/@types/mime-2.0.1.tgz?cache=0&sync_timestamp=1588201894076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fmime%2Fdownload%2F%40types%2Fmime-2.0.1.tgz",
|
||||
@@ -1002,6 +1008,12 @@
|
||||
"integrity": "sha1-Uvq8xqYG0aADAoAmSO9o9jnaJow=",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-json": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/buffer-json/download/buffer-json-2.0.0.tgz",
|
||||
"integrity": "sha1-9z4TseQvGW/i/WfQAcfXEH7dfCM=",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-xor": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
|
||||
@@ -1068,6 +1080,152 @@
|
||||
"unset-value": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"cache-loader": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npm.taobao.org/cache-loader/download/cache-loader-4.1.0.tgz",
|
||||
"integrity": "sha1-mUjK41OuwKH8ser9ojAIFuyFOH4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-json": "^2.0.0",
|
||||
"find-cache-dir": "^3.0.0",
|
||||
"loader-utils": "^1.2.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"neo-async": "^2.6.1",
|
||||
"schema-utils": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz",
|
||||
"integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1608059984992&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=",
|
||||
"dev": true
|
||||
},
|
||||
"big.js": {
|
||||
"version": "5.2.2",
|
||||
"resolved": "https://registry.npm.taobao.org/big.js/download/big.js-5.2.2.tgz",
|
||||
"integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=",
|
||||
"dev": true
|
||||
},
|
||||
"emojis-list": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz",
|
||||
"integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang=",
|
||||
"dev": true
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz",
|
||||
"integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^3.0.2",
|
||||
"pkg-dir": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz?cache=0&sync_timestamp=1597169884679&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-4.1.0.tgz",
|
||||
"integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"json5": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npm.taobao.org/json5/download/json5-1.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-1.0.1.tgz",
|
||||
"integrity": "sha1-d5+wAYYE+oVOrL9iUhgNg1Q+Pb4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"loader-utils": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-1.4.0.tgz",
|
||||
"integrity": "sha1-xXm140yzSxp07cbB+za/o3HVphM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"big.js": "^5.2.2",
|
||||
"emojis-list": "^3.0.0",
|
||||
"json5": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-locate": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz",
|
||||
"integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-limit": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=",
|
||||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz?cache=0&sync_timestamp=1602859056682&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpkg-dir%2Fdownload%2Fpkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"schema-utils": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-2.7.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fschema-utils%2Fdownload%2Fschema-utils-2.7.1.tgz",
|
||||
"integrity": "sha1-HKTzLRskxZDCA7jnpQvw6kzTlNc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.5",
|
||||
"ajv": "^6.12.4",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz?cache=0&sync_timestamp=1606852064928&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-6.3.0.tgz",
|
||||
"integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"camel-case": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npm.taobao.org/camel-case/download/camel-case-4.1.1.tgz",
|
||||
|
40
package.json
40
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cadview",
|
||||
"version": "1.2.3",
|
||||
"version": "1.1.9",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"private": true,
|
||||
@@ -8,7 +8,8 @@
|
||||
"t": "tsc --noEmit -w",
|
||||
"build": "tsc",
|
||||
"umd": "webpack --config ./config/webpack.umd.ts",
|
||||
"dev": "webpack-dev-server --config ./config/webpack.view.ts"
|
||||
"dev": "webpack-dev-server --config ./config/webpack.view.ts",
|
||||
"rmtype": "ts-node ./utils/rmtype.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -18,29 +19,32 @@
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/hard-source-webpack-plugin": "^1.0.1",
|
||||
"@types/node": "^13.13.4",
|
||||
"@types/node": "^13.13.52",
|
||||
"@types/three": "^0.103.2",
|
||||
"@types/uglifyjs-webpack-plugin": "^1.1.0",
|
||||
"@types/webpack": "^4.41.12",
|
||||
"@types/webpack-dev-server": "^3.10.1",
|
||||
"@types/webpack-env": "^1.15.2",
|
||||
"@types/webpack-merge": "^4.1.5",
|
||||
"@types/webpack": "^4.41.32",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"cache-loader": "^4.1.0",
|
||||
"fork-ts-checker-webpack-plugin": "^4.1.3",
|
||||
"fork-ts-checker-webpack-plugin": "^4.1.6",
|
||||
"hard-source-webpack-plugin": "^0.13.1",
|
||||
"html-webpack-plugin": "^4.2.1",
|
||||
"ts-loader": "^7.0.2",
|
||||
"ts-node": "^8.9.1",
|
||||
"typescript": "^3.8.3",
|
||||
"html-webpack-plugin": "^4.5.2",
|
||||
"ts-loader": "^7.0.5",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "^4.5.5",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"webpack": "^4.43.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-dev-server": "^3.10.3",
|
||||
"webpack-merge": "^4.2.2"
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"three": "^0.120.1",
|
||||
"wolfy87-eventemitter": "^5.2.9"
|
||||
"@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"
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
185
src/SimpleBoard.ts
Normal file
185
src/SimpleBoard.ts
Normal 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;
|
||||
}
|
||||
}
|
18
src/Text.ts
18
src/Text.ts
@@ -1,6 +1,7 @@
|
||||
import { Font, FontLoader, Mesh, ShapeGeometry, Vector3, Shape } from "three";
|
||||
import { Font, FontLoader, Matrix4, Mesh, Shape, ShapeGeometry, Vector3 } from "three";
|
||||
import { ColorMaterial } from "./ColorPalette";
|
||||
import { MoveMatrix } from "./GeUtils";
|
||||
import { XAxis, XAxisN, YAxis, YAxisN, ZAxisN } from "./Utils";
|
||||
|
||||
class FontLoaderUtil
|
||||
{
|
||||
@@ -40,4 +41,19 @@ export class DbText extends Mesh
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
13
src/Utils.ts
13
src/Utils.ts
@@ -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);
|
||||
|
@@ -1,444 +1,197 @@
|
||||
[
|
||||
{
|
||||
"L": 4408.678960586129,
|
||||
"W": 4408.678960586129,
|
||||
"H": 18,
|
||||
"CabName": "主卧",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": -82.91743119266054,
|
||||
"y": 73.39449541284404,
|
||||
"z": 0
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 4408.678960586129,
|
||||
"y": 2204.3394802930643
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 2204.3394802930648
|
||||
},
|
||||
{
|
||||
"x": 4408.678960586129,
|
||||
"y": 2204.3394802930643
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
-0.9999999999999999,
|
||||
-0.9999999999999999,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [
|
||||
{
|
||||
"L": 633.2307692307686,
|
||||
"W": 633.2307692307686,
|
||||
"H": 5,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": -95.91743119266054,
|
||||
"y": 2910.9647449366785,
|
||||
"z": 1405.2625572161414
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 633.2307692307686,
|
||||
"y": 316.6153846153843
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 316.61538461538436
|
||||
},
|
||||
{
|
||||
"x": 633.2307692307686,
|
||||
"y": 316.6153846153843
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
-0.9999999999999999,
|
||||
-0.9999999999999999,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
},
|
||||
{
|
||||
"L": 557.8461538461524,
|
||||
"W": 557.8461538461524,
|
||||
"H": 5,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": -82.91743119266054,
|
||||
"y": 3016.50320647514,
|
||||
"z": 2257.1087110622957
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 557.8461538461524,
|
||||
"y": 278.9230769230762
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 278.9230769230763
|
||||
},
|
||||
{
|
||||
"x": 557.8461538461524,
|
||||
"y": 278.9230769230762
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
-0.9999999999999999,
|
||||
-0.9999999999999999,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
},
|
||||
{
|
||||
"L": 444.76923076923117,
|
||||
"W": 686,
|
||||
"H": 5,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": -95.91743119266054,
|
||||
"y": 1689.7339757059085,
|
||||
"z": 1556.0317879853721
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 686,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 686,
|
||||
"y": 444.76923076923117
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 444.76923076923117
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
},
|
||||
{
|
||||
"L": 625.6923076923076,
|
||||
"W": 1349.3846153846157,
|
||||
"H": 5,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": -82.91743119266054,
|
||||
"y": 1177.1185910905238,
|
||||
"z": 2626.493326446911
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 1349.3846153846157,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 1349.3846153846157,
|
||||
"y": 625.6923076923076
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 625.6923076923076
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
}
|
||||
],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
},
|
||||
{
|
||||
"L": 2000,
|
||||
"DataID": 3996018,
|
||||
"OrderNo": 20230727027642,
|
||||
"L": 800,
|
||||
"W": 600,
|
||||
"H": 18,
|
||||
"CabName": "主卧",
|
||||
"BoardName": "",
|
||||
"BoardName": "层板",
|
||||
"Grain": 0,
|
||||
"BoardType": 0,
|
||||
"CustomNumber": "",
|
||||
"BasePoint": {
|
||||
"x": 1099.0825688073396,
|
||||
"y": 73.39449541284404,
|
||||
"z": 0
|
||||
"x": 1877.02062480031,
|
||||
"y": -1.77635683940025e-13,
|
||||
"z": 823.651271182857
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"x": 2.22044604925031e-16,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": -1,
|
||||
"y": 2.22044604925031e-16,
|
||||
"z": 0
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 600,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 600,
|
||||
"y": 2000
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 2000
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [
|
||||
{
|
||||
"L": 144.00000000000023,
|
||||
"W": 170.42201834862385,
|
||||
"H": 5,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": 1099.0825688073396,
|
||||
"y": 288.2935779816515,
|
||||
"z": 1001.247706422018
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 170.42201834862385,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"x": 170.42201834862385,
|
||||
"y": 144.00000000000023
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 144.00000000000023
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Pts": [],
|
||||
"Buls": [],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
"SubBoardAssoc": [],
|
||||
"Drillings": [
|
||||
{
|
||||
"x": 50,
|
||||
"y": 766,
|
||||
"r": 7.5,
|
||||
"h": 13.5,
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"L": 189.0974955047293,
|
||||
"W": 189.0974955047293,
|
||||
"H": 18,
|
||||
"CabName": "",
|
||||
"BoardName": "",
|
||||
"BasePoint": {
|
||||
"x": 1099.0825688073396,
|
||||
"y": 234.6989586696538,
|
||||
"z": 1267.3595091283692
|
||||
},
|
||||
"XVec": {
|
||||
"x": 0,
|
||||
"y": 1,
|
||||
"z": 0
|
||||
},
|
||||
"YVec": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 1
|
||||
},
|
||||
"ZVec": {
|
||||
"x": 1,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Grain": 0,
|
||||
"Pts": [
|
||||
{
|
||||
"x": 189.0974955047293,
|
||||
"y": 94.54874775236476
|
||||
"x": 300,
|
||||
"y": 766,
|
||||
"r": 7.5,
|
||||
"h": 13.5,
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"x": -1.4210854715202004e-14,
|
||||
"y": 94.54874775236478
|
||||
"x": 550,
|
||||
"y": 766,
|
||||
"r": 7.5,
|
||||
"h": 13.5,
|
||||
"f": 0
|
||||
},
|
||||
{
|
||||
"x": 189.0974955047293,
|
||||
"y": 94.54874775236476
|
||||
}
|
||||
],
|
||||
"Buls": [
|
||||
-0.9999999999999999,
|
||||
-0.9999999999999999,
|
||||
0
|
||||
],
|
||||
"SubBoardLocal": [],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
}
|
||||
],
|
||||
"SubBoardAssoc": null,
|
||||
"Drillings": null
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@@ -1,22 +1,21 @@
|
||||
// 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";
|
||||
|
||||
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 +24,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];
|
||||
@@ -36,15 +45,16 @@ view.m_CameraCtrl.m_TouthTypeList = [CameraControlState.Pan, CameraControlState.
|
||||
btn.onclick = () =>
|
||||
{
|
||||
console.time();
|
||||
let data = require("./data.json");
|
||||
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);
|
||||
};
|
||||
|
@@ -1,11 +1,18 @@
|
||||
|
||||
import { Mesh, Raycaster, Scene, Vector3, WebGLRenderer, WebGLRendererParameters } from "three";
|
||||
import { Mesh, MeshBasicMaterial, Raycaster, Scene, Vector3, WebGLRenderer, WebGLRendererParameters } from "three";
|
||||
import { boardMaterial, CameraControls, PointPick, selectMaterial } from ".";
|
||||
import { CameraUpdate } from "./CameraUpdate";
|
||||
import { ColorMaterial } from "./ColorPalette";
|
||||
import { cZeroVec, GetBox, GetBoxArr } 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;
|
||||
@@ -20,13 +27,19 @@ export class Viewer
|
||||
|
||||
m_Scene: Scene = new Scene();
|
||||
|
||||
_Settings = new ViewerSettings();
|
||||
/**
|
||||
*
|
||||
* @param {HTMLElement} canvasContainer 可以传入一个div或者一个画布
|
||||
* @memberof Viewer
|
||||
*/
|
||||
constructor(canvasContainer: HTMLElement)
|
||||
constructor(canvasContainer: HTMLElement, setupAction: (settings: ViewerSettings) => void = null)
|
||||
{
|
||||
if (setupAction)
|
||||
{
|
||||
setupAction(this._Settings);
|
||||
}
|
||||
|
||||
this.m_DomEl = canvasContainer;
|
||||
this.initRender(canvasContainer);
|
||||
this.OnSize();
|
||||
@@ -193,11 +206,15 @@ export class Viewer
|
||||
{
|
||||
let mesh = PointPick(this, x, y);
|
||||
if (this.oldMesh)
|
||||
this.oldMesh.material = boardMaterial;
|
||||
this.oldMesh.material = this._Settings.boardMaterial;
|
||||
if (mesh && mesh.material !== ColorMaterial.GetBasicMaterial(1))
|
||||
{
|
||||
this.oldMesh = mesh;
|
||||
mesh.material = selectMaterial;
|
||||
mesh.material = this._Settings.selectMaterial;
|
||||
if (this._Settings.selectByPointCallback)
|
||||
{
|
||||
this._Settings.selectByPointCallback(mesh.id);
|
||||
}
|
||||
}
|
||||
this.m_bNeedUpdate = true;
|
||||
}
|
||||
@@ -207,7 +224,7 @@ export class Viewer
|
||||
{
|
||||
let meshId = blockMeshMap.get(dataID);
|
||||
if (this.oldMesh)
|
||||
this.oldMesh.material = boardMaterial;
|
||||
this.oldMesh.material = this._Settings.boardMaterial;
|
||||
this.m_Scene.children.forEach(obj =>
|
||||
{
|
||||
if (obj instanceof Mesh)
|
||||
@@ -215,7 +232,7 @@ export class Viewer
|
||||
if (obj.id == meshId)
|
||||
{
|
||||
this.oldMesh = obj;
|
||||
obj.material = selectMaterial;
|
||||
obj.material = this._Settings.selectMaterial;
|
||||
this.m_bNeedUpdate = true;
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,7 @@
|
||||
import { CylinderGeometry, Geometry, LineSegments, Mesh, Shape, Vector2, Vector3, Matrix4, ExtrudeGeometry, EdgesGeometry } from 'three';
|
||||
import { ColorMaterial } from './ColorPalette';
|
||||
import { equalv3, polar } from './GeUtils';
|
||||
import { boardMaterial, edgeMaterial } from './Material';
|
||||
import { RotateUVs } from './RotateUV';
|
||||
import { ThreeBSP } from './ThreeCSG';
|
||||
import { EdgesGeometry, Geometry, LineSegments, MeshBasicMaterial, Shape, Vector2 } from 'three';
|
||||
import { polar } from './GeUtils';
|
||||
import { edgeMaterial } from './Material';
|
||||
import { SimpleBoard } from './SimpleBoard';
|
||||
//解析二维圆弧类.
|
||||
export class Arc2d
|
||||
{
|
||||
@@ -56,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
|
||||
{
|
||||
@@ -71,137 +69,13 @@ export function createPath(pts: Vector2[], buls: number[], shapeOut?: Shape): Sh
|
||||
}
|
||||
return shape;
|
||||
}
|
||||
export function getVec(data: object): Vector3
|
||||
{
|
||||
return new Vector3(data["x"], data["y"], data["z"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//创建板件 暂时这么写
|
||||
export function createBoard(boardData: object)
|
||||
{
|
||||
let pts: Vector2[] = [];
|
||||
let buls: number[] = [];
|
||||
let boardPts = boardData["Pts"];
|
||||
let boardBuls = boardData["Buls"];
|
||||
|
||||
let boardHeight = boardData["H"];
|
||||
|
||||
let boardMat = new Matrix4();
|
||||
let matInv: Matrix4 = new 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);
|
||||
|
||||
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 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,
|
||||
depth: boardHeight
|
||||
};
|
||||
|
||||
let ext = new ExtrudeGeometry(sp, extrudeSettings) as Geometry;
|
||||
ext.computeBoundingSphere();
|
||||
ext.computeBoundingBox();
|
||||
ext.translate(0, 0, -boardHeight)
|
||||
ext.applyMatrix4(boardMat);
|
||||
|
||||
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)[] = [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.applyMatrix4(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 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 = [];
|
||||
@@ -212,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 };
|
||||
|
550
src/data.ts
550
src/data.ts
@@ -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,10 +1,13 @@
|
||||
{
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"target": "esnext",
|
||||
"sourceMap": true,
|
||||
"module": "commonjs",
|
||||
"target": "es2020",
|
||||
"noLib": false,
|
||||
"moduleResolution": "node",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
@@ -12,13 +15,13 @@
|
||||
"types": [
|
||||
"node",
|
||||
"webpack-env",
|
||||
"webpack-dev-server"
|
||||
"webpack-dev-server",
|
||||
],
|
||||
"module": "commonjs",
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*",
|
||||
// "./config/**/*"
|
||||
"./config/**/*"
|
||||
]
|
||||
}
|
||||
|
7
utils/rmtype.ts
Normal file
7
utils/rmtype.ts
Normal 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);
|
||||
});
|
Reference in New Issue
Block a user