制作逻辑图

制作逻辑图

我想制作这样的逻辑图: 图表

镜像:https://pasteboard.co/HicPswl.png

但我不想用 \includegraphics 添加图片... 我没有在 latex 中绘制图表的经验。你能给出一个示例代码吗?我在电路图 TikZ 包中找到了一些示例。但我找不到类似的上述图表。谢谢你的帮助。

我的尝试和结果:

\tikzstyle{block} = [draw,fill=blue!20,minimum size=2em]
% diameter of semicircle used to indicate that two lines are not connected
\def\radius{.7mm} 
\tikzstyle{branch}=[fill,shape=circle,minimum size=3pt,inner sep=0pt]
\tikzstyle{block} = [draw,fill=blue!10,minimum size=2em]

\begin{tikzpicture}[circuit logic US, huge circuit symbols]

\node[block] at (0,0) (block1) {Sınıf diğer sınıfların niteliklerine erişmekte \newline
ATFD > 3};
\node[block] at (0,2) (block2) {Sınıfın fonksiyonel karmaşıklığı fazla
\newline
WMC >= 47};
\node[block] at (0,4) (block3) {Sınıf diğer sınıfların niteliklerine erişmekte \newline
ATFD > 3};

\node[and gate US, draw, rotate=0] at (7,2) (And1) {};

\draw[->] (block1) -- (And1);
\draw[->] (block2) -- (And1);
\draw[->] (block3) -- (And1);
\node[block] at (9,2) (Result) {God Class};
\draw[->] (And1) -- (Result);
\end{tikzpicture}

结果 :https://pasteboard.co/HidxBjn.png

答案1

这是一个起点

\documentclass[tikz]{standalone}
\usetikzlibrary{circuits.logic.US}
\begin{document}
\begin{tikzpicture}[circuit logic US]
\node[draw,align=center] (box1) at (-2,2) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node[draw,align=center] (box2) at (-2,0) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node[draw,align=center] (box3) at (-2,-2) {Some centered tex \\ with math \\ \\ $\sin(\pi)$};
\node [and gate] (a1) at (1,0) {VE};
\node[draw] (a2) at (3,0) {other node};

\draw (box1.east) -|++(1mm,-1mm)|- ([yshift=1mm]a1.west);
\draw (box3.east) -|++(1mm,1mm)|- ([yshift=-1mm]a1.west);
\draw(box2) -- (a1);
\draw (a1) -- (a2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

其余内容您可以在手册中或在此网站上搜索找到。

相关内容