Extract a subset of a mesh given by the cell identifiers.
npm install @itk-wasm/sub-mesh
Import:
import {
subMesh,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
} from "@itk-wasm/sub-mesh"
Extract a subset of a mesh given by the cell identifiers.
async function subMesh(
mesh: Mesh,
options: SubMeshOptions = { cellIdentifiers: [] as number[], }
) : Promise<SubMeshResult>
Parameter | Type | Description |
---|---|---|
mesh |
Mesh | Full mesh |
SubMeshOptions
interface:
Property | Type | Description |
---|---|---|
cellIdentifiers |
number[] | Cell identifiers for output mesh. |
webWorker |
null or Worker or boolean | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to false to run in the current thread / worker. |
noCopy |
boolean | When SharedArrayBuffer's are not available, do not copy inputs. |
SubMeshResult
interface:
Property | Type | Description |
---|---|---|
subMesh |
Mesh | Sub mesh. |
webWorker |
Worker | WebWorker used for computation. |
Set base URL for WebAssembly assets when vendored.
function setPipelinesBaseUrl(
baseUrl: string | URL
) : void
Get base URL for WebAssembly assets when vendored.
function getPipelinesBaseUrl() : string | URL
Import:
import {
subMeshNode,
} from "@itk-wasm/sub-mesh"
Extract a subset of a mesh given by the cell identifiers.
async function subMeshNode(
mesh: Mesh,
options: SubMeshNodeOptions = { cellIdentifiers: [] as number[], }
) : Promise<SubMeshNodeResult>
Parameter | Type | Description |
---|---|---|
mesh |
Mesh | Full mesh |
SubMeshNodeOptions
interface:
Property | Type | Description |
---|---|---|
cellIdentifiers |
number[] | Cell identifiers for output mesh. |
SubMeshNodeResult
interface:
Property | Type | Description |
---|---|---|
subMesh |
Mesh | Sub mesh. |