Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2cd7f413da | ||
![]() |
aed2217f2e | ||
![]() |
98cd31e18c | ||
![]() |
f138585a5c | ||
![]() |
83207410ad | ||
![]() |
28f91d7904 | ||
![]() |
10cc259261 | ||
![]() |
cef0e8938b | ||
![]() |
3b032dfcad |
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
@@ -1,3 +1,16 @@
|
||||
// 将设置放入此文件中以覆盖默认值和用户设置。
|
||||
{
|
||||
"editor.formatOnSave": true
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||
//格式化设置
|
||||
"editor.tabSize": 4,
|
||||
"editor.formatOnPaste": true,
|
||||
"editor.formatOnSave": true,
|
||||
//格式设置
|
||||
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
|
||||
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
|
||||
"typescript.referencesCodeLens.enabled": true,
|
||||
"javascript.format.placeOpenBraceOnNewLineForFunctions": true,
|
||||
"javascript.format.enable": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"editor.detectIndentation": true,
|
||||
}
|
||||
|
19
dist/createBoard.js
vendored
19
dist/createBoard.js
vendored
@@ -80,11 +80,20 @@ function createBoard(boardData) {
|
||||
boardMat.setPosition(pBase);
|
||||
matInv.getInverse(boardMat, true);
|
||||
}
|
||||
for (let i = 0; i < boardPts.length; i++) {
|
||||
let pt = getVec(boardPts[i]);
|
||||
pt.applyMatrix4(matInv);
|
||||
pts.push(new THREE.Vector2(pt.x, pt.y));
|
||||
buls.push(boardBuls[i]);
|
||||
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 three_1.Vector2(0, 0), new three_1.Vector2(width, 0), new three_1.Vector2(width, length), new three_1.Vector2(0, length), new three_1.Vector2(0, 0));
|
||||
buls.push(0, 0, 0, 0, 0);
|
||||
}
|
||||
let sp = createPath(pts, buls);
|
||||
let extrudeSettings = {
|
||||
|
2
dist/createBoard.js.map
vendored
2
dist/createBoard.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cadview",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.4",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import * as THREE from 'three';
|
||||
import { Geometry, LineSegments } from 'three';
|
||||
import { Geometry, LineSegments, Vector2 } from 'three';
|
||||
import { polar } from './GeUtils';
|
||||
import { boardMaterial, edgeMaterial } from './Material';
|
||||
import { RotateUVs } from './RotateUV';
|
||||
@@ -101,12 +101,27 @@ export function createBoard(boardData: object)
|
||||
matInv.getInverse(boardMat, true);
|
||||
}
|
||||
|
||||
for (let i = 0; i < boardPts.length; i++)
|
||||
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 pt = getVec(boardPts[i]);
|
||||
pt.applyMatrix4(matInv);
|
||||
pts.push(new THREE.Vector2(pt.x, pt.y));
|
||||
buls.push(boardBuls[i]);
|
||||
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);
|
||||
|
Reference in New Issue
Block a user