This repository contains the process of transforming bathymetric data from a .laz
file into a 3D model. The process is explained in three main steps, from obtaining the .laz
file to generating a 3D mesh and preparing it for 3D printing using Blender.
- Getting the .laz File
- Generating an Image from the .laz File
- Creating a 3D Mesh from the Image
- Editing the 3D Model in Blender
Bathymetric data is typically stored in .laz
files, which are compressed LiDAR data files. Here's how you can obtain a .laz
file:
- Find a Data Source: Bathymetric data can be obtained from various sources such as the USGS, NOAA, or other geological data repositories. Also inside laz.db databases already created.
- Download the File: Ensure that the data covers the region you're interested in and download the
.laz
file to your local machine.
Once you have the .laz
file, the next step is to generate an image that represents the bathymetric map. For this, we used the program QGIS:
-
Read the .laz File: We used QGIS as it is easier to operate. Drag and drop .laz into QGIS window.
-
Process the Data: Extract the relevant points from the file and convert them into a grayscale image, where the brightness corresponds to depth.
- Change
.laz
PointCloud to GreyScale- Open Layer Settings: Double left click on the "Layers" window (bottom left).
- Navigate to Attibute Settings: Navigate to Simbology>Attribute by Ramp.
- Change Color Ramp: See option "Color ramp" and select Greys from the drop down menu.
- Convert LAZ layer to raster Layer: Convert your
.laz
file into a format that QGIS can work with, such as a raster GeoTIFF DEM (Digital Elevation Model).- Install LASTools Plugin: Download LASTools Plugin going to Plugins Menu and clicking on "Manage and Install Plugins". Then, search for LASTools plugin
- Install LASTools Library: QGIS will try to find LASTools library in <C:\LAStools\bin\las2dem>. Make sure that LASTools are installed in your system and located in this directory. LASTools library can be found in: LASTools Official Website
- Convert LAZ CloudPoints into GeoTIFF:
- Find the newly installed Toolbox in Processing menu by clicking "Toolbox".
- Search for las2dem inside LASTools package tool and double click.
- Select your
.laz
file as input and configure as recommended by the IDE on the right hand side of the window. To gain more resolution, use the <step size / pixel size> in order to gain more or less resolution. We used 0.1 and that was enough for our application, but we tried different values in between 0 and 1. - Set output file by selecting "Save to File" and the file must be given the extension
.tif
so las2dem tool understands that we want a GeoTiff file.
- Create Area of Interest (AoI):
- Create new ShapeFile Layer: Set Geometry Type to "Polygon".
- Enable editing: Right click on the layer and click on "Toggle Editing" option.
- Enable Shape Digitizing Toolbar: Go into View Menu > Toolbars and enable Shape Digitizing Toolbar.
- Create Rectangle over AoI: Use the Shape Digitizing Toolbar to create a rectangle that represents your AoI using "Rectangle from 3 points (distance) option.
- Disable editing: Once the editing is done, Right click on the layer and click on "Toggle Editing" option. Editing should deactivate.
- Clip GeoTiff DEM layer using AoI:
- Remove laz layer or disable it
- Import newly created
.tif
file - Make sure Geotiff DEM layer and AoI are enabled
- Clip the DEM
- Go to Raster menu > Extraction > Clip Raster by Mask Layer
- Input Layer should be the previously created DEM layer.
- Mask Layer should be the AoI polygon we just created
- Set the file it will be saved into. Here the extension is provided by QGIS.
- Run the tool. > Note: Errors like this ERROR 1: Did not get any cutline features and ERROR 1: Cannot compute bounding box of cutline. Cannot find source SRS can be found. Use the forum to sor them out.
- Change
-
Save the Image: Export the processed data as an image file
.tiff
, which will be used in the next step.
To do this, we used a free to use SW called Terresculptor.
- Import the DEM into Terresculptor: Go to File menu. Then click in "Import Terrain". A new window will appear and in the different file formats proposed, choose "TIFF/GeoTIF [new] (*tif, *tiff)". We will then find our GeoTIFF file with our DEM. Select the file and Open it. Make sure option "Fill Holes" is selected, just in case.
- Smooth the Surface: If topografic lines and other hard edges need to be smoothened out, use this Smooth tool. It can be found inside the Filter menu. Play with parameters "Size", "Strength" and "Passes" to modify the surface of the model.
- Export the 3D model: Inside File menu, Click on "Export Terrain" and choose Alias Wavefront Object (
*.obj
).Then, proceed to Save the file and accept default configuration.
To make the appropiated edits, we used Blender.
- Scale the object to an appropiated X and Y: In our case, for our printer, 25x25cm XY. To do this, select the object and press "N".
- Decimate the object: In the Properties panel (usually located on the right side), go to the Modifiers tab (the wrench icon). Click in Add Modifier and find Generate>Decimate. We chose to decimate less than 25% of the triangles. Pivot between wireframe and shading viewpoint modes to understand better the effect of this modifier and make sure no important details are lost.
- Trim the plane: If the plane generated by
- In our case, we generated a cube to trim the
.obj
to 24x24cm. Leaving 0.5cm per side for tolerance. Mkae sure both objects are aligned to their centers. - In the Properties panel (usually located on the right side), go to the Modifiers tab (the wrench icon). Click in Add Modifier and find Generate>Boolean.
- Use Intersect mode and select the Cube as intersecting Object.
- In our case, we generated a cube to trim the
- Close the plane to form an object with volume:
- Go into Edit Mode (Can press Tab for this).
- Press 2 to switch to edge select mode (or click the edge select button in the toolbar).
- Press Alt + Shift + Left Click on one of the outer edges of your surface. This should select the entire boundary edge loop around your surface.
- Select the 4 sides of the plane.
- Press "D" to duplicate the points.
- Press "E" to extrude.
- With the vertices selected, press S to scale.
- Press Z to constrain the scaling to the Z-axis.
- Type 0 and press Enter.
- Move the newly created vertex points along the "Z" axis and lower them to the lowest vertex of the mesh.
- Still having all the newly created vertex selected, press "F" for Blender to create a new face connecting them all and closing the 3D mesh.
- Export the new Mesh to .stl: This can be done by going into File menu and clicking in Export>STL (.stl) option. Other formats can be exported depending on what you need to work with. We used .stl because we wanted to 3D print this specific area.