Grasshopper custom curve display

Thanks Jeff. I’ll give it a try.

What’s harder than solving a problem with GH is inventing similar scenarios for the community to help solve — because my work prevents me from showing or even implying the kind of work I’m doing. It’s not top secret, but it is sensitive.

I would love nothing more than to share the actual project and say “Here, this is the problem right here, and I need this to happen when I do this so we have this information from there…” Know what I mean?

What would REALLY help me is to set custom colours, patterns and thicknesses for lines I get GH to draw. Much of what I do requires lines to overlap each other. Sometimes I generate a line between two moving points just so I have a live feed on measurement. Then I have a second line in the very same spot that I can control the length of. But all lines have the same display property: red and solid. I would be nice to make the measurement line a dotted line in blue with a 50% alpha and a thickness of 3. Sometimes I select lines in GH but can’t see them highlight because other lines are over them in the same place. I end up hiding those lines just to see where I’m going.

Hi Ken,

the attached file has a C# component which draws curves using a custom colour, width and dash-pattern. The dash pattern is what takes up 90% of the code, so if you don’t need that we can rip it out and make the code a lot easier to understand.

curvedisplay.gh (20.2 KB)

The dashes+gaps are measured in world space, not screen space. It’s simply a bit of text with any number of numeric values separated by a space. The first value becomes the first dash, the second value the first gap, the third value the second dash and so on. The list is just cycled through until I run out of curve to chop up.

5 Likes

Incidentally Rhino doesn’t draw curves with transparency, you’ll have to settle for just the properties I’ve exposed.

I tested your definition using RhinoWIP for Mac, but seems that here it is not working.

I’m getting this errors:

Are you seeing this in the WIP too? I thought I had alpha properly handled, but maybe not.

yep, same for me.

Seems that this definition is written using the upcoming Grasshopper2 used by the Rhino6 Windows?

Will be the Mac version of Rhino6 shipped with Grasshopper2? Hopefully less compatibility issues if so.

It was written in GH1 for RhinoWip. There should be no compatibility issues from the GH side, but something went wrong with the System.Drawing.Color compilation.

Is there any way to “force” grasshopper to draw curves in Rhino 6 wip render view?

I know it is render engine.
But i do not want to pipe each time I want to draw something on nice render display

1 Like