Skip to main content

Mask To Surface

The Mask To Surface tool calculates surface meshes from target masks and creates new surface objects. The tool uses the marching cubes algorithm to extract triangle mesh surfaces that can be used for visualization, 3D printing, CAD applications, and further mesh processing.

Accessing the Tool

  1. Navigate to the Segmentation tab in the ribbon.
  2. Click Mask To Surface in the Convert section.

Parameters

Target Object(s)

OptionDescription
Active maskConvert the active mask only.
Selected masksConvert all selected masks.
Visible masksConvert all visible masks.
All masksConvert every mask in the project.
3D preview of visible mask object(s)Convert from existing 3D preview instead of recalculating.

Quality

OptionDescription
OptimalBest quality with full resolution.
HighHigh quality with minimal optimization.
MediumBalanced quality and performance.
LowLower quality with faster processing.
CustomManual control over all parameters.

Options

The Options section is visible when converting from mask data (not from 3D preview). Some options are only editable when Quality is set to Custom.

Resolution Reduction (Checkable)

ParameterDescription
XY resolutionResolution reduction factor in XY plane (1× to 999999999×).
Z resolutionResolution reduction factor in Z direction (1× to 999999999×).

Filter Shells (Checkable)

ParameterDescription
Number of largest shellsRetain only the specified number of largest shells by area (1 to 999999999).

Smoothing (Checkable)

ParameterDescription
IterationsNumber of smoothing iterations (10 to 9999, default: 20).
Smooth factorSmoothing strength where lower values produce more smoothing (0.000 to 1.000, default: 0.010).
Feature angle (°)Angle for sharp edge identification; small values preserve features, higher values produce more smoothing (0.000° to 90.000°, default: 85.000°).

Triangle Reduction (Checkable)

ParameterDescription
Reduction percent (%)Percentage of triangles to reduce (1% to 99%, default: 50%).

Workflow

  1. Open the Mask To Surface tool from the Segmentation tab.
  2. Select the Target Object(s) to convert.
  3. Choose the Quality preset or select Custom for manual control.
  4. If using Custom quality, configure the Options:
    • Enable/disable Resolution reduction and set factors
    • Enable/disable Filter shells and set count
    • Enable/disable Smoothing and adjust parameters
    • Enable/disable Triangle reduction and set percentage
  5. Click Apply to generate the surface mesh(es).

The new surface object(s) appear in the Object Browser.

Algorithm: Marching Cubes

The marching cubes algorithm:

  1. Divides the volume into a grid of cubes.
  2. Evaluates mask values at cube corners.
  3. Determines which cube edges intersect the iso-surface.
  4. Generates triangles to approximate the surface within each cube.
  5. Connects triangles to form a continuous mesh.

Post-Processing Options

After surface generation, consider applying:

  • Smooth (Surface tab): Additional surface smoothing.
  • Reduce (Surface tab): Further polygon reduction.
  • Remesh (Surface tab): Improve triangle quality.
  • Fill Holes (Surface tab): Close any surface gaps.

Use Cases

3D Printing

Prepare models for additive manufacturing:

  1. Complete and refine the mask segmentation.
  2. Convert to surface with appropriate decimation.
  3. Export as STL or OBJ format.

CAD Integration

Create surfaces for engineering applications:

  1. Generate high-quality surface mesh.
  2. Apply smoothing and optimization.
  3. Export in CAD-compatible formats.

Visualization

Create lightweight 3D models for presentations:

  1. Use higher decimation for smaller file sizes.
  2. Apply smoothing for visual quality.

Simulation Preprocessing

Prepare geometry for finite element analysis:

  1. Generate surface mesh.
  2. Convert to volume mesh using Mask To Volume Mesh or Surface To Volume Mesh.

Tips

  • Use Optimal quality for final output and Low for quick previews.
  • Apply mask smoothing before conversion for smoother surfaces.
  • Enable Filter shells to remove small disconnected components.
  • Use Resolution reduction for very large masks to improve performance.
  • The 3D preview option is faster as it uses pre-calculated preview meshes.
  • For Custom quality, start with a preset and adjust individual parameters.
tip

When Quality is set to Optimal, High, Medium, or Low, the Resolution reduction, Smoothing, and Triangle reduction options are automatically configured and cannot be edited.

warning

Very large masks may generate surfaces with millions of triangles. Use resolution reduction or triangle reduction if performance is an issue.

Scripting

import ScriptingApi as api

app = api.Application()
mask_operations = app.get_mask_operations()

mask_to_surface_params = api.MaskToSurfaceParams()
mask_to_surface_params.triangle_reduction = True
mask_to_surface_params.triangle_reduction_percent = 80

# Convert mask to surface object
mask_operations.convert_to_surface_objects(["Segmentation_Mask"], mask_to_surface_params)

See Also