@itk-wasm/mesh-to-poly-data
v1.1.1
Published
Convert an ITK Mesh to a simple data structure compatible with vtkPolyData.
Downloads
3,046
Readme
@itk-wasm/mesh-to-poly-data
Convert an ITK Mesh to a simple data structure compatible with vtkPolyData.
Installation
npm install @itk-wasm/mesh-to-poly-data
Usage
Browser interface
Import:
import {
meshToPolyData,
polyDataToMesh,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
} from "@itk-wasm/mesh-to-poly-data"
meshToPolyData
Convert an itk::Mesh to an itk::PolyData
async function meshToPolyData(
mesh: Mesh,
options: MeshToPolyDataOptions = {}
) : Promise<MeshToPolyDataResult>
| Parameter | Type | Description |
| :-------: | :----: | :---------- |
| mesh
| Mesh | Input mesh |
MeshToPolyDataOptions
interface:
| Property | Type | Description |
| :---------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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. |
MeshToPolyDataResult
interface:
| Property | Type | Description |
| :---------: | :--------: | :------------------------------ |
| polyData
| PolyData | Output polydata |
| webWorker
| Worker | WebWorker used for computation. |
polyDataToMesh
Convert an itk::PolyData to an itk::Mesh
async function polyDataToMesh(
polyData: PolyData,
options: PolyDataToMeshOptions = {}
) : Promise<PolyDataToMeshResult>
| Parameter | Type | Description |
| :--------: | :--------: | :------------- |
| polyData
| PolyData | Input polydata |
PolyDataToMeshOptions
interface:
| Property | Type | Description |
| :---------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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. |
PolyDataToMeshResult
interface:
| Property | Type | Description |
| :---------: | :------: | :------------------------------ |
| mesh
| Mesh | Output 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 {
meshToPolyDataNode,
polyDataToMeshNode,
} from "@itk-wasm/mesh-to-poly-data"
meshToPolyDataNode
Convert an itk::Mesh to an itk::PolyData
async function meshToPolyDataNode(
mesh: Mesh
) : Promise<MeshToPolyDataNodeResult>
| Parameter | Type | Description |
| :-------: | :----: | :---------- |
| mesh
| Mesh | Input mesh |
MeshToPolyDataNodeResult
interface:
| Property | Type | Description |
| :--------: | :--------: | :-------------- |
| polyData
| PolyData | Output polydata |
polyDataToMeshNode
Convert an itk::PolyData to an itk::Mesh
async function polyDataToMeshNode(
polyData: PolyData
) : Promise<PolyDataToMeshNodeResult>
| Parameter | Type | Description |
| :--------: | :--------: | :------------- |
| polyData
| PolyData | Input polydata |
PolyDataToMeshNodeResult
interface:
| Property | Type | Description |
| :------: | :----: | :---------- |
| mesh
| Mesh | Output mesh |