Distance scalar computation between surface and polyline

Hello all!

I have a polydata with triangle cells (surface) and another polydata with polyline cells. I need scalar distance values on surface computed from polyline.

I tried these,

vtkDistancePolyDataFilter - Works only for two surfaces.

vtkSelectPolyData - Inputs are points and very slow for large data set as it computes topological distance. Ideally suitable for a polyline that lies on the surface.

vtkStaticCellLocatior - Build with polyline for distance computation, iterate over all the points of the surface mesh and create a FloatArray for distance scalar. This operation is also bit slow, is there a way to improve the iteration of distance calculation with vtkSMPTools? Is there a SMP iteration method available for vtkPoints structure?



You can try creating a narrow surface from your polyline by using vtkLinearExtrusionFilter. Then you can use vtkDistancePolyDataFilter on the output to get results close to what the actual polyline would yield.