Browse Source

Cleaning up TextGeometry a little

zz85 13 years ago
parent
commit
c583db7749
2 changed files with 4 additions and 19 deletions
  1. 2 10
      src/extras/core/TextPath.js
  2. 2 9
      src/extras/geometries/TextGeometry.js

+ 2 - 10
src/extras/core/TextPath.js

@@ -1,7 +1,8 @@
 /**
  * @author zz85 / http://www.lab4games.net/zz85/blog
  *
- * TextPath
+ * TextPath - not sure if there's much use for this class.
+ only thing it has it .toShapes() which can be removed by refactoring.
  *
  **/
 
@@ -56,13 +57,4 @@ THREE.TextPath.prototype.toShapes = function () {
 
 	return shapes;
 
-	//console.log(path);
-	//console.log(fontShapes);
-
-	// Either find actions or curves.
-
-	//var text3d = new THREE.ExtrudeGeometry( shapes , { amount: 20, bevelEnabled:true, bevelThickness:3	} );
-
-	//return text3d;
-
 };

+ 2 - 9
src/extras/geometries/TextGeometry.js

@@ -142,8 +142,7 @@ THREE.FontUtils = {
 
 			var ret = this.extractGlyphPoints( chars[ i ], face, scale, offset, path );
 			offset += ret.offset;
-			//characterPts.push( ret.points );
-			//allPts = allPts.concat( ret.points );
+
 			fontPaths.push( ret.path );
 
 		}
@@ -207,8 +206,6 @@ THREE.FontUtils = {
 					x = outline[ i++ ] * scaleX + offset;
 					y = outline[ i++ ] * scaleY;
 
-					pts.push( new THREE.Vector2( x, y ) );
-
 					path.moveTo( x, y );
 					break;
 
@@ -218,7 +215,6 @@ THREE.FontUtils = {
 
 					x = outline[ i++ ] * scaleX + offset;
 					y = outline[ i++ ] * scaleY;
-					pts.push( new THREE.Vector2( x, y ) );
 					path.lineTo(x,y);
 					break;
 
@@ -245,8 +241,6 @@ THREE.FontUtils = {
 							var t = i2 / divisions;
 							var tx = THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx );
 							var ty = THREE.Shape.Utils.b2( t, cpy0, cpy1, cpy );
-							pts.push( new THREE.Vector2( tx, ty ) );
-
 					  }
 
 				  }
@@ -278,7 +272,6 @@ THREE.FontUtils = {
 							var t = i2 / divisions;
 							var tx = THREE.Shape.Utils.b3( t, cpx0, cpx1, cpx2, cpx );
 							var ty = THREE.Shape.Utils.b3( t, cpy0, cpy1, cpy2, cpy );
-							pts.push( new THREE.Vector2( tx, ty ) );
 
 						}
 
@@ -293,7 +286,7 @@ THREE.FontUtils = {
 
 
 
-		return { offset: glyph.ha*scale, points:pts, path:path};
+		return { offset: glyph.ha*scale, path:path};
 	}
 
 };