Was looking at creating a video in Grasshopper which has many overlapping lines. I was hoping to provide some depth to this by making them 50% transparent for example, or a thinner line weight, but the option of lineweight seems to have a minimum lineweight and to achieve a very fine line weight doesn’t seem to be possible with custom lineweight preview.
having done some more research, I have seen Javascript Rhino is becoming a thing now. Maybe its easier to make these edits through java, as my output will be web based.
There’s this grasshopper plugin for drawing shapes using GLSL shaders. @nathanletwory has done some custom line drawing stuff, he may be able to tell you more.
This is definitely possible with GhGL, but not as easy as I would like it to be. I think I’ll need to make a tweak to the GhGL component to make this work.
Here is a sample definition to start with sorted_curves.gh (29.0 KB)
If you right click on the “GL Shader” components, the context menu will give you access to “Preview Sort Order” and “glLineWidth”. Use the “Preview Sort Order” to define which curves will be drawn before other curves. This is necessary to get things like alpha blending to properly work. Use the “glLineWidth” to adjust the width of each curve.
I am struggling to get it working for more complex curves, for instance like my attached. In which the curves will be coloured by the length so have their own parameter. I could only seem to colour one of the curves. Most of the ‘linetype’ previews seem to either draw between start and end point, losing the curvature.
@bensonjtom and @laurent_delrieu
You must not have the latest version of the GhGL component. Run TestPackageManager in V6 or PackageManager in V7 to see if you have the latest GhGL. I’m hoping the package manager will show you that an update is available.
Thanks a ton for this. I was searching for something similar.
However, I’m unable to bake the geometry with different lineweights.
How can I do it? Moreover, is there any method to reduce lineweights based upon the distance of the object from my eyes? That is, the closer the object is, the thicker is lineweight, as the objects go further away, their lineweights reduce automatically.