I found an approach to calculate volume on Potree. after drawing a polygone area around the wanted element we can calculate the volume partially using a triangulation (in my case i used Delaunay triangulation using the js library "Delaunator"
const points = [[168, 180], [168, 178], [168, 179], [168, 181], [168, 183], ...];
const delaunay = Delaunator.from(points);
// [623, 636, 619, 636, 444, 619, ...]
now after we have small triangles of the drawed polygone we are going to calculate partial volumes of pointcloud inside each triangle. to do that i calculated the coordinates of the center of each triangle and then get the Z value of the intersection with cloud point.
now that we have the are of each triangle and the z valu we can calculate parial volumes
Vi = (triangleArea*height)/3
the total volume is the sum of partial volumes