function updateSelection() {

	const startTime = window.performance.now();
	const indices = computeSelectedTriangles( mesh, camera, tool, params );

	const traverseTime = window.performance.now() - startTime;
	outputContainer.innerText = `${ traverseTime.toFixed( 3 ) }ms`;

	const indexAttr = mesh.geometry.index;
	const newIndexAttr = highlightMesh.geometry.index;
	if ( indices.length && params.selectWholeModel ) {

		// if we found indices and we want to select the whole model
		for ( let i = 0, l = indexAttr.count; i < l; i ++ ) {

			const i2 = indexAttr.getX( i );
			newIndexAttr.setX( i, i2 );

		}

		highlightMesh.geometry.drawRange.count = Infinity;
		newIndexAttr.needsUpdate = true;

	} else {

		// update the highlight mesh
		for ( let i = 0, l = indices.length; i < l; i ++ ) {

			const i2 = indexAttr.getX( indices[ i ] );
			newIndexAttr.setX( i, i2 );

		}

		highlightMesh.geometry.drawRange.count = indices.length;
		newIndexAttr.needsUpdate = true;

	}

}
Compute selected triangles:

1. Construct a list of screen space line segments that represent the lasso shape drawn by the user.
2. For every triangle in the geometry check if any part is within the lasso. If it is then consider the triangle selected.

@see https://github.com/gkjohnson/three-mesh-bvh/issues/166#issuecomment-752194034