toBatchedMesh() {

		const { batchGroups, singleGroups, uniqueGeometries } = this._analyzeModel();
		const meshesToRemove = this._createBatchedMeshes( batchGroups );

		this.disposeMeshes( meshesToRemove );
		this.removeEmptyNodes( this.scene );

		if ( this.debug ) {

			const totalOriginalMeshes = meshesToRemove.size + singleGroups.size;
			const totalFinalMeshes = batchGroups.size + singleGroups.size;

			const stats = {
				originalMeshes: totalOriginalMeshes,
				batchedMeshes: batchGroups.size,
				singleMeshes: singleGroups.size,
				drawCalls: totalFinalMeshes,
				uniqueGeometries: uniqueGeometries,
				reductionRatio: ( ( 1 - totalFinalMeshes / totalOriginalMeshes ) * 100 ).toFixed( 1 ),
			};

			this._logDebugInfo( stats );

		}

		return this.scene;

	}
Performs the auto-baching by identifying groups of meshes in the scene
that can be represented as a single {@link BatchedMesh}. The method modifies
the scene by adding instances of `BatchedMesh` and removing the now redundant
individual meshes.

@return {Scene} The optimized scene.