修正排钻孔洞没有在正确的位置

This commit is contained in:
ChenX 2018-05-31 11:24:37 +08:00
parent 128b1bcf70
commit ffd1404d12
4 changed files with 12 additions and 4 deletions

5
dist/createBoard.js vendored
View File

@ -125,7 +125,10 @@ function createBoard(boardData) {
for (let dri of dris) {
let geo = new three_1.CylinderGeometry(dri.r, dri.r, dri.h, 32);
geo.rotateX(Math.PI * 0.5);
geo.translate(dri.x, dri.y, 0);
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);
edges.push(createEdge(geo));
let subCsg = new ThreeCSG_1.ThreeBSP(geo);

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "cadview",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -163,7 +163,12 @@ export function createBoard(boardData: object)
{
let geo = new CylinderGeometry(dri.r, dri.r, dri.h, 32);
geo.rotateX(Math.PI * 0.5);
geo.translate(dri.x, dri.y, 0);
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);
edges.push(createEdge(geo));