Colorpick at UV parameter

Hi,

I have facade elements that I want to color based on an image.
I have seen tutorials en searched but it still doesn’t work.

The main problem is: the facade isn’t neatly divided into a regular X-Y grid.

So, what I need is a colorpicker that doesn’t divide the image into pixels and distributres them.
I need to pixel the image and than pick a color at a UV-parameter.

in the attached screenshot:
1: surface at the facade where every point is the centroid of the facade-element. (Surface.UVParameterAtPoint)
2: the image
3: the result.

Since there are not so many nodes dealing with images I’m stuck.
How do I map the correct color onto the correct facade-element?

It’s a very logic reasoning:

  • find points in a facade where to pick a color
  • create an image with the same dimensions
  • chop the image into pixels
  • find color at UV parameter

So what am I doing wrong?

Can you post any error messages? Also I think posting your DYN will go a long way with those that can and willing to help.

2 Likes

I think you’d have to use the same “coordinate system” between your panels and your image in order to map to the right pixels. Set up a point grid on your facade to match where you’ll be selecting pixel colors from. Then just use Image.Pixels to get the color of each pixel and map it back to the panel intersecting the matching point.

1 Like

Hi nick,

That sounds logical. I understand what you’re saying.
However, I have points on the facade, it’s just not a regular grid.

I had a hunch that that would be the main problem.

Thanks, I’ll try this and ofcourse post the result.

Menno

Hi Tom,

Sure, here it is:

color at UV parameter.dyn (127.6 KB)

If you want I can Wetransfer the revit file too.
I purged everything exept for the panels in this facade and the grid but the rvt is still bigger than I’m allowed to upload.

So you would either have to get the nearest point or define a new grid with a denser spacing to approximate your panel points.

The facade is not yet finished, I had to work on something else first.
Yesterday I started investigating on a simplified version:

So I have 12 colors:

Now I created 12 walls and a big wall to get the same ratio and location.
Script and file with the elements are attached. In the script some explaination in textnotes.
All nodes are ootb.

Now back to the main task of mapping images onto facades…

pipet.dyn (69.0 KB) pipet.rvt (960 KB)