我现在有点开始习惯 tikz 了。但我正尝试在 tikz 中重现下面的图像
我已经设法使用 tikz 制作了三角形(我想是吧?),现在我不知道如何制作图像周围的摇摆部分。我确实研究过诸如抛物线之类的东西,但没有成功。我读了一些关于贝尔齐尔曲线的文章,但这让我更加困惑。
我的代码到目前为止
\documentclass{article}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{backgrounds}
\usepgflibrary{shapes}
\usetikzlibrary{through}
\usetikzlibrary{arrows}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=1.4,label]
\tkzInit[xmin=-1 , xmax=14 , ymin=-1 , ymax=5]
\tkzClip
\tkzDefPoint(0,0){A} \tkzDefPoint(10,0){B}
\tkzDefPointBy[rotation= center B angle -15.4](A)
\tkzGetPoint{C}
\tkzDefPointBy[rotation= center A angle 69.7](B)
\tkzGetPoint{D}
\tkzDrawSegment[very thick](A,B)
\tkzInterLL(A,D)(C,B) \tkzGetPoint{I}
\tkzDrawSegments[dashed](A,I I,B)
\tkzDefMidPoint(A,I) \tkzGetPoint{M}
\tkzMarkAngle[scale=0.75,dashed](A,I,B)
\tkzMarkAngle[scale=0.75,dashed](B,A,I)
\tkzDrawPoints[color=black,shape=circle,fill=red,size=10pt](A,I,B)
\tkzLabelPoint[left](M){$40.0m$}
\tkzLabelPoint[right](B){\Large $B$}
\tkzLabelPoint[left](A){\Large $A$}
\tkzLabelPoint[above left](I){\Large $C$}
\tkzLabelAngle[pos=0.8](A,I,B){ $94.9^{\circ}$ }
\tkzLabelAngle[pos=0.9 ](B,A,I){ $69.7^{\circ}$ }
\end{tikzpicture}
\end{document}
有人能提示或演示如何在乳胶中生成稍微任意的阴影斑点/多边形吗?另一个问题是我的斑点需要尽可能接近上图中的斑点。
答案1
您可以使用库random steps
中的装饰decorations.pathmorphing
,并结合起来rounded corners
创建类似的东西。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[label]
\tkzInit[xmin=-1.5 , xmax=14 , ymin=-3 , ymax=5]
\tkzClip
\tkzDefPoint(0,0){A} \tkzDefPoint(10,0){B}
\tkzDefPointBy[rotation= center B angle -15.4](A)
\tkzGetPoint{C}
\tkzDefPointBy[rotation= center A angle 69.7](B)
\tkzGetPoint{D}
\tkzDrawSegment[very thick](A,B)
\tkzInterLL(A,D)(C,B) \tkzGetPoint{I}
\tkzDrawSegments[dashed](A,I I,B)
\tkzDefMidPoint(A,I) \tkzGetPoint{M}
\tkzMarkAngle[scale=0.75,dashed](A,I,B)
\tkzMarkAngle[scale=0.75,dashed](B,A,I)
\tkzDrawPoints[color=black,shape=circle,fill=red,size=10pt](A,I,B)
\tkzLabelPoint[left](M){40.0\,m}
\tkzLabelPoint[right](B){\Large $B$}
\tkzLabelPoint[left](A){\Large $A$}
\tkzLabelPoint[above left](I){\Large $C$}
\tkzLabelAngle[pos=0.8](A,I,B){ $94.9^{\circ}$ }
\tkzLabelAngle[pos=0.9 ](B,A,I){ $69.7^{\circ}$ }
\draw [shade,
top color=blue,
bottom color=white,
fill opacity=.1,
decoration={random steps,segment length=1cm,amplitude=.5cm},
decorate,
rounded corners=.3cm]
(A) -- (0.4,0.7) -- (5,3.1) -- (B) -- (10,-1) -- (1.6,-1.5) -- (A);
\end{tikzpicture}
\end{document}
由于装饰效果在某种程度上是随机的,您的输出可能与此不同。
如果 blob 必须与图像中的 blob 几乎相同,那么在 Inkscape 中手动绘制路径并使用以下方式导出到 TikZ 代码可能会更容易inkscape2tikz
。(可能还有其他工具可以让你做到这一点,但我知道这些,所以我用的是这些。)
代码并不漂亮,我必须手动移动和缩放它以使其适合现有的绘图,但这并没有花费太长时间。
\documentclass{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[label]
\tkzInit[xmin=-1.5 , xmax=14 , ymin=-3 , ymax=5]
\tkzClip
\tkzDefPoint(0,0){A} \tkzDefPoint(10,0){B}
\tkzDefPointBy[rotation= center B angle -15.4](A)
\tkzGetPoint{C}
\tkzDefPointBy[rotation= center A angle 69.7](B)
\tkzGetPoint{D}
\tkzDrawSegment[very thick](A,B)
\tkzInterLL(A,D)(C,B) \tkzGetPoint{I}
\tkzDrawSegments[dashed](A,I I,B)
\tkzDefMidPoint(A,I) \tkzGetPoint{M}
\tkzMarkAngle[scale=0.75,dashed](A,I,B)
\tkzMarkAngle[scale=0.75,dashed](B,A,I)
\tkzDrawPoints[color=black,shape=circle,fill=red,size=10pt](A,I,B)
\tkzLabelPoint[left](M){40.0\,m}
\tkzLabelPoint[right](B){\Large $B$}
\tkzLabelPoint[left](A){\Large $A$}
\tkzLabelPoint[above left](I){\Large $C$}
\tkzLabelAngle[pos=0.8](A,I,B){ $94.9^{\circ}$ }
\tkzLabelAngle[pos=0.9 ](B,A,I){ $69.7^{\circ}$ }
\begin{scope}[x=0.01cm,y=-0.01cm,shift={(-67,-380)},scale=1.18]
\path[draw=black,
shade,
top color=blue,
bottom color=white,
fill opacity=.1] (324.2857,37.4286) .. controls (324.2857,37.4286)
and (375.7143,8.8571) .. (402.8571,8.8571) .. controls (537.1429,8.8571) and
(594.9022,229.4892) .. (645.7143,237.4286) .. controls (691.4286,244.5714) and
(687.1428,196.0000) .. (732.8571,196.0000) .. controls (761.5711,196.0000) and
(819.9039,267.6222) .. (854.2857,284.5714) .. controls (872.0828,293.3449) and
(898.1530,287.6641) .. (904.2857,310.2857) .. controls (908.4648,325.7012) and
(915.4588,428.9108) .. (880.9086,428.5105) .. controls (859.7549,428.2654) and
(847.9021,422.6772) .. (834.2857,418.8571) .. controls (820.2451,414.9181) and
(814.2857,393.1429) .. (782.8571,390.2857) .. controls (751.4286,387.4286) and
(711.4514,402.4931) .. (680.0000,401.7143) .. controls (622.3075,400.2857) and
(496.2045,334.2248) .. (450.4902,341.3677) .. controls (404.7759,348.5105) and
(370.8368,402.6229) .. (326.5511,406.8368) .. controls (282.3729,411.0405) and
(224.1124,380.4590) .. (176.9695,380.4590) .. controls (129.8267,380.4590) and
(114.2857,408.8571) .. (102.8571,408.8571) .. controls (91.4286,408.8571) and
(43.7959,397.5021) .. (43.8673,366.6635) .. controls (43.9391,335.6534) and
(128.3263,212.2045) .. (158.3263,199.3474) .. controls (188.3263,186.4902) and
(228.5714,164.5714) .. (237.1429,153.1429) .. controls (245.7143,141.7143) and
(231.4286,86.0000) .. (254.2857,71.7143) .. controls (277.1429,57.4286) and
(324.2857,37.4286) .. (324.2857,37.4286) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}