Surfaces have different uv values


(Ka) #1

Hello every one, i have many rectangles, extruded and deconstrected to get surfaces, i am trying to divide these surfaces using divide surface component, but I am getting different uv results, the uv values were applied differenty on the faces, some faces have the u and v values switched, does any one know how to fix this, thank you

(Ben Haycraft) #2

Hello -

Here is a GH file that will look at a list of surfaces and then compare the UV of the surfaces to a correct UV. It will then feed the bad UV surfaces into a script that swaps the U and V.

bad uv (9.8 KB)
bad uv srfs.3dm (47.0 KB)

Hope this helps!


(Ka) #3

it didn’t unfortunately, thank you any way


Really? It sounds like exactly what you’re looking for… I didn’t look at @BenHaycraft’s code but did you try to learn anything useful from it? If you had posted a model with your question, he might have shown you how to make it work.

(Ka) #5

haha why are you angry …it says all the surfaces are bad (17.8 KB)

(Ben Haycraft) #6

You are right - the way I was doing it will not work in this case. I will keep looking at it and see if I can come up with something.


“haha”? Why did you disrespect forum etiquette by not posting a model with your question? That’s rude, dude.

Without seeing his file first, you had no way of knowing. Typical waste of time responding to questions where no file is posted.

(Ben Haycraft) #8

Hello -

If you add a flip between DeBrep and then add the SwapUV script that I had in my first model, does that give you what you are looking for? It should make all of the UV’s correct.

q5 with correct (15.6 KB)


(qythium) #9

Off topic, but it looks like @DavidRutten’s “How to ask effective questions” post should really be made compulsory EULA-type reading for first time posters … seems that every other new topic has it linked to for one reason or another :sweat_smile:

Whatever what one may think about forum etiquette, new posters won’t be familiar with it and it does waste a bit of time on everyone’s part as Joseph pointed out above.

(Ka) #10

ok I am sorry, I thought I have decribe it enough, i will do thta next time.

(Ka) #11

actually not, even in in the last file you sent, the vertical spaces shoud be the same in all surfaces, also the horizantal spaces should be the same on every surface, in the following pic you can see the last result, the small boxes have more points.

(David Rutten) #12

If you let Grasshopper create surfaces from outline curves, then you will most likely end up with pretty random UVN directions. Based on your image it seems as though all your surfaces are perfectly orthogonal (axis oriented). In that case you could perhaps switch from rectangles to bounding boxes, which are also axis-oriented and therefore more consistent. But it does require all your surfaces are exactly at 90-degree increments.

(Ka) #13

actually i don’t want boxes tops and bottoms to be included in dividing surfaces.

(Tim Stark) #14

Deconstruct the bounding boxes and cull the top and bottom faces.

(Ka) #15

i have already tried, the same results

(Ben Haycraft) #16


In reading your newest post, it sounds like you want the “density” of the points per surface to be the same. The file I posted and the one in your last screenshot are dividing the surfaces correctly and giving you the same amount of points on each surface. The reason some look like they have more points than others is that some of the surface lengths are longer than others, so when you divide the surface the points get placed farther apart. If you would rather have the points evenly spaced apart, you would want to divide by length instead of count.

Attached is my attempt at dividing the surfaces by length. surfaces by (22.5 KB)

Hope this helps!

(Ka) #17

thank you, this is realy nice but complecated! have a good evening.