@@ -80,7 +80,7 @@ class Box2Acc extends Box2 {
80
80
this . nice_acc = nice_acc ;
81
81
}
82
82
this . raw_acc = this . raw_acc ? this . nice_acc : raw_acc ;
83
-
83
+
84
84
}
85
85
/**
86
86
*
@@ -280,7 +280,7 @@ class SlidingMarchingCubes {
280
280
this . ext_p = new THREE . Vector3 ( ) ;
281
281
282
282
283
-
283
+
284
284
285
285
/**
286
286
* Resulting mesh data
@@ -289,17 +289,17 @@ class SlidingMarchingCubes {
289
289
this . geometry = null ;
290
290
291
291
292
- // Ensure triangulation along min curvature edge
292
+ // Ensure triangulation along min curvature edge
293
293
/** @type {boolean } */
294
294
this . minCurvOrient = true ;
295
295
296
296
297
- // Returns true if 123/143 split is along min curvature
297
+ // Returns true if 123/143 split is along min curvature
298
298
/** @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
303
303
//for optimization of triangulation criteria
304
304
//assuming a v1v2v3v4 quad
305
305
/** @type {THREE.Vector3 } */
@@ -313,9 +313,9 @@ class SlidingMarchingCubes {
313
313
//Edges from v2
314
314
/** @type {THREE.Vector3 } */
315
315
let pp_2_1 = new THREE . Vector3 ( ) ; //v2v1 edge
316
- /** @type {THREE.Vector3 } */
316
+ /** @type {THREE.Vector3 } */
317
317
let pp_2_3 = new THREE . Vector3 ( ) ; //v2v3 edge
318
- /** @type {THREE.Vector3 } */
318
+ /** @type {THREE.Vector3 } */
319
319
let pp_2_4 = new THREE . Vector3 ( ) ; //v2v4 edge
320
320
//Edges from v4
321
321
/** @type {THREE.Vector3 } */
@@ -336,28 +336,28 @@ class SlidingMarchingCubes {
336
336
//Quad opposes v1 and v3 and v2 and v4
337
337
//check min curvature
338
338
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 ]
340
340
p1 . z = this . geometry . position [ v1 * 3 + 2 ] ;
341
341
342
342
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 ]
344
344
p2 . z = this . geometry . position [ v2 * 3 + 2 ] ;
345
-
345
+
346
346
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 ]
348
348
p3 . z = this . geometry . position [ v3 * 3 + 2 ] ;
349
-
349
+
350
350
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 ]
352
352
p4 . z = this . geometry . position [ v4 * 3 + 2 ] ;
353
353
354
- //Edges from v2
355
- pp_2_1 . subVectors ( p1 , p2 ) ;
354
+ //Edges from v2
355
+ pp_2_1 . subVectors ( p1 , p2 ) ;
356
356
pp_2_3 . subVectors ( p3 , p2 ) ;
357
357
pp_2_4 . subVectors ( p4 , p2 ) ;
358
358
359
359
//Edges from v4
360
- pp_4_1 . subVectors ( p1 , p4 ) ;
360
+ pp_4_1 . subVectors ( p1 , p4 ) ;
361
361
pp_4_3 . subVectors ( p3 , p4 ) ;
362
362
363
363
//normal of 123 triangle
@@ -368,7 +368,7 @@ class SlidingMarchingCubes {
368
368
n_4 . copy ( pp_4_1 ) ;
369
369
n_4 . cross ( pp_4_3 ) . normalize ( ) ;
370
370
371
- //normal of 234 triangle
371
+ //normal of 234 triangle
372
372
n_23 . copy ( pp_2_3 ) ;
373
373
n_23 . cross ( pp_2_4 ) . normalize ( ) ;
374
374
@@ -1034,7 +1034,7 @@ class SlidingMarchingCubes {
1034
1034
// if no areas, blobtree is empty so stop and send an empty mesh.
1035
1035
if ( this . areas . length === 0 ) {
1036
1036
this . progress ( 100 ) ;
1037
- return new THREE . BufferGeometry ( ) ;
1037
+ return this . buildResultingBufferGeometry ( ) ;
1038
1038
}
1039
1039
1040
1040
this . min_acc = this . areas . length !== 0 ? this . areas [ 0 ] . bv . getMinAcc ( ) : 1 ;
@@ -1166,7 +1166,7 @@ class SlidingMarchingCubes {
1166
1166
this . curr_steps . y = this . min_acc ;
1167
1167
this . curr_step_vol =
1168
1168
this . curr_steps . x * this . curr_steps . y * this . curr_steps . z ;
1169
-
1169
+
1170
1170
for ( var iy = 0 ; iy < this . reso [ 1 ] - 1 ; ++ iy ) {
1171
1171
for ( var ix = 0 ; ix < this . reso [ 0 ] - 1 ; ++ ix ) {
1172
1172
this . y = corner . y + iy * this . min_acc ;
@@ -1278,7 +1278,7 @@ class SlidingMarchingCubes {
1278
1278
let v3 = this . vertices_xy [ 0 ] [ ( y - 1 ) * this . reso [ 0 ] + x ] ;
1279
1279
let v4 = this . vertices_xy [ 0 ] [ idx_y_0 ] ;
1280
1280
1281
-
1281
+
1282
1282
if ( this . minCurvOrient )
1283
1283
{
1284
1284
let switch_edge = ! this . _isMinCurvatureTriangulation ( v1 , v2 , v3 , v4 ) ;
0 commit comments