# Image sampler not working properly on curved surface

Hi, would anyone help me with this problem. The image does not scale properly on the curved surface. Sorry I am new to grasshopper and this forum, I cannot seem to upload my gh file.

there are a couple of things that Iâ€™d change, the first one, when you generate lines to be extruded, unless you shift with Wrap=False for both start point and end point, I think youâ€™ll end up with an Invalid Line in your final Lines list (or you end up with a new line that connects the start to the end of your original curve:

so Iâ€™d suggest to shift both of them (+1 and-1) with Wrap = False:

about the Image Sampler, I guess the result you want to achieve is something like: â€śif I had my curve as a straight line, perfectly aligned and scaled along the length of the rainbow image, what colour whould I get for these points?â€ť

which means that you should consider at which parameter t each point lies along the length of the curve (original curve to be reparametrized, in such a way all values will be in the range 0-to-1 which also happens to be the standard range for the image sampler)

because your image is sort of â€śunidimensionalâ€ť (Y value for sampling doesnâ€™t really matterâ€¦) you can just input the X value to the Point XYZ component

image_sampling_along_curve.gh (20.2 KB)

2 Likes

Hi inno, thank you for your prompt reply! Thank you for explaining the above.

What I am trying to achieve is the image sampler projecting the colors of the image uniformly on the curve surface, and in the case of my image, uniform color bands.

Is this possible on a 90degree like curve surface?

you want something like this?

just note: your original image has 6 colors, so it will work good only in a total number of panels which is evenly divisible by 6

because what you look for is a serie of colors, you might as well just input in the image_sampler a Range of numbers [0,1] based on a List Length connected to your Lines or Surfaces (they will be the very same amount, so it doesnâ€™t really matter which one)

image_sampling_along_curve_Re.gh (23.4 KB)

[btw, Evaluate Surface component could be deleted if you use the Range method]

2 Likes

@inno This is exactly what I am looking for. Thank you very much for your help!

Donâ€™t forget to mark the solution

1 Like