vtkSTLWriter unknown error

this is file name


this is my code in python


after doing last command I am getting


What it may be?


attempt to write an empty file


to do information in error code/message about this case

Hello, Inna. I suggest you to double the backslashes in your path string: c:\\Users\\Admin\\workspace\\TA_PlacerOptimizer\\General_folder\\Patient_21007large_TALPS_2_0_InitNormAngles_90_90_90_ 90\\EF14_Patient_21007_Fully_segmented.stl The backslash is a metacharacter in C-like languages like Python. The double backslash will ensure an \ in the output.

If that doesn’t work, If you ARE the Admin user, then try writing to a shorter path. Then I suggest eliminating file system-related issues like disk full, insufficient privileges, etc.

Hi, Paulo,

thank you for answer. I wrote in my topic below, that I found in what my problem. My problem was in attempt to write empty file. If input data for vtkStlWriter is not empty, I haven’t problem.

I suggested also to developers to describe this situation in error code. Since I had got Unknown Error as error code for this case.

If I had have an error like “attempt to write empty file”, I wouldn’t spent a time to research of problem with “unknown error”.

It is all.
Thank you.

In this case you should report a bug here: https://gitlab.kitware.com/groups/vtk/-/issues as writing an empty file is not supposed to trigger an error. Having a zero-byte file is odd, but it is not an error.

All the best,


I agree that it would be sometimes useful to create empty “placeholder” files, but most mesh and image file formats do not allow such empty files. This is not a limitation of VTK.

VTK should log an error message “No data to write!”, but maybe the mechanism is not robust enough (if GetPoints returns non-nullptr but there are 0 points then maybe it does not log the message). It would be great if you could submit a merge request with a proposed fix.