Hello,
I'm computing the workspace of a robot and visualizing it using a PointCloud object. How can I automatize the saving the x, y, z points of the point cloud in a .txt or .xyz text file? Any suggestions?
How to export point cloud data
Re: How to export point cloud data
Read point cloud content with sim.getPointCloudPoints and write to text file:
Code: Select all
local points = sim.getPointCloudPoints(pointCloudHandle)
local f = assert(io.open(filename, 'w'))
for i = 1, #points, 3 do
f:write(string.format('%f, %f, %f\n', points[i], points[i+1], points[i+2]))
end
f:close()