# How to control the scaling with the Color Ramp node so that the scaling is smooth?

I need to control the scaling of the mesh with a color ramp so that the effect is smooth like the mesh on the right. I tried different combinations of the nodes in the picture, but nothing worked for me.

• The mesh on the right is smooth only in middle, not on the start and end of the gradient. Have you tried switching "Linear" mode to other options? Feb 12 at 20:19
• @MarkusvonBroady It does not have to be exactly the same as on the gradient. The main requirement is that it should be guided by a gradient. Feb 12 at 22:26

Scale Elements will separate the Selection, and then separate that by mesh islands, and then scale the islands. So if you don't want the cuboid to be simply scaled as a single object, you need to separate the horizontal edges. Then you need to simply pass the $$z$$ coordinate to the Color Ramp, but since the ramp expects inputs in range $$[0,1]$$, all $$z$$ coordinates below $$0$$ will read as $$0$$, and all $$z$$ coordinates above $$1$$ will read as $$1$$ (they will be clamped to the expected range). To combat this I use an Attribute Statistic node, but you could as well e.g. just divide the coordinate by the height of the mesh if it started at zero as in your case… Notice the "Ease" mode…
• @arachnoden vertical edges are at an angle of $90°$ to a horizontal vector, so I select edges that aren't at that angle. The Vector $<1, 1, 0>$ was picked, but any vector with $z = 0$ would do as long as both $x$ and $y$ weren't equal (or very close to, due to εpsilon allowing some fuzziness) to $0$ (because an edge parallel to $y$ axis is at $90°$ to $<1, 0, 0>$ and an edge parallel to $x$ axis is at $90°$ to $<0, 1, 0>$, and we want to select those horizontal edges). Feb 13 at 9:12