Color (and display) vertices in a polyline

Is it possible to apply different colors to different vertices in a polyline? (I am thinking along the lines of how ComputeMeshVertices works for meshes)

Hi @Jack_Minardi,

The Rhino.Geometry.PolylineCurve class does not have a place holder for vertex colors. But it is possible, using RhinoCommon’s user text feature, to add an array of vertex colors to the object. Then if needed, you could draw the PolylineCurve with those colors using a display conduit.

Does this help/

– Dale

Hi @dale,

Could you maybe expand on this a bit? We want to draw a ployline where each segment is colored differently. I’m unable to find out how to do this based on the documentation, even when I look at the DisplayConduit class.

Regards
Felix

Hi Felix,

Are you coding in C++, C#, or Python?

– Dale

Hi Dale,

I’m coding in C#.

Felix

Hi @felix.konstantin.mau,

The Rhino Developer Samples repository on GitHub has a number of RhinoCommon samples that use a DisplayConduit. You might consider either downloading or cloning the repository, and then opening SampleCs.sln and searching the code for “DisplayConduit”.

In a display conduit, you can call DisplayPipeLine.DrawLine to draw a segment of a polyline in whatever color works.

– Dale

Hello .

I would also like to do this.
could you help me with some examples?
I write in Python.
Thank you very much.

Domenico