mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2025-01-11 03:45:08 +01:00
geplakt var with const or let in createLines
This commit is contained in:
parent
87b8f1f29b
commit
4747d072b9
@ -1,7 +1,7 @@
|
|||||||
import THREE from 'three.js';
|
import THREE from 'three.js';
|
||||||
|
|
||||||
function addLine(geometry, lineLookup, lines, a, b) {
|
function addLine(geometry, lineLookup, lines, a, b) {
|
||||||
var index = lineLookup[`${b}_${a}`];
|
let index = lineLookup[`${b}_${a}`];
|
||||||
|
|
||||||
if (index === undefined) {
|
if (index === undefined) {
|
||||||
index = lines.length;
|
index = lines.length;
|
||||||
@ -20,19 +20,19 @@ function addLine(geometry, lineLookup, lines, a, b) {
|
|||||||
export default function createLines(geometry, settings) {
|
export default function createLines(geometry, settings) {
|
||||||
console.log('constructing unique lines from geometry');
|
console.log('constructing unique lines from geometry');
|
||||||
|
|
||||||
var lines = [];
|
const lines = [];
|
||||||
var lineLookup = {};
|
const lineLookup = {};
|
||||||
|
|
||||||
for (var i = 0; i < geometry.faces.length; i ++) {
|
for (let i = 0; i < geometry.faces.length; i ++) {
|
||||||
var face = geometry.faces[i];
|
const face = geometry.faces[i];
|
||||||
if (face.normal.y !== 1 && face.normal.y !== -1) {
|
if (face.normal.y !== 1 && face.normal.y !== -1) {
|
||||||
var normal = new THREE.Vector2(face.normal.z, face.normal.x).normalize();
|
const normal = new THREE.Vector2(face.normal.z, face.normal.x).normalize();
|
||||||
|
|
||||||
// check for only adding unique lines
|
// check for only adding unique lines
|
||||||
// returns index of said line
|
// returns index of said line
|
||||||
var a = addLine(geometry, lineLookup, lines, face.a, face.b);
|
const a = addLine(geometry, lineLookup, lines, face.a, face.b);
|
||||||
var b = addLine(geometry, lineLookup, lines, face.b, face.c);
|
const b = addLine(geometry, lineLookup, lines, face.b, face.c);
|
||||||
var c = addLine(geometry, lineLookup, lines, face.c, face.a);
|
const c = addLine(geometry, lineLookup, lines, face.c, face.a);
|
||||||
|
|
||||||
// set connecting lines (based on face)
|
// set connecting lines (based on face)
|
||||||
lines[a].connects.push(b, c);
|
lines[a].connects.push(b, c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user