### Getting Started Tutorial
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
A foundational tutorial to get started with the pyhelios library.
```python
import helios
# Load a sample point cloud
point_cloud = helios.load_point_cloud("path/to/your/point_cloud.las")
# Perform basic processing
processed_cloud = helios.process_point_cloud(point_cloud)
# Visualize the result
helios.visualize(processed_cloud)
```
--------------------------------
### TLS Livox Demo Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing TLS data from a Livox sensor.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/livox_demo.las")
# Visualize the point cloud
tls.show()
```
--------------------------------
### Start and Monitor Simulation
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/A-arboretum_notebook.ipynb
Starts the simulation process and prints status information.
```python
# Start the simulation.
start_time = time.time()
sim.start()
if sim.isStarted():
print(
"Simulation has started!\nSurvey Name: {survey_name}\n{scanner_info}".format(
survey_name=sim.sim.getSurvey().name,
scanner_info=sim.sim.getScanner().toString(),
)
)
```
```python
while sim.isRunning():
duration = time.time() - start_time
mins = duration // 60
secs = duration % 60
print(
"\r"
+ "Simulation is running since {} min and {} sec. Please wait.".format(
int(mins), int(secs)
),
end="",
)
time.sleep(10)
if sim.isFinished():
print("\n" + "Simulation has finished!")
```
--------------------------------
### Full Scene Swap Example
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Scene-swaps
Demonstrates a sequence of scene part modifications including loading different geometries, scaling, translating, and finally removing the part. The example shows initial state, swapping to a cube for two steps, scaling the cube down, and then removing the part.
```XML
```
--------------------------------
### Start simulation
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Getting-started
Initiate the simulation process.
```python
sim.start()
```
--------------------------------
### Import pyhelios and Get Version
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/I-getting-started.ipynb
Import the pyhelios library and print its version. Ensure pyhelios is installed correctly.
```python
import pyhelios
print(pyhelios.__version__)
```
--------------------------------
### DJI Zenmuse L2 Demo Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing data from a DJI Zenmuse L2 sensor.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/dji-zenmuse-l2_demo.las")
# Visualize the point cloud
tls.show()
```
--------------------------------
### Dynamic Geometry Swap Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example demonstrating dynamic geometry swapping in point cloud processing.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/dyn_geom_swap.las")
# Perform dynamic geometry swap
tls.dynamic_geometry_swap()
# Visualize the result
tls.show()
```
--------------------------------
### Multi-Scanner Puck Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example demonstrating processing of data from a multi-scanner Puck system.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/multi_scanner_puck.las")
# Visualize the point cloud
tls.show()
```
--------------------------------
### ULS Toyblocks Livox Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing ULS data of toy blocks from a Livox sensor.
```python
from helios.core.uls import ULS
uls = ULS.from_file("../data/uls/toyblocks_livox.las")
# Visualize the point cloud
uls.show()
```
--------------------------------
### Set up HELIOS++ Development Environment
Source: https://github.com/3dgeo-heidelberg/helios/wiki/First-steps
Commands to clone the repository, create a development environment, and install the package in editable mode.
```bash
git clone https://github.com/3dgeo-heidelberg/helios.git
cd helios
conda env create -f environment-dev.yml
conda activate helios-dev
# On Linux, the following line is recommended, to go with a Conda-provided compiler.
# We had issues with incompatible system compilers before.
conda install -c conda-forge gcc gxx
python -m pip install --no-deps -v -e .
```
--------------------------------
### Arboretum Notebook Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
An example notebook demonstrating the use of pyhelios with arboretum data.
```python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import helios
# Load arboretum data
data = pd.read_csv("../data/arboretum.csv")
# Process the data using helios
processed_data = helios.process_arboretum_data(data)
# Plot the results
plt.figure(figsize=(10, 6))
plt.plot(processed_data['x'], processed_data['y'])
plt.title('Arboretum Visualization')
plt.xlabel('X Coordinate')
plt.ylabel('Y Coordinate')
plt.grid(True)
plt.show()
```
--------------------------------
### TLS Sphere XYZLoader Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for loading and visualizing TLS data of a sphere using XYZLoader.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/sphere_xyzloader.xyz")
# Visualize the point cloud
tls.show()
```
--------------------------------
### Development Installation of HELIOS++
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Clone the repository, set up the development environment using the provided conda environment file, and install the package in editable mode. This is recommended for contributing to the project. Ensure you have a Conda installation.
```bash
git clone https://github.com/3dgeo-heidelberg/helios.git
cd helios
conda env create -f environment-dev.yml
conda activate helios-dev
# On Linux, the following line is recommended, to go with a Conda-provided compiler.
# We had issues with incompatible system compilers before.
conda install -c conda-forge gcc gxx
python -m pip install --no-build-isolation --config-settings=build-dir="build" -v -e .
```
--------------------------------
### Configure Dynamic Motion Frequencies in XML
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Dynamic-scenes
Example demonstrating the use of dynStep and kdtDynStep attributes at both the scene and part levels to manage simulation performance.
```xml
```
--------------------------------
### TLS Tree Dynamic Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing dynamic Terrestrial Laser Scanning (TLS) data of trees.
```python
from helios.core.tls import TLS
tls = TLS.from_file("../data/tls/tree_dynamic.las")
# Visualize the point cloud
tls.show()
```
--------------------------------
### Example HELIOS++ Log File Name
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/doc/debug/DEBUG.md
An example of a correctly named log file for a specific HELIOS++ configuration.
```text
MyExec_KDT4_SAH32_PS1_CS32_WF4_SC8_BC5.log
```
--------------------------------
### Manage simulation lifecycle
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Getting-started
Demonstrates starting, pausing, resuming, and checking the status of a simulation.
```python
import time
sim.start()
if sim.isStarted():
print('Simulation is started!')
time.sleep(1.)
sim.pause()
if sim.isPaused():
print('Simulation is paused!')
if not sim.isRunning():
print('Simulation is not running.')
time.sleep(5)
sim.resume()
if sim.isRunning():
print('Simulation has resumed!')
while sim.isRunning():
pass
# alternatively, we can block the thread until it is finished with sim.join()
if sim.isFinished():
print('Simulation has finished.')
```
--------------------------------
### DetailedVoxels File Format Example
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Scene
An example of the ASCII .vox file format used by DetailedVoxels. It includes header information and voxel data.
```text
VOXEL SPACE
#min_corner: 12.464750289916992 -10.332499504089355 243.5574951171875
#max_corner: 21.312000274658203 -1.6010000705718994 272.84124755859375
#split: 36 35 118
#res:0.25 #nsubvoxel:8 #nrecordmax:0 #fraction-digits:7 #lad_type:Spherical #type:TLS #max_pad:5.0 #build-version:1.4.3
i j k PadBVTotal angleMean bsEntering bsIntercepted bsPotential ground_distance lMeanTotal lgTotal nbEchos nbSampling transmittance attenuation attenuationBiasCorrection
0 0 0 0 86.3137164 0.4989009 0 2.8475497 0.1240837 0.1632028 693.775004 0 4251 1 0 0
0 0 1 0 86.989336 1.011544 0 2.840831 0.3722511 0.1784628 1292.784752 0 7244 1 0 0
0 0 2 0 87.2224845 1.1786434 0 2.835464 0.6204185 0.1828753 1434.1079874 0 7842 1 0 0
0 0 3 0 87.1534196 0.9608315 0 2.8170681 0.8685859 0.1816032 1186.2322972 0 6532 1 0 0
0 0 4 0 87.2968587 0.8746295 0 2.8187793 1.1167532 0.1841085 1201.8604542 0 6528 1 0 0
0 0 5 0 87.1479655 0.9425028 0 2.8363264 1.3649206 0.1747828 1195.6891804 0 6841 1 0 0
```
--------------------------------
### MLS Toyblocks Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Demonstrates processing of MLS data for toy blocks.
```python
from helios.core.mls import MLS
mls = MLS.from_file("../data/mls/toyblocks.las")
# Visualize the point cloud
mls.show()
```
--------------------------------
### Urban MLS Dynamic Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing dynamic Mobile Laser Scanning (MLS) data in an urban environment.
```python
from helios.core.mls import MLS
mls = MLS.from_file("../data/mls/urban_dynamic.las")
# Visualize the point cloud
mls.show()
```
--------------------------------
### Simulation Output Log
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/15-tls_tree_dynamic.ipynb
Example output showing the duration comparison between dynamic and static simulations.
```text
Duration for dynamic simulation: 705.5 s
Duration for static simulation: 25.4 s
On this system, dynamic simulations took 27.8 times longer.
```
--------------------------------
### Start and Monitor Helios Simulation
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/II-the-survey.ipynb
Starts the built Helios simulation and monitors its progress, printing the elapsed time until completion. The simulation output is then joined.
```python
import time
start_time = time.time()
simB.start()
if simB.isStarted():
print("Simulation is started!")
while simB.isRunning():
duration = time.time() - start_time
mins = duration // 60
secs = duration % 60
print(
"\r"
+ "Simulation is running since {} min and {} sec. Please wait.".format(
int(mins), int(secs)
),
end="",
)
time.sleep(1)
output = simB.join()
print("\nSimulation has finished.")
```
--------------------------------
### Define a custom static tripod platform
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Platforms
Example of a static platform configuration with a custom scanner mount height.
```xml
```
--------------------------------
### Display Survey XML Configuration
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/15-tls_tree_dynamic.ipynb
Displays the XML configuration file for the survey setup.
```python
Code(display_xml("data/surveys/dyn/tls_tree1_dyn.xml"), language="XML")
```
--------------------------------
### ALS HD Demo Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Demonstrates Airborne Laser Scanning (ALS) High Definition data.
```python
from helios.core.als import ALS
als = ALS.from_file("../data/als/hd_demo.las")
# Visualize the point cloud
als.show()
```
--------------------------------
### TLS Arbaro Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Demonstrates processing of TLS data using the Arbaro library.
```python
import numpy as np
from helios.core.tls import TLS
from helios.core.tls.arbaro import Arbaro
tls = TLS.from_file("../data/tls/arbaro.las")
# Create a new Arbaro instance
arbaro = Arbaro(tls)
# Get the tree parameters
tree_params = arbaro.get_tree_params()
# Print the tree parameters
print(tree_params)
```
--------------------------------
### Start, Pause, and Resume Simulation
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/III-pyhelios_sim_and_vis.ipynb
Initiates the LiDAR simulation, demonstrates pausing and resuming its execution, and checks its status.
```python
# Start the simulation.
sim = simB.build()
sim.start()
# Various simulation status functions available.
if sim.isStarted():
print("Simulation has started!")
# Simulation can be paused with simulation.pause().
time.sleep(3)
sim.pause()
if sim.isPaused():
print("Simulation is paused!")
if not sim.isRunning():
print("Sim is not running.")
time.sleep(5)
sim.resume()
if sim.isRunning():
print("Simulation has resumed!")
```
--------------------------------
### Execute HELIOS++ Simulation
Source: https://github.com/3dgeo-heidelberg/helios/wiki/First-steps
Commands to start a simulation using a survey file and optional asset paths.
```bash
helios [survey-file]
```
```bash
helios [survey-file] --assets --assets
```
```bash
helios data\surveys\demo\tls_arbaro_demo.xml
```
--------------------------------
### Run Simulation with Status Checks and Timing
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/I-getting-started.ipynb
Demonstrates starting, pausing, resuming, and monitoring a simulation's progress over time. Includes time-based status updates.
```python
import time
sim.start()
if sim.isStarted():
print("Simulation is started!")
time.sleep(1.0)
sim.pause()
if sim.isPaused():
print("Simulation is paused!")
if not sim.isRunning():
print("Simulation is not running.")
time.sleep(5)
start_time = time.time()
sim.resume()
if sim.isRunning():
print("Simulation is resumed!")
while sim.isRunning():
duration = time.time() - start_time
mins = duration // 60
secs = duration % 60
print(
"\r"
+ "Simulation is running since {} min and {} sec. Please wait.".format(
int(mins), int(secs)
),
end="",
)
time.sleep(1)
if sim.isFinished():
print("\nSimulation has finished.")
```
--------------------------------
### Calculate and Get Survey Length
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Details
Calculates the length of the survey if it hasn't been run yet, and then retrieves the length. If the survey has already started, getLength() will return the pre-calculated length.
```python
survey.calculateLength()
length = survey.getLength()
```
--------------------------------
### Helios Simulation Output
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/1-tls_arbaro.ipynb
Example output from the Helios simulation, detailing configuration parameters, asset loading, and KD-Grove building statistics. This output provides insights into the simulation's setup and processing.
```text
HELIOS++ VERSION 2.0.0a3.dev10+g9e1844ae.d20240528
CWD: "E:\\Software\\_helios_versions\\helios"
seed: AUTO
surveyPath: "data/surveys/demo/tls_arbaro_demo.xml"
assetsPath: ["E:\\Software\\_helios_versions\\helios", "E:\\Software\\_helios_versions\\helios\\python\\pyhelios", "E:\\Software\\_helios_versions\\helios\\python\\pyhelios\\data", "assets/", ]
outputPath: "output/"
writeWaveform: 0
writePulse: 0
calcEchowidth: 0
fullWaveNoise: 0
splitByChannel: 0
parallelization: 1
njobs: 0
chunkSize: 32
warehouseFactor: 4
platformNoiseDisabled: 0
legNoiseDisabled: 0
rebuildScene: 0
writeScene: 1
lasOutput: 0
las10: 0
fixedIncidenceAngle: 0
gpsStartTime:
kdtType: 4
kdtJobs: 0
kdtGeomJobs: 0
sahLossNodes: 32
xmlDocFilename: tls_arbaro_demo.xml
xmlDocFilePath: E:\\Software\\_helios_versions\\helios\\data/surveys/demo
xmlDocFilename: scanners_tls.xml
xmlDocFilePath: E:\\Software\\_helios_versions\\helios\\python\\pyhelios\\data
Using default value for attribute 'averagePower_w' : 4
Using default value for attribute 'beamQualityFactor' : 1
Using default value for attribute 'opticalEfficiency' : 0.99
Using default value for attribute 'receiverDiameter_m' : 0.15
Using default value for attribute 'atmosphericVisibility_km' : 23
Using default value for attribute 'wavelength_nm' : 1064
Scanner: riegl_vz400
Device[0]: riegl_vz400
Average Power: 4 W
Beam Divergence: 0.3 mrad
Wavelength: 1064 nm
Visibility: 23 km
Using default value for attribute 'maxNOR' : 0
Using default value for attribute 'rangeMax_m' : 1.79769e+308
Using default value for attribute 'binSize_ns' : 0.25
Using default value for attribute 'winSize_ns' : 1.25
Using default value for attribute 'maxFullwaveRange_ns' : 0
Using default value for attribute 'apertureDiameter_m' : 0.15
Number of subsampling rays (riegl_vz400): 19
Using default value for attribute 'receivedEnergyMin_W' : 0.0001
xmlDocFilename: platforms.xml
xmlDocFilePath: E:\\Software\\_helios_versions\\helios\\python\\pyhelios\\data
No platform type specified. Using static platform.
Using default value for attribute 'winSize_ns' : 1.25
Using default value for attribute 'maxFullwaveRange_ns' : 0
Using default value for attribute 'apertureDiameter_m' : 0.15
Number of subsampling rays (riegl_vz400): 19
Using default value for attribute 'numRuns' : 1
Using default value for attribute 'simSpeed' : 1
Using default value for attribute 'stripId' : NULL_STRIP_ID
Using platform default value for attribute 'z' : 0
Using platform default value for attribute 'stopAndTurn' : 1
Using platform default value for attribute 'smoothTurn' : 0
Using platform default value for attribute 'slowdownEnabled' : 1
Using platform default value for attribute 'movePerSec_m' : 70
Using scanner default value for attribute 'beamDivergence_rad' : 0.003
Using scanner default value for attribute 'trajectoryTimeInterval_s' : 0
Using default value for attribute 'name' : Unnamed scannerSettings asset
Using scanner default value for attribute 'active' : 1
Using scanner default value for attribute 'pulseFreq_hz' : 100000
Using scanner default value for attribute 'scanFreq_hz' : 120
Using scanner default value for attribute 'beamDivergence_rad' : 0.003
Using default value for attribute 'stripId' : NULL_STRIP_ID
Using platform default value for attribute 'z' : 0
Using platform default value for attribute 'stopAndTurn' : 1
Using platform default value for attribute 'smoothTurn' : 0
Using platform default value for attribute 'slowdownEnabled' : 1
Using platform default value for attribute 'movePerSec_m' : 70
Using scanner default value for attribute 'active' : 1
Using scanner default value for attribute 'pulseFreq_hz' : 100000
Using scanner default value for attribute 'scanFreq_hz' : 120
Using scanner default value for attribute 'beamDivergence_rad' : 0.003
Loading Scene...
Reading serial scene wrapper object from E:\\Software\\_helios_versions\\helios\\data/scenes/demo/arbaro_demo.scene ...
Building KD-Grove...
KDTree (num. primitives 226860) :
Max. # primitives in leaf: 77
Min. # primitives in leaf: 1
Max. depth reached: 38
KDTree axis-aligned surface area: 91156.3
Interior nodes: 421922
Leaf nodes: 350744
Total tree cost: 6.16345
KDGrove stats:
Number of trees: 1
Number of static trees: 1
Number of dynamic trees: 0
Statistics (min, max, total, mean, stdev):
Building time: (0.5320, 0.5320, 0.5320, 0.5320, 0.0000)
Tree primitives: (226860, 226860, 226860, 226860.0000, 0.0000)
Max primitives in leaf: (77, 77, 77, 77.0000, 0.0000)
Min primitives in leaf: (1, 1, 1, 1.0000, 0.0000)
Maximum depth: (38, 38, 38, 38.0000, 0.0000)
Axis-aligned surface area: (91156.3160, 91156.3160, 91156.3160, 91156.3160, 0.0000)
Number of interior nodes: (421922, 421922, 421922, 421922.0000, 0.0000)
```
--------------------------------
### Install HELIOS++ with Conda
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Use this command to install HELIOS++ via the conda-forge channel. Ensure you have a Conda installation like mamba, micromamba, or miniconda.
```bash
conda install -c conda-forge helios
```
--------------------------------
### Configure scanner and platform settings with templates
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Survey
Demonstrates defining global settings as templates and referencing them within legs, with local overrides for specific parameters.
```xml
```
--------------------------------
### Install Helios++ Executable
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/CMakeLists.txt
Defines an installation rule to copy the compiled 'helios++' executable into the 'pyhelios/bin' directory of the Python package. This ensures the executable is available when the package is installed.
```cmake
install(
TARGETS
helios++
DESTINATION pyhelios/bin
)
```
--------------------------------
### pyhelios Simulation and Visualization Tutorial
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Tutorial covering simulation and visualization capabilities of pyhelios.
```python
import helios
# Simulate a point cloud
simulated_cloud = helios.simulate_point_cloud(parameters)
# Visualize the simulated data
helios.visualize_simulation(simulated_cloud)
```
--------------------------------
### Initialize SimulationBuilder
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Details
Sets up the SimulationBuilder with survey data, asset paths, and output directories. Configures logging, number of threads, and output format.
```python
import pyhelios
pyhelios.loggingQuiet()
# Build simulation parameters
simBuilder = pyhelios.SimulationBuilder(
'data/surveys/demo/tls_arbaro_demo.xml',
'assets/',
'output/'
)
simBuilder.setNumThreads(0)
simBuilder.setLasOutput(True)
simBuilder.setZipOutput(True)
```
--------------------------------
### Run Simple Primitives Demo
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/doc/debug/DEBUG.md
Execute the simple demo to verify the correct loading and functionality of the demos module. A successful run will visualize basic primitives.
```bash
./helios --demo simple_primitives
```
--------------------------------
### Initialize CMake Project and Environment
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/CMakeLists.txt
Sets up the project versioning, environment paths for Conda, and basic CMake policies.
```cmake
cmake_minimum_required(VERSION 3.18)
# If we are running in a Conda environment, we automatically
# add the Conda env prefix to the CMAKE_PREFIX_PATH
if(DEFINED ENV{CONDA_PREFIX})
list(APPEND CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}")
#TODO: Windows Conda environments are structured differently,
# how unfortunate is this?
list(APPEND CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}/Library")
endif()
# Set the version strings for the project
if(SKBUILD)
set(HELIOS_VERSION ${SKBUILD_PROJECT_VERSION})
set(HELIOS_VERSION_FULL ${SKBUILD_PROJECT_VERSION_FULL})
else()
set(HELIOS_VERSION "2.0.1")
set(HELIOS_VERSION_FULL "2.0.1")
endif()
project(Helios++
VERSION ${HELIOS_VERSION}
LANGUAGES C CXX
DESCRIPTION "Helios software for LiDAR simulations")
# We also store relevant CMake modules in the cmake/ directory
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
# Set CMake policies for this project
# We allow _ROOT (env) variables for locating dependencies
cmake_policy(SET CMP0074 NEW)
# We allow target_sources to convert relative paths to absolute paths
cmake_policy(SET CMP0076 NEW)
# Initialize some default paths
include(GNUInstallDirs)
# Define the minimum C++ standard that is required
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# For Python bindings, we need to enable position-independent code
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
```
--------------------------------
### Live Trajectory Plot Tutorial
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Tutorial on plotting live trajectories using pyhelios.
```python
import helios
# Initialize live trajectory plotter
trajectory_plotter = helios.LiveTrajectoryPlotter()
# Update with new trajectory data
trajectory_plotter.update(new_data)
# Keep the plot running
trajectory_plotter.run()
```
--------------------------------
### Install HELIOS++ via Conda
Source: https://github.com/3dgeo-heidelberg/helios/wiki/First-steps
Use these commands to install the HELIOS++ package from the conda-forge channel.
```bash
conda install -c conda-forge helios
```
```bash
mamba install -c conda-forge helios
```
--------------------------------
### Interpolated Trajectory Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example showcasing the use of interpolated trajectories in point cloud processing.
```python
from helios.core.trajectory import Trajectory
trajectory = Trajectory.from_file("../data/trajectory/interpolated.csv")
# Get interpolated positions
interpolated_positions = trajectory.get_interpolated_positions()
# Print the interpolated positions
print(interpolated_positions)
```
--------------------------------
### MLS Wheat Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing Mobile Laser Scanning (MLS) data of wheat.
```python
from helios.core.mls import MLS
mls = MLS.from_file("../data/mls/wheat.las")
# Visualize the point cloud
mls.show()
```
--------------------------------
### Build simulation parameters
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Getting-started
Initialize a simulation using SimulationBuilder to define paths, threading, and output behavior.
```python
# Build simulation parameters
simBuilder = pyhelios.SimulationBuilder(
'data/surveys/demo/tls_arbaro_demo.xml',
'assets/',
'output/'
)
simBuilder.setNumThreads(0)
simBuilder.setLasOutput(True)
simBuilder.setZipOutput(True)
simBuilder.setCallbackFrequency(0) # Run without callback
simBuilder.setFinalOutput(True) # Return output at join
simBuilder.setExportToFile(False) # Disable export pointcloud to file
simBuilder.setRebuildScene(False)
```
--------------------------------
### Manual CMake Build
Source: https://github.com/3dgeo-heidelberg/helios/wiki/First-steps
Alternative instructions for building the project manually using CMake.
```bash
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH= ..
make
```
--------------------------------
### Install PDAL with Conda
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/A-arboretum_notebook.ipynb
Installs PDAL, python-pdal, and GDAL using Conda. Ensure you are in the correct environment.
```bash
conda install -c conda-forge pdal python-pdal gdal
```
--------------------------------
### Visualize Moving TLS Toyblocks Scene
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/doc/debug/DEBUG.md
An example command to visualize the moving TLS toyblocks scene using the dynamic scene demo. Ensure the survey and assets paths are correct.
```bash
./helios --demo dynamic_scene --demoSurvey data/surveys/toyblocks/moving_tls_toyblocks.xml --demoAssets assets/
```
--------------------------------
### Initialize Simulation Builder
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/A-arboretum_notebook.ipynb
Configures the simulation parameters including output formats and callback frequency.
```python
# use SimulationBuilder to configure simulation
simB = SimulationBuilder(str(survey_file), "assets/", "output/")
simB.setLasOutput(True)
simB.setZipOutput(True)
simB.setCallbackFrequency(10000)
```
--------------------------------
### ALS ULS Detailed Voxel Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example demonstrating detailed voxelization for ALS and ULS data.
```python
from helios.core.als import ALS
from helios.core.uls import ULS
als = ALS.from_file("../data/als/detailed_voxel.las")
uls = ULS.from_file("../data/uls/detailed_voxel.las")
# Voxelize the point clouds
als_voxel = als.voxelize(0.1)
uls_voxel = uls.voxelize(0.1)
# Visualize the voxelized point clouds
als_voxel.show()
uls_voxel.show()
```
--------------------------------
### The Survey Tutorial
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Tutorial focusing on handling and processing survey data with pyhelios.
```python
import helios
# Load survey data
survey_data = helios.load_survey_data("path/to/survey.las")
# Analyze survey parameters
survey_analysis = helios.analyze_survey(survey_data)
# Display analysis results
print(survey_analysis)
```
--------------------------------
### Initialize Simulation and Create Legs
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Details
Demonstrates the initialization of a simulation with a default survey and the subsequent creation of legs within the Python script. This is useful when a survey initially contains no legs.
```python
import pyhelios
pyhelios.loggingDefault()
default_survey_path = "data/surveys/default_survey.xml"
```
--------------------------------
### Build Simulation
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/A-arboretum_notebook.ipynb
Constructs the simulation instance from the builder configuration.
```python
# build the simulation
sim = simB.build()
```
--------------------------------
### ALS HD Height Above Ground Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for calculating height above ground using ALS HD data.
```python
from helios.core.als import ALS
als = ALS.from_file("../data/als/hd_height_above_ground.las")
# Calculate height above ground
height_above_ground = als.height_above_ground()
# Visualize the result
als.show(height_above_ground)
```
--------------------------------
### Configure Scene XML with Scene Writer
Source: https://github.com/3dgeo-heidelberg/helios/wiki/pyhelios-🐍-The-util-subpackage
Demonstrates programmatic creation of scene XML files using the scene_writer module.
```python
from pyhelios.util import scene_writer
```
```python
filters = scene_writer.add_transformation_filters(translation=[478335.125, 5473887.89, 0.0], rotation=[0, 0, 90], on_ground=-1)
```
```python
sp = scene_writer.create_scenepart_tiff(r"data/sceneparts/tiff/dem_hd.tif",
matfile=r"data/sceneparts/basic/groundplane/groundplane.mtl",
matname="None")
sp2 = scene_writer.create_scenepart_obj("data/sceneparts/arbaro/black_tupelo_low.obj", trafofilter=filters)
```
```python
scene = scene_writer.build_scene(scene_id="test", name="test_scene", sceneparts=[sp, sp2])
print(scene)
```
```console
```
--------------------------------
### Initialize Simulation Builder
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/III-pyhelios_sim_and_vis.ipynb
Creates a SimulationBuilder instance to configure and build the LiDAR simulation. Specify paths for surveys, assets, and output.
```python
from pyhelios import SimulationBuilder
simB = SimulationBuilder("data/surveys/" + survey_path, "assets/", "output/")
simB.setLasOutput(True)
simB.setZipOutput(False)
simB.setCallbackFrequency(100)
simB.setFinalOutput(True)
```
--------------------------------
### ALS Toyblock Multi-Scanner Livox Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing ALS data from multiple Livox scanners on toy blocks.
```python
from helios.core.als import ALS
als = ALS.from_file("../data/als/toyblock_multi_scanner_livox.las")
# Visualize the point cloud
als.show()
```
--------------------------------
### Build Simulation Configuration
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/I-getting-started.ipynb
Create a SimulationBuilder instance with survey XML, asset paths, and output directory. Configure simulation parameters like number of threads, output format, callback frequency, and scene rebuilding.
```python
simBuilder = pyhelios.SimulationBuilder(
"data/surveys/toyblocks/als_toyblocks.xml", ["assets/"], "output/"
)
# simBuilder.setNumThreads(1) # use only one thread (to ensure reproducibility)
simBuilder.setLasOutput(True)
simBuilder.setZipOutput(True)
simBuilder.setCallbackFrequency(10) # Run with callback
simBuilder.setFinalOutput(True) # Return output at join
# simBuilder.setExportToFile(False) # Disable export point cloud to file
simBuilder.setRebuildScene(True)
sim = simBuilder.build()
```
--------------------------------
### ULS Toyblocks Surveyscene Example
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/README.md
Example for processing Unmanned Laser Scanning (ULS) data of toy blocks in a survey scene.
```python
from helios.core.uls import ULS
uls = ULS.from_file("../data/uls/toyblocks_surveyscene.las")
# Visualize the point cloud
uls.show()
```
--------------------------------
### Configure and Build a Simulation
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Python-bindings-🐍-Details
Initializes a survey XML file and uses the SimulationBuilder to configure simulation parameters and build the simulation object.
```python
survey = """
"""
with open(default_survey_path, "w") as f:
f.write(survey)
simBuilder = pyhelios.SimulationBuilder(default_survey_path, "assets/", "output/")
simBuilder.setCallbackFrequency(10)
simBuilder.setLasOutput(True)
simBuilder.setZipOutput(True)
simBuilder.setRebuildScene(True)
simB = simBuilder.build()
```
--------------------------------
### Install NumPy for helios-live Compatibility
Source: https://github.com/3dgeo-heidelberg/helios/wiki/Visualising-the-simulation
If `helios-live` crashes due to NumPy version incompatibility (versions >= 2.0.0), install version 1.26.4 to resolve the issue.
```bash
mamba install numpy=1.26.4
```
--------------------------------
### Run Dynamic Scene Demo
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/doc/debug/DEBUG.md
Visualize a scene composed by HELIOS++ using the dynamic scene demo. Specify the survey path and assets directory.
```bash
./helios --demo dynamic_scene --demoSurvey --demoAssets
```
--------------------------------
### Install Python Bindings Library
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/CMakeLists.txt
Installs the compiled Python bindings library '_pyhelios' to the root of the Python package if the BUILD_PYTHON flag is enabled. This makes the library accessible to Python scripts.
```cmake
if(BUILD_PYTHON)
install(
TARGETS
_pyhelios
DESTINATION .
)
endif()
```
--------------------------------
### Build Simulation with SimulationBuilder
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/example_notebooks/II-the-survey.ipynb
Initialize a simulation using the SimulationBuilder, specifying the survey XML file, asset paths, and output directory. Configure thread count, LAS output, and ZIP output options.
```python
simBuilder = pyhelios.SimulationBuilder(
"data/surveys/toyblocks/als_toyblocks.xml", ["assets/"], "output/"
)
simBuilder.setNumThreads(0)
simBuilder.setLasOutput(True)
simBuilder.setZipOutput(True)
simB = simBuilder.build()
```
--------------------------------
### Run Ray Casting Demo
Source: https://github.com/3dgeo-heidelberg/helios/blob/main/doc/debug/DEBUG.md
Visualize the ray casting process of a given survey. This demo helps in understanding how rays are cast and rendered, with options to view details or a global perspective.
```bash
./helios --demo raycasting --demoSurvey --demoAssets
```