Skip to content

Commit ea5fad1

Browse files
committed
Fixed returned value in SMC
1 parent 7be3789 commit ea5fad1

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/polygonizers/SlidingMarchingCubes.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Box2Acc extends Box2 {
8080
this.nice_acc = nice_acc;
8181
}
8282
this.raw_acc = this.raw_acc ? this.nice_acc : raw_acc;
83-
83+
8484
}
8585
/**
8686
*
@@ -280,7 +280,7 @@ class SlidingMarchingCubes {
280280
this.ext_p = new THREE.Vector3();
281281

282282

283-
283+
284284

285285
/**
286286
* Resulting mesh data
@@ -289,17 +289,17 @@ class SlidingMarchingCubes {
289289
this.geometry = null;
290290

291291

292-
// Ensure triangulation along min curvature edge
292+
// Ensure triangulation along min curvature edge
293293
/** @type {boolean} */
294294
this.minCurvOrient = true;
295295

296296

297-
// Returns true if 123/143 split is along min curvature
297+
// Returns true if 123/143 split is along min curvature
298298
/** @type {(v1:number,v2:number,v3:number,v4:number) => boolean} */
299-
this._isMinCurvatureTriangulation =
300-
(function ()
301-
{
302-
//Var and tmp var pre allocated and Scoped
299+
this._isMinCurvatureTriangulation =
300+
(function ()
301+
{
302+
//Var and tmp var pre allocated and Scoped
303303
//for optimization of triangulation criteria
304304
//assuming a v1v2v3v4 quad
305305
/** @type {THREE.Vector3} */
@@ -313,9 +313,9 @@ class SlidingMarchingCubes {
313313
//Edges from v2
314314
/** @type {THREE.Vector3} */
315315
let pp_2_1 = new THREE.Vector3(); //v2v1 edge
316-
/** @type {THREE.Vector3} */
316+
/** @type {THREE.Vector3} */
317317
let pp_2_3 = new THREE.Vector3(); //v2v3 edge
318-
/** @type {THREE.Vector3} */
318+
/** @type {THREE.Vector3} */
319319
let pp_2_4 = new THREE.Vector3(); //v2v4 edge
320320
//Edges from v4
321321
/** @type {THREE.Vector3} */
@@ -336,28 +336,28 @@ class SlidingMarchingCubes {
336336
//Quad opposes v1 and v3 and v2 and v4
337337
//check min curvature
338338
p1.x = this.geometry.position[v1*3];
339-
p1.y = this.geometry.position[v1*3+ 1]
339+
p1.y = this.geometry.position[v1*3+ 1]
340340
p1.z = this.geometry.position[v1*3 + 2];
341341

342342
p2.x = this.geometry.position[v2*3]
343-
p2.y = this.geometry.position[v2*3+ 1]
343+
p2.y = this.geometry.position[v2*3+ 1]
344344
p2.z = this.geometry.position[v2*3+ 2];
345-
345+
346346
p3.x = this.geometry.position[v3*3]
347-
p3.y =this.geometry.position[v3*3+ 1]
347+
p3.y =this.geometry.position[v3*3+ 1]
348348
p3.z = this.geometry.position[v3*3+ 2];
349-
349+
350350
p4.x = this.geometry.position[v4*3]
351-
p4.y = this.geometry.position[v4*3+ 1]
351+
p4.y = this.geometry.position[v4*3+ 1]
352352
p4.z = this.geometry.position[v4*3+ 2];
353353

354-
//Edges from v2
355-
pp_2_1.subVectors(p1,p2);
354+
//Edges from v2
355+
pp_2_1.subVectors(p1,p2);
356356
pp_2_3.subVectors(p3,p2);
357357
pp_2_4.subVectors(p4,p2);
358358

359359
//Edges from v4
360-
pp_4_1.subVectors(p1,p4);
360+
pp_4_1.subVectors(p1,p4);
361361
pp_4_3.subVectors(p3,p4);
362362

363363
//normal of 123 triangle
@@ -368,7 +368,7 @@ class SlidingMarchingCubes {
368368
n_4.copy(pp_4_1);
369369
n_4.cross(pp_4_3).normalize();
370370

371-
//normal of 234 triangle
371+
//normal of 234 triangle
372372
n_23.copy(pp_2_3);
373373
n_23.cross(pp_2_4).normalize();
374374

@@ -1034,7 +1034,7 @@ class SlidingMarchingCubes {
10341034
// if no areas, blobtree is empty so stop and send an empty mesh.
10351035
if (this.areas.length === 0) {
10361036
this.progress(100);
1037-
return new THREE.BufferGeometry();
1037+
return this.buildResultingBufferGeometry();
10381038
}
10391039

10401040
this.min_acc = this.areas.length !== 0 ? this.areas[0].bv.getMinAcc() : 1;
@@ -1166,7 +1166,7 @@ class SlidingMarchingCubes {
11661166
this.curr_steps.y = this.min_acc;
11671167
this.curr_step_vol =
11681168
this.curr_steps.x * this.curr_steps.y * this.curr_steps.z;
1169-
1169+
11701170
for (var iy = 0; iy < this.reso[1] - 1; ++iy) {
11711171
for (var ix = 0; ix < this.reso[0] - 1; ++ix) {
11721172
this.y = corner.y + iy * this.min_acc;
@@ -1278,7 +1278,7 @@ class SlidingMarchingCubes {
12781278
let v3 = this.vertices_xy[0][(y - 1) * this.reso[0] + x];
12791279
let v4 = this.vertices_xy[0][idx_y_0];
12801280

1281-
1281+
12821282
if(this.minCurvOrient)
12831283
{
12841284
let switch_edge = !this._isMinCurvatureTriangulation(v1, v2, v3, v4);

0 commit comments

Comments
 (0)