TikZ가 교차점을 계산하지 않음

TikZ가 교차점을 계산하지 않음

구문 을 사용하여 두 줄을 교차시키려고 합니다 (intersection cs: first line={}, second line={}). 그러나 다음 예제를 컴파일해도 내가 원하는 대로 되지 않습니다.

%!TEX encoding = UTF-8 Unicode
%!TEX program = lualatex
\documentclass[11pt,a4paper,fleqn,pdftex]{report}
\usepackage[dvipsnames, table]{xcolor}
\usepackage[utf8]{luainputenc} 
\usepackage[latin,english]{babel}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes.geometric}

\begin{document}
    \begin{figure}[!h]
   \centering
   \begin{tikzpicture}
      \coordinate (S) at (-5 ,0);
      \coordinate (M'1) at (0,4.5);
      \coordinate (M2) at (0,3);
      \def\angleM{10}

      \draw[color=Red, thick] (M'1) -- (intersection cs: first line={(M'1)--++(90 - \angleM:-8)}, second line={(-5,-5) -- (5,5)}) circle (2pt) -- (S); % (S) -> (M'1)
      \draw[color=Red, thick] (M2) -- (intersection cs: first line={(M2) --++(90 - \angleM:-8)}, second line={(45:-4) -- (45:4)}) circle (2pt) -- (S); % (S) -> (M2)

      \draw (S) node[ellipse, fill=white, minimum height=3cm,minimum width=2mm,draw]{$(S)$};
      \begin{scope}[thick]
         \draw[densely dashed] (M'1) ++(1,0) -- ++(-2,0) node[left]{$M'_1$};
         \draw (M2) ++(1,0) -- ++(-2,0) node[left]{$M_2$};
      \end{scope}
      \fill[pattern=north east lines] (M'1) ++(1,0) rectangle ++(-2,0.2);
      \fill[pattern=north east lines] (M2) ++(1,0) rectangle ++(-2,0.2);
      \draw[very thick] (45:-2) -- (45:2);
   \end{tikzpicture}
\end{figure}
\end{document}

이 코드는 다음을 산출합니다: 컴파일 결과

반면에 빨간색 선이 중앙의 검은색 선과 교차하기를 원합니다. 내가 뭘 잘못하고 있는 걸까요? PGF/TikZ 매뉴얼은 상대 경로와 교차 구문의 예를 제공하지 않습니다.

답변1

좌표계의 선 지정에 공백을 두지 마십시오 intersection.

\draw[color=Red, thick] (M'1) -- (intersection cs: first line={(M'1)--++(90 - \angleM:-8)}, second line={(-5,-5) -- (5,5)}) circle (2pt) -- (S); % (S) -> (M'1)
\draw[color=Red, thick] (M2) -- (intersection cs: first line={(M2) --++(90 - \angleM:-8)}, second line={(45:-4) -- (45:4)}) circle (2pt) -- (S); % (S) -> (M2)

당신은 사용해야합니다

\draw[color=Red, thick] (M'1) -- (intersection cs: first line={(M'1)--++(90 - \angleM:-8)}, second line={(-5,-5)--(5,5)}) circle (2pt) -- (S); % (S) -> (M'1)
\draw[color=Red, thick] (M2) -- (intersection cs: first line={(M2) --++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt) -- (S); % (S) -> (M2)

(설명을 더 명확하게 하기 위해 second line={(-5,-5) -- (5,5)}the 양쪽에 공백이 있어야 하며 공백이 없어야 --합니다 second line={(-5,-5)--(5,5)}). 다른 쪽에도 비슷한 설명이 있습니다 \draw.

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

코드:

%!TEX encoding = UTF-8 Unicode
%!TEX program = lualatex
\documentclass[11pt,a4paper,fleqn,pdftex]{report}
\usepackage[dvipsnames, table]{xcolor}
\usepackage[utf8]{luainputenc} 
\usepackage[latin,english]{babel}
\usepackage{tikz}
\usetikzlibrary{patterns,calc}
\usetikzlibrary{shapes.geometric}

\begin{document}
    \begin{figure}[!h]
   \centering
   \begin{tikzpicture}
      \coordinate (S) at (-5 ,0);
      \coordinate (M'1) at (0,4.5);
      \coordinate (M2) at (0,3);
      \def\angleM{10}

      \draw[color=Red, thick] (M'1) -- (intersection cs: first line={(M'1)--++(90 - \angleM:-8)}, second line={(-5,-5)--(5,5)}) circle (2pt) -- (S); % (S) -> (M'1)
      \draw[color=Red, thick] (M2) -- (intersection cs: first line={(M2) --++(90 - \angleM:-8)}, second line={(45:-4)--(45:4)}) circle (2pt) -- (S); % (S) -> (M2)

      \draw (S) node[ellipse, fill=white, minimum height=3cm,minimum width=2mm,draw]{$(S)$};
      \begin{scope}[thick]
         \draw[densely dashed] (M'1) ++(1,0) -- ++(-2,0) node[left]{$M'_1$};
         \draw (M2) ++(1,0) -- ++(-2,0) node[left]{$M_2$};
      \end{scope}
      \fill[pattern=north east lines] (M'1) ++(1,0) rectangle ++(-2,0.2);
      \fill[pattern=north east lines] (M2) ++(1,0) rectangle ++(-2,0.2);
      \draw[very thick] (45:-2) -- (45:2);
      \coordinate (L) at  ( $ (80 :-8) + (0,4.5) $ );
   \end{tikzpicture}
\end{figure}
\end{document}

사실, 앞에는 공백을 남겨둘 수 있지만 --뒤에는 공백을 둘 수 없습니다! 아마도 이것은 버그로 간주될 수 있습니까?

관련 정보