[API](/solutions/geotoolkit/geotoolkit_js/apis/readme) / [geotoolkit3d](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d) / [data](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8) / [loader](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#loader) / [vtk](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtk) / [VTKFactory](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory) / VTKFactory

# Class: VTKFactory

[vtk](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtk).[VTKFactory](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory).VTKFactory

This class can parse vtk files and return a comprehensive json object.<br>
<br>
This object can be used to generate Geometries and Object3D.<br>
<br>
Note that, for now, only ASCII format is supported

## Table of contents

Constructors
- [new VTKFactory()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory.md#new vtkfactory())


Methods
| [create](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#create) | [createLines](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#createlines) | [createMesh](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#createmesh) |
|  --- | --- | --- |
| [createPointcloud](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#createpointcloud) | [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#getclassname) | [getClassName](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.data-8.loader.vtk.vtkfactory.vtkfactory#getclassname-1) |


## Contents

Constructors
#### new VTKFactory()

• **new VTKFactory**()

Methods
#### create

▸ **create**(`json`, `options`): `Object3D`<`Object3DEventMap`&gt;[]

Creates objects 3D from the given JSON (generated by parsing a VTK dataset).<br>
<br>
Note, that this factory will automatically apply a recenter and a rotation (to apply Z = UP paradigm) on the given vertices.<br>

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `json` | [`Data`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#data) | The input json object |
| `options` | [`Options`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#options) | The options to use to customize resulting objects |


#### Returns

`Object3D`<`Object3DEventMap`&gt;[]

#### createLines

▸ **createLines**(`json`, `options`): `Line`<`BufferGeometry`<`NormalBufferAttributes`&gt;, `Material` | `Material`[], `Object3DEventMap`&gt;[]

Creates lines from the given JSON (generated by parsing a VTK dataset).

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `json` | [`LinesData`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#linesdata) | The input json object |
| `options` | [`LinesOptions`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#linesoptions) | The options to use to customize resulting objects |


#### Returns

`Line`<`BufferGeometry`<`NormalBufferAttributes`&gt;, `Material` | `Material`[], `Object3DEventMap`&gt;[]

l The line

#### createMesh

▸ **createMesh**(`json`, `options`): `Mesh`<`BufferGeometry`<`NormalBufferAttributes`&gt;, `Material` | `Material`[], `Object3DEventMap`&gt;

Creates a mesh from the given JSON (generated by parsing a VTK dataset).

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `json` | [`MeshData`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#meshdata) | The input json object |
| `options` | [`MeshOptions`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#meshoptions) | The options to use to customize resulting objects |


#### Returns

`Mesh`<`BufferGeometry`<`NormalBufferAttributes`&gt;, `Material` | `Material`[], `Object3DEventMap`&gt;

m The mesh

#### createPointcloud

▸ **createPointcloud**(`json`, `options`): [`PointCloud`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.scene-3.pointset.pointcloud.pointcloud)

Creates a pointcloud from the given JSON (generated by parsing a VTK dataset).<br>
<br>
One can choose what attribute will be used for point size and point color based on their names.<br>
Note that only 'scalar' attributes and FieldData with a stride of 1 can be used.<br>

#### Parameters

| Name  | Type  | Description  |
|  --- | --- | --- |
| `json` | [`PointcloudData`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#pointclouddata) | The input json object |
| `options` | [`PointcloudOptions`](/solutions/geotoolkit/geotoolkit_js/apis/modules/geotoolkit3d.data-8#vtkfactory#pointcloudoptions) | The options to use to customize resulting objects |


#### Returns

[`PointCloud`](/solutions/geotoolkit/geotoolkit_js/apis/classes/geotoolkit3d.scene-3.pointset.pointcloud.pointcloud)

p The pointcloud

#### getClassName

▸ **getClassName**(): `string`

#### Returns

`string`

#### getClassName

▸ `Static` **getClassName**(): `string`

#### Returns

`string`