# AdapterForLaserScans

**AdapterForLaserScans** captures point data from **E57** files and saves it as a **.upvc** file.

This file is then used as input for CAXperts **UDiTH** to generate visualisations.

## Supported Formats

### Laser scan

- E57

> Results may be better if the scanning position is included.

### Panorama

- TruViews
- LFM Panoramas

### Mesh

- OBJ (may include optional MTL and texture files)

## Overview

This section provides a brief overview of the main functions of **AdapterForLaserScans**.

For more detailed information, please refer to the dedicated chapters or [visit our help center](https://help.caxperts.com/).

<img src="./media/AdapterForLaserScans_image11.png" width="660" height="317">

### Operating Principle

**AdapterForLaserScans** converts point cloud data from a *laser scan file* into a *tessellated mesh*.

<img src="./media/AdapterForLaserScans_image8.png" width="500" height="">

It removes duplicate points and optimises cloud density.

<img src="./media/AdapterForLaserScans_image9.png" width="500" height="">

AdapterForLaserScans also integrates 3D textures into the laser scans, as illustrated below:

<img src="./media/AdapterForLaserScans_image10.png" width="500" height="">

### Interface

Select the input folder for AdapterForLaserScans and the required target folder.

<img src="./media/AdapterForLaserScans_image6.png" width="486" height="271">

## Settings

### Meshing Options

<img src="./media/AdapterForLaserScans_LaserScanAdapterSettings.png" width="500" height="">

### \%temp% Option

Given the large file sizes of laser scan data, you can specify the data path for temporary storage. Click **Browse** to select your preferred folder location.

><img src="./media/AdapterForLaserScans_Icon_Info.png" width="16" height="16"> The size of the laser scan files may affect the loading time of AdapterForLaserScans. Overlapping sections of each scan are compared.

### Configurations

**Create `defaultConfig.upv` with views** - This option creates default settings to save laser scan data (`.upv` files) with predefined views.

**Delete temporary files** - Enabling this option ensures that temporary files are deleted regularly to free up space.

<table>
<tr><th colspan="2"><strong>Image/Texture/Panorama Settings</strong></th></tr>
<tr><td>

Convert generated images to panoramas

</td><td>

When this option is enabled, you can choose a viewing point directly from the laser scan. If it is disabled, panoramas are not available through the red `360°` markers.

</td></tr>
<tr><td>

Fill images

</td><td>

Enabling this option improves the quality of the generated images.

*This does not work for TruViews and panoramas.*

</td></tr>
<tr><td>

Resolution

</td><td>

Adjusts the quality of the `360°` image. Move the slider to the left for lower quality (`4000 × 2000` pixels) and to the right for higher quality (`16000 × 8000` pixels).

</td></tr>
</table>

><img src="./media/AdapterForLaserScans_Icon_Info.png" width="16" height="16"> Using the highest resolution can reduce performance.

<table>
<tr><th colspan="2"><strong>OBJ Import</strong></th></tr>
<tr><td>

Aspect to use

</td><td>

<strong>.obj</strong> files can be imported. In **Settings** under **Aspects**, <strong>.obj</strong> files can be deactivated separately.

</td></tr>
</table>

## Command Line Mode

**AdapterForLaserScans** can also be started in command-line mode.

To display all parameters directly in a command window, enter:

`C:\Program Files\CAXperts\LaserscanAdapter>LaserscanAdapter.exe -?`

<img src="./media/AdapterForLaserScans_CMDAdapterForLaserScans.png" width="600" height="">

Available parameters are:

- `-input:C:\Input` (`Occurrence: ExactlyOnce`; Help Text: Path to a folder containing TruViews and laser scans)

- `-output:C:\Output\Example.upvc` (`Occurrence: ExactlyOnce`; Help Text: Path to where the UPVC file is created. File extension `upvc` is added if it is not already present.)

- `-licensekey` (`Occurrence: Arbitrary`; Help Text: Activates the licence key.)

- `-log` (`Occurrence: Arbitrary`; Help Text: Path to the log file. If not defined, the log file is placed in `C:\Users\CAXperts\AppData\Local\Temp`.)

## LaserscanAdapter

To locate this configuration file for editing, you can use the following path:

`%AppData%\CAXperts\LaserscanAdapter\<USERNAME>.ini`

><img src="./media/AdapterForLaserScans_Icon_Info.png" width="16" height="16"> Replace `<USERNAME>` with the actual user name when accessing the file.

Example:
```
[LaserscanAdapter]
DeleteTempFiles=1
TempFolder=%temp%
CreateDefaultConfig=1
ConvertImagesToPanorama=1
FillImages=1
ObjAspect=Simple Physical
TextureResolution=1024
MeshQuality=0
TruViewInput=C:\test
UPVCFile=C:\test.upvc
OutlierCheck=0
RemoveGhostObject=0
ImageType=CubeMapExtracted
sForceRgbMesh=0
[FrmMain]
WindowState=Normal
Top=142
Left=45
Height=330
Width=520
```

### INI Parameters

<table border="1">
    <thead>
        <tr>
            <th>Parameter</th>
            <th>Default Value</th>
            <th>Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>

<strong>BoxSize</strong>

</td>
            <td>

4 [meters]

</td>
            <td>

The mesh is split into boxes of `4 × 4 × 4` metres. If a box is too large or contains too many points, it can be split into smaller boxes. This speeds up calculations. Use the default size for indoor scans. For outdoor scans, such as landscapes or drone scans, use sizes greater than `10` metres.

</td>
        </tr>
        <tr>
            <td>

<strong>FurthestScanDistance</strong>

</td>
            <td>

30 [meters]

</td>
            <td>

Points farther than this distance from the scanner are ignored and removed. For example, with the default setting, a point `30.1` metres away is deleted.

</td>
        </tr>
        <tr>
            <td>

<strong>PointSamplingRate</strong>

</td>
            <td>

1

</td>
            <td>

This defines how often points are sampled from the point cloud. For example, if it is set to `3`, every third point is used for mesh calculations.

</td>
        </tr>
        <tr>
            <td>

<strong>ForceRgbMesh</strong>

</td>
            <td>

0

</td>
            <td>

When set to `1`, the system uses RGB information from the point cloud. This replaces the use of panorama textures.

</td>
        </tr>
        <tr>
            <td>

<strong>SimplifyMeshes</strong>

</td>
            <td>

1

</td>
            <td>

When set to `1`, the system reduces the number of triangles in the mesh after triangulation while maintaining good mesh quality.

</td>
        </tr>
        <tr>
            <td>

<strong>Simplification</strong>

</td>
            <td>

Between 0.001 and 0.000001 depending on the quality

</td>
            <td>

The higher this value, the more strongly the mesh is simplified. This results in fewer triangles.

</td>
        </tr>
        <tr>
            <td>

<strong>OctDownMaxNodeSize</strong>

</td>
            <td>

0.02 [meters]

</td>
            <td>

This determines the level of downsampling and affects the density of the point cloud used for meshing. A lower value means more points and more triangles. The recommended range is between `0.05` and `0.5` metres.

</td>
        </tr>
        <tr>
            <td>

<strong>RemoveGhostObject</strong>

</td>
            <td>

0

</td>
            <td>

When set to `1`, this removes parts of the point cloud that move and are not consistent across different scans.

</td>
        </tr>
        <tr>
            <td>

<strong>FumeCheck</strong>

</td>
            <td>

0

</td>
            <td>

When set to `1`, this removes fumes in the air. It works only if the `RemoveGhostObject` parameter is also set to `1`.

</td>
        </tr>
    </tbody>
</table>
