banesullivan
(Bane Sullivan (Community Stakeholder))
September 8, 2020, 2:31pm
1
I am currently unable to adjust the line width of an actor with vtkLineSource. Is there something I am missing? Are there perhaps no line cells?
(psuedo-ish code)
lineSource = vtkLineSource.newInstance();
lineActor = vtkActor.newInstance();
mapper = vtkMapper.newInstance();
lineActor.setMapper(mapper);
mapper.setInputConnection(lineSource.getOutputPort());
lineSource.setPoint1(...)
lineSource.setPoint2(...)
then try to set the line width on the actor
p = lineActor.getProperty()
p.setLineWidth(10)
and there is no observable change after re-rendering
WebGL does not support line width. Firefox may do, but the spec does not enforce that support.
ken-martin
(Ken Martin)
September 24, 2020, 1:35pm
3
Technically webgl does support line width but it is legal for a driver to set the maximum and minimum width to be 1.0 which some drivers do. So you can have wide lines as long as their width is 1.0 On desktop we catch this case and convert lines to triangles which we reposition using a geometry shader etc. It is a lot of work.
Alireza
(Alireza Sedghi)
April 2, 2021, 7:57pm
4
@banesullivan I’m wondering what did you end up doing for having a thicker line?
I can think of using a cylinder source instead, but it cannot be dashed !
banesullivan
(Bane Sullivan (Community Stakeholder))
April 2, 2021, 8:51pm
5
I used a tube filter and varied the radius with how thick I wanted the line to be
finetjul
(Julien Finet)
June 21, 2022, 7:27pm
6
Thick/Wide lines have been implemented in v24.1.0
banesullivan
(Bane Sullivan (Community Stakeholder))
June 21, 2022, 8:28pm
7
@finetjul , would you provide an example or link to one in the docs?
finetjul
(Julien Finet)
June 21, 2022, 9:10pm
8
zxrzxr
(xr)
February 17, 2024, 8:11am
9
Hi, thanks a lot for implementing this feature. I found it very useful. This increased the width of my visualization CPlantBox Web Assembly .
Just wondering, is is now possible to make each line with different linewidth?
finetjul
(Julien Finet)
February 17, 2024, 7:19pm
10
No, currently, the line width is an actor property.
zxrzxr
(xr)
February 20, 2024, 1:19pm
11
Thanks a lot for the reply. Looking forward to the future developments.