Custom Lineweights Visualisation

Hi team,

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.

anyone found any work arounds?

Best,
Tom

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.

anyone got any tips?

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.

1 Like

Actually, that’d be @stevebaer :slight_smile:

I uploaded the GH definition with the OpenGL code in as well:

1 Like

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.

I just updated GhGL to support preview sort order so you can do this.

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.

2 Likes

Hey Steve,

This is great! super interesting and helpful.

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.

I will keep testing.

Best,
Tom

There were some bugs in that version of GhGL. I just posted a new version with a fix.

You’ll want to use the modified components found in this new version of the gh definition
sorted_curves.gh (36.4 KB)

1 Like

I am still getting the same issue, could it an rhino version issue? Even though it says my Rhino is up to date I doubt it.

It only shows me the first circle

THe same thing here, I suppose if there was a modification in Rhino/Grasshopper it will appears on thursday ! I also don’t see

image
And at the moment the component seems to not handle the DataTree. If you flatten the list of points you will see this

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

1 Like

works perfect!!

Thanks @stevebaer

Tom

2 Likes

That’s great to hear. Please let me know if there are any other effects you would like to see for custom curve display

Hi, @stevebaer, I believe that a glowing effect for curves would be a perfect add to the custom curve display.

Could these work with Clipping Planes?

Does glow look good on bright viewport backgrounds?

1 Like

NGon | Food4Rhino

inside ngon there is a battery called curvepreview.
with color and stroke.
hope it would help.

1 Like

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.

variable lineweight query.gh (119.4 KB)