Example: Moebius strip

Published 2014-03-16 | Author: Jake

A Moebius strip plot.

This code was written by Jake on TeX.SE.

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Moebius strip

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
    hide axis,
    view = {40}{40}
  ]
  \addplot3 [
    surf,
    colormap/greenyellow,
    shader     = faceted interp,
    point meta = x,
    samples    = 40,
    samples y  = 5,
    z buffer   = sort,
    domain     = 0:360,
    y domain   =-0.5:0.5
  ] (
    {(1+0.5*y*cos(x/2)))*cos(x)},
    {(1+0.5*y*cos(x/2)))*sin(x)},
    {0.5*y*sin(x/2)}
  );

  \addplot3 [
    samples=50,
    domain=-145:180, % The domain needs to be adjusted manually,
                     % depending on the camera angle, unfortunately
    samples y=0,
    thick
  ] (
    {cos(x)},
    {sin(x)},
    {0}
  );
  \end{axis}
\end{tikzpicture}
\end{document}

Comments

Adding comments is currently not enabled.

There are currently 0 comments on this entry.

Features
Tags
Scientific and technical areas

Creative Commons License