1
$\begingroup$

I'm trying to create a mapping that curves the line to keep it the same width. But I couldn't find anything on the entire internet.

I would like to understand what approach and how to do it. Furthermore, I think that the bending must be done according to a "Radius" of a hypothetical circle.

For now I have created something like this but it doesn't work as I hoped, as the line narrows, while I would like it to remain the same thickness once folded.

This is a view at the nodes that create the line:

enter image description here

This is my procedural attempt to bend the Line

As you can see, the line curves exactly where I'm interested, but with this bending, the line narrows when bent.

enter image description here

My idea is to choose the radius of curvature, and the degree of curvature. But I haven't found much help anywhere on the internet.

I hope to be more specific with this additional note:

My question is more oriented towards Vectors and how to bend them. Suppose I had inserted a dotted line (also an image texture), I would like to be able to bend the dotted line or the texture as well. Essentially Bend the vector coordinates without using UV mapping.

Bending 90 Degrees Example:

When I say I mean "Bend" I mean this, as you can see, the strip is only Folded in one point. (This example is done with 2 overlapping objects)

enter image description here

$\endgroup$
11
  • $\begingroup$ I think for this to work you need to account for the space bending in your "Less Than" threshold. Since space is bended it makes sense that the line is also bended and its width varies. And I would use an "Absolute" math node rather than a power of two which will make the computations harder $\endgroup$
    – Gorgious
    Commented Jul 3 at 8:56
  • 1
    $\begingroup$ I just want start off saying I never used Blender in my life and I came here from Stack Overflow because the question sounded interesting. I'm not sure if this is possible in Blender, but have you thought about using a quadratic function? If you want it to be a straight line, you can set the x^2 parameter to 0, and slowly increase it to get a curve (like 0.00... slowly) and you can use the x parameter to orient it or just use it as 0. Again, I've never used Blender so this may all just be me rambling, but I'll be glad if it actually helps anyone. $\endgroup$ Commented Jul 3 at 17:10
  • $\begingroup$ Perhaps you could make use of a polar coordinate system - treat the u coordinate as the angle, and threat the v coordinate as the radial component. Both coordinates could have an offset, and the u coordinate might also have a scaling factor - these could serve to control the curvature. Then "convert back" to cartesian uv coordinates. Might need some tweaking/clamping $\endgroup$ Commented Jul 3 at 23:08
  • $\begingroup$ Duplicate of blender.stackexchange.com/questions/98736/…. $\endgroup$
    – Lutzi
    Commented Jul 5 at 10:28
  • $\begingroup$ This question is similar to: Convert Object texture coords to Polar. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. $\endgroup$
    – Lutzi
    Commented Jul 5 at 10:29

2 Answers 2

5
+50
$\begingroup$

You can use the Vector Rotate node to rotate the texture coordinates.

I start by determining the angle and the rotating the coordinates to that angle. Now $x=0$ lies on that angle. Next, shift $x$ to your desired value using the subtract node.

By using the Clamp node on the angle, we can limit the effect and continue with undistorted coordinates after the bent segment.

vector rotate setup

result

$\endgroup$
8
  • $\begingroup$ Very interesting! I'm trying your setup and it looks very good. But I think there is a problem in "Radius" it doesn't set the radius, or am I wrong? $\endgroup$
    – Noob Cat
    Commented Jul 7 at 7:28
  • 1
    $\begingroup$ Radius indicates at what distance (radius) from the origin (which we rotate around) the uv coords x length remains the same and is not not stretched/squashed. With the UV grid you can see, that the points close to the origin appear distorted (squashed) and the points far from the origin appear distorted (stretched). With radius you can control which part is not stretched. When bending anything, the inner arc gets shorter and the outer arc gets longer. $\endgroup$
    – Leander
    Commented Jul 7 at 9:05
  • $\begingroup$ Excellent, it can be combined so that it works in symbiosis. This setup seems to be the answer I'm looking for. Another question: Doesn't this setup of nodes bend in the other direction? I noticed that you can only do this towards the bottom -Y and it doesn't bend to +Y $\endgroup$
    – Noob Cat
    Commented Jul 7 at 17:38
  • $\begingroup$ To bend in the other direction, multiply the Y input (after the Separate XYZ node) with $-1$ and the input to the angle (of the Vector Rotate node) with $-1$ as well. $\endgroup$
    – Leander
    Commented Jul 7 at 18:06
  • 1
    $\begingroup$ No, it wouldnt. ( But I should have said flip vertically before and after) :P $\endgroup$
    – Leander
    Commented Jul 7 at 18:54
3
$\begingroup$

You can start with two circles, as you suggested:

enter image description here

With a 0.0 - 1.0 Slider version:

enter image description here

$\endgroup$
2
  • $\begingroup$ My idea is to bend the line as desired, this solution is useful for creating a curve, as shown in the example, my Group node has an input that must act as a bender $\endgroup$
    – Noob Cat
    Commented Jul 3 at 9:11
  • $\begingroup$ Interesting answer, but this does not bend a straight strip, but rather creates a curve at will, it cannot return to a straight line. My question is more oriented towards Vectors and how to fold them. Suppose I had inserted a dotted line (also a texture), I would like to be able to bend the dotted line too. So I'm dedicating myself to creating a procedural node dedicated to "Folding" vector coordinates $\endgroup$
    – Noob Cat
    Commented Jul 3 at 17:17

You must log in to answer this question.

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