[vtkusers] Distance filter

Cory Quammen cory.quammen at kitware.com
Tue May 30 11:32:31 EDT 2017


Hi Rao,

The actor transforms apply only during rendering of the data object -
they do not transform the data objects themselves. To properly account
for the actor transforms in the vtkDistancePolyDataFilter, you would
need to create vtkTransformPolyDataFilters for each actor, copying the
actor transform to the vtkTransform used by
vtkTransformPolyDataFilter, then connect the output port of the
vtkTransformPolyDataFilters to your vtkCleanPolyData filters.

HTH,
Cory

On Mon, May 22, 2017 at 3:24 PM, Koteswara Rao Ruvva via vtkusers
<vtkusers at vtk.org> wrote:
> I have the following code to compute the distance between two polygonal
> actors.
>
> def ComputeDistanceFilter(sourceActor, targetActor):
>
>     clean1 = vtk.vtkCleanPolyData()
>     clean1.SetInputData(sourceActor.GetMapper().GetInput())
>     clean2 = vtk.vtkCleanPolyData()
>     clean2.SetInputData(targetActor.GetMapper().GetInput())
>
>     distanceFilter = vtk.vtkDistancePolyDataFilter()
>     distanceFilter.SetInputConnection(0, clean1.GetOutputPort())
>     distanceFilter.SetInputConnection(1, clean2.GetOutputPort())
>     distanceFilter.Update()
>
> I am not sure where and how the transformation of the actors should be used
> while computing the distance filter.
>
> Thank you
> Rao
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list