[vtkusers] Extract Polydata points with same scalar value

Jochen K. jochen.kling at email.de
Tue Jun 26 04:52:08 EDT 2012


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: http://vtk.1045678.n5.nabble.com/Extract-Polydata-points-with-same-scalar-value-tp5714208p5714224.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120626/50d2ad96/attachment.htm>


More information about the vtkusers mailing list