jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
951 stars 188 forks source link

linewidth has no effect on LineBasicMaterial #192

Closed JuanCab closed 6 years ago

JuanCab commented 6 years ago

So, I have been playing with sketching curves on a 3D surface using the following snippet

import pythreejs as p3j

"""
Much code snipped out
"""

vertices1= curve_points.tolist()
curve_color = ['yellow']*len(curve_points.tolist)
curve_geom = p3j.Geometry(vertices= vertices1, colors= curve_color)
curve = p3j.Line(geometry= curve_geom, material=p3j.LineBasicMaterial(linewidth=5, vertexColors='VertexColors'))

Turns out regardless of the linewidth value I set for the p3j.LineBasicMaterial, it always seems to come up with a width of 1. There is documentation in the three.js website for LineBasicMaterial that there is a known OpenGL Windows bug that works like this, but I am doing this on a macOS machine. Is the line width trait being ignored?

vidartf commented 6 years ago

What browser are you using? I think this would be a relevant issue: https://github.com/mrdoob/three.js/issues/10357

JuanCab commented 6 years ago

Yep, it’s chrome and thus I hit that Bug. Apparently the fix someone worked out has not yet been incorprosated into three.js

vidartf commented 6 years ago

I'm in the process of updating to r97 of three, and decided to include the example code for thick lines that was released with r96 (I think). It should be usable from the next release.