فهرست منبع

approved style

Andreas Plesch 8 سال پیش
والد
کامیت
8872771667
1فایلهای تغییر یافته به همراه20 افزوده شده و 15 حذف شده
  1. 20 15
      examples/webgl_geometry_text_earcut.html

+ 20 - 15
examples/webgl_geometry_text_earcut.html

@@ -47,50 +47,55 @@
 		<!-- replace built-in triangulation with Earcut -->
 		<!-- replace built-in triangulation with Earcut -->
 		<script src="js/libs/earcut.js"></script>
 		<script src="js/libs/earcut.js"></script>
 		<script>
 		<script>
-
 			THREE.ShapeUtils.triangulateShape = function ( contour, holes ) {
 			THREE.ShapeUtils.triangulateShape = function ( contour, holes ) {
-				
-				function removeDupEndPts(points) {
+
+				function removeDupEndPts( points ) {
 
 
 					var l = points.length;
 					var l = points.length;
 					if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {
 					if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {
+
 						points.pop();
 						points.pop();
+
 					}
 					}
+
 				}
 				}
 
 
 				function addContour( vertices, contour ) {
 				function addContour( vertices, contour ) {
 
 
-					for ( var i = 0; i < contour.length; i++ ) {
-						vertices.push( contour[i].x );
-						vertices.push( contour[i].y );
+					for ( var i = 0; i < contour.length; i ++ ) {
+
+						vertices.push( contour[ i ].x );
+						vertices.push( contour[ i ].y );
+
 					}
 					}
+
 				}
 				}
-				
+
 				removeDupEndPts( contour );
 				removeDupEndPts( contour );
 				holes.forEach( removeDupEndPts );
 				holes.forEach( removeDupEndPts );
 
 
 				var vertices = [];
 				var vertices = [];
-
 				addContour( vertices, contour );
 				addContour( vertices, contour );
-
 				var holeIndices = [];
 				var holeIndices = [];
 				var holeIndex = contour.length;
 				var holeIndex = contour.length;
+				for ( i = 0; i < holes.length; i ++ ) {
 
 
-				for ( i = 0; i < holes.length; i++ ) {
 					holeIndices.push( holeIndex );
 					holeIndices.push( holeIndex );
-					holeIndex += holes[i].length;
-					addContour( vertices, holes[i] );
+					holeIndex += holes[ i ].length;
+					addContour( vertices, holes[ i ] );
+
 				}
 				}
 
 
 				var result = earcut( vertices, holeIndices, 2 );
 				var result = earcut( vertices, holeIndices, 2 );
-
 				var grouped = [];
 				var grouped = [];
 				for ( var i = 0; i < result.length; i += 3 ) {
 				for ( var i = 0; i < result.length; i += 3 ) {
+
 					grouped.push( result.slice( i, i + 3 ) );
 					grouped.push( result.slice( i, i + 3 ) );
+
 				}
 				}
-				
+
 				return grouped;
 				return grouped;
-				
+
 			};
 			};
 			
 			
 		</script>
 		</script>