I am having a problem to apply a single nonlinear transformation to a path decorated with custom pics. A minimal example follows:
\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{shapes}
\usepgflibrary{curvilinear}
\usepgfmodule{nonlineartransformations}
\begin{document}
\tikzset{
cell/.pic={
% Shading for the endothelial cells
\pgfdeclareradialshading{centred}{\pgfqpoint{0bp}{0bp}}{%
color(0bp)=(white);
color(10bp)=(red!10!white);
color(20bp)=(red!20!white);
color(30bp)=(red!30!white);
color(100bp)=(red)
}
\node[%
draw,
rounded rectangle,
inner xsep=0.24cm,
inner ysep=0.075cm,
shade,
shading=centred,
ultra thin
] at (0,0) {};
}
}
\begin{tikzpicture}
\def\wallSideStartX{0}
\def\wallSideLength{15cm}
\coordinate (origin) at (\wallSideStartX,0);
\def\thickness{1.50cm}
% Start nonlinear transformation
\pgfsetcurvilinearbeziercurve
{\pgfpointxy{0}{0}}{\pgfpointxy{10}{0}}
{\pgfpointxy{20}{5}}{\pgfpointxy{20}{15}}
\pgftransformnonlinear{\pgfgetlastxy\x\y%
\pgfpointcurvilinearbezierorthogonal{\x}{\y}}%
\draw[%
fill=red
] (origin)
rectangle
++(\wallSideLength,\thickness);
\path[%
postaction=decorate,
decoration={%
markings,
mark=between positions 0 and 1 step 5mm with{%
\pic[%
%scale=0.7,
sloped,
transform shape
] {cell};
}
}
] (\wallSideStartX,0.5*\thickness)
--
++(\wallSideLength,0);
\end{tikzpicture}
\end{document}
This code compiles to the following image:

The same transformation is affecting somehow differently the decorations and the actual path underlining it. Ideally, I want that the decoration to follow the rectangle too.
I am not very experienced with nonlinear transformations in TikZ, so I suppose it could be some interaction of it with pics and decorated paths that I am not aware of and, so far, I could not find anything that could solve it. Could someone help me with a solution for it? Thanks a lot!



\pic[pos=\i, sloped, transform shape] ...would work but it did not, apparently (not sure why). – iago.oliveira May 23 '22 at 23:51