排钻显示改成实体显示.

This commit is contained in:
ChenX
2018-05-31 21:01:30 +08:00
parent f72bb04ff5
commit fa20fa5f48
8 changed files with 26 additions and 15 deletions

9
dist/createBoard.js vendored
View File

@@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
const THREE = require("three");
const three_1 = require("three");
const ColorPalette_1 = require("./ColorPalette");
const GeUtils_1 = require("./GeUtils");
const Material_1 = require("./Material");
const RotateUV_1 = require("./RotateUV");
@@ -123,14 +124,18 @@ function createBoard(boardData) {
if (boardData["Drillings"]) {
let dris = boardData["Drillings"];
for (let dri of dris) {
let geo = new three_1.CylinderGeometry(dri.r, dri.r, dri.h, 32);
let geo = new three_1.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);
edges.push(createEdge(geo));
let mesh = new three_1.Mesh(geo, ColorPalette_1.ColorMaterial.GetLineMaterial(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);
}