Skip to main content
Mslicer features an extremely fast slicing engine optimized for MSLA 3D printers. The implementation uses advanced acceleration structures and parallel processing to achieve industry-leading performance.

How Slicing Works

The slicing process converts 3D models into a series of 2D layers that can be printed by an MSLA printer.

Basic Process

  1. Model Loading - 3D models (.stl, .obj) are loaded and converted into triangle meshes
  2. Layer Calculation - The slicer determines how many layers are needed based on the slice height and model bounds
  3. Plane Intersection - Each layer is generated by intersecting a horizontal plane with the model’s triangles
  4. Rasterization - The vector intersections are converted into pixels at the printer’s resolution
  5. Encoding - Layers are compressed using run-length encoding to minimize file size
The uncompressed data for a high-resolution print can easily exceed 30GB. Mslicer compresses layers as they are generated to keep memory usage low.

Acceleration Structures

Mslicer uses two key acceleration structures to achieve fast slicing performance:

1D Segments (Primary Acceleration)

The primary acceleration structure splits the mesh into segments along the Z-axis. Instead of testing every triangle in the mesh for each layer, only triangles that overlap the current layer height are tested. Implementation details (slicer/src/geometry/segments_1d.rs:18):
  • Divides the mesh into 100 vertical segments by default
  • Each segment contains references to triangles that overlap that height range
  • Transformed vertex positions are cached for faster access
  • Significantly reduces the number of intersection tests per layer
// From slice_raster.rs:26-28
let segments = (self.models.iter())
    .map(|x| Segments1D::from_mesh(x, SEGMENT_LAYERS))
    .collect::<Vec<_>>();

Without Segments

Must test all triangles for every layerTime complexity: O(layers × triangles)

With Segments

Only tests relevant triangles per layerTime complexity: O(layers × triangles/100)

BVH (Bounding Volume Hierarchy)

The BVH acceleration structure is used for ray-mesh intersections, including:
  • Support generation and routing
  • Overhang detection
  • Manual support placement
  • Viewport picking
Implementation (slicer/src/geometry/bvh/mod.rs:24):
  • Hierarchical tree structure of bounding boxes
  • Leaf nodes contain up to 8 triangles each
  • Built automatically when models are loaded
  • Enables fast ray casting for support generation
// BVH is built in a background task
let bvh = Bvh::build(&mesh, progress);

Rasterization Algorithm

The rasterization converts vector line segments into pixels at the printer’s resolution.

Scanline Filling

For each row of pixels (slice_raster.rs:56):
  1. Find all line segments that cross the current row
  2. Calculate the X position where each segment intersects
  3. Sort intersections by X position
  4. Use depth tracking to handle overlapping models
  5. Generate runs of white pixels between intersection pairs
// From slice_raster.rs:70-86
let mut intersections = (segments.iter())
    .filter(|&(a, b, _)| (a.y >= yf) ^ (b.y >= yf))
    .map(|(a, b, facing)| {
        let t = (yf - a.y) / (b.y - a.y);
        (a.x + t * (b.x - a.x), facing)
    })
    .collect::<Vec<_>>();
The depth tracking system prevents cavities when models overlap or self-intersect, ensuring solid prints.

Multi-threaded Processing

Slicing is fully parallelized using Rayon for maximum performance. Parallel layer generation (slice_raster.rs:30):
let layers = (0..self.layers)
    .into_par_iter()
    .map(|layer| {
        // Each layer processed independently
    })
    .collect::<Vec<_>>();

CPU Utilization

All CPU cores are utilized during slicing for maximum throughput

Memory Efficient

Layers are compressed immediately after generation

Supported Output Formats

Mslicer supports multiple output formats:
FormatExtensionDescriptionRemote Print
GOO.gooElegoo format for Saturn/Mars printers
CTB.ctbChitubox format (widely compatible)
NanoDLP.zipNanoDLP format
SVG.svgVector output for debugging
Only .goo and .ctb formats can be sent via the Remote Print module.

Performance Characteristics

Mslicer is designed to be extremely fast:
  • Typical slicing time: 2-10 seconds for most models
  • Large models (1M+ triangles): 10-30 seconds
  • Memory usage: ~100-500MB during slicing
  • Output file size: 50-500MB depending on resolution and layer count
As noted in the getting started guide: “mslicer is the fastest MSLA slicer currently available” according to the developer’s benchmarks.

Starting a Slice Operation

To slice your models:
  1. Configure your printer settings in the Slice Config panel
  2. Load your models and position them on the build plate
  3. Press Slice in the top bar or use Ctrl+R
  4. Wait for the operation to complete (usually just a few seconds)
  5. Review the preview and save or send to your printer
The Slice Operation panel will show real-time progress during slicing.

Slice Preview

Navigate and inspect sliced layers

Model Management

Position and transform models before slicing

Build docs developers (and LLMs) love