forked from gacevedobolton/myVTKPythonLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetCellLocator.py
40 lines (31 loc) · 1.26 KB
/
getCellLocator.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#coding=utf8
########################################################################
### ###
### Created by Martin Genet, 2012-2016 ###
### ###
### University of California at San Francisco (UCSF), USA ###
### Swiss Federal Institute of Technology (ETH), Zurich, Switzerland ###
### École Polytechnique, Palaiseau, France ###
### ###
########################################################################
import vtk
import myVTKPythonLibrary as myVTK
########################################################################
def getCellLocator(
mesh,
verbose=1):
myVTK.myPrint(verbose, "*** getCellLocator ***")
cell_locator = vtk.vtkCellLocator()
cell_locator.SetDataSet(mesh)
cell_locator.Update()
closest_point = [0.]*3
generic_cell = vtk.vtkGenericCell()
k_cell = vtk.mutable(0)
subId = vtk.mutable(0)
dist = vtk.mutable(0.)
return (cell_locator,
closest_point,
generic_cell,
k_cell,
subId,
dist)