Colour gradient number remapping

My idea for remapping a sun study doesn’t appear to be working as anticipated. The outcome mesh bears no relation to the original; but in my mind this should probably be a simple re-mapping exercise. Im a bit rusty on GH so i may be missing something obvious, but as far as I can tell the lists should match properly.

I have solar studies coming out with a count of hours they receive sunlight. I am doing multiple instances of the study on separate days of the year, so generally the areas get a count of 0 through 17. I need the gradients to keep a common max/min value for comparison, so I divide by 24 (hours in a day) to get a consistent value between instances. Howver something is happening in the gradient tool that breaks the connection. Snips below of the left vs. right mesh.

I can’t tell where the break in my data structures is occuring … i assume it has to be inside of the gradient tab.

Hi @BeeCee ,

Please upload your .gh file with the inputs in purple internalized and I’d be happy to take a look!

Without looking at the mesh and your data you could try the following:

-If the Min and Max are 0 and 15

-Plug those into your L0 and L1 gradient inputs.

-Then plug your “Data” directly into the t parameter input of the Gradient component.

1 Like
  1. I recommend posting your Ladybug Tools related questions to the Ladybug Tools forum: https://discourse.ladybug.tools
  2. Try using the legend parameters component to set the min/max values for the legend. You can connect it to the legend_par input of the DirectSunHours component.
2 Likes

Woops! attached.
230921_Sun-Study_sample.gh (657 KB)

missing

Used Bounds to get the domain for gradient. Looks more interesting with a different gradient preset:


Joseph - this is still the incorrect mesh though. The correct one is the sun shade study snip above. I am trying to gain more control of the bounds so that the number of daylight tracks to a constant relationship of 24h.

Coloring mesh faces has never worked well for me, As surfaces though, they look OK?


Sun-Study_2023Sep21a.gh (665.1 KB)

Using your original (boring) gradient:

Wow! That looks exaclty like i was thinking. Is this just a break in re-coloring mesh items? so weird. Typically I try to avoid surfaces in this instance due to the shear size they can swell to, but maybe its required in thsi instance?

Also, what is the mesh-to-brep node you have at the bottom, i am not seeing it for some reason…

And the obvious follow-up question … if surfaces are required, how do those get baked wtih the associated color …

I never attempted “casting” boundary curves directly to a surface node…

That’s actually amazing. If you run the Boundary Surface component here in lieu of “Surface Container” its a 2+ min computation time. Yet the Surface node returns the same untrimmed surface result as the BS component in ~400ms. Wow! What a difference!

Are you using Rhino 8 or Rhino 7?

Face Boundaries and a Surface (Srf) param. Nothing special.

If you bake the preview component, the colors are saved. Use ‘Rendered’ to see them.
But the file is 72 .5 MB :exclamation:

I think it only works when the face boundaries are planar? (flat) I’ve used EdgeSrf when they are not.

I noticed that too. Something is wrong!

I’ve used this method previously but man now that I know about the Srf container I’m going to test that on some “slow” planar boundary srf results in my other scripts.

P.S. Maybe 16K faces on this mesh (and 16K data values) is more than you really need?

rhino 7 for me

In that case @Joseph_Oster has shared some code in the past that allows baking with materials intact.

Alternatively you can use Elefront plugin to dynamically bake the result.

Otherwise, as Joseph pointed out you can right click manually bake the Custom Preview and it will keep the colors intact as they were technically “assigned” within the context of the Custom Preview

Hi @BeeCee ,

Riffing off what @Joseph_Oster put together, if we pass the recolored “brep mesh” back into a mesh again, join it, etc. we can greatly reduce the file size when baking!

I have attached the result to this post to illustrate this :slight_smile:

Graph Space:

Model Space:

20230921_Sun-Study_sample_Response_01a_Bake_Result.3dm (1.7 MB)

20230921_Sun-Study_sample_Response_01a.gh (441.3 KB)

2 Likes

Wait, what :question: Truly bizarre :exclamation:

1 Like

In testing this further it does appear that I am “remeshing” the original mesh at the Mesh Brep component and actually subdividing the original mesh quite a bit which I don’t want.

I need to see why I can’t simply convert the Brep surfaces to mesh faces without the subdividing occuring.

This isn’t a file size issue but it does effect the welding and blurring of the mesh gradient

Hmm…