Commit b1b1cecd4383d978ce0b354e07605c9d09fbe509
1 parent
dc7451d9
Exists in
master
and in
6 other branches
ADD: Export polydata binary or ascii mode
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
invesalius/data/polydata_utils.py
@@ -117,3 +117,13 @@ def Merge(polydata_list): | @@ -117,3 +117,13 @@ def Merge(polydata_list): | ||
117 | 117 | ||
118 | return append.GetOutput() | 118 | return append.GetOutput() |
119 | 119 | ||
120 | +def Export(polydata, filename, bin=False): | ||
121 | + writer = vtk.vtkXMLPolyDataWriter() | ||
122 | + writer.SetFileName(filename) | ||
123 | + if bin: | ||
124 | + writer.SetDataModeToBinary() | ||
125 | + else: | ||
126 | + writer.SetDataModeToAscii() | ||
127 | + writer.SetInput(polydata) | ||
128 | + writer.Write() | ||
129 | + |