# Laserscan Clipping — trim and isolate scan geometry

Processes laser-scan geometry using clipping or spraying objects already present in the Builder inputs. Use it to remove unwanted scan regions or isolate regions as separate objects.

## Prepare and export

1. Install a compatible plugin package; this tool also uses internal Builder interfaces, so host compatibility matters.
2. Include laser-scan data and the corresponding clipping or spraying objects in the input sessions, with aligned coordinates.
3. Adapt [UPVBPluginLaserscanClipping.xml](UPVBPluginLaserscanClipping/UPVBPluginLaserscanClipping/UPVBPluginLaserscanClipping.xml), placing it beside the first session or in the installed plugin/helper directory.
4. On clipping objects, supply a `LaserscanClipping` attribute with the intended mode below. The older `LaserscanClippingMode` attribute is accepted as a fallback.
5. Export to a separate output and inspect boundaries, textures and isolated objects.

| Mode | Intended operation |
| --- | --- |
| `ClipOutside` | Trim the scan outside the clipping region. |
| `Delete` | Cut out scan geometry inside the region. |
| `Isolate` | Extract the region into separate geometry. |
| `ignore` | Skip the clipping object. |
| `Update` | Use the old/new scan update workflow. |

Legacy values `OuterBound`, `Cut` and `Replace` correspond to `ClipOutside`, `Delete` and `Isolate`. Spraying objects use `LaserscanUid` and `ElementUid` plus geometry in the `Spraying` aspect. Objects carrying an `Objects` attribute are ignored by mode selection.

## Main settings

- `RetainTextureClipping` and `RetainTextureSpraying` control texture retention.
- `DeleteUnmatchedSpraying` controls removal of unmatched spraying data.
- `MergeClippedItemsByName` groups clipped results by name.
- `DuplicateIsolateMeshes` controls duplication for isolation.
- `CreatePanoramaPOI` adds panorama markers in `PointOfInterest`.
- `ClipPanorama` and `ClipPanoramaDistance` control panorama clipping.
- `UpdateOldUPVC` and `UpdateNewUPVC` identify the old/new scan inputs for updates.
- `ThreadCount` controls concurrency; `LegacyScanSupport` enables legacy scan handling.

The XML sample enables several optional operations. Review it before use. If nothing changes, check the log, attribute spelling, scan format and clipping geometry. The plugin consumes prepared clipping data; it does not supply an interactive clipping editor.

[All solutions](UniversalPlantViewer.SDK.md)
