<commit_before>THREE.DecalVertex = function( v, n ) {

	this.vertex = v;
	this.normal = n;

};

THREE.DecalVertex.prototype.clone = function() {

	return new THREE.DecalVertex( this.vertex.clone(), this.normal.clone() );

};

THREE.DecalGeometry = function( mesh, position, rotation, dimensions, check ) {

	THREE.Geometry.call( this );

	if ( check === undefined ) check = null;
	check = check || new THREE.Vector3( 1, 1, 1 );

	this.uvs = [];

	this.cube = new THREE.Mesh( new THREE.BoxGeometry( dimensions.x, dimensions.y, dimensions.z ), new THREE.MeshBasicMaterial() );
	this.cube.rotation.set( rotation.x, rotation.y, rotation.z );
	this.cube.position.copy( position );
	this.cube.scale.set( 1, 1, 1 );
	this.cube.updateMatrix();

	this.iCubeMatrix = ( new THREE.Matrix4() ).getInverse( this.cube.matrix );

	this.faceIndices = [ 'a', 'b', 'c', 'd' ];

	this.clipFace = function( inVertices, plane ) {

		var size = .5 * Math.abs( ( dimensions.clone() ).dot( plane ) );

		function clip( v0, v1, p ) {

			var d0 = v0.vertex.dot( p ) - size,
				d1 = v1.vertex.dot( p ) - size;

			var s = d0 / ( d0 - d1 );
			var v = new THREE.DecalVertex(
				new THREE.Vector3(
					v0.vertex.x + s * ( v1.vertex.x - v0.vertex.x ),
					v0.vertex.y + s * ( v1.vertex.y - v0.vertex.y ),
					v0.vertex.z + s * ( v1.vertex.z - v0.vertex.z )
				),
				new THREE.Vector3(
					v0.normal.x + s * ( v1.normal.x - v0.normal.x ),
					v0.normal.y + s * ( v1.normal.y - v0.normal.y ),
					v0.normal.z + s * ( v1.normal.z - v0.normal.z )
				)
			);

			// need to clip more values (texture coordinates)? do it this way:
			//intersectpoint.value = a.value + s*(b.value-a.value);

			return v;

		}

		if ( inVertices.length === 0 ) return [];
		var outVertices = [];

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

			var v1Out, v2Out, v3Out, total = 0;

			var d1 = inVertices[ j + 0 ].vertex.dot( plane ) - size,
				d2 = inVertices[ j + 1 ].vertex.dot( plane ) - size,
				d3 = inVertices[ j + 2 ].vertex.dot( plane ) - size;

			v1Out = d1 > 0;
			v2Out = d2 > 0;
			v3Out = d3 > 0;

			total = ( v1Out ? 1 : 0 ) + ( v2Out ? 1 : 0 ) + ( v3Out ? 1 : 0 );

			switch ( total ) {
				case 0: {

					outVertices.push( inVertices[ j ] );
					outVertices.push( inVertices[ j + 1 ] );
					outVertices.push( inVertices[ j + 2 ] );
					break;

				}
				case 1: {

					var nV1, nV2, nV3;
					if ( v1Out ) {

						nV1 = inVertices[ j + 1 ];
						nV2 = inVertices[ j + 2 ];
						nV3 = clip( inVertices[ j ], nV1, plane );
						nV4 = clip( inVertices[ j ], nV2, plane );

					}
					if ( v2Out ) {

						nV1 = inVertices[ j ];
						nV2 = inVertices[ j + 2 ];
						nV3 = clip( inVertices[ j + 1 ], nV1, plane );
						nV4 = clip( inVertices[ j + 1 ], nV2, plane );

						outVertices.push( nV3 );
						outVertices.push( nV2.clone() );
						outVertices.push( nV1.clone() );

						outVertices.push( nV2.clone() );
						outVertices.push( nV3.clone() );
						outVertices.push( nV4 );
						break;

					}
					if ( v3Out ) {

						nV1 = inVertices[ j ];
						nV2 = inVertices[ j + 1 ];
						nV3 = clip( inVertices[ j + 2 ], nV1, plane );
						nV4 = clip( inVertices[ j + 2 ], nV2, plane );<commit_msg>Fix variable nV4 implicitly declared in DecalGeometry<commit_after>THREE.DecalVertex = function( v, n ) {

	this.vertex = v;
	this.normal = n;

};

THREE.DecalVertex.prototype.clone = function() {

	return new THREE.DecalVertex( this.vertex.clone(), this.normal.clone() );

};

THREE.DecalGeometry = function( mesh, position, rotation, dimensions, check ) {

	THREE.Geometry.call( this );

	if ( check === undefined ) check = null;
	check = check || new THREE.Vector3( 1, 1, 1 );

	this.uvs = [];

	this.cube = new THREE.Mesh( new THREE.BoxGeometry( dimensions.x, dimensions.y, dimensions.z ), new THREE.MeshBasicMaterial() );
	this.cube.rotation.set( rotation.x, rotation.y, rotation.z );
	this.cube.position.copy( position );
	this.cube.scale.set( 1, 1, 1 );
	this.cube.updateMatrix();

	this.iCubeMatrix = ( new THREE.Matrix4() ).getInverse( this.cube.matrix );

	this.faceIndices = [ 'a', 'b', 'c', 'd' ];

	this.clipFace = function( inVertices, plane ) {

		var size = .5 * Math.abs( ( dimensions.clone() ).dot( plane ) );

		function clip( v0, v1, p ) {

			var d0 = v0.vertex.dot( p ) - size,
				d1 = v1.vertex.dot( p ) - size;

			var s = d0 / ( d0 - d1 );
			var v = new THREE.DecalVertex(
				new THREE.Vector3(
					v0.vertex.x + s * ( v1.vertex.x - v0.vertex.x ),
					v0.vertex.y + s * ( v1.vertex.y - v0.vertex.y ),
					v0.vertex.z + s * ( v1.vertex.z - v0.vertex.z )
				),
				new THREE.Vector3(
					v0.normal.x + s * ( v1.normal.x - v0.normal.x ),
					v0.normal.y + s * ( v1.normal.y - v0.normal.y ),
					v0.normal.z + s * ( v1.normal.z - v0.normal.z )
				)
			);

			// need to clip more values (texture coordinates)? do it this way:
			//intersectpoint.value = a.value + s*(b.value-a.value);

			return v;

		}

		if ( inVertices.length === 0 ) return [];
		var outVertices = [];

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

			var v1Out, v2Out, v3Out, total = 0;

			var d1 = inVertices[ j + 0 ].vertex.dot( plane ) - size,
				d2 = inVertices[ j + 1 ].vertex.dot( plane ) - size,
				d3 = inVertices[ j + 2 ].vertex.dot( plane ) - size;

			v1Out = d1 > 0;
			v2Out = d2 > 0;
			v3Out = d3 > 0;

			total = ( v1Out ? 1 : 0 ) + ( v2Out ? 1 : 0 ) + ( v3Out ? 1 : 0 );

			switch ( total ) {
				case 0: {

					outVertices.push( inVertices[ j ] );
					outVertices.push( inVertices[ j + 1 ] );
					outVertices.push( inVertices[ j + 2 ] );
					break;

				}
				case 1: {

					var nV1, nV2, nV3, nV4;
					if ( v1Out ) {

						nV1 = inVertices[ j + 1 ];
						nV2 = inVertices[ j + 2 ];
						nV3 = clip( inVertices[ j ], nV1, plane );
						nV4 = clip( inVertices[ j ], nV2, plane );

					}
					if ( v2Out ) {

						nV1 = inVertices[ j ];
						nV2 = inVertices[ j + 2 ];
						nV3 = clip( inVertices[ j + 1 ], nV1, plane );
						nV4 = clip( inVertices[ j + 1 ], nV2, plane );

						outVertices.push( nV3 );
						outVertices.push( nV2.clone() );
						outVertices.push( nV1.clone() );

						outVertices.push( nV2.clone() );
						outVertices.push( nV3.clone() );
						outVertices.push( nV4 );
						break;

					}
					if ( v3Out ) {

						nV1 = inVertices[ j ];
						nV2 = inVertices[ j + 1 ];
						nV3 = clip( inVertices[ j + 2 ], nV1, plane );
						nV4 = clip( inVertices[ j + 2 ], nV2, plane );
{'fraction_non_alphanumeric': 0.16844878351154502, 'fraction_numerical': 0.03471253680458702, 'mean_word_length': 2.2399598393574296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2124726', 'n_tokens_mistral': 3146, 'n_tokens_neox': 2558, 'n_words': 627}