[vtk.js] LineWidth with vtkLineSource

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();


then try to set the line width on the actor

p = lineActor.getProperty()

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.

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 :slight_smile: 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.

1 Like

@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 !

I used a tube filter and varied the radius with how thick I wanted the line to be

1 Like