Hi there,
I’m trying to thicken the lines of a wireframe cube so that the boundaries are more visible when viewed against an MRI image. I read that the setLineWidth
is not supported by WebGL, so I have been trying to use the TubeFilter to accomplish the same effect (ref: [vtk.js] LineWidth with vtkLineSource - #5 by banesullivan)
However, I noticed that all of the examples of TubeFilter involve lines or polydata, and not volumes, such as with the CubeSource. Is it possible to apply the TubeFilter to the edges of a cube? If not, do you have any suggestions on what I might be able to try?
Here is an excerpt of my code:
const cubeActor = vtkActor.newInstance();
const cubeMapper = vtkMapper.newInstance();
const cubeSource = vtkCubeSource.newInstance({
xLength: 0.1,
yLength: 0.1,
zLength: 0.1,
});
cubeMapper.setInputConnection(cubeSource.getOutputPort());
cubeActor.setMapper(cubeMapper);
cubeActor.getProperty().setRepresentation(1);
const tubeFilter = vtkTubeFilter.newInstance();
tubeFilter.setInputConnection(cubeSource.getOutputPort());
tubeFilter.setRadius(0.05);
tubeFilter.setNumberOfSides(50);
tubeFilter.setCapping(false);
tubeFilter.setInputArrayToProcess(0, "Scalars", "PointData", "Scalars");
const tubeMapper = vtkMapper.newInstance();
tubeMapper.setInputConnection(tubeFilter.getOutputPort());
const tubeActor = vtkActor.newInstance();
tubeActor.setMapper(tubeMapper);
renderer.addActor(tubeActor);
renderer.addActor(cubeActor);
Use case example, in which the edges of the cube are just barely visible. Changing the color helps slightly, but a thicker line would be much better.
Thanks!