How to close corners with tubefilter ?

How can I close the corners of the TubeFilter generated with vtkCutter ?

Screenshot_20220621_133909

const cutter = vtkCutter.newInstance();
cutter.setCutFunction(cutPlane);
cutter.setInputConnection(cube.getOutputPort());

const tubeFilter = vtkTubeFilter.newInstance({
radius: 1.5,
numberOfSides: 50,
capping: false
});
tubeFilter.setInputConnection(cutter.getOutputPort());
const tubeMapper = vtkMapper.newInstance();
tubeMapper.setInputConnection(tubeFilter.getOutputPort());
const tubeActor = vtkActor.newInstance();
tubeActor.setMapper(tubeMapper);
const tubeProperty = tubeActor.getProperty();
tubeProperty.setColor(0, 1, 0);

Have you considered using thick lines instead of tubes ?

I don’t understand how to do that
How can I increase the thickness of vtkCutter ?

The output of vtkCutter is a vtkPolyData.
You simply use an actor+mapper to render the polydata into the render window and you set the lineWidth on the actor property.

Maybe you could use vtkStripper with JoinContigousSegmentsOn (something like this)

Hope it helps

1 Like

When using setLineWidth, the same thing still happens.

Screenshot_20220622_112726

const cutter = vtkCutter.newInstance();
cutter.setCutFunction(cutPlane);
cutter.setInputConnection(cube.getOutputPort());
const cutMapper = vtkMapper.newInstance();
cutMapper.setInputConnection(cutter.getOutputPort());
const cutActor = vtkActor.newInstance();
cutActor.setMapper(cutMapper);
const cutProperty = cutActor.getProperty();
cutProperty.setLineWidth(10);

I don’t think vtkStripper is implemented in vtk.js