Sort by and apply colour of surface beneath geometry to polysurface

Hi,

I’m trying to figure out a method of sorting polysurface (or mesh) by the colour of a surface beneath, Then applying the surface colour to the polysurface (or mesh) geometry.

I thought to try and sort the breps by wether they’re in-curve of the surfaces below (divided by colour) but I’m sure there must be a smarter way.

230420_pickup surface beneath colour.gh (6.3 MB)

Could also be done by matching x,y location of bottom plane and colour plane?

  1. Get all the boxes COG
  2. Get all the surfaces below COG
  3. Compute the shortest distance between the a box and all the surfaces, the one with the shortest distance It’s the one right below
  4. Repeat for every box

The shortest distance will always be the one right below it if you measure starting from the cog

There is a good chance I don’t understand your objective… But if I do, isn’t it much simpler?


surface beneath colour_2023Apr20a.gh (6.3 MB)

(6.3 MB!! Ouch - this is a case where a Rhino file makes more sense than internalizing geometry.)

P.S. Why “find bottom plane”? Simpler using Volume ‘C’ (Centroid) instead, eh?


surface beneath colour_2023Apr20b.gh (6.3 MB)

1 Like

Amazing - thank you, this works perfectly.

One further question - how do you extract the geometry per colour from the entwine node? In order to re-bake by colour?
Also - how to add more than two zones to the Entwine component - I tried adding additional but somehow it didn’t work.

Sounds like you need to know more about data trees.


surface beneath colour_2023Apr20b3

This code demonstrates how more zones can be added.


surface beneath colour_2023Apr21a.gh (6.3 MB)

1 Like