Anderes Ausgabebild bei Verwendung von Koordinaten in Tikz

Anderes Ausgabebild bei Verwendung von Koordinaten in Tikz

Ich erhalte unterschiedliche Ausgabebilder, wenn ich in tikz-3dplot benannte vs. Rohkoordinaten verwende. Gibt es eine Möglichkeit, die Werte der Koordinaten auszudrucken, um beim Debuggen zu helfen oder Protokolldateien zu überprüfen? Minimales Beispiel unten:

\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}

Ausgabebild

Antwort1

Sie haben tdplot_main_coordsbei der Definition der symbolischen Koordinate nicht verwendet M. Wenn Sie ersetzen

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

von

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

beide Ergebnisse stimmen überein.

\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}

Bildbeschreibung hier eingeben

Die calcBibliothek, die automatisch von geladen wird tikz-3dplot, ermöglicht es Ihnen, die Bildschirmkoordinaten benannter Knoten/Koordinaten zu vergleichen. Die inoffizielle Bibliothek3dtoolsermöglicht Ihnen, die Koordinaten abzurufen, die zum Definieren des Knotens/der Koordinate verwendet wurden, speichert an dieser Stelle jedoch nicht die Information, in welchen Koordinatensystemen sie definiert wurden.

verwandte Informationen