Exporting PointCloud

I find online the code for the creation of PointCloud from an object in a scene.
The code is here: Code .
Now I need to save this pointcloud object to a file but when I export the file with blender my object is not in a file and the same with the script:
import bpy
import os

from pyntcloud import PyntCloud

blend_file_path = "/Users/marcomameli/Downloads/"
directory = os.path.dirname(blend_file_path)
target_file = os.path.join(directory, 'pointcloud.obj')


I obtain the file obj and mil but when I open it in a online tool to visualize the this file I have an error.
The tool is: Online 3D View

What you want exactly?
Do you want to generate a lot of points on the surface of a mesh and export those points as an .obj or you already have the points and want to convert to an specific format?

You say that you have an error. What is that error? Do you see any message?

I have the point obtained by the first link and I want to convert it in obj or any other file that is useful for pointcloud&ie rappresentation.
The error is on the opening file with the second link and it give me only this information: “Failed to open file. Maybe something is wrong with your file.”

Thank you for your answer.

It seems like the viewer just doesn’t support only-points geometry.
Maybe you can replace the vertices with tiny tetrahedrons using some script, the file will be 4x larger but at least will work.

Do you have a viewer to see point cloud online after the extrapolation from blender?

No, I dont know any web viewer that support raw vertices so far.