- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_python_wrapper.py
More file actions
Latest commit
27 lines (20 loc) · 523 Bytes
/
Copy pathtest_python_wrapper.py
File metadata and controls
27 lines (20 loc) · 523 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
importsys
importvtk
importca_smoothing
stl=vtk.vtkSTLReader()
stl.SetFileName(sys.argv[1])
stl.Update()
normals=vtk.vtkPolyDataNormals()
normals.SetInputConnection(stl.GetOutputPort())
normals.ComputeCellNormalsOn()
normals.Update()
clean=vtk.vtkCleanPolyData()
clean.SetInputConnection(normals.GetOutputPort())
clean.Update()
pd=clean.GetOutput()
pd.BuildLinks()
tpd=ca_smoothing.ca_smoothing(pd, 0.7, 3, 0.2, 10)
ply=vtk.vtkPLYWriter()
ply.SetFileName(sys.argv[2])
ply.SetInputData(tpd)
ply.Write()