Hello,
VTK has the vtkOBJExporter
class (https://vtk.org/doc/nightly/html/classvtkOBJExporter.html) that saves the entire scene contained in a vtkRenderWindow
as a .OBJ
file. As far as I know, there is no data object-to-obj direct conversion. In other words, it exports the scene as rendered and not as data. I mean, if your volume is being rendered as a slice, there will be only a flat panel with a texture applied to it in the OBJ file (vtkOBJExporter
also generates a complimentary .mtl
file with material description when necessary). There is a small Python example on how to use vtkOBJExporter
here: https://discourse.vtk.org/t/how-can-i-export-tubes-to-obj/6015/12
Now, if you aim at converting all the voxels of the input volume into grid cells of a mesh described as OBJ format, I believe you need to study the OBJ file format and write the code to generate the file explicitly.
take care,
Paulo