Inkscape: Project a rectangle on bent path keeping gradients intact

I have a rectangle (4-node path) filled with a gradient which I now want to bend along its vertical axis in such a way that it resembles the curvature of another Bezier curve that bends in two places. The linear gradient axis should, at every point of the new non-rectangular path, be perpendicular to the Bezier curve (see image).

The picture shows an approximation of what I'd like to achieve, the missing space should be interpolated from the other blocks. I tried Pattern along Path but I seem to be using it the wrong way.

I do not have enough points to comment. So I post this as an answer to the comments about the video hoping that it helps OP. The pencil does not have a gradient. It has a blurred shaped on top of the pencil. If you put the blurred shape on top of a shape and then group, you can use the Bend trick in the video.

Gradient fills are clipped or masked by the shapes they fill - they don't relate to the outlines that bound them.

If you're expecting to add a linear fill and then have it deform with the shape itself you're going to be eternally disappointed.

To achieve the effect you're after I'd deform my base shape and then use a radial gradient fill. The linear gradient will start and finish white with a couple of stops of the main colour at offsets of about 0.4 and 0.6

Move the centre of the radial fill beyond the object to the hypothetical centre of its deformation and adjust the major and minor vertices to suit.

As you're limited to defining the fill as an oval (1 major and 1 minor axis) this will only work with simple deformations. With the deformed shape you provided I think it would look OK.

That's the fill part of your question covered I think. Good luck with deforming the shape how you intend - I couldn't! :-\

• ..and then I find something to completely undermine my answer! - youtube.com/watch?v=lEq-Dh3YtPk Looks like it can all be done
– user19660
Commented Mar 4, 2015 at 13:39
• You should write an answer about that (but be sure not to just link the video but also describe the essential aspects here). Also note that the reason why this is so hidden is that it is not contained in the SVG standard. Commented Mar 4, 2015 at 14:25
• If I could reproduce the effect in the video I would certainly include it as an answer - but I can't! :-(
– user19660
Commented Mar 4, 2015 at 14:39