@itk-wasm/sub-mesh
v2.0.0
Published
Extract a subset of a mesh given by the cell identifiers.
Downloads
9
Readme
@itk-wasm/sub-mesh
Extract a subset of a mesh given by the cell identifiers.
Installation
npm install @itk-wasm/sub-mesh
Usage
Browser interface
Import:
import {
subMesh,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
} from "@itk-wasm/sub-mesh"
subMesh
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. |
setPipelinesBaseUrl
Set base URL for WebAssembly assets when vendored.
function setPipelinesBaseUrl(
baseUrl: string | URL
) : void
getPipelinesBaseUrl
Get base URL for WebAssembly assets when vendored.
function getPipelinesBaseUrl() : string | URL
Node interface
Import:
import {
subMeshNode,
} from "@itk-wasm/sub-mesh"
subMeshNode
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. |