generate_shell_with_progress

Function generate_shell_with_progress 

Source
pub fn generate_shell_with_progress(
    inner_shell: &Mesh,
    params: &ShellParams,
    callback: Option<&ProgressCallback>,
) -> (Mesh, ShellResult)
Expand description

Generate a printable shell with progress reporting.

This is a progress-reporting variant of generate_shell that allows tracking the shell generation progress and supports cancellation via the progress callback.

The shell generation proceeds through these phases:

  1. Vertex normal computation
  2. Outer surface generation (normal offset or SDF)
  3. Inner/outer face creation
  4. Rim generation to connect boundaries
  5. Optional validation

§Arguments

  • inner_shell - The inner surface mesh (from offset stage)
  • params - Shell generation parameters
  • callback - Optional progress callback. Returns false to request cancellation.

§Returns

A tuple of (shell mesh, generation result). If cancelled via callback, returns the partial shell.

§Example

use mesh_shell::{generate_shell_with_progress, ShellParams};
use mesh_repair::progress::ProgressCallback;

let callback: ProgressCallback = Box::new(|progress| {
    println!("{}% - {}", progress.percent(), progress.message);
    true // Continue
});

let (shell, result) = generate_shell_with_progress(&inner_mesh, &ShellParams::default(), Some(&callback));