# CUT OUT HEXAGONS

## Canvas, 113 112 bytes

«/＊α_×－／═↔⁸３＋ ＊－╶Ｒ⇵｛；Ｘ：«ｗ╷/###/＊Ｋｋｙ┤_×＋－ｙ#×/×－ｙ_×－／═ŗ∙ #⟳#¶#╋# ⟳_╋↔ｘ“kｙv╴e┌/ｉ┴⁰U＜ａlisｓfr↖；,ｉmＦE！↷qB╪²－‟＃ŗ｝#∙ ╋↔║


Try it here!

A part of the answer is literally evaluating the JavaScript p.p.overlap(p.p,0,p.p,(a,b)=>b==0?a:b)..

## Charcoal, 80 bytes

Ｆ⮌…·¹Ｎ«→↘Ｆ²«Ｍ⁺³×⁴ι↑Ｐ×_⊗ι↙Ｆ⊗ι«ＦκＰ× ⁴↙¹»→Ｆι«ＦκＰ× ⁴↘¹»Ｆ⊖ι«ＦκＰ× ⁻×³ιλ↘¹»\Ｐ×_⊗ι»»‖ＢＯ²


Try it online! Link is to verbose version of code. Explanation:

Ｆ⮌…·¹Ｎ«


Loop from the largest to the smallest hexagon.

→↘Ｆ²«Ｍ⁺³×⁴ι↑


Draw each hexagon twice in the desired location.

Ｐ×_⊗ι


Draw half of the top line of the hexagon.

↙Ｆ⊗ι«ＦκＰ× ⁴↙¹»


Draw the top left diagonal, but for each row erase 4 spaces first if this is the second hexagon.

→Ｆι«ＦκＰ× ⁴↘¹»


Draw half of the bottom left diagonal, still erasing 4 spaces first if this is the second hexagon.

Ｆ⊖ι«ＦκＰ× ⁻×³ιλ↘¹»


Draw almost all of the rest of the bottom left diagonal, erasing until the middle of the hexagon if this is the second hexagon.

\Ｐ×_⊗ι


Finish the bottom left diagonal and draw half of the bottom line of the hexagon.

»»‖ＢＯ²


Mirror everything at the end.

Alternative approach, also 80 bytes:

Ｆ⮌…·¹Ｎ«→↘Ｆ²«Ｍ⁺³×⁴ι↑ＦκＧ→⊗ι↓³←⊖⊗ι↙⊖⊗ι↘⊖⊗ι→⊖⊗ι↓³←⊗ι↖⊕⊗ι↗⊕⊗ι Ｐ×_⊗ι↙↙⊗ι→↘⊗ι↑Ｐ×_⊗ι»»‖Ｍ


Try it online! Link is to verbose version of code. Explanation:

Ｆ⮌…·¹Ｎ«


Loop from the largest to the smallest hexagon.

→↘Ｆ²«Ｍ⁺³×⁴ι↑


Draw each hexagon twice in the desired location.

ＦκＧ→⊗ι↓³←⊖⊗ι↙⊖⊗ι↘⊖⊗ι→⊖⊗ι↓³←⊗ι↖⊕⊗ι↗⊕⊗ι


Before drawing the second hexagon, erase the area between it and the next smaller hexagon.

Ｐ×_⊗ι↙↙⊗ι→↘⊗ι↑Ｐ×_⊗ι»»‖Ｍ


Draw the left half of each hexagon, and then mirror everything at the end.

## C (clang), 374 bytes

#define F(X,R)*d=*(d=o+x*(l*3+35-g)+x/2+X+R)-32?*d:R?
i,z,x,l,w,r,g,m;f(n){int*d,o[i=z=(x=n*8+1)*(n*5+4)],*c=o;for(;l=i--;)*c++=i%x?32:10;for(;l++<n;)for(g=35;i=g-29;g-=3){for(r=m+=m=w=l*2;r--;F(~-w*x-w,r)g:g)F(w*~x,r)95:95,F(w*x-w,r)95:95;for(;w--;)for(r=4;r--;F(m-~w*~-x,-r)g:47)F(w-m-w*x,r)g:47,F(w-m-~w*x,r)g:92,F(m+~w-w*x,-r)g:92;}for(;i<z;++i)printf(o[i]-35?o+i:" ");}


Try it online!

-33 more saved by @ceilingcat improvement

## C (clang), 433412 407 bytes

#define F(Y,X,W,R)*d=*(d=c-Y+X+W+R)-32?*d:R?
i,z,x,l,w,r,d,G,g,m;f(n){int*c,*d,o[i=z=(x=n*8+1)*(n*5+4)];for(c=o;l=i--;)*c++=i%x?32:10;for(;l++<n;)for(G=0;i=G<4;G+=3){g=35-G;c=o+x*l*3+G*x+x/2;for(r=m+=m=w=l*2;r--;F(x-w*x,-w,0,r)g:g)F(w*x,-w,0,r)95:95,F(-w*x,-w,0,r)95:95;for(;w--;)for(r=4;r--;F(~w*x,m,~w,-r)g:47)F(w*x,-m,w,r)g:47,F(~w*x,-m,w,r)g:92,F(w*x,m,~w,-r)g:92;}for(;i<z;)i+=printf(o[i]-35?o+i:" ");}


Try it online!

-21 thanks to @ceilingcat -5 @ceilingcat + y removed

   ###\
###\   <= we  draw only on spaces ' '
\###
\###        first time we draw '#' for collisions

/####\
/######\
\######/
\####/

____
/####\        then we move our drawing pointer
/######\     3 lines below
\######/
\____/         and we draw spaces
\      /
\____/

____
_/####\
//######\     and we repeat for bigger donuts
/#\######/   moving our drawing pointer
/###\____/
/###/      \
\###\      /
\###\____/
\####??####/
\________/