[vtkusers] Extract Polydata points with same scalar value

Sara Rolfe smrolfe at u.washington.edu
Tue Jun 26 17:16:41 EDT 2012


Hi Jochen,

I was able to use vtkThresholdPoints to do exactly what I wanted.   
Thanks for your help!

Sara

On Jun 26, 2012, at 1:52 AM, Jochen K. wrote:

> Hi Sara,
>
> you may try to separate your polydata by scalar values using a  
> vtkThresholdPoints object:
>
> untested snippet:
>          //...
>          vtkSmartPointer<vtkThresholdPoints> threshold =  
> vtkSmartPointer<vtkThresholdPoints>::New();
>          threshold.SetInput(contourPolydata);
>          threshold.SetInputArrayToProcess(
>             0,
>             0,
>             vtkDataObject::FIELD_ASSOCIATION_POINTS,
>             vtkDataSetAttributes::SCALARS,
>             "NameOfYourScalarArray");
>          threshold->ThresholdBetween(0, 1); // would give you the  
> points labeled with 1
>          // you may have to experiment with the value range a bit
>          //threshold->ThresholdBetween(1, 2); // would give you the  
> points labeled with 2
>
>          threshold->Update();
>
>          vtkSmartPointer<vtkPolyData> part =  
> vtkSmartPointer<vtkPolyData>::New();
>          part->SetInputConnection(threshold->GetOutputConnection());
>          //...
>
> best regards
> Jochen
> View this message in context: Re: Extract Polydata points with same  
> scalar value
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120626/ead7d967/attachment.htm>


More information about the vtkusers mailing list