I’m unsure exactly what to call this, so please bear with me as I try and describe it. Have a look at the image below.
Suppose I’ve designed a repeating patterned design (top image), but I want to fit it to an object which varies in width (e.g. a knife handle). The simple approach I’ve found is to use flow along surface to map the design from its original rectangular shape to the varying-width shape (after using 2-rail sweep to create a surface suitable for flowing onto). This works, but as you can see (second image from top) the design is only stretched vertically to fit into the shape, it isn’t altered horizontally. As a result, the center portion looks stretched vertically, but the right-hand portion looks squashed.
To get around this, I figured out a way of non-uniformly stretching the original design horizontally in such a way (third image from top) that when it’s flowed to the final shape, everything looks correct. For example, I’ve stretched the middle portion horizontally and squashed the right-hand portion. This now looks great (bottom image) but it’s a bit of a pain to do, as it involves creating a curve whose slope is the integral of the width of the shape, then doing several projecting/draping operations to distort the original design.
The proper term for all this seems to be “conformal mapping” which preserves angles but allows the design to scale. However, my searches for conformal mapping all led down a rabbit hole of incomprehensible maths.
If you’re still awake, I’m wondering if there is any simpler way of achieving what I’m trying to do? Given a repeating pattern that’s initially drawn on a regular, square grid, and an arbitrary shape that I want to map it to, how could this be done? I’m guessing there will be some clever trick involving Grasshopper, but I’m afraid I don’t know enough about it to experiment.