daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. polys = vtk.vtkAppendPolyData()
  2.  
  3. Nslices = 10
  4. p01 = (0,0,0)
  5. p02 = (0,1,0)
  6. for ks in range(Nslices):
  7.     p0 = (0,p01[1]+(p02[1]-p01[1])/float(Nslices)*ks,0)
  8.     plane = vtk.vtkPlane()
  9.     plane.SetNormal(0,1,0)
  10.     plane.SetOrigin(p0)
  11.  
  12.     cut = vtk.vtkCutter()
  13.     cut.SetInput(ugrid)
  14.     cut.SetCutFunction(plane)
  15.     cut.Update()
  16.     output = cut.GetOutput()
  17.     polys.AddInput(output)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top