# LED Mapping to Arcs

I have a curious problem. I have successfully mapped four 16x16 panels into a 32x32 panel, and now am trying my hand at mapping 4 runs of tape to 4 graduating arcs. I have them successfully created and merged into a single plane view, but for the life of me can not figure out why the pixels are mapped image seems to have the left and right edges meeting at the middle of the mapped image.

I’ve attached the TOE here. I am a novice, so very open to critique and corrections. My challenge is just grokking all of it.

LED_Mapping_Arcs.toe (12.6 KB)

Hi there!

The reason why this is happening is because of the toptoCHOP. You’re sending the tx,ty and tz positions of your SOP straight into the toptoCHOP. This chop expects UV coordinates (values going from 0 to 1). It will now only fetch the first 2 channels (tx and ty) and treat it as if it were uv coordinates. Negative values will be out of bound and by default looped (toptoCHOP ‘extend’ page). So this is the reason why it’s meeting in the middle (tx = 0).

To fix this, you could move and scale the tx & ty values in such a way that they fit in a space between 0 and 1. It depends on how you want to map the TOP in what way you need to scale it. If you want to keep the proportions as they are in the sop, you would need the scale tx and ty with the same value. If you just want to fit the TOP to all leds, you could do something like this:

As you can see in the math3 CHOP, the values of u and v are between 0 and 1.

Hope this helps.

Cheers,
tim

Oh thank you! I THINK I understand. Will give it a whack.

Cheers! btw, you can also do it before moving to chops with a transformSOP, which might be a bit easier:

Super helpful. I can see my mistake now when I compare it to the function of my grid solution. That one I was able to keep within -1 to 1 on both X and Y.

New issue. I can clearly see the image I am mapping to the pixels in now repeating, as the canvas of the pixels is wider that what the top image file is outputting…

No matter what I do to the TOP out res, nothing seems to change in the pixel map. (Added image with redbox around the boundary of the TOP input, which you then see repeating…)

The X and Y should be between 0 and 1 to be a valid uv coordinate… if x goes from -1 to 1 you’ll sample the TOP twice.
Anyways I think an example explains it better, so I made a quick generic solution that uses a few analyzeCHOPs to get the measurements of your SOP and fits in either best fit, fit outside or stretching.
LED_Mapping_Arcs.toe (12.6 KB)
SOPPositionsToUV.tox (934 Bytes)

Cheers,
tim

Thanks, Tim! I will look over your solutions tomorrow morning. I appreciate your help!
Cheers,
Cam

1 Like

Hi Tim,

When working with UV value instead of XY(Z) values, do I have to mapped them to the geometry differently? I am trying to figure out how to implement your SOPtoUV base.

Cheers,
Cameron

Hi Cameron,

The ‘UV’ coordinate system is a way to address a position in a TOP (2d image) where the coordinate u = 0, v = 0 is the bottom left of the image. u = 1, v = 1 is the top right.
Now using the TopToCHOP it’s possible to sample the color of a certain pixel of the specified TOP and using the input you can supply your own UV coordinates where to sample from.
Now you want to have those UV values between 0 and 1 to be inside the TOP.
Your XYZ-positions of your geometry can be way larger or smaller, so you would need to fit them inside the area between 0 and 1…

What the SOPToUV base does is finding the size of your geometry and scaling it so it fits in the 0 to 1 area.

Hope this makes sense

Cheers,
tim