% !TEX lualatex
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{calc}
\newcommand{\noeud}[6]{%
  % \noeud{sommets}{saut}{rayon1}{rayon2}{épaisseur}{dureté}
  \begin{tikzpicture}%
    \foreach \i in {1, ..., #1} {
      \fill[white]
      ({(\i-.5)*360/#1}:#3)
      --
      ({\i*360/#1}:{#3/cos(180/#1)})
      ..
      controls
      +({90+360*(\i-.5)/#1}:#6)
      and
      +({90+360*(\i+#2/2)/#1}:{-#6})
      ..
      ({(\i+#2/2)*360/#1}:#4)
      --
      ({(\i+#2/2)*360/#1}:{#4+#5})
      ..
      controls
      +({90+360*(\i+#2/2)/#1}:{-#6*(#4+#5)/#4})
      and
      +({90+360*(\i-.5)/#1}:{#6*(#3+#5)/#3})
      ..
      ($({\i*360/#1}:{#3/cos(180/#1)}) + ({(\i-.5)*360/#1}:#5)$)
      --
      ({(\i-.5)*360/#1}:{#3+#5})
      ;
      \draw[black]
      ({(\i-.5)*360/#1}:#3)
      --
      ({\i*360/#1}:{#3/cos(180/#1)})
      ..
      controls
      +({90+360*(\i-.5)/#1}:#6)
      and
      +({90+360*(\i+#2/2)/#1}:{-#6})
      ..
      ({(\i+#2/2)*360/#1}:#4)
      ;
      \draw[black]
      ({(\i+#2/2)*360/#1}:{#4+#5})
      ..
      controls
      +({90+360*(\i+#2/2)/#1}:{-#6*(#4+#5)/#4})
      and
      +({90+360*(\i-.5)/#1}:{#6*(#3+#5)/#3})
      ..
      ($({\i*360/#1}:{#3/cos(180/#1)}) + ({(\i-.5)*360/#1}:#5)$)
      --
      ({(\i-.5)*360/#1}:{#3+#5})
      ;
    }
    \foreach \i in {1, ..., #1} {
      \fill[white]
      ({(\i-.5)*360/#1}:#3)
      --
      ({(\i-1)*360/#1}:{#3/cos(180/#1)})
      ..
      controls
      +({-90+360*(\i-.5)/#1}:#6)
      and
      +({-90+360*(\i-1-#2/2)/#1}:{-#6})
      ..
      ({(\i-1-#2/2)*360/#1}:#4)
      --
      ({(\i-1-#2/2)*360/#1}:{#4+#5})
      ..
      controls
      +({-90+360*(\i-1-#2/2)/#1}:{-#6*(#4+#5)/#4})
      and
      +({-90+360*(\i-.5)/#1}:{#6*(#3+#5)/#3})
      ..
      ($({(\i-1)*360/#1}:{#3/cos(180/#1)}) + ({(\i-.5)*360/#1}:#5)$)
      --
      ({(\i-.5)*360/#1}:{#3+#5})
      ;
      \draw[black]
      ({(\i-.5)*360/#1}:{#3})
      --
      ({(\i-1)*360/#1}:{#3/cos(180/#1)})
      ..
      controls
      +({-90+360*(\i-.5)/#1}:{#6})
      and
      +({-90+360*(\i-1-#2/2)/#1}:{-#6})
      ..
      ({(\i-1-#2/2)*360/#1}:#4)
      ;
      \draw[black]
      ({(\i-.5)*360/#1}:{#3+#5})
      --
      ($({(\i-1)*360/#1}:{#3/cos(180/#1)}) + ({(\i-.5)*360/#1}:#5)$)
      ..
      controls
      +({-90+360*(\i-.5)/#1}:{#6*(#3+#5)/#3})
      and
      +({-90+360*(\i-1-#2/2)/#1}:{-#6*(#4+#5)/#4})
      ..
      ({(\i-1-#2/2)*360/#1}:{#4+#5})
      ;
    }
  \end{tikzpicture}%
}

\begin{document}
\noeud{5}{1}{1}{1.5}{.2}{.4}
\noeud{5}{1}{1}{1.5}{.5}{.4}
\noeud{30}{5}{2}{2.4}{.06}{.4}
\end{document}

Source: https://jouets.ababsurdo.fr/fr/latest/latex/noeuds2/

Copyright 2023 Louis Paternault

This work may be distributed and/or modified under the following licences:

LaTeX Project Public Licence

This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.

Creative Commons by-sa 4.0

This work may be distributed and/or modified under the conditions of the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). The full text of this license is in https://creativecommons.org/licenses/by-sa/4.0/

Compile using LuaLaTeX
$ lualatex $basename