@@ -614,15 +614,15 @@ function generateIsosurfaceMesh(data) {
614
614
tryCreateTri ( style , getXYZV ( [ c , d , a ] ) , [ c , d , a ] , min , max ) ;
615
615
}
616
616
617
- function beginSlice ( style , p00 , p01 , p10 , p11 , min , max , isEven ) {
617
+ function begin2dCell ( style , p00 , p01 , p10 , p11 , min , max , isEven ) {
618
618
if ( isEven ) {
619
619
addRect ( style , p00 , p01 , p11 , p10 , min , max ) ;
620
620
} else {
621
621
addRect ( style , p01 , p11 , p10 , p00 , min , max ) ;
622
622
}
623
623
}
624
624
625
- function beginCell ( style , p000 , p001 , p010 , p011 , p100 , p101 , p110 , p111 , min , max , isEven ) {
625
+ function begin3dCell ( style , p000 , p001 , p010 , p011 , p100 , p101 , p110 , p111 , min , max , isEven ) {
626
626
var cellStyle = style ;
627
627
if ( isEven ) {
628
628
if ( drawingSurface && styleIncludes ( style , 'check2' ) ) cellStyle = null ;
@@ -633,11 +633,11 @@ function generateIsosurfaceMesh(data) {
633
633
}
634
634
}
635
635
636
- function drawSectionsX ( style , items , min , max ) {
636
+ function drawSlicesX ( style , items , min , max ) {
637
637
items . forEach ( function ( i ) {
638
638
for ( var k = 1 ; k < depth ; k ++ ) {
639
639
for ( var j = 1 ; j < height ; j ++ ) {
640
- beginSlice ( style ,
640
+ begin2dCell ( style ,
641
641
getIndex ( i , j - 1 , k - 1 ) ,
642
642
getIndex ( i , j - 1 , k ) ,
643
643
getIndex ( i , j , k - 1 ) ,
@@ -651,11 +651,11 @@ function generateIsosurfaceMesh(data) {
651
651
} ) ;
652
652
}
653
653
654
- function drawSectionsY ( style , items , min , max ) {
654
+ function drawSlicesY ( style , items , min , max ) {
655
655
items . forEach ( function ( j ) {
656
656
for ( var i = 1 ; i < width ; i ++ ) {
657
657
for ( var k = 1 ; k < depth ; k ++ ) {
658
- beginSlice ( style ,
658
+ begin2dCell ( style ,
659
659
getIndex ( i - 1 , j , k - 1 ) ,
660
660
getIndex ( i , j , k - 1 ) ,
661
661
getIndex ( i - 1 , j , k ) ,
@@ -669,11 +669,11 @@ function generateIsosurfaceMesh(data) {
669
669
} ) ;
670
670
}
671
671
672
- function drawSectionsZ ( style , items , min , max ) {
672
+ function drawSlicesZ ( style , items , min , max ) {
673
673
items . forEach ( function ( k ) {
674
674
for ( var j = 1 ; j < height ; j ++ ) {
675
675
for ( var i = 1 ; i < width ; i ++ ) {
676
- beginSlice ( style ,
676
+ begin2dCell ( style ,
677
677
getIndex ( i - 1 , j - 1 , k ) ,
678
678
getIndex ( i - 1 , j , k ) ,
679
679
getIndex ( i , j - 1 , k ) ,
@@ -692,7 +692,7 @@ function generateIsosurfaceMesh(data) {
692
692
for ( var k = 1 ; k < depth ; k ++ ) {
693
693
for ( var j = 1 ; j < height ; j ++ ) {
694
694
for ( var i = 1 ; i < width ; i ++ ) {
695
- beginCell ( style ,
695
+ begin3dCell ( style ,
696
696
getIndex ( i - 1 , j - 1 , k - 1 ) ,
697
697
getIndex ( i - 1 , j - 1 , k ) ,
698
698
getIndex ( i - 1 , j , k - 1 ) ,
@@ -716,7 +716,7 @@ function generateIsosurfaceMesh(data) {
716
716
for ( var k = 1 ; k < depth ; k ++ ) {
717
717
for ( var j = 1 ; j < height ; j ++ ) {
718
718
for ( var i = 1 ; i < width ; i ++ ) {
719
- beginCell ( style ,
719
+ begin3dCell ( style ,
720
720
getIndex ( i - 1 , j - 1 , k - 1 ) ,
721
721
getIndex ( i - 1 , j - 1 , k ) ,
722
722
getIndex ( i - 1 , j , k - 1 ) ,
@@ -824,18 +824,18 @@ function generateIsosurfaceMesh(data) {
824
824
if ( e === 'z' ) indices = createRange ( 1 , depth - 1 ) ;
825
825
}
826
826
827
- if ( e === 'x' ) drawSectionsX ( activeStyle , indices , activeMin , activeMax ) ;
828
- if ( e === 'y' ) drawSectionsY ( activeStyle , indices , activeMin , activeMax ) ;
829
- if ( e === 'z' ) drawSectionsZ ( activeStyle , indices , activeMin , activeMax ) ;
827
+ if ( e === 'x' ) drawSlicesX ( activeStyle , indices , activeMin , activeMax ) ;
828
+ if ( e === 'y' ) drawSlicesY ( activeStyle , indices , activeMin , activeMax ) ;
829
+ if ( e === 'z' ) drawSlicesZ ( activeStyle , indices , activeMin , activeMax ) ;
830
830
}
831
831
832
832
// draw caps
833
833
var cap = data . caps [ e ] ;
834
834
if ( cap . show && cap . fill ) {
835
835
setFill ( cap . fill ) ;
836
- if ( e === 'x' ) drawSectionsX ( activeStyle , [ 0 , width - 1 ] , activeMin , activeMax ) ;
837
- if ( e === 'y' ) drawSectionsY ( activeStyle , [ 0 , height - 1 ] , activeMin , activeMax ) ;
838
- if ( e === 'z' ) drawSectionsZ ( activeStyle , [ 0 , depth - 1 ] , activeMin , activeMax ) ;
836
+ if ( e === 'x' ) drawSlicesX ( activeStyle , [ 0 , width - 1 ] , activeMin , activeMax ) ;
837
+ if ( e === 'y' ) drawSlicesY ( activeStyle , [ 0 , height - 1 ] , activeMin , activeMax ) ;
838
+ if ( e === 'z' ) drawSlicesZ ( activeStyle , [ 0 , depth - 1 ] , activeMin , activeMax ) ;
839
839
}
840
840
}
841
841
} ) ;
0 commit comments