Here is the rendering of three vtkLines:
Now I use vtkStripper
in the hopes of getting a single vtkPolyLine
:
vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::New();
poly->SetPoints( points );
poly->SetLines( segments );
poly->GetCellData()->SetScalars( dataIndexes );
vtkSmartPointer<vtkStripper> stripper = vtkSmartPointer<vtkStripper>::New();
stripper->SetInputData( poly );
stripper->SetMaximumLength( 200 );
stripper->JoinContiguousSegmentsOn();
stripper->Update();
Application::instance()->logInfo("=====>" + QString::number( poly->GetNumberOfCells() ));
Application::instance()->logInfo("=====>" + QString::number( stripper->GetOutput()->GetNumberOfCells() ));
Here’s what I get:
I was supposed to get just one object count in the second call.
Here is the data used to build the geometry:
test
8
x_initial
x_final
y_initial
y_final
z_initial
z_final
color_code
0.0 0.0 0.0 0.0 0.0 1.0 1
0.0 0.0 0.0 0.0 1.0 2.0 2
0.0 0.0 0.0 0.0 2.0 3.0 1
As can be seen, there is no geometry mismatch that would cause vtkStripper
to misbehave.
I’ll appreciate any help.