Is there a way in TikZ to add a transformation such as xshift=1mm to every coordinate of a path?
The following don't work because they do either more or less than "every coordinate of a path":
\path [xshift=1mm] ...doesn't apply to coordinates defined with nodes, e.g.\draw [xshift=1mm] (A) -- (B);doesn't shift anything.transform canvas={xshift=1mm}transforms everything (not just path coordinates), and causes troubles with the bounding box and the definition of new coordinates.- decorations don't change the underlying path (I think?) so
\draw [fancy decoration] (A) -- (B) node [below] {text};will have the node at the "wrong" position (corresponding to the unshifted path).
What does work is to manually add options to each coordinate, for example this works even with nodes: \draw ([opts]0,0) -- ([opts]A);. Well at least it works if A is defined through coordinate, and for other nodes it works when specifying an anchor as in A.center.
Is there something like a every coordinate/.style={opts} that would do the same thing without having to write opts for each coordinate?
As motivation, here's an example where it would help, while I think neither of the above three alternatives work:
\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (1,0);
\coordinate (B) at (3,1);
\draw [very thick,->] (A) -- (B) node [above left] {$\vec v$};
%
% Define style for shifting by 1cm perpendicular to A-B
\tikzset{perpshift/.style={shift={($(A)!1cm!270:(B)-(A)$)}}}
%
\draw [very thick,->] ([perpshift]A) coordinate (A2) --
([perpshift]$(A)!0.5!(B)$) coordinate (B2)
node (N) [below right] {$\vec w$};
\draw [dashed] (A) -- (A2)
($(A)!(B2)!(B)$) -- (B2);
\end{tikzpicture}
\end{document}

\begin{scope}[...] ... \end{scope}? – cfr Nov 03 '23 at 15:29\path [opts] ...;options among several paths, but it doesn't help for the problem thatoptswill have no effect on node coordinates like(A.center).... – jeremie Nov 03 '23 at 15:55Aa specification like(A)is supposed to specify a point on the border (for many of the path operation that exist). That's the whole point of nodes, in a way. – Qrrbrbirlbel Nov 03 '23 at 16:07.reasier to input than[…]), my opinion, Q95030 (alternative approach but still very manual). – Qrrbrbirlbel Nov 03 '23 at 16:13optsin\path ([opts]A.center)or\coordinate (A) at (1,2); \path ([opts]A), but for the whole path instead of putting it there manually for each coordinate. – jeremie Nov 03 '23 at 16:15\path ([opts]...)I don't think it would be a hack to have a style or something to apply the same to all coordinates on the path... – jeremie Nov 03 '23 at 16:17shift leftandshift rightkey we could also use. – Qrrbrbirlbel Nov 03 '23 at 16:25-|path between to nodes but rotated, you simply do\draw[rotate=45] (A) -| (B);. The-|will be rotated, the points on the border of the node are correct and it looks good. Consider coordinates fixed points on the page and not shortcuts to pair of x and y values. – Qrrbrbirlbel Nov 03 '23 at 18:58