2
$\begingroup$

In this topic Quellenform explains nicely how to get the UVmap from a curve to mesh. On the internet there are also other ways, for example with the use of a spline factor, to get the U and V values for the UVmap.

In most cases I'm using round caps instead of the original caps. I normaly make these with a half UV-sphere and instance them on the start and end position with an Endpoint Selection. The UV-sphere has a built-in UV Map.

I thought it was possible to add the UV-vectors and combine them to one UV-vector.

So far I have not been able to combine the UV map of both the curve and the round caps. Is there a way to do this?

Update:

I've implemented spherical coordinates in the geometry node tree and think I'm almost there. Maybe someone can help me to solve the last piece.

In the figure below you can see how the round caps are generated:

enter image description here

The uv_caps are generated with cartesian to spherical coordinate and the spherical coordinate to cartesian groups. Cartesian to spherical coordinate group has the following node tree:

enter image description here

Spherical coordinate to cartesian group has the next node tree:

enter image description here

However, even though I think I'm close now, I still can't get the right UV map. The pattern isn't matching the curve. I can't get it right, no matter what variables I turn. Some of the results:

enter image description here

enter image description here

I think it should be like this (quick photoshop draw):

enter image description here

This is my blend file (made in Blender 4.1 alpha but also usable in previous versions):

$\endgroup$
7
  • 1
    $\begingroup$ You can study this to learn spherical coordinates, then assuming you cut along equator ($0$ elevation), you can set the the polar coordinate (azimuth) to the same UV map coordinate as the one depending on the length of the curve profile, and use elevation as an extension of the same coordinate as the one depending on the length of the main curve. Keep in mind you have to realize caps instances and adjust the latter coordinate depending on curve length. $\endgroup$ Jan 14 at 22:36
  • $\begingroup$ Tnx a lot! I will study this solution. $\endgroup$
    – EwSa
    Jan 15 at 5:09
  • $\begingroup$ @MarkusvonBroady what does they really have to do with this? if it has a uv already, make sure it's lined up properly (so U matches curves') and add some to the curve uv and end according to where the uv ends off and also scale it to it matches up with the curve uv (the radius might be useful for this)..., 🤔 I think. $\endgroup$
    – shmuel
    Jan 15 at 23:16
  • $\begingroup$ @shmuel you're right, the default UV Sphere already is unwrapped like this, so all you need is to scale based on radius. The geonodes primitive node "UV Sphere" also has such UV, though rotated and flipped: i.imgur.com/3ki84iz.gif $\endgroup$ Jan 16 at 10:47
  • $\begingroup$ @MarkusvonBroady: I've made an update (see original question). Maybe you can take a look? $\endgroup$
    – EwSa
    Jan 20 at 17:14

1 Answer 1

2
$\begingroup$

I'm unfortunately short on time, which is why I can only respond briefly for now, but I would still like to share the blend file with you...

If you want to use the hemispheres with their existing UVs, you would simply have to scale them accordingly (and possibly rotate them), as already mentioned in the comments.

Depending on what exactly you want to do with them and which parameters should remain flexible, you can solve this by multiplying $U$ by the circle resolution and $V$ by the number of rings/3 of your hemisphere, for example:

PS: Also note that in your setup you only instantiate the hemispheres at the end points and not at every point of the curve.


(Blender 4.0.2+)

$\endgroup$
1
  • $\begingroup$ Thank you so much! This is exactly what I was looking for, and a very easy approach :) If you have some time, can you explain me why to divide the number of rings by 3? Finally, If I would like to rotate the UV of the hemispheres, I can simply flip the U and V coördinates. Why can't this be done when mapping the UV coordinates in your setup: blender.stackexchange.com/questions/258246/… ? $\endgroup$
    – EwSa
    Jan 23 at 19:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .