Working with point clouds

Software required

 * CloudCompare
 * FileToVox
 * MagicaVoxel
 * Any image editor with basic features like Invert Color and Greyscale

CloudCompare
Point cloud data comes in several forms. The most common ones you'll encounter are .laz and .asc/.xyz

The latest version of FileToVox can directly import .asc files, but if you want to do things like merge it with another point cloud or clean it up first you'll still need CloudCompare.

First open your point cloud file in CloudCompare. You'll see a window with a bunch of settings that can be left at default.

When your file loads you may get something ugly like this image:



Go to Edit - Colors - Height Ramp and choose custom with white being the high value and black being the low value.

Make sure your vertical axis (Z in this case) is chosen.

If your image needs cleaning up you may run into this issue.



Because the highest points are noise hundreds of feet in the air, everything else gets low values that make it hard to see what's going on.

There are several ways to fix this. You can use either of the two noise reduction tools (Tools - Clean), or in this case you can just crop out everything above ground level. (Edit - Crop)

Cropping will preserve your original data separately, so if you mess up you can just delete what you've done and go back to the pre-cropped version in the DB Tree.



Now we need to get it into a form that's usable by MagicaVoxel. If you started with an .asc file you can just save it as .asc again.

For this one, since the data was gathered from above, there's no points on the sides of buildings, so a heightmap and texture will work well.

First go to Tools - Projection - Rasterize. You'll likely have to adjust your grid size to get the size you want. MV's maximum size is 2016x2016, so stay under that. (You can also render at full scale and crop your heightmap and texture in the next step)

For working with terrain, you'll want to set empty cells to interpolate.

Export your heightmap. It should look something like this:



If your point cloud has colors, now export RGB by changing active layer.

For some reason CloudCompare sometimes won't let you export to .png at this stage, but choosing raster will export to .tif, which we can convert back to png in the next step.

Image Editing
First open your heightmap. If it's larger than 2016x2016, crop it down to that size or smaller now.

Now you need to convert it to greyscale, and invert colors if your highest points are darker than your lowest.

Your RGB image shouldn't require editing unless it needs to be cropped or converted to .png

   

Importing
Download FileToVox if you haven't already. To make things as simple as possible I usually just drop both images into the same folder.

Now Shift + Right Click on the FileToVox folder and "Open PowerShell Window here"

Type something like:

replacing the file names with the ones you are using.

is the height of the voxel file. You will probably need to adjust this to get it to look right for your project.

That's it! If everything worked you should get something that looks like this. (You may need to enable Sparse Volume to render the whole thing)