tikzpicture를 회전하면 교차로가 엉망이 됩니다.

tikzpicture를 회전하면 교차로가 엉망이 됩니다.

저는 TikZ를 사용하여 그림 작업을 하고 있으며 교차점을 사용하여 몇 가지 점( $α(t_{j+i}$)을 그립니다. 크기를 조정하고 90도 회전하면 그림이 페이지에 더 잘 맞는다는 것을 알았고 놀랍게도 이로 인해 교차점이 완전히 엉망이 되었습니다. 회전이나 ​​크기 조정이 없는 출력은 다음과 같습니다.

일반 사진

그림의 크기를 조정하면 다음과 같은 일이 발생합니다(교차점이 해당 지점에서 벗어났지만 많지는 않음).

축소된 그림

그리고 이것을 회전시키면 이런 일이 일어납니다. 완전히 엉망이 됩니다.

회전된 사진

TikZ는 0.8 대신 0.64로 크기를 조정하거나 90도 대신 180도 회전하는 등 두 배의 변환을 적용한 것 같습니다. MWE는 다음과 같습니다.

\documentclass{minimal}

\usepackage{tikz}

\usetikzlibrary{arrows}
\usetikzlibrary{patterns}
\usetikzlibrary{intersections}
\begin{document}

\tikzstyle{nodepoint}=[inner sep=1pt, circle, draw, black, fill=black]

\begin{tikzpicture}[rotate = 0, scale=1]

\pgfmathsetmacro{\uiminoraxis}{3}
\pgfmathsetmacro{\uimajoraxis}{4}
\pgfmathsetmacro{\uilabelfactor}{1.2}
\pgfmathsetmacro{\uiinclination}{45}

\begin{scope}
\clip[rotate around={\uiinclination:(-\uimajoraxis,0)}] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
\fill[pattern=north east lines, pattern color=orange!80!white] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
\end{scope}

\foreach[count=\i] \a in {\uiinclination, 0, -\uiinclination}
{
    \begin{scope}[rotate around={\a:(-\uimajoraxis,0)}, scale=1]
        \draw[name path global=open\i] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
        \draw[dotted, name path global=axis\i] ({-\uimajoraxis},0) -- ({\uimajoraxis}, 0);
        \node at ({\uimajoraxis*\uilabelfactor}, 0) {$U_\i$};
    \end{scope}
}

\node[nodepoint, label={left:$x_0$}] (X) at (-\uimajoraxis / 2,0) {};

\draw[rotate around={\uiinclination:({-\uimajoraxis},0)}, (-), red] ({-\uimajoraxis / 2}, {1}) to[bend left] node[midway, above, sloped, yshift=4] {$A_j$} (1,1);

\draw[dotted, name path=outercircle] ({-\uimajoraxis},{1.44*\uimajoraxis}) arc[start angle = {\uiinclination*2}, end angle = {-\uiinclination * 2}, radius={1.44*\uimajoraxis}];

\draw[dotted, name path=joiner1, name intersections={of=open1 and open2}] (intersection-1)  -- (intersection-2);
\draw[dotted, name path=joiner2, name intersections={of=open2 and open3}] (intersection-1)  -- (intersection-2);

\node[name intersections={of=axis1 and outercircle}, nodepoint, label={above:{$\alpha(t_j)$}}] (AJ0) at (intersection-1) {};
\node[name intersections={of=axis2 and outercircle}] (AJ1) at (intersection-1) {};
\node[name intersections={of=axis3 and outercircle}, nodepoint, label={below:{$\alpha(t_{j+3})$}}] (AJ2) at (intersection-1) {};

\node[nodepoint, name intersections={of=joiner1 and outercircle}, label={right:{$\alpha(t_{j+1})$}}] (J1) at (intersection-1) {};
\node[nodepoint, name intersections={of=joiner2 and outercircle}, label={left:{$\alpha(t_{j+2})$}}] (J2) at (intersection-1) {};

\draw[blue, thick] (AJ0) to[bend left] node[midway, right] {$A_j$} (J1);
\draw[blue, thick] (J1) to[bend left] node[midway, right] {$A_{j+1}$} (J2);
\draw[blue, thick] (J2) to[bend left] node[midway, right] {$A_{j+2}$} (AJ2);

\draw[green!70!black, thick] (X) to[bend left] node[midway, above] {$\beta_j$} (J1);
\draw[green!70!black, thick] (J2) to[bend right] node[midway, below] {$\beta_{j_1}^-$} (X);
\end{tikzpicture}

\end{document}

무슨 일이 일어날 수 있는지 아는 사람 있나요?

답변1

node at교차로 사용 에 버그가 있는 것 같습니다 .

예는 다음과 같습니다.

\documentclass[varwidth,border=50]{standalone}
\usepackage{tikz}

\usetikzlibrary{intersections}
\begin{document}

\tikzstyle{nodepoint}=[inner sep=1pt, circle, draw, black, fill=black]

\begin{tikzpicture}[rotate = 30, scale=1]
  \node[nodepoint]{};

  \draw[name path=a] (120:1) -- (10:1); 
  \draw[name path=b] (0:0) -- (90:1);

  \node[nodepoint, red, name intersections={of=a and b}] at (intersection-1) {};
  \path[name intersections={of=a and b}] (intersection-1) node[nodepoint, green] {};

\end{tikzpicture}

\end{document}

여기에 이미지 설명을 입력하세요

그래서 그것 \node at (point)으로 교체하면 \path (point) node괜찮을 것입니다.

편집하다:수정된 코드는 다음과 같습니다.

\documentclass{minimal}

\usepackage{tikz}

\usetikzlibrary{arrows}
\usetikzlibrary{patterns}
\usetikzlibrary{intersections}
\begin{document}

\tikzstyle{nodepoint}=[inner sep=1pt, circle, draw, black, fill=black]

\begin{tikzpicture}[rotate = 30, scale=.9]

\pgfmathsetmacro{\uiminoraxis}{3}
\pgfmathsetmacro{\uimajoraxis}{4}
\pgfmathsetmacro{\uilabelfactor}{1.2}
\pgfmathsetmacro{\uiinclination}{45}

\begin{scope}
\clip[rotate around={\uiinclination:(-\uimajoraxis,0)}] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
\fill[pattern=north east lines, pattern color=orange!80!white] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
\end{scope}

\foreach[count=\i] \a in {\uiinclination, 0, -\uiinclination}
{
    \begin{scope}[rotate around={\a:(-\uimajoraxis,0)}, scale=1]
        \draw[name path global=open\i] (0,0) ellipse ({\uimajoraxis} and {\uiminoraxis});
        \draw[dotted, name path global=axis\i] ({-\uimajoraxis},0) -- ({\uimajoraxis}, 0);
        \node at ({\uimajoraxis*\uilabelfactor}, 0) {$U_\i$};
    \end{scope}
}

\node[nodepoint, label={left:$x_0$}] (X) at (-\uimajoraxis / 2,0) {};

\draw[rotate around={\uiinclination:({-\uimajoraxis},0)}, (-), red] ({-\uimajoraxis / 2}, {1}) to[bend left] node[midway, above, sloped, yshift=4] {$A_j$} (1,1);

\draw[dotted, name path=outercircle] ({-\uimajoraxis},{1.44*\uimajoraxis}) arc[start angle = {\uiinclination*2}, end angle = {-\uiinclination * 2}, radius={1.44*\uimajoraxis}];

\draw[dotted, name path=joiner1, name intersections={of=open1 and open2}] (intersection-1)  -- (intersection-2);
\draw[dotted, name path=joiner2, name intersections={of=open2 and open3}] (intersection-1)  -- (intersection-2);

\path[name intersections={of=axis1 and outercircle}] (intersection-1) node[nodepoint, label={above:{$\alpha(t_j)$}}] (AJ0) {};
\path[name intersections={of=axis2 and outercircle}] (intersection-1) node (AJ1) {};
\path[name intersections={of=axis3 and outercircle}] (intersection-1) node[nodepoint, label={below:{$\alpha(t_{j+3})$}}] (AJ2) {};

\path[name intersections={of=joiner1 and outercircle}] (intersection-1) node[nodepoint, label={right:{$\alpha(t_{j+1})$}}] (J1) {};
\path[name intersections={of=joiner2 and outercircle}] (intersection-1) node[nodepoint, label={left:{$\alpha(t_{j+2})$}}] (J2) {};

\draw[blue, thick] (AJ0) to[bend left] node[midway, right] {$A_j$} (J1);
\draw[blue, thick] (J1) to[bend left] node[midway, right] {$A_{j+1}$} (J2);
\draw[blue, thick] (J2) to[bend left] node[midway, right] {$A_{j+2}$} (AJ2);

\draw[green!70!black, thick] (X) to[bend left] node[midway, above] {$\beta_j$} (J1);
\draw[green!70!black, thick] (J2) to[bend right] node[midway, below] {$\beta_{j_1}^-$} (X);
\end{tikzpicture}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보