Skip to content

OBJWriter ​

Introduction ​

vtkOBJWriter writes wavefront obj (.obj) files in ASCII form. OBJ files contain the geometry including lines, triangles and polygons. Normals and texture coordinates on points are also written if they exist.

One can specify a texture passing a vtkTexture using setTexture. If a texture is set, additional .mtl and .png files are generated.

Methods ​

exportAsZip ​

Get the zip file containing the OBJ and MTL files.

extend ​

Method used to decorate a given object (publicAPI+model) with vtkOBJWriter characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIOBJWriterInitialValuesNo(default: {})

getMtl ​

Get the MTL file as a string.

newInstance ​

Method used to create a new instance of vtkOBJWriter

ArgumentTypeRequiredDescription
initialValuesIOBJWriterInitialValuesNofor pre-setting some of its content

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setMaterialFilename ​

Set the material filename.

ArgumentTypeRequiredDescription
materialFilenameYes

Returns ​

TypeDescription
booleantrue if the material file name was set successfully

setModelFilename ​

Set the model filename.

ArgumentTypeRequiredDescription
modelFilenameYes

setTexture ​

Set the texture instance.

ArgumentTypeRequiredDescription
texturevtkTextureYes

Returns ​

TypeDescription
booleantrue if the texture was set successfully

setTextureFileName ​

Set the texture file name.

ArgumentTypeRequiredDescription
textureFileNamestringYes

Returns ​

TypeDescription
booleantrue if the texture file name was set successfully

writeOBJ ​

ArgumentTypeRequiredDescription
polyDatavktPolyDataYes