Need help creating UV on generated mesh (geometry nodes)

I have created the following mesh using geometry nodes:

And this is how I’ve applied the UV:

The and bottom UVs of the mesh are correct, however the sides are generated by the UV Unwrap node and are warped:


The sides would need to be vertical strips on the texture to look right.

How would I rectify this?
Is there an alternative way to map all the side faces as vertical strips that doesn’t use UV Unwrap? Or do I need to set some seams further up in my node tree to use in UV Unwrap? Not sure how I would do this.

Any suggestions would be appreciated.

Still a bit stuck on this.
A nudge in the right direction would be appreciated.

Hi hedgehog90,
if you’re using the UV Unwrap node you have to define some seams for it to work properly. For example based on the Edge Angle:


However, that alone won’t fix your problem on the side faces because you would still get a closed ring like shape. So you need to define an additional seam to split it up.

For example an edge that sits at X = 0 and Y < 0:

An alternative approach (if you created this shape with curves) could be to use this node group here to create the side faces with a Curve Line as the profile:


The top and bottom faces can be created with the Fill Curve node.

Hope that helps!

3 Likes

Very helpful. Thank you!

1 Like

While the CurveToMeshUV group does an excellent job of generating UVs, I’m having a bit of trouble with the generated meshes’ normals.

I start with this flat 2d mesh (with the face orientation overlay enabled):

blender_jJQAoXHD6D

Then I have to convert my mesh into independent curves, so I Mesh to Curve just the edges that have single faces. This gives me 2 outlines.

However, both curves are in the same direction, so when I use CurveToMeshUV I get:

And when I finally combine everything:
blender_7ubisTGZux

The inner edges have the correct normals but the outer edges have inverted normals.
So I need to reverse just the outer curve in this example, but I have other more complex example with concentric curves where I need better logic than ‘just reverse curve with index n’

Or maybe I can use the extrude node to generate the mesh and transfer the UV from CurveToMeshUV over? I don’t know how to do this though…

This is very deep and tricky subject without a straightforward answer… it really depends on the topology of the thing you’re generating. Currently there are only hacky solutions in GN for “recalculating normals”.

For your specific use-case, you could try something like this:


…it requires 4.1’s Sort Elements node, and the initial geometry needs to be at the origin on the XY plane.

Good luck.

3 Likes