Tikz-填充任意区域并绘制一条线到另一条线

Tikz-填充任意区域并绘制一条线到另一条线

嗨!我对我目前的论文有两个问题。抱歉我的手绘太差了。

  1. 我如何填充任意部分(用 A 填充红色区域)?
  2. 我想从填充区域 A 的底部曲线绘制一些线,然后停在线 CD 处。我认为应该使用相交命令。但我不知道该怎么做。

谢谢你的帮助。

在此处输入图片描述

    \usepackage{tikz-dimline,wasysym}%dimensional lines
    \begin{figure}
    \centering
    \caption{Caption}
    \begin{tikzpicture}
    \coordinate (origin) at (0,0);
    \coordinate (A) at (135:2);
    \coordinate (B) at (-45:2);
    \coordinate (C) at (-70:2);
    \coordinate (D) at (-110:2);
    \draw (C)--++(0,0.5) coordinate (E);
    \draw (D)--++(0,0.5) coordinate (F);
    \draw (E)--node[below] {shoe} (F);
    \draw (origin) circle [radius=2cm];
    \draw [<->,thick](B)--node[below] {D} (A);
    \draw (C)--++(-45:0.5) coordinate (G);
    \draw (D)--++(-45:0.5) coordinate (H);
    \draw (G)--(H);
    \draw (-80:2)--++(-45:0.5);
    \draw (-90:2)--++(-45:0.5);
    \draw (-100:2)--++(-45:0.5);
    \dimline[line style = {line width=0.7,
    arrows=dimline reverse-dimline reverse},extension start 
    length=0.14,extension end length=0.14,label style={above}] {(E)}{(F)} 
    {ABC};
    \label{fig:my_label}
    \end{tikzpicture}
    \end{figure}

答案1

这是一项提议。我擅自用图案代替了您的 45 度线。

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-dimline}%dimensional lines
\makeatletter % https://tex.stackexchange.com/a/127045/121799
\tikzset{use path/.code=\tikz@addmode{\pgfsyssoftpath@setcurrentpath#1}}
\makeatother
\usetikzlibrary{backgrounds,patterns}
\begin{document}
    \begin{tikzpicture}
    \coordinate (origin) at (0,0);
    \coordinate (A) at (135:2);
    \coordinate (B) at (-45:2);
    \coordinate (C) at (-70:2);
    \coordinate (D) at (-110:2);
    \draw (C)--++(0,0.5) coordinate (E);
    \draw (D)--++(0,0.5) coordinate (F);
    \draw (E)--node[below] {shoe} (F);
    \draw[save path=\Circle] (origin) circle [radius=2cm];
    \draw [<->,thick](B)--node[below] {D} (A);
    \draw (C)--++(-45:0.5) coordinate (G);
    \draw (D)--++(-45:0.5) coordinate (H);
    \draw (G)--(H);
%     \draw (-80:2)--++(-45:0.5);
%     \draw (-90:2)--++(-45:0.5);
%     \draw (-100:2)--++(-45:0.5);
    \dimline[line style = {line width=0.7,
    arrows=dimline reverse-dimline reverse},extension start 
    length=0.14,extension end length=0.14,label style={above}] {(E)}{(F)} 
    {ABC};
    \begin{scope}[on background layer]
    \fill[pattern=north west lines] (C) -- (G) -- (H) -- (D);
    \end{scope}
    \begin{scope}[on background layer]
    \clip [use path=\Circle];
    \fill[red] (E|- 0,-2) rectangle (F);
    \end{scope}
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容