<commit_before>import * as THREE from 'three';
import { MeshBVH, acceleratedRaycast, computeBoundsTree, disposeBoundsTree, CENTER, SAH, AVERAGE } from '../src/index.js';
import fs from 'fs';
import path from 'path';

const dataPath = path.resolve( __dirname, './data/points.bin' );
const buffer = fs.readFileSync( dataPath );
const points = new Float32Array( buffer.buffer, buffer.byteOffset, buffer.byteLength / 4 );

THREE.Mesh.prototype.raycast = acceleratedRaycast;
THREE.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
THREE.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;

describe( 'AVERAGE Points Raycast', () => {

	let geometry = null;
	let mesh = null;
	let raycaster = null;
	beforeEach( () => {

		geometry = new THREE.BufferGeometry();
		geometry.addAttribute( 'position', new THREE.BufferAttribute( points, 3 ) );
		geometry.computeVertexNormals();

		mesh = new THREE.Mesh( geometry );

		const x = 101086.2438562272;
		const y = 99421.40510391879;
		raycaster = new THREE.Raycaster();
		raycaster.firstHitOnly = true;
		raycaster.set( new THREE.Vector3( x, y, - 1000 ), new THREE.Vector3( 0, 0, 1 ) );

	} );
<commit_msg>Center the geometry before checking<commit_after>import * as THREE from 'three';
import { MeshBVH, acceleratedRaycast, computeBoundsTree, disposeBoundsTree, CENTER, SAH, AVERAGE } from '../src/index.js';
import fs from 'fs';
import path from 'path';

const dataPath = path.resolve( __dirname, './data/points.bin' );
const buffer = fs.readFileSync( dataPath );
const points = new Float32Array( buffer.buffer, buffer.byteOffset, buffer.byteLength / 4 );

THREE.Mesh.prototype.raycast = acceleratedRaycast;
THREE.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
THREE.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;

describe( 'AVERAGE Points Raycast', () => {

	let geometry = null;
	let mesh = null;
	let raycaster = null;
	beforeEach( () => {

		geometry = new THREE.BufferGeometry();
		geometry.addAttribute( 'position', new THREE.BufferAttribute( points, 3 ) );
		geometry.computeVertexNormals();

		mesh = new THREE.Mesh( geometry );


		geometry.computeBoundingBox();
		const center = new THREE.Vector3();
		geometry.boundingBox.getCenter( center );

		const x = 101086.2438562272 - center.x;
		const y = 99421.40510391879 - center.y;

		geometry.center();


		raycaster = new THREE.Raycaster();
		raycaster.firstHitOnly = true;
		raycaster.set( new THREE.Vector3( x, y, - 1000 ), new THREE.Vector3( 0, 0, 1 ) );

	} );

{'fraction_non_alphanumeric': 0.12752475247524753, 'fraction_numerical': 0.03603960396039604, 'mean_word_length': 4.702031602708804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2328775', 'n_tokens_mistral': 910, 'n_tokens_neox': 779, 'n_words': 206}