如何创建具有圆角的环路的反馈图?

如何创建具有圆角的环路的反馈图?

在此处输入图片描述

我目前正在使用 MS Paint 绘制此类图表。但是,我希望顶部和底部的环(连接块的带箭头的线)有圆角,而不是尖角。(更像是 $\subset$ 而不是 $\sqsubset$)

有没有办法在 Tikz 或其他生成高保真图表的工具中做到这一点?

这个问题一直困扰我!

答案1

@Ignasy 答案的变体,但包含一些(题外话)图像和图像代码改进/更改。代码中差异用 标记<---

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,        % <--- added
                ext.paths.ortho,    % <--- added
                positioning}
\begin{document}
    \begin{tikzpicture}[
arr/.style = {-Latex, rounded corners=4mm},
lbl/.style = {font=\footnotesize, text=red, auto},
  N/.style = {draw, semithick, minimum width=2cm, minimum height=1.5cm}
                        ]           % <--- added image elements styles
\node[N] (a) {$\displaystyle \int \cos x \,dx$};    % <--- changed
\node[N, right=of a] (b) {$x^2 \sin x$};            % <--- changed

\draw[arr]  (a)  r-ud [distance=-10mm] node[lbl]  {$a$ to $b$} (b);    % <--- changed
\draw[arr]  (b)  r-du [distance=-10mm] node[lbl]  {$b$ to $a$} (a);    % <--- changed
    \end{tikzpicture}
\end{document}

在此处输入图片描述

编辑: 现在被认为是@Qrrbrbirlbel,TikZ 扩展包作者,评论。

答案2

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath,tikz}
\usetikzlibrary{positioning}
\begin{document}
    \begin{tikzpicture}
        \node[minimum width=2cm, minimum height=1.5cm, draw] (a) {$\int \cos x \,dx$};
        \node[minimum width=2cm, minimum height=1.5cm, draw, right=2cm of a] (b) {$x^2 \sin x$};
        \draw[-latex, rounded corners] (a) --++(90:2cm)-| node[near start, red, above]{$a$ to $b$} (b);
        \draw[-latex, rounded corners] (b) --++(-90:2cm) -| node[near start, red, below]{$b$ to $a$} (a);
    \end{tikzpicture}   
\end{document}

在此处输入图片描述

答案3

像这样:

在此处输入图片描述

代码:

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath,tikz}
\begin{document}
    \begin{tikzpicture}[scale=2] 
        \draw (0,0) rectangle (.8,.5) node[midway] (a) {$\int \cos x \,dx$};
        \draw (2,0) rectangle (2.8,.5) node[midway] (b) {$x^2 \sin x$};
        \draw[-latex] (.4,.5) to [out=60,in=120] node[red, above]{$a$ to $b$} (2.4,.5);
        \draw[-latex] (2.4,0) to [out=-120,in=-60] node[red, below]{$b$ to $a$} (.4,0);
    \end{tikzpicture}   
\end{document}

相关内容