Source code for vtk_openCARP_methods_ibt.vtk_methods.finder

import vtk

from ..vtk_methods.converters import vtk_to_numpy


[docs] def find_closest_point(dataset, point): loc = vtk.vtkPointLocator() loc.SetDataSet(dataset) loc.BuildLocator() return loc.FindClosestPoint(point)
[docs] def get_global_cell_ids(mesh, id_array_name="Global_ids"): return get_cell_ids(mesh, id_array_name).astype(int)
[docs] def get_cell_ids(mesh, id_array_name): return vtk_to_numpy(mesh.GetCellData().GetArray(id_array_name))
[docs] def get_points(mesh): return vtk_to_numpy(mesh.GetPoints().GetData())