Last updated

API / geotoolkit3d / data / loader / vtk / VTKFactory / VTKFactory

Class: VTKFactory

vtk.VTKFactory.VTKFactory

This class can parse vtk files and return a comprehensive json object.

This object can be used to generate Geometries and Object3D.

Note that, for now, only ASCII format is supported

Table of contents

Constructors
Methods

Contents

Constructors

new VTKFactory()

new VTKFactory()

Methods

create

create(json, options): Object3D<Object3DEventMap>[]

Creates objects 3D from the given JSON (generated by parsing a VTK dataset).

Note, that this factory will automatically apply a recenter and a rotation (to apply Z = UP paradigm) on the given vertices.

Parameters

Name Type Description
jsonDataThe input json object
optionsOptionsThe options to use to customize resulting objects

Returns

Object3D<Object3DEventMap>[]


createLines

createLines(json, options): Line<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]

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

Parameters

Name Type Description
jsonLinesDataThe input json object
optionsLinesOptionsThe options to use to customize resulting objects

Returns

Line<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>[]

l The line


createMesh

createMesh(json, options): Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

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

Parameters

Name Type Description
jsonMeshDataThe input json object
optionsMeshOptionsThe options to use to customize resulting objects

Returns

Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

m The mesh


createPointcloud

createPointcloud(json, options): PointCloud

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

One can choose what attribute will be used for point size and point color based on their names.
Note that only 'scalar' attributes and FieldData with a stride of 1 can be used.

Parameters

Name Type Description
jsonPointcloudDataThe input json object
optionsPointcloudOptionsThe options to use to customize resulting objects

Returns

PointCloud

p The pointcloud


getClassName

getClassName(): string

Returns

string


getClassName

Static getClassName(): string

Returns

string