% 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

\documentclass[tikz]{standalone}

\newcommand{\etoile}[3]{
  % \etoile{radius}{number of edges}{gap}
  \begin{tikzpicture}
    \draw[
      rounded corners=1pt,
      fill=yellow,
      draw=yellow!50!black,
      line width=4pt,
    ]
    (
      {0}
      :
      {#1}
    ) -- (
      {(180/(#2)}
        :
        {(#1)/(cos(180/(#2))*(1+tan(180/(#2))/tan(90*(#2-2*#3)/(#2))))}
      )
      \foreach \i in {0, ..., {#2}}{
        -- (
          {(360*\i)/(#2)}
          :
          {#1}
        ) -- (
          {((2*\i+1)*180)/(#2)}
          :
          {(#1)/(cos(180/(#2))*(1+tan(180/(#2))/tan(90*(#2-2*#3)/(#2))))}
        )
      }
      -- cycle;
    \end{tikzpicture}
  }

  \begin{document}

  \etoile{1}{5}{2}

  \etoile{1}{6}{2}

  \etoile{1}{7}{2}
  \etoile{1}{7}{3}

  \etoile{1}{8}{2}
  \etoile{1}{8}{3}

  \end{document}
