Skip to content

Commit 0c3049e

Browse files
committed
Added a simple python test to swig python wrapper
1 parent 68f7958 commit 0c3049e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test_python_wrapper.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import sys
2+
3+
import vtk
4+
import ca_smoothing
5+
6+
stl = vtk.vtkSTLReader()
7+
stl.SetFileName(sys.argv[1])
8+
stl.Update()
9+
10+
normals = vtk.vtkPolyDataNormals()
11+
normals.SetInput(stl.GetOutput())
12+
normals.ComputeCellNormalsOn()
13+
normals.Update()
14+
15+
clean = vtk.vtkCleanPolyData()
16+
clean.SetInput(normals.GetOutput())
17+
clean.Update()
18+
19+
pd = clean.GetOutput()
20+
pd.BuildLinks()
21+
22+
tpd = ca_smoothing.ca_smoothing(pd, 0.7, 3, 0.2, 10)
23+
24+
ply = vtk.vtkPLYWriter()
25+
ply.SetFileName(sys.argv[2])
26+
ply.SetInput(tpd)
27+
ply.Write()

0 commit comments

Comments
 (0)