|
| 1 | +# Pointcloudprinter |
| 2 | +A tool to turn pointcloud data from aerial lidar scans into solid meshes for 3D printing. |
| 3 | + |
| 4 | +## Requirements |
| 5 | +- Data: Your data needs to be one or multiple `.xyz` text files that contain comma separated numbers. I've tested this tool with data from [here](https://www.opengeodata.nrw.de/produkte/geobasis/dom/dom1l/). This website provides free data for the German state NRW. |
| 6 | +- A computer running Windows. (You can port this software to Linux though) |
| 7 | +- Have [Blender](https://www.blender.org/download/) and [Meshlab](http://www.meshlab.net/#download) installed. |
| 8 | + |
| 9 | +## Usage |
| 10 | +1. Download and unpack this software. |
| 11 | +2. Download your pointcloud data and move your `.xyz` files into the data folder. You can also put them somewhere else and configure the location later. |
| 12 | +3. Decide on the location of the square you would like to extract from the data. I suggest you use [Google Maps](https://www.google.com/maps/) to find the right place. Copy the two numbers in your Google Maps URL. They are the latitude and longitude. |
| 13 | +4. Edit the file `create_mesh.bat` and put in your configuration. You need to set your latitude and longitude. You can also set the size of the square you'd like to extract. |
| 14 | +5. Double click the `create_mesh.bat` file. It will now run all the steps required to generate the mesh. Depending on how much data there is to process, this will take between a few minutes and an hour. Once finished, the window closes and if everything worked, a file called `mesh.stl` can be found in the project directory. |
| 15 | + |
| 16 | +If you followed these steps and it did or did not work, please [tell me how it worked](mailto:mail@marian42.de)! |
| 17 | + |
| 18 | +## How it works |
| 19 | +This paragraph will explain what each line of the batch file does. |
| 20 | + |
| 21 | + pointcloudtool.exe extract %datadirectory% pointcloud.xyz %latitude% %longitude% %projection% %size% |
| 22 | + |
| 23 | +This line runs the code from this repository to search all `.xyz`files in the `%datadirectory%`. It collects all points that are in the specified square and writes them to the file `pointcloud.xyz`. |
| 24 | + |
| 25 | + pointcloudtool.exe fix pointcloud.xyz pointcloud.xyz heightmap.xyz |
| 26 | + |
| 27 | +This line runs the same program to fix holes in the pointcloud by adding new points where there are holes. |
| 28 | +These holes confuse the mesh reconstruction algorithm later. It also creates a simplified heightmap of the pointcloud with normals. |
| 29 | + |
| 30 | + %meshlab% -i pointcloud.xyz -i heightmap.xyz -o mesh.stl -s filter_script.mlx |
| 31 | + |
| 32 | +This line runs Meshlab with a script that contains instructions on how to reconstruct the mesh. |
| 33 | +First, Meshlab runs a surface reconstruction algorithm on the heightmap. |
| 34 | +This can be done because normals where calculated for it earlier. |
| 35 | +Then, the normals of this mesh are transferred to the actual, high-detail pointcloud. |
| 36 | +The mesh reconstruction algorithm is run again, now on the big pointcloud. |
| 37 | +This mesh is then saved to mesh.stl. |
| 38 | + |
| 39 | + pointcloudtool.exe makeSolid mesh.stl mesh.stl cube.stl %size% %verticaloffset% |
| 40 | + |
| 41 | +This line, again, uses the program from this project. |
| 42 | +It adds new triangles around the seam of the mesh and connects them, resulting in a watertight, solid mesh. This could already be 3D-printed! |
| 43 | +Furthermore, it creates a box with the exact horizontal and vertical dimensions that where configured. |
| 44 | + |
| 45 | + %blender% -b -P intersect.py -- mesh.stl cube.stl mesh.stl |
| 46 | + |
| 47 | +This line uses Blender calculate the boolean intersection between the solid mesh and the box. The result of this is the final mesh. |
| 48 | + |
| 49 | +## License |
| 50 | + |
| 51 | +This project is distributed under the MIT licensense. Exempt from the license are the parts that link a source, as I didn't write them. |
0 commit comments