tikz에서 좌표를 사용할 때 다른 출력 이미지

tikz에서 좌표를 사용할 때 다른 출력 이미지

tikz-3dplot에서 명명된 v/s 원시 좌표를 사용할 때 다른 출력 이미지가 나타납니다. 로그 파일을 디버그하거나 확인하는 데 도움이 되도록 좌표 값을 인쇄하는 방법이 있습니까? 아래의 최소 예:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{calc}

\begin{document}

    \tdplotsetmaincoords{70}{100}%right hand
    \begin{tikzpicture}[scale=2]
        \def\xmax{2}
        \def\ymax{2}
        \def\dz{0.2}
        \coordinate (M) at (0.5*\xmax,0.5*\ymax,0);
        \draw[fill=green!40!white, opacity = 0.5,tdplot_main_coords]
        ({0},{0},{0}) to [out=30,in=200]
        ({0},{\ymax},{0}) to
        ({\xmax},{\ymax},{0}) to[out=200,in=30]
        ({\xmax},{0},{0}) to
        ({0},{0},{-\dz}) to
         (M) to
        (0,0,0);
        \end{tikzpicture}

    \tdplotsetmaincoords{70}{100}%right hand
    \begin{tikzpicture}[scale=2]
        \def\xmax{2}
        \def\ymax{2}
        \def\dz{0.2}
        \draw[fill=green!40!white, opacity = 0.5,tdplot_main_coords]
        ({0},{0},{0}) to [out=30,in=200]
        ({0},{\ymax},{0}) to
        ({\xmax},{\ymax},{0}) to[out=200,in=30]
        ({\xmax},{0},{0}) to
        ({0},{0},{-\dz}) to
         (0.5*\xmax,0.5*\ymax,0) to
        (0,0,0);
        \end{tikzpicture}

\end{document}

출력 이미지

답변1

tdplot_main_coords기호 좌표를 정의할 때 사용하지 않았습니다 M. 교체하면

\coordinate (M) at (0.5*\xmax,0.5*\ymax,0);

~에 의해

\path[tdplot_main_coords] (0.5*\xmax,0.5*\ymax,0) coordinate (M);

두 결과가 모두 일치합니다.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}

\begin{document}

    \tdplotsetmaincoords{70}{100}%right hand
    \begin{tikzpicture}[scale=2]
        \def\xmax{2}
        \def\ymax{2}
        \def\dz{0.2}
        \path[tdplot_main_coords] (0.5*\xmax,0.5*\ymax,0) coordinate (M);
        \draw[fill=green!40!white, opacity = 0.5,tdplot_main_coords]
        ({0},{0},{0}) to [out=30,in=200]
        ({0},{\ymax},{0}) to
        ({\xmax},{\ymax},{0}) to[out=200,in=30]
        ({\xmax},{0},{0}) to
        ({0},{0},{-\dz}) to
         (M) to
        (0,0,0);
        \end{tikzpicture}

    \tdplotsetmaincoords{70}{100}%right hand
    \begin{tikzpicture}[scale=2]
        \def\xmax{2}
        \def\ymax{2}
        \def\dz{0.2}
        \draw[fill=green!40!white, opacity = 0.5,tdplot_main_coords]
        ({0},{0},{0}) to [out=30,in=200]
        ({0},{\ymax},{0}) to
        ({\xmax},{\ymax},{0}) to[out=200,in=30]
        ({\xmax},{0},{0}) to
        ({0},{0},{-\dz}) to
         (0.5*\xmax,0.5*\ymax,0) to
        (0,0,0);
        \end{tikzpicture}

\end{document}

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

calc에 의해 자동으로 로드되는 라이브러리를 사용 하면 tikz-3dplot명명된 노드/좌표의 화면 좌표를 비교할 수 있습니다. 비공식 도서관3dtools노드/좌표를 정의하는 데 사용된 좌표를 검색할 수 있지만 이 시점에서는 해당 좌표계가 정의된 정보를 저장하지 않습니다.

관련 정보