@itk-wasm/sub-mesh
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@itk-wasm/sub-mesh

npm version

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.

Package Sidebar

Install

npm i @itk-wasm/sub-mesh

Weekly Downloads

2

Version

2.0.0

License

Apache-2.0

Unpacked Size

1.18 MB

Total Files

26

Last publish

Collaborators

  • paulhax
  • thewtex