2

enter image description hereI am trying to create an irregular pentagon shaped node to use in multiple system diagrams. I cannot seem to get the code to work from following examples I could find. Below is a sample of what I tried to do with no success. Kindly assist with an example of how to go about this.

    \documentclass{article}
    \usepackage{tikz}
    \usepackage{pgf}

    \pgfdeclareshape{materialtransfer}{

\inheritsavedanchors[from={rectangle}]
\inheritanchor[from={rectangle}]{center}
\inheritanchor[from={rectangle}]{east}
\inheritanchor[from={rectangle}]{west}
\anchor{text}{\pgfpointorigin}

\backgroundpath{%
    % store lower left in xa/ya and upper right in xb/yb
    \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
    \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y

    % compute tip of ``arrow''
    \pgf@xc=\pgf@xb
    \pgf@yc=\pgf@yb \advance\pgf@yc by-.5\ht\pgnodeparttextbox
    % compute arrow defelction point
    \pgf@xd = \pgf@xa \advance\pgf@xd by 0.8\wd\pgnodeparttextbox
    \pgf@yd = \pgf@yb

    % construct main path
    \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
    \pgfpathlineto{\pgfpoint{\pgf@xd}{\pgf@yd}}
    \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
    \pgfpathlineto{\pgfpoint{-\pgf@xd}{-\pgf@yd}}
    \pgfpathclose

    \pgfusepath{draw}
        }
    }

    \begin{document}
    \begin{tikzpicture}[node distance=2cm]{
        \pgfnode{materialtransfer}{center}{Raw material}{rawmaterial}{\pgfusepath{draw}}
    }
    \end{tikzpicture}
    \end{document}
6
  • Welcome! Can you also sketch in paint or something what the node shape should look like? – percusse Apr 5 '16 at 7:58
  • Using regular tikz drawing it should look like this: – TNP Apr 5 '16 at 8:12
  • I think you pasted something in the comments but it's not visible. You can edit your own question with the button below it. If you can't add an image due to rep limit, add it like an image and remove the ! in front of it. We will add it for you. – percusse Apr 5 '16 at 8:17
  • @TNP Why don't you use the signal shape ? page 721 of the tikz doc – flav Apr 5 '16 at 8:24
  • @flav Can I edit the signal shape to look exactly like the sketch I added? The reason being we have a standard for drawing system diagrams that I have to follow. – TNP Apr 5 '16 at 8:42
2
\documentclass{standalone}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{backgrounds, shapes}

\begin{document}
\begin{tikzpicture}[background rectangle/.style={draw=blue!50,fill=blue!10,
      rounded corners=1ex},
    show background rectangle]


    \node[name=s1, signal, minimum width=2cm, minimum height=1cm,
    draw=black] {};

  \end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.