How to destroy terrain using Sebastian Lague's Marching Cubes implementation

I have created a voxel engine in the past but have never been able to get marching cubes quite right, and Sebastian Lague recently created his own using marching cubes. The problem is that he is useing compute shaders in order to improve performance and I am not sure how to access the “Array” to edit it. The goal is to be able to remove a single cube/voxel like in minecraft or 7 days to die (more like 7 days to die because I want it smoothened). I believe that the voxels are being set here in the NoiseDensity.compute

int index = indexFromCoord(id.x,id.y,id.z);
    points[index] = float4(pos, finalVal); //-----------------------> Value of Point is set!!!

The cubes are marched in the MarchingCubes.compute and I believe that the values of the voxels are being stored in the pointsBuffer compute buffer so as a test I attempted to extract these values to an aray where they could later be edited and then set as the new buffer. p.s. i don’t know what a compute buffer is / does, but I believe it is similar to an array. This is my attempt to extract the buffer, in order to do this I made it public in the MeshGenerator script. When I execute the mine function it logs a System.Single. I tried making the float array 2D but that caused an error saying that their is not enough memory.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dig : MonoBehaviour
{
    private MeshGenerator meshGen;

    public float chunkSize = 10f;
    public float range = 3f;
    
    // Start is called before the first frame update
    void Start()
    {
        meshGen = GameObject.FindGameObjectWithTag("MeshGenerator").GetComponent<MeshGenerator>();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Mine()
    {
        Transform myChunk;

        RaycastHit hit;
        if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hit, range))
        {
            Debug.Log(hit.transform.name);

            //if (hit.transform.tag == "Chunk")
            //{
                myChunk = hit.transform;

                float[] voxels = new float[meshGen.pointsBuffer.count];
                meshGen.pointsBuffer.GetData(voxels);
                //meshGen.UpdateChunkMesh(myChunk.GetComponent<Chunk>());

                Debug.Log(voxels);
            
            //}

        }
    }
}

video: Coding Adventure: Marching Cubes - YouTube
His code can be found here: GitHub - SebLague/Marching-Cubes: Coding Adventure

Hi, you might try a Vector4 array instead of float, since the shader is setting points as float4(pos, final value). I was able to extract the positions this way.

Hope that helps.