RayWrap is a tool for extracting ground and surface meshes from ray clouds by wrapping the point data with triangulated surfaces. It creates mesh representations that can grow in different directions from the point cloud.
raywrap <raycloud_file> <direction> <curvature> [options]
<raycloud_file>: Input ray cloud file (.ply)<direction>: Wrapping direction (upwards, downwards, inwards, outwards)<curvature>: Maximum curvature to bend to (controls surface smoothness)
Grows mesh from bottom upward (typical for ground surface extraction):
raywrap terrain_scan.ply upwards 1.0
Grows mesh from top downward (ceiling or canopy extraction):
raywrap forest_scan.ply downwards 0.5
Grows mesh inward from exterior points:
raywrap building_scan.ply inwards 2.0
Grows mesh outward from interior points:
raywrap cavity_scan.ply outwards 1.5
The curvature value controls surface flexibility:
- Lower values (0.1-0.5): Smoother surfaces, less detail
- Medium values (1.0-2.0): Balanced smoothness and detail
- Higher values (3.0+): More detailed surfaces, follows contours closely
Uses convex hull approach:
- Faster processing
- Suitable for most applications
- Cannot handle overhangs or complex concavities
raywrap scan.ply upwards 1.0
Uses concave hull approach with --full option:
- Slower processing
- Handles overhangs and complex geometry
- More accurate for complex surfaces
raywrap complex_scan.ply upwards 1.0 --full
The tool generates a mesh file with the suffix _mesh.ply:
- Triangulated mesh representation
- Vertices positioned on or near the original points
- Faces connecting vertices to form continuous surface
Extract terrain models from LiDAR data:
raywrap lidar_terrain.ply upwards 0.8
Create building surface meshes:
raywrap building_points.ply outwards 1.2 --full
Extract canopy surfaces:
raywrap forest_canopy.ply downwards 0.6
Handle complex underground geometry:
raywrap cave_scan.ply inwards 2.0 --full
raywrap ground_points.ply upwards 0.5
raywrap facade_scan.ply outwards 1.0 --full
raywrap tree_tops.ply downwards 1.2
raywrap excavation.ply upwards 0.3 --full
raywrap pit_scan.ply inwards 1.8
- Processing large datasets quickly
- Surface has simple, convex geometry
- Overhangs are not important
- Speed is prioritized over accuracy
- Complex surfaces with overhangs
- Detailed accuracy is required
- Processing time is not critical
- Archaeological or precision applications
The tool automatically:
- Removes unbounded rays: Uses only bounded ray endpoints
- Centers coordinates: Temporarily moves data to origin for processing
- Restores position: Returns mesh to original coordinate system
- Works best with dense, well-distributed points
- Requires bounded rays for meaningful results
- Benefits from noise removal (consider
raysmoothfirst)
- Curvature parameter significantly affects output quality
- Lower curvature creates smoother but less detailed meshes
- Higher curvature preserves detail but may include noise
- Default method: Fast, suitable for large datasets
- Full method: Significantly slower, use for smaller or critical datasets
- Processes entire point cloud in memory
- Mesh generation requires additional memory for triangulation
- Consider decimation for very large datasets
- Output mesh is in PLY format with triangular faces
- Mesh reduction is applied to minimize file size
- Coordinate transformations preserve original positioning
- For more detailed information on wrapping algorithms, refer to the
RayWrapsource code atraycloudtools/raywrap/raywrap.cpp.