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

1.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: {}, }
) : 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: {}, }
) : 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

1

Version

1.0.0

License

Apache-2.0

Unpacked Size

1.19 MB

Total Files

72

Last publish

Collaborators

  • paulhax
  • thewtex