<p>The answer is highly depending on the programming skills of the programmer, but in theory, if all pieces of software exist, they can either be tied together in a workflow process (automated) or directly programmed into a new tool.</p>

CC BY-SA 4.0
2021-07-13T14:21:37.027Z
2021-07-13T14:21:37.027Z
0scar
<p>TL;DR - The problem would <em>appear</em> to be that some of the steps require a bit of manual tinkering in order to complete them successfully - it isn't just a simple question of conversion. So, no (not currently).</p>
<p><em>Also, whilst writing this answer, it dawned on me that unless someone has actually managed to automate the whole process already, then your question may merely invite opinions (rather than factual solutions).</em></p>
<hr />
<p>From the link that you provided the conversion stages seem to be:</p>
<ol>
<li>Obtain the <code>LAZ</code> file from LiDAR</li>
<li><code>LAZ</code> to <code>LAS</code></li>
<li><code>LAS</code> to <code>DSM</code></li>
<li><code>DSM</code> to <code>STL</code></li>
<li><code>STL</code> to G-code</li>
</ol>
<p>These stages would need to be put into an automated pipeline.</p>
<h3 id="step-1-3t5u">Step 1</h3>
<p>This step could be automated.</p>
<h3 id="step-2-c1ql">Step 2</h3>
<p>The LAZ to LAS seems to be a straightforward conversion using  command line tools <code>las2las</code>, <code>lasview</code> and <code>las2dem</code>. This step <em>probably</em> could be automated (assuming that no manual intervention of the settings ​is required), as command line interfaces are easy to script (when compared with a GUI).</p>
<h3 id="step-3-bjn5">Step 3</h3>
<p>This step uses one of three GUI applications and looks like some manual labour (like adjusting settings) <em>may</em> be required, it is not clear. If the applications suggested by the article have APIs then a CLI option of automating the process could be possible - again it is not clear just by reading the article.</p>
<h3 id="step-4-bqet">Step 4</h3>
<p>This step again uses a GUI (possibly to employ the export plugin and certainly to visualise the results) and so would appear to need some settings modifications and reiteration, to quote:</p>
<blockquote>
<p>the conversion settings are something that will have to be explored via trial and error in order to figure out what is right for your dataset. In order to visualize the differences between the different settings you will have to open the .STL file into a software designed for 3D Printing.</p>
</blockquote>
<h3 id="step-5-pwke">Step 5</h3>
<p>While the use of a slicer <em>can</em> be automated (assuming that you have predefined (known parameters) thresholds), it usually requires some manual intervention (at least to begin with). If you google &quot;automate slicing&quot; then some interesting links appear, but usually they are for batch processing of similar objects/models.</p>
<h3 id="summary-3bxj">Summary</h3>
<p>The language used in the steps above contains a lot of conditionals (may, can, could) because there are a lot of variables involved. A substantial amount of research would be required to get these elements of the pipeline to work together seamlessly. So, it is unlikely that a &quot;point and click&quot; solution exists where an STL file would just pop out at the end, with no manual intervention.</p>
<p>That said, if your LiDAR datasets were consistent (i.e. similar environments, similar objects being scanned) then you <em>may</em> be able to find a range of settings, for each stage, that work consistently well for a particular scenario. Then with these settings - in combination with some command line or Python scripting and/or an appropriate GUI scripting tool - you might be able to automate some, if not all, of the process.</p>
<p>Looking even further ahead, by using <em>Machine Learning</em> you may be able to train a model to learn to examine the visual feedback stages and then auto-tinker with the settings in order to get better results - however, whilst not in the realms of impossibility, it certainly is rather cutting edge (at this point in time). In a few years time though, it almost certainly will be possible.</p>

CC BY-SA 4.0
2021-07-13T04:03:50.957Z
2021-07-13T13:59:05.427Z
2021-07-13T13:59:05.427Z
Greenonline
<p>Some people have figured out how to take raw LiDAR data and after going through multiple steps (using LAS tools, converting to digital elevation model (DEM), converting to an STL) getting an STL file that they can then slice and print.</p>
<p>Could you write a program that cuts out all of those intermediate steps and converts raw LiDAR data directly to an STL that can be printed? Could you even cut out the need for slicers and just go straight to a G-code file?</p>
<p>Is this even possible?</p>
<p>From <a href="https://research.umn.edu/units/uspatial/news/3d-printing-models-derived-lidar-data" rel="nofollow noreferrer">3D Printing Models derived from Lidar Data</a>:</p>
<blockquote>
<ol>
<li>Retrieve Lidar Data</li>
<li>Process Lidar Data</li>
<li>Create a DSM</li>
<li>Export the DSM into a .STL</li>
<li>Process for 3D Printing</li>
<li>3D Print!</li>
</ol>
</blockquote>

CC BY-SA 4.0
2021-07-13T16:55:25.717Z
@Greenonline your answer was great. Your answer had to be supposition because my question was too. You've got me thinking and doing extra research, so of course it was a great answer.
Jonathan L.
<g-code><stl><scanning><file-formats>
Building a program to convert LiDAR data directly to an STL or directly to G-code
Jonathan L.
# Building a program to convert LiDAR data directly to an STL or directly to G-code

(Asked by: username_0 on 2021-07-12)

Some people have figured out how to take raw LiDAR data and after going through multiple steps (using LAS tools, converting to digital elevation model (DEM), converting to an STL) getting an STL file that they can then slice and print.

Could you write a program that cuts out all of those intermediate steps and converts raw LiDAR data directly to an STL that can be printed? Could you even cut out the need for slicers and just go straight to a G-code file?

Is this even possible?

From [3D Printing Models derived from Lidar Data](https://research.umn.edu/units/uspatial/news/3d-printing-models-derived-lidar-data):

> 1. Retrieve Lidar Data
> 2. Process Lidar Data
> 3. Create a DSM
> 4. Export the DSM into a .STL
> 5. Process for 3D Printing
> 6. 3D Print!

**Tags:** g-code, stl, scanning, file-formats
> **Comments:**
> **username_0**: @Greenonline your answer was great. Your answer had to be supposition because my question was too. You've got me thinking and doing extra research, so of course it was a great answer.  

---

## 2 answers

### Answer by username_2 on 2021-07-13. Score: 2 | Accepted answer

TL;DR - The problem would *appear* to be that some of the steps require a bit of manual tinkering in order to complete them successfully - it isn't just a simple question of conversion. So, no (not currently).

*Also, whilst writing this answer, it dawned on me that unless someone has actually managed to automate the whole process already, then your question may merely invite opinions (rather than factual solutions).*

---

From the link that you provided the conversion stages seem to be:

1. Obtain the `LAZ` file from LiDAR
2. `LAZ` to `LAS`
3. `LAS` to `DSM`
4. `DSM` to `STL`
5. `STL` to G-code

These stages would need to be put into an automated pipeline.

### Step 1

This step could be automated.

### Step 2

The LAZ to LAS seems to be a straightforward conversion using command line tools `las2las`, `lasview` and `las2dem`. This step *probably* could be automated (assuming that no manual intervention of the settings ​is required), as command line interfaces are easy to script (when compared with a GUI).

### Step 3

This step uses one of three GUI applications and looks like some manual labour (like adjusting settings) *may* be required, it is not clear. If the applications suggested by the article have APIs then a CLI option of automating the process could be possible - again it is not clear just by reading the article.

### Step 4

This step again uses a GUI (possibly to employ the export plugin and certainly to visualise the results) and so would appear to need some settings modifications and reiteration, to quote:

> the conversion settings are something that will have to be explored via trial and error in order to figure out what is right for your dataset. In order to visualize the differences between the different settings you will have to open the .STL file into a software designed for 3D Printing.

### Step 5

While the use of a slicer *can* be automated (assuming that you have predefined (known parameters) thresholds), it usually requires some manual intervention (at least to begin with). If you google "automate slicing" then some interesting links appear, but usually they are for batch processing of similar objects/models.

### Summary

The language used in the steps above contains a lot of conditionals (may, can, could) because there are a lot of variables involved. A substantial amount of research would be required to get these elements of the pipeline to work together seamlessly. So, it is unlikely that a "point and click" solution exists where an STL file would just pop out at the end, with no manual intervention.

That said, if your LiDAR datasets were consistent (i.e. similar environments, similar objects being scanned) then you *may* be able to find a range of settings, for each stage, that work consistently well for a particular scenario. Then with these settings - in combination with some command line or Python scripting and/or an appropriate GUI scripting tool - you might be able to automate some, if not all, of the process.

Looking even further ahead, by using *Machine Learning* you may be able to train a model to learn to examine the visual feedback stages and then auto-tinker with the settings in order to get better results - however, whilst not in the realms of impossibility, it certainly is rather cutting edge (at this point in time). In a few years time though, it almost certainly will be possible.


---

### Answer by username_1 on 2021-07-13. Score: 1

The answer is highly depending on the programming skills of the programmer, but in theory, if all pieces of software exist, they can either be tied together in a workflow process (automated) or directly programmed into a new tool.


---

