Overview
Island detection identifies areas of a layer that have no support from the layer below. These “islands” can cause print failures because they require the resin to cure without anything beneath them, often leading to:- Failed prints with floating geometry
- Delamination between layers
- Resin curing in the vat instead of on the build plate
- Wasted time and materials
How Island Detection Works
The island detection algorithm uses a sophisticated clustering approach to identify unsupported regions:Algorithm Steps
Layer Comparison
Compare each layer with the layer directly below it. The algorithm processes layers sequentially, maintaining both the current and previous layer data.
Row-Based Clustering
Convert layer data into a mask of non-zero voxels, split by rows. Group areas of adjacent pixels within the current layer using cluster analysis.This creates clusters of connected pixels that represent continuous geometry.
Support Detection
For each cluster, check if any run in that cluster overlaps with geometry in the previous layer.If no overlap is found, the cluster is marked as an island.
Data Structures
Layer Representation
Layers are converted to a condensed row format for efficient processing:- First dimension: row index
- Second dimension: run-length encoded pixel data for that row
Cluster Runs
Clusters are tracked usingClusterRun structures containing:
row: The row indexindex: Position within the rowposition: Absolute pixel positionsize: Number of pixels in the run
Overlap Detection
Therow_overlaps function determines if a run has support:
Overlap Logic
Two runs overlap if:- The current run starts before or within the previous run ends:
run.position <= (prev_pos + x) - The current run ends after or within the previous run starts:
(run.position + run.size) >= prev_pos
Cascade Mode
The algorithm supports an optional cascade mode:- Visualization purposes
- Automatic support generation
- Understanding support requirements
Output Format
The function returnsVec<Vec<u64>> where:
- Outer vector: One entry per layer (starting from layer 1)
- Inner vector: Run-length encoded island positions
Encoding Scheme
For each island run, two values are stored:- Offset: Distance from the previous position
- Size: Number of pixels in the island run
Performance Characteristics
Time Complexity
- Per Layer: O(pixels × rows) for clustering
- Overlap Check: O(clusters × runs_per_cluster × runs_in_prev_layer)
- Overall: Linear with number of layers and complexity of geometry
Space Complexity
- Layer Storage: Two layers in memory at once (current + previous)
- Cluster Data: Temporary storage for cluster analysis
- Output: Compressed run-length encoding
Progress Tracking
Interpreting Results
No Islands
Islands Detected
- Layer 1: Island of 50 pixels at position 100, island of 30 pixels at position 170
- Layer 3: Island of 10 pixels at position 500
Use Cases
Pre-Print Validation
Run island detection before starting a print to validate that:
- All geometry has proper support
- No floating islands exist
- The model is printable as-is
Automatic Support Generation
Use detected islands to:
- Generate support structures automatically
- Place supports only where needed
- Optimize support placement
Model Analysis
Analyze models to:
- Identify problematic geometry
- Understand support requirements
- Compare different orientations
Quality Control
In production environments:
- Reject models with islands
- Flag prints for manual review
- Ensure print success rate
Integration Example
Here’s how island detection is typically used:Optimization Techniques
Run-Length Encoding
The algorithm uses RLE extensively to reduce memory usage and improve cache performance:Memory Efficiency
Only two layers are kept in memory at once:Limitations
Best Practices
Run Early in Pipeline
Run Early in Pipeline
Execute island detection early in your slicing pipeline to catch issues before committing to a print.
Use with Orientation Tools
Use with Orientation Tools
Combine with model orientation optimization to find the best print angle with minimal islands.
Consider Cascade Mode
Consider Cascade Mode
Enable cascade mode for visualization purposes, but use standard mode for accurate detection.
Log Results
Log Results
Keep records of island detection results for quality control and process improvement.