If I manually create some poly data and pass it to the vtkTubeFilter
, the output only shows a tube for the first cell (0th index).
I would expect the tube filter to produce a tube around every line cell much like the VTK-proper tube filter; is there something I am missing?
import vtk from 'vtk.js/Sources/vtk';
import vtkActor from 'vtk.js/Sources/Rendering/Core/Actor';
import vtkMapper from 'vtk.js/Sources/Rendering/Core/Mapper';
import vtkTubeFilter from 'vtk.js/Sources/Filters/General/TubeFilter';
const lines = vtk({
vtkClass: 'vtkPolyData',
points: {
vtkClass: 'vtkPoints',
dataType: 'Float32Array',
numberOfComponents: 3,
values: [
0,0,0,
1,1,0,
1,1,1
]
},
lines: {
vtkClass: 'vtkCellArray',
dataType: 'Uint16Array',
values: [
2, 0, 2,
2, 2, 1,
2, 1, 0
]
}
});
const tubeFilter = vtkTubeFilter.newInstance();
tubeFilter.setInputData(lines);
tubeFilter.setRadius(0.1);
const lineActor = vtkActor.newInstance();
const lineMapper = vtkMapper.newInstance();
lineActor.setMapper(lineMapper);
lineMapper.setInputConnection(tubeFilter.getOutputPort());
renderer.addActor(lineActor);