这是我的代码,我想让绿色汽车的闪光灯距离街区末端一厘米而不是街区中间,我该怎么做?
\documentclass[10pt,border=3mm]{standalone} % 在开发过程中更有用
\usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{ pics/my car/.style={ code={ \tikzset{my car/.cd, #1} \shade[我的车/汽车颜色, 阴影角度={135}, 绘制=黑色, 圆角=1.2ex, 非常厚] (1.5,.5) -- ++(0,1) -- ++(1,0.3) -- ++(3,0) -- ++(1,0) -- ++(0,-1.3) -- (1.5,.5) -- 循环;
\draw[very thick, rounded corners=0.5ex, fill=black!20!blue!20!white, thick]
(2.5,1.8) -- ++(1,0.7) -- ++(1.6,0) -- ++(0.6,-0.7) -- (2.5,1.8);
\draw[thick] (4.2,1.8) -- (4.2,2.5);
\draw[fill=gray!50, thick]
(2.75,.5) circle[radius=.5cm]
(5.5,.5) circle[radius=.5cm];
\draw[fill=gray!80, semithick]
(2.75,.5) circle[radius=.4cm]
(5.5,.5) circle[radius=.4cm];
\coordinate (-front) at (1.5,1);
\coordinate (-back) at (6.5,1);
\coordinate (-top) at (4.25,2.5);
\coordinate (-bottom) at (4.25,0);
}
},
my car/car color/.style={
top color=red, bottom color=white
}
}
\begin{document} \begin{tikzpicture}[% ~~~ 将样式移至此处 ~~~~~~~~~~~~~ >={Stealth}, % 替换所有箭头提示 mytext/.style ={font=\fontfamily{put}\selectfont\tiny, align=center,color=black}, block/.style ={mytext,rectangle,minimum height=1.5cm,minimum width=5cm, fill=white,draw=black!150}, % ~~~ 对于所有这些线条(按层次结构使用) ~~~~~~~~~ lnw/.style={line width=2pt}, arr/.style={->,lnw}, arr1/.style={arr,draw=green!50!blue!100}, arr2/.style={lnw,draw=green!50!blue!100}, arr3/.style={arr,draw=teal!70!black!60}, arr4/.style={lnw,draw=teal!70!black!60}, % ~~~ 对于文本节点 ~~~~~~~~~~~ txt/.style={fill=gray!10,align=center}, ] % ~~~ 放置功能块 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \node[block] (A) at ( 14.2, 7){controller} ; \pic (car 1) at (0,0) {my car};
\pic (car 2) at (10,0) {my car={car color/.append style={top color=blue}}};
\pic (car 3) at (20,0) {my car={car color/.append style={top color=green}}};
\pic (car 4) at (30,0) {my car={car color/.append style={top color=black}}};
\draw[line width=5pt][<-, shorten <=5pt, shorten >=5pt]
(car 1-back) to[out=90, in=90] (car 2-front);
\draw[line width=5pt][<-, shorten <=5pt, shorten >=5pt] (car 2-back) to[out=90, in=90] (car 3-front);
\draw[line width=5pt][<-, shorten <=5pt, shorten >=5pt]
(car 3-back) to[out=90, in=90] (car 4-front);
\node [coordinate, above of=A,node distance=3cm](none){};
\node [coordinate, above of=A,node distance=2cm](none2){};
\draw[arr1](汽车 1-顶部) |- (无) -- (A); % \draw[arr1](汽车 1-顶部)-- ++(0,8) -- ++(5,2) |- (A.north) ; \draw[arr1](汽车 2-顶部) -- (A); \draw[arr1](汽车 3-顶部) |- (无2) --(A) ;
\end{tikzpicture}
\结束{文档}