答案1
数学和角度。
您可以使用scale
键或x
和y
键来改变拱门的大小。
代码
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\newcommand*\myAng {7.5}
\newcommand*\myArches{5} % starting with 0
\coordinate (@);
\foreach[evaluate={\c=\i/\myArches*100;}] \i in {0,...,\myArches}
\draw[rotate=-(\i-(\myArches-1)/2)*2*\myAng+\myAng, fill=red!\c!blue!50]
(@) -- +(90+\myAng:1)
-- +([shift=(90-\myAng:1)]right:1)
-- +(right:1) coordinate (@)
-- cycle;
\draw[rotate= (\myArches+1)*\myAng] (0, -0.2) rectangle +(-1.4, 1.4);
\draw[rotate=-(\myArches+1)*\myAng] ([shift={(0, -0.2)}]@) rectangle +( 1.4, 1.4);
\end{tikzpicture}
\end{document}
输出
答案2
您可以使用双线来绘制桥梁,并用垂直线装饰它以模仿石头:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[decoration=ticks]
\draw [double distance=1.7mm] (0,0) arc [start angle=30, end angle=151, radius=2cm];
\draw [decorate] (0,0) arc [start angle=30, end angle=151, radius=2cm];
\end{tikzpicture}
\end{document}
答案3
可以使用trapezium
形状链。这样做的好处是,各个角点等都可以作为节点锚点供以后使用。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[declare function={alpha=40;% opening angle of the bridge
n=6;% number of inner bricks
w=1;% brick height
beta=alpha/n;% auxiliary angle
},line join=round]
\pgfmathtruncatemacro{\myn}{n}
\path coordinate (tmp) node[anchor=south east,shift={(alpha-90:w*0.1cm)},minimum size=w*1.2cm,rectangle,draw,rotate=alpha](L){}
foreach \i in {1,...,\myn}
{node[trapezium,draw,outer sep=0pt,trapezium angle={-90+beta},minimum height=1cm,anchor=bottom left corner,rotate={alpha-2*(\i-0.5)*beta}](t-\i) {}
(t-\i.bottom right corner) }
node[anchor=south west,shift={(-alpha-90:w*0.1cm)},minimum size=w*1.2cm,rectangle,draw,rotate=-alpha](R){};
\end{tikzpicture}
\end{document}