<commit_before>/**
 * @author astrodud / http://astrodud.isgreat.org/
 * @author zz85 / https://github.com/zz85
 */

THREE.LatheGeometry = function ( points, steps, angle ) {

	THREE.Geometry.call( this );

	this.steps = steps || 12;
	this.angle = angle || 2 * Math.PI;

	var stepSize = this.angle / this.steps,
	newV = [],
	matrix = new THREE.Matrix4().makeRotationZ( stepSize );

	for ( var j = 0; j < points.length; j ++ ) {

		this.vertices.push( new THREE.Vertex( points[ j ] ) );

		newV[ j ] = points[ j ].clone();

	}

	for ( var i = 0; i < this.steps; i ++ ) {

		for ( var j = 0; j < newV.length; j ++ ) {

				newV[ j ] = matrix.multiplyVector3( newV[ j ].clone() );
				this.vertices.push( new THREE.Vertex( newV[ j ] ) );

		}

		var a, b, c, d;
		var steps = this.steps;
		for ( var k = 0, kl = points.length; k < kl-1; k++) {

			a = i * kl + k;
			b = ((i + 1) % steps) * kl + k;
			c = ((i + 1) % steps) * kl + (k + 1) % kl;
			d = i * kl + (k + 1) % kl;
			

			this.faces.push( new THREE.Face4( a, b, c, d ) );

			this.faceVertexUvs[ 0 ].push( [

				// UV mappings which wraps around
				new THREE.UV( 1 - i / steps, k / kl ),
				new THREE.UV( 1 - (i + 1) / steps, k / kl ),
				new THREE.UV( 1 - (i + 1) / steps, ( k+ 1 ) / kl ),
				new THREE.UV( 1 - i / steps, ( k + 1 ) / kl ),
				
			] );

		}


	}

	this.computeCentroids();
	this.computeFaceNormals();
	this.computeVertexNormals();

};

THREE.LatheGeometry.prototype = new THREE.Geometry();
THREE.LatheGeometry.prototype.constructor = THREE.LatheGeometry;
<commit_msg>LatheGeometry code clean up. Hmm... I'll need to rewrite this one, the result seems to be wrong.<commit_after>/**
 * @author astrodud / http://astrodud.isgreat.org/
 * @author zz85 / https://github.com/zz85
 */

THREE.LatheGeometry = function ( points, steps, angle ) {

	THREE.Geometry.call( this );

	var _steps = steps || 12;
	var _angle = angle || 2 * Math.PI;

	var _newV = [];
	var _matrix = new THREE.Matrix4().makeRotationZ( _angle / _steps );

	for ( var j = 0; j < points.length; j ++ ) {

		_newV[ j ] = points[ j ].clone();
		this.vertices.push( new THREE.Vertex( _newV[ j ] ) );

	}

	for ( var i = 0; i < _steps; i ++ ) {

		for ( var j = 0; j < _newV.length; j ++ ) {

			_newV[ j ] = _matrix.multiplyVector3( _newV[ j ].clone() );
			this.vertices.push( new THREE.Vertex( _newV[ j ] ) );

		}

		for ( var k = 0, kl = points.length; k < kl - 1; k ++ ) {

			var a = i * kl + k;
			var b = ( ( i + 1 ) % _steps ) * kl + k;
			var c = ( ( i + 1 ) % _steps ) * kl + ( k + 1 ) % kl;
			var d = i * kl + ( k + 1 ) % kl;

			this.faces.push( new THREE.Face4( a, b, c, d ) );

			this.faceVertexUvs[ 0 ].push( [

				new THREE.UV( 1 - i / _steps, k / kl ),
				new THREE.UV( 1 - ( i + 1 ) / _steps, k / kl ),
				new THREE.UV( 1 - ( i + 1 ) / _steps, ( k + 1 ) / kl ),
				new THREE.UV( 1 - i / _steps, ( k + 1 ) / kl )
				
			] );

		}

	}

	this.computeCentroids();
	this.computeFaceNormals();
	this.computeVertexNormals();

};

THREE.LatheGeometry.prototype = new THREE.Geometry();
THREE.LatheGeometry.prototype.constructor = THREE.LatheGeometry;

{'fraction_non_alphanumeric': 0.1833976833976834, 'fraction_numerical': 0.018018018018018018, 'mean_word_length': 2.3180362860192103, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2750511', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1200, 'n_words': 345}