Circuitikz 中的跳跃交叉

Circuitikz 中的跳跃交叉

我想在 leg1 和电压的交叉点上画一个跳跃节点。如果你能运行代码,你大概就会明白我的意思。我尝试过[交叉]并命名交叉点,然后在那里放置一个节点,但节点从来没有在我想要的位置。实际上我想要一个更大的跳跃,如右图所示。我真的很感激任何帮助。

在此处输入图片描述

\documentclass[preview]{standalone}

\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{steinmetz}
\usepackage[usenames,dvipsnames]{color}
\usepackage[american,cuteinductors,smartlabels]{circuitikz}

\usetikzlibrary{calc}
\ctikzset{bipoles/thickness=1}
\ctikzset{bipoles/length=0.8cm}
\ctikzset{bipoles/vsourceam/height/.initial=1.5}
\ctikzset{bipoles/vsourceam/width/.initial=1.5}
\tikzstyle{every node}=[font=\small]
\tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round]

\begin{document}
\textbf{Question 1}\\
 \textbf{a.}
\begin{center}
\begin{tikzpicture}

    \draw
    % Thyristors leg 2
    (5,4.5) to [open, v^=$V_o$] ++(0,-5)
    (2,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg2)
    % Thyristors leg 1
    (0,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg1)
    % Connections and load RL
        -- ++(4,0)
        to[short, f^=$\sqrt{2}\si{\ampere}$] ++(0,-1.5)
        to[R,l^=$R$] ++(0,-1)
    % Back to (0,0)
        |- (0,0)
    % AC source
    (-2,0) coordinate (Vnn)
        to[sV, l^=$230\sqrt{2}\sin{(2\pi 50t)}$] ++(0,4)
        to [short] (-1,4)
        to [short] ++(0,-1.6) coordinate (Vpp)
        -- (leg1 |- Vpp) node [circ] {}
    (Vnn) to [short] (-1,0)
        to [short] ++(0,1.6) coordinate (Vxx)
        -- ++(3,0) node [circ] {}
    % capasitor
    (3,4) 
        to[short, f^=$I_C$, current/distance=0.5] ++(0,-1.5)
        to[curved capacitor,l^=$C$] ++(0,-1)
        -- ++(0,-1.5)
    ;

\end{tikzpicture}
\end{center}
\end{document}

答案1

元素crossing位于to绘制的线段的中心。大小由键 控制bipoles/crossing/size,默认为0.2。如果我理解正确的话,一种可能性是这样的:

\documentclass[preview]{standalone}

\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{steinmetz}
\usepackage[usenames,dvipsnames]{color}
\usepackage[american,cuteinductors,smartlabels]{circuitikz}

\usetikzlibrary{calc}
\ctikzset{bipoles/thickness=1}
\ctikzset{bipoles/length=0.8cm}
\ctikzset{bipoles/vsourceam/height/.initial=1.5}
\ctikzset{bipoles/vsourceam/width/.initial=1.5}
\tikzstyle{every node}=[font=\small]
\tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round]

\begin{document}
\textbf{Question 1}\\
 \textbf{a.}
\begin{center}
\begin{tikzpicture}
    \draw
    % Thyristors leg 2
    (5,4.5) to [open, v^=$V_o$] ++(0,-5)
    (2,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg2)
    % Thyristors leg 1
    (0,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg1)
    % Connections and load RL
        -- ++(4,0)
        to[short, f^=$\sqrt{2}\si{\ampere}$] ++(0,-1.5)
        to[R,l^=$R$] ++(0,-1)
    % Back to (0,0)
        |- (0,0)
    % AC source
    (-2,0) coordinate (Vnn)
        to[sV, l^=$230\sqrt{2}\sin{(2\pi 50t)}$] ++(0,4)
        to [short] (-1,4)
        to [short] ++(0,-1.6) coordinate (Vpp)
        -- (leg1 |- Vpp) node [circ] {}
    (Vnn) to [short] (-1,0)
        to [short] ++(0,1.6) coordinate (Vxx)
        % the jump crossing should be at (Vxx|-leg1), move symmetrically around
        ([xshift=-0.5cm]Vxx -| leg1) to[crossing, bipoles/crossing/size=1] 
            ([xshift=0.5cm]Vxx -| leg1)
        % left and right connections
        ([xshift=-0.5cm]Vxx -| leg1)  -- (Vxx)
        ([xshift=0.5cm]Vxx -| leg1) -- (Vxx -| leg2) node[circ]{}
    % capasitor
    (3,4)
        to[short, f^=$I_C$, current/distance=0.5] ++(0,-1.5)
        to[curved capacitor,l^=$C$] ++(0,-1)
        -- ++(0,-1.5)
    ;
\end{tikzpicture}
\end{center}
\end{document}

在此处输入图片描述

更简洁的解决方案是使用一个xing节点,将其定位在(Vxx -| leg1)绘制垂直线或水平线之前,然后从那里开始(但您应该重新组织您的绘图,以便您Vxx更早地定义)

答案2

一个技巧是在之前绘制的交叉点上绘制一个白色填充区域,然后添加jump crossing节点。

\documentclass[preview]{standalone}

\usepackage{amsmath}
\usepackage{siunitx}
\usepackage{steinmetz}
\usepackage[usenames,dvipsnames]{color}
\usepackage[american,cuteinductors,smartlabels]{circuitikz}

\usetikzlibrary{calc}
\ctikzset{bipoles/thickness=1}
\ctikzset{bipoles/length=0.8cm}
\ctikzset{bipoles/vsourceam/height/.initial=1.5}
\ctikzset{bipoles/vsourceam/width/.initial=1.5}
\tikzstyle{every node}=[font=\small]
\tikzstyle{every path}=[line width=0.8pt,line cap=round,line join=round]

\begin{document}
\textbf{Question 1}\\
 \textbf{a.}
\begin{center}
\begin{tikzpicture}

    \draw
    % Thyristors leg 2
    (5,4.5) to [open, v^=$V_o$] ++(0,-5)
    (2,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg2)
    % Thyristors leg 1
    (0,0)
        to[D] ++(0,1.5)
        -- ++(0,1)
        to[D] ++(0,1.5) coordinate (leg1)
    % Connections and load RL
        -- ++(4,0)
        to[short, f^=$\sqrt{2}\si{\ampere}$] ++(0,-1.5)
        to[R,l^=$R$] ++(0,-1)
    % Back to (0,0)
        |- (0,0)
    % AC source
    (-2,0) coordinate (Vnn)
        to[sV, l^=$230\sqrt{2}\sin{(2\pi 50t)}$] ++(0,4)
        to [short] (-1,4)
        to [short] ++(0,-1.6) coordinate (Vpp)
        -- (leg1 |- Vpp) node [circ] {}
    (Vnn) to [short] (-1,0)
        to [short] ++(0,1.6) coordinate (Vxx)
        -- ++(3,0) node [circ] {}
    % capasitor
    (3,4) 
        to[short, f^=$I_C$, current/distance=0.5] ++(0,-1.5)
        to[curved capacitor,l^=$C$] ++(0,-1)
        -- ++(0,-1.5)
    ;
  \path (0,1.6) node[fill=white][circle]{} node[draw, jump crossing,scale=5]{};

\end{tikzpicture}
\end{center}

演示

相关内容