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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IOBJWriterInitialValues | No | (default: {}) |
getMtl
Get the MTL file as a string.
newInstance
Method used to create a new instance of vtkOBJWriter
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IOBJWriterInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setMaterialFilename
Set the material filename.
| Argument | Type | Required | Description |
|---|---|---|---|
materialFilename | Yes |
Returns
| Type | Description |
|---|---|
| boolean | true if the material file name was set successfully |
setModelFilename
Set the model filename.
| Argument | Type | Required | Description |
|---|---|---|---|
modelFilename | Yes |
setTexture
Set the texture instance.
| Argument | Type | Required | Description |
|---|---|---|---|
texture | vtkTexture | Yes |
Returns
| Type | Description |
|---|---|
| boolean | true if the texture was set successfully |
setTextureFileName
Set the texture file name.
| Argument | Type | Required | Description |
|---|---|---|---|
textureFileName | string | Yes |
Returns
| Type | Description |
|---|---|
| boolean | true if the texture file name was set successfully |
writeOBJ
| Argument | Type | Required | Description |
|---|---|---|---|
polyData | vktPolyData | Yes |