Skip to main content

Module streaming

Module streaming 

Source
Expand description

Streaming point cloud processing pipeline.

Enables out-of-core processing of arbitrarily large point clouds by reading and processing data in bounded-size chunks. Only one chunk resides in RAM at a time; the pipeline accumulates lightweight per-chunk state (e.g. a voxel map) that is orders of magnitude smaller than the full dataset.

§Architecture

Source iterator                Pipeline stage           Output
(file / network / …)  ──►  process_chunk(&[T])  ──►  finalize()
     chunk 0                  accumulate state
     chunk 1                  accumulate state
     …                        …
     chunk N                  accumulate state

§Provided pipelines

TypeDescription
StreamingVoxelFilterDownsamples via a voxel grid; O(voxels) memory
StreamingStatisticsAccumulates bounding-box and point count
StreamingCollectorCollects all points (useful for testing)

§Example

use threecrate_algorithms::streaming::{
    StreamingPipeline, StreamingVoxelFilter, StreamingVoxelFilterConfig, run_pipeline,
};
use threecrate_core::Point3f;

let points: Vec<Result<Point3f, _>> = vec![
    Ok(Point3f::new(0.0, 0.0, 0.0)),
    Ok(Point3f::new(0.05, 0.0, 0.0)),
    Ok(Point3f::new(1.0, 1.0, 1.0)),
];
let mut filter = StreamingVoxelFilter::new(StreamingVoxelFilterConfig { voxel_size: 0.1 });
let stats = run_pipeline(&mut filter, points.into_iter(), 2).unwrap();
let cloud = filter.finalize().unwrap();
println!("Downsampled to {} points", cloud.len());

Structs§

PointCloudStats
Accumulated statistics produced by StreamingStatistics.
RunOptions
Options for run_pipeline.
RunStats
Statistics reported by run_pipeline.
StreamingCollector
Streaming pipeline stage that collects all points into a PointCloud.
StreamingStatistics
Streaming statistics collector.
StreamingVoxelFilter
Streaming voxel-grid downsampler.
StreamingVoxelFilterConfig
Configuration for StreamingVoxelFilter.

Traits§

StreamingPipeline
Trait for chunk-based streaming processors.

Functions§

cloud_as_stream
Wrap a PointCloud as a streaming source of Result<Point3f>.
run_pipeline
Drive pipeline by reading from source in chunks of chunk_size items.
run_pipeline_with_options
Like run_pipeline but accepts explicit options.