A bit of LaTeX-based code from Notes

Hilbert Curve via PGF and TikZ codes

\documentclass{article}\usepackage{tikz}
\usepackage{ifthen}
\usepackage{xcolor}
\definecolor{mallard}{HTML}{008080}
\definecolor{eggplant}{HTML}{800080}
\usepackage[position = top, labelformat = empty]{subfig}
ewdimen\HilbertLastX

ewdimen\HilbertLastY

ewcounter{HilbertOrder}
\def\DrawToNext#1#2{
\advance \HilbertLastX by #1
\advance \HilbertLastY by #2
\pgfpathlineto{\pgfqpoint{\HilbertLastX}{\HilbertLastY}}
}
\def\Hilbert[#1, #2, #3, #4, #5, #6, #7, #8]{
\ifnum\value{HilbertOrder} > 0
\addtocounter{HilbertOrder}{-1}
\Hilbert[#5, #6, #7, #8, #1, #2, #3, #4]
\DrawToNext {#1} {#2}
\Hilbert[#1,#2, #3, #4, #5, #6, #7, #8]
\DrawToNext {#5} {#6}
\Hilbert[#1,#2, #3, #4, #5, #6, #7, #8]
\DrawToNext {#3} {#4}
\Hilbert[#7, #8, #5, #6, #3, #4, #1, #2]
\addtocounter{HilbertOrder}{1}
\fi
}
\def\hilbert((#1, #2), #3){
\advance \HilbertLastX by #1
\advance \HilbertLastY by #2
\pgfpathmoveto{\pgfqpoint{\HilbertLastX}{\HilbertLastY}}
 etcounter{HilbertOrder}{#3}
\Hilbert[1mm, 0mm, -1mm, 0mm, 0mm, 1mm, 0mm, -1mm]
\pgfusepath{stroke}
}
\begin{document}
\begin{figure}
\centering
 ubfloat[\tiny stage 1]{\tikz[scale = 18, very thin, mallard] \hilbert((0mm, 0mm), 1);}~~
 ubfloat[\tiny stage 2]{\tikz[scale = 6, very thin, eggplant] \hilbert((0mm, 0mm),2);}~~
 ubfloat[\tiny stage 3]{\tikz[scale = 2.6, very thin, mallard] \hilbert((0mm, 0mm), 3);} \
 ubfloat[\tiny stage 4]{\tikz[scale = 1.2, very thin, eggplant] \hilbert((0mm, 0mm),4);}~~
 ubfloat[\tiny stage 5]{\tikz[scale = 0.58, very thin, mallard] \hilbert((0mm, 0mm), 5);}~~
 ubfloat[\tiny stage 6]{\tikz[scale = 0.285, very thin, eggplant] \hilbert((0mm, 0mm), 6);}
\end{figure}
\end{document}

Hyperboloid Surfaces Coexistence via pst-solides3d elaborated with XeLaTeX

\documentclass{article}\usepackage{pst-solides3d}
\usepackage{xcolor}
\definecolor{mallard}{HTML}{008080}
\definecolor{mallard+luminance}{HTML}{04FFD9}
\definecolor{eggplant}{HTML}{800080}
\definecolor{eggplant+luminance}{HTML}{B700B7}
\begin{document}
\pagenumbering{gobble}
\centering
\psset{unit = 0.8,
viewpoint = 50 60 30 rtp2xyz,
Decran = 50,
ngrid = 20 20,
incolor = eggplant+luminance!59,
fillcolor = mallard+luminance!59}
\begin{pspicture}(-4, -4)(4, 4)
\defFunction[algebraic]{f1}(u, v){u*cos(v)}{u*sin(v)}{u}
\defFunction[algebraic]{f3}(u, v){u*cos(v)}{u*sin(v)}{sqrt(u^2+1)}
\defFunction[algebraic]{f4}(u, v){u*cos(v)}{u*sin(v)}{-sqrt(u^2+1)}
\defFunction[algebraic]{f5}(u, v){u*cos(v)}{u*sin(v)}{sqrt(u^2-1)}
\defFunction[algebraic]{f6}(u, v){u*cos(v)}{u*sin(v)}{-sqrt(u^2-1)}
\psSolid[object = surfaceparametree,
base = -4 4 pi pi neg,
function = f1,
linecolor = teal,
linewidth = 0.2 pt]
\psSolid[object = surfaceparametree,
function = f4,
base = -1 4 pi pi neg,
opacity = 0.4,
linecolor = eggplant,
linewidth = 0.2 pt]
\psSolid[object = surfaceparametree,
function = f3, opacity = 0.4,
linecolor = eggplant+luminance,
linewidth = 0.2 pt]
\psSolid[object = surfaceparametree,
function = f4, opacity = 0.4,
linecolor = eggplant+luminance,
linewidth = 0.2 pt]
\psSolid[object = surfaceparametree,
function = f6,
base = 1 4 pi pi neg,
fillcolor = eggplant+luminance!59,
incolor = mallard+luminance!59,
opacity = 0.2,
linewidth = 0.2 pt]
\psSolid[object = surfaceparametree,
function = f5,
base = 1 4 pi pi neg,
opacity = 0.2,
linewidth = 0.2 pt]
\axesIIID[linewidth = 0.35 pt,
linecolor = black,
axisnames = {x, y, z},
axisemph = {\color{black}},
labelsep = 13 pt](1.6, 1.6, 2.2)(5.7, 8.7, 7)
\end{pspicture}
\end{document}

Icosahedron + Dodecahedron via pst-solides3d elaborated with XeLaTeX

\documentclass{article}\usepackage[dvipsnames]{pstricks}
\usepackage{pst-solides3d}
\usepackage{xcolor}
\definecolor{mallard}{HTML}{008080}
\definecolor{mallard+luminance}{HTML}{04FFD9}
\definecolor{eggplant}{HTML}{800080}
\definecolor{eggplant+luminance}{HTML}{B700B7}
\begin{document}
\pagenumbering{gobble}
% Icosahedron\begin{pspicture}(-2.5, -2.3)(2.5, 2.7)
\psset{lightsrc = 55 45 75, viewpoint = 45 10 30 rtp2xyz, Decran = 30}
\psSolid[object = icosahedron,
a = 3,
linecolor = teal,
linewidth = 0.2 pt,
opacity = 0.6,,
action = draw*,
fillcolor = mallard+luminance]
\axesIIID[linewidth = 0.35 pt,
linecolor = black,
axisnames = {x, y, z},
axisemph = {\color{black}},
labelsep = 13 pt](5, 3, 3.4)(5.7, 3.7, 4)
\end{pspicture}
% Dodecahedron\begin{pspicture}(-4, -4)(4, 4)
\psset{lightsrc = 20 40 30, viewpoint = 45 40 30 rtp2xyz, Decran = 30}
\psSolid[object = dodecahedron,
a = 3,
linecolor = eggplant,
linewidth = 0.2 pt,
opacity = 0.6,
action = draw*,
fillcolor = eggplant+luminance]
\axesIIID[linewidth = 0.35 pt,
linecolor = black,
axisnames = {x, y, z},
axisemph = {\color{black}},
labelsep = 13 pt](4, 3.6, 3.6)(4.8, 4.2, 4.2)
\end{pspicture}
\end{document}

Klein Bottle via tikzpicture code processed with LuaLaTeX

\RequirePackage{luatex85}
\documentclass[border = 5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{
compat = 1.12,
/pgf/declare function={
b = 2;
h = 6;
r(\u) = 2 - cos(\u);
},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
trig format plots = rad,
domain = 0:2 * pi,
samples = 50,
variable = u,
variable y = v,
colormap/viridis,
]
\addplot3[
surf,
z buffer=sort,
fill opacity=0.35,
](
{b * (1 - sin(u)) * cos(u) + r(u) * cos(v) * (2 * exp(-(u/2 - pi)^2 ) - 1)},
{r(u) * sin(v)},
{h * sin(u) + 0.5 * r(u) * sin(u) * cos(v) * exp(-(u - 3 * pi / 2)^2 )}
);
\end{axis}
\end{tikzpicture}
\end{document}

Möbius Strip via tikzpicture code

\documentclass{book}\usepackage{graphicx}
\usepackage{pgfplots}
\usepgfplotslibrary{colormaps, external}
\usepackage{float}
\usepackage{tikz}
\begin{document}
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
\begin{axis}[
hide axis,
view = {40}{40}
]
\addplot3 [
mesh, shader = faceted interp,
point meta = x,
colormap/blackwhite,
samples = 100,
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,
samples y = 0,
thick
](
{cos(x)},
{sin(x)},
{0});
\end{axis}
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}

Helianthus-like Phyllotaxis via tikzpicture code

\documentclass{book}\usepackage{tikz}\begin{document}
\pagestyle{empty}
\def
brcircles{610} %
brcircles{4181}
\def \outerradius{15mm}
\def \dotradius{1pt}
\centering
\begin{tikzpicture}
\pgfmathsetmacro{\proportioaurea}{(1 + sqrt(5))}
\foreach \b in {1,...,
brcircles}{
\pgfmathsetmacro{\angle}{mod(\proportioaurea * \b,2) * 180}
\pgfmathsetmacro{ radius}{\b /
brcircles * \outerradius / 10}
\draw[] (\angle: radius) circle [radius=\dotradius];
}
\end{tikzpicture}
\end{document}

Tessellation of the Upper Half-Plane
(Beltrami–Poincaré Hyperbolic Plane)
via tikzpicture code

\begin{center}
\pgfmathsetmacro{\myxlow}{-2}
\pgfmathsetmacro{\myxhigh}{2}
\pgfmathsetmacro{\myiterations}{6}
\begin{tikzpicture}[scale = 2]
\draw (-1.5, 0) -- (1.5, 0);
\filldraw[thin, fill = mallard, opacity = 0.30] (0, 0)
arc[start angle = 0, end angle = 60, radius = 1] --
({-cos(60)}, 1.2) -- ({cos(60)}, 1.2) -- ({cos(60)}, {sin(60)})
arc[start angle = 120, end angle = 180, radius = 1];
\draw (\myxlow -0.1, 0) -- (\myxhigh +0.1, 0);
\pgfmathsetmacro{ uccofmyxlow}{\myxlow +0.5}
\foreach \x in {\myxlow,  uccofmyxlow,..., \myxhigh}
{\draw (\x, 0) -- (\x, -0.05) node[below, font = \tiny]{\x};
}
\foreach \y in {0.2, 0.4,..., 1}
{\draw (0, \y) -- (-0.05, \y) node[left, font = \tiny] {\pgfmathprintnumber{\y}};
}
\draw (0, -0.1) -- (0, 1.2);
\clip (\myxlow, 0) rectangle (\myxhigh, 1.1);
\foreach \i in {1,..., \myiterations}
{\pgfmathsetmacro{\mysecondelement}{\myxlow+1/pow(2,floor(\i/3))}
\pgfmathsetmacro{\myradius}{pow(1/3, \i-1}
\foreach \x in {-2, \mysecondelement,..., 2}
{\draw[thin, eggplant] (\x, 0) arc(0:180:\myradius);
\draw[very thin, eggplant] (\x, 0) arc(180:0:\myradius);
}
}
\end{tikzpicture}
\end{center}