Interface ShellGenerationParams

Options that control shell generation from source triangle geometry.

Use lower resolutions for cheaper shells and lower memory use. Use "surfaceNets" plus smoothing when a less blocky silhouette is more important than exact voxel-boundary coverage.

const shell = generator.generate(objects, {
shellResolution: 64,
extraction: "surfaceNets",
smoothing: {
iterations: 3
},
simplification: {
targetTriangleCount: 4000
}
});
interface ShellGenerationParams {
    extraction?: "voxelFaces" | "surfaceNets";
    shellResolution?: number;
    simplification?: false | ShellSimplificationParams;
    smoothing?: false | ShellSmoothingParams;
    voxelSize?: number;
}

Properties

extraction?: "voxelFaces" | "surfaceNets"

Surface extraction method.

  • "voxelFaces" emits blocky voxel boundary faces.
  • "surfaceNets" emits a dual mesh with one smoothed vertex per mixed voxel neighborhood. It is smoother, but less exact and more experimental.
shellResolution?: number

Longest voxel grid axis.

Reasonable first values are 32, 64 and 128. The generator clamps this to MAX_SHELL_RESOLUTION.

simplification?: false | ShellSimplificationParams

Optional low-poly simplification. This first implementation uses vertex clustering, which is fast and robust but not feature-preserving.

Set to false to disable simplification.

smoothing?: false | ShellSmoothingParams

Optional post-extraction smoothing. Only applied to "surfaceNets".

When omitted, surface-net extraction uses a conservative default. Set to false to disable smoothing.

voxelSize?: number

Explicit voxel size in shell-local/world units.

When set to a positive value, this overrides shellResolution.