3

Enter image description here

I wish to make a logo like the one in http://math.et.info.free.fr/TikZ/aideLogoSite.html.

But with a hexagon pattern as in the attached picture. It has no text, and it is better with two options: one had shadow, the other with curves, lines only making a negative space effect. Simple is best so that it can be used with pdflatex.

How can I make one with Tikz?

Enter image description here

Epa
  • 3,449

3 Answers3

26

Once we see that these Mobius ribbons always have a regular polygon in the middle the rest is practically finding a nice curve over each edge such that it blends with the next edge nicely (see the hexagon in the middle).

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.geometric}
\tikzset{my polygon/.style={regular polygon,regular polygon sides=#1,minimum size=4cm}}
\begin{document}
\begin{tikzpicture}[top color=black!50!blue,bottom color=blue]
\node[my polygon=6] (a){};
\foreach \x[remember=\x as \xp (initially 6)] in {1,...,6}{ % use `in {1}` to see the edge
  \fill[shade,shading angle={60*(\x+2)}] (a.corner \xp)
     ..controls ++(60*\x:2cm) .. 
     ([shift={({60*(\x+1)+6}:1.5cm)}]a.corner \x) 
     -- (a.corner \x);% Come back such that shading doesn't leak
}
\end{tikzpicture}
\end{document}

enter image description here

When we remove the fill, all my lies reveal themselves and we need further tweaks(I've also forgot the outer sep=0 before). Because we have to know the tangent point on the next bezier curve. I don't see any immediate fix for that since we are trying to blend in to a curve that is not drawn yet. Hence this :

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.geometric,calc}
\tikzset{my polygon/.style={regular polygon,regular polygon sides=#1,minimum size=4cm}}
\begin{document}
\begin{tikzpicture}
\node[my polygon=6,draw,outer sep=0] (a){};
\foreach \x[remember=\x as \xp (initially 6)] in {1,...,6}{
\draw[] (a.corner \xp)
      ..controls ++(60*\x:2cm) ..
        ([shift={({60*(\x+1)+7.35}:1.55cm)}]a.corner \x); % This part needs tweaking for a 
                                                       % nice blend (or a derivative I think).
}
\end{tikzpicture}
\end{document}

enter image description here

percusse
  • 157,807
  • You could try to emulate the pink color from the image, which looks nice :P – Manuel Mar 31 '15 at 18:40
  • 2
    @Manuel I would if I wasn't colorblind and didn't think that it was one of those strange colors. – percusse Mar 31 '15 at 18:45
  • Ahm, I did not know :) – Manuel Mar 31 '15 at 19:34
  • The blue is much nicer than the pink anyway. – cfr Apr 01 '15 at 00:21
  • Thank you. It looks awesome online yet the shadow effect disappear when printed on paper. How can we make the simplified one with just curves and lines, still having the negative space effect? – Epa Apr 01 '15 at 01:17
  • @Thumbolt Add draw option to node (a) and start the next command with \filldraw[draw=black,fill=white] for example. – percusse Apr 01 '15 at 08:31
  • I could not draw it as lines and curves as in UKMT logo which is good for printing and 3D viewing. Could you please help. – Epa Apr 08 '15 at 07:44
  • \begin{tikzpicture}[top color=black!50!blue,bottom color=blue] \node[my polygon=6, draw] (a){}; \foreach \x[remember=\x as \xp (initially 6)] in {1,...,6}{ % use in {1} to see the edge \filldraw[draw=black,fill=white, shade,shading angle={60(\x+2)}] (a.corner \xp) ..controls ++(60\x:2cm) .. ([shift={({60*(\x+1)+6}:1.5cm)}]a.corner \x) -- (a.corner \x);% Come back such that shading doesn't leak } \end{tikzpicture} – Epa Apr 09 '15 at 02:37
  • @Thumbolt Instead of this, add draw to the node options and then replace the path in the loop with \draw[] (a.corner \xp)..controls ++(60*\x:2cm) ..([shift={({60*(\x+1)+6}:1.5cm)}]a.corner \x); – percusse Apr 09 '15 at 09:34
  • It works now, but the sides of inner hexagon do not coincide with the other lines with a closer look. How can we increase the side length of this hexagon? I change the number 2cm and 1.5cm slightly but it is not helpful. By the way, I would use this logo for my project and I would like to write your name for the credit of making this possible. – Epa Apr 09 '15 at 13:06
  • @Thumbolt I've added another version. It is not that automatic as I tweaked my way out. But you can also do the same. The size is the minimum size key. And regarding the license, that's very kind of you but you don't need to do anything, look at my profile for the license I use ;) – percusse Apr 09 '15 at 23:31
  • Perfect now. May I know your full name and affiliation? – Epa Apr 10 '15 at 05:39
1
\documentclass{article}

\usepackage{pgf,tikz}

\begin{document}

\begin{tikzpicture}    
\draw[rounded corners=6mm, ultra thick]
  (3.97, 5.91) -- (6.15,3.65) -- (5.28,0.64) --
  (2.24,-0.12) -- (0.06,2.14) -- (0.93,5.15) --
  cycle;    
\draw [thick] (4.23,4.2) -- (1.14,5.1);    
\draw [thick] (2.53,4.53) -- (0.217,2.25);    
\draw [thick] (2.04,1.57) -- (5.09,0.69);    
\draw [thick] (3.74,1.34) -- (6,3.52);    
\draw [thick] (4.77,2.71) -- (4.02,5.7);    
\draw [thick] (1.42,3.17) -- (2.18,0.1);    
\end{tikzpicture}

\end{document}

output

Sean Allred
  • 27,421
Epa
  • 3,449
0

The wheelchart package, which I wrote, can be used.

The inner part of the slices is a straight line segment by using the key slices inner arc={0}{0}.

Using the key slices outer angle shift, the end angle and the start angle of the outer part of the slices is modified.

The outer part of the slices is determined by the key slices outer to={45}{10}. This key sets the to path operation for the outer part of the slices. The angle at the start is 45 and the angle at the end is 10.

The shading is defined in the key slices style.

enter image description here

\documentclass[border=6pt]{standalone}
\usepackage{wheelchart}
\begin{document}
\begin{tikzpicture}[looseness=0.5]
\wheelchart[
  slices inner arc={0}{0},
  slices outer angle shift=90-180/\WCtotalcount,
  slices outer to={45}{10},
  slices style={
    left color=pink,
    right color=pink!20!white,
    shading angle=\WCmidangle
  },
  start angle=0,
  total count=6
]{}
\end{tikzpicture}
\end{document}
matexmatics
  • 4,819