Trying to create hatches and color them based on display color

I’m trying to create an automatic converter from polysurfaces to hatches so I can use them as SVGs.

  1. I make polysurfaces in Rhino
  2. I change their Display Color
  3. I import the surfaces from Rhino to grasshopper
  4. I use Make2D to make planar curves. Here they understandably lose their color.
  5. I use SurfaceSplit to split a plane into pieces using the planar curves
  6. I use Populate geometry to create a single point anywhere on the split surfaces.
  7. I use ProjectPoint to project the point onto the original polysurfaces
  8. I use the projected points to sort the original polysurfaces in the same order as the split planar surfaces so I can color them
  9. I get the display color codes from the original polysurfaces
  10. I turn the split surfaces into hatches.

Step 9 is where I’m having problems. I know it seems like the most easy step in the whole list but I just can’t figure it out.

Any help would be appreciated.

I messed up the attached rhino file. The Make2D is supposed to be set to a named view. Not top view.
Here are the updated files
Hatch Test 2.gh (24.4 KB)
Hatch Test.3dm (369.0 KB)

Hi Johnny -

With standard Grasshopper components, you can’t get the display color of sub-objects.
When you explode the polysurfaces in Rhino before referencing them in Grasshopper, you can get the display color with Object ModelDisplay Attributes

-wim

@Johnny1 -

Andy corrects me. You can use the Explode Object component to get access to the sub-object display colors:

-wim

Thank you so much for your responses.
Two things.

  1. I would like to know the colors that have been sorted at the end of the List Item component. Not the soilds at the beggining. Because I will use their display colors to color hatches.

  2. I can’t use the Exolode component because it doesn’t output anything that wasn’t exploded. If that makes any sense. A torus or a sphere wouldn’t come out because there’s nothing to explode.