So, I'm trying to make a Saturation Block, to use in a tikz block diagram, like the following:
I tried adapting this answer, but I'm not able to make the left side of the figure. I know I must use the \pgfusepath{stroke} to use different widths in the shape. This are my atempts:
\pgfdeclareshape{satnode}{
\inheritsavedanchors[from={rectangle}]
\inheritbackgroundpath[from={rectangle}]
\inheritanchorborder[from={rectangle}]
\foreach \x in {center,north east,north west,north,south,south east,south west}{
\inheritanchor[from={rectangle}]{\x}
}
\foregroundpath{
\pgfpointdiff{\northeast}{\southwest}
\pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast
\pgfsetnonzerorule
\pgfsetlinewidth{0.4pt}
\pgfpathmoveto{\pgfpoint{0}{0.45\pgf@ya}}
\pgfpathlineto{\pgfpoint{0}{-0.45\pgf@ya}}
\pgfpathmoveto{\pgfpoint{-0.4\pgf@xa}{0}}
\pgfpathlineto{\pgfpoint{0\pgf@xa}{0}}
\pgfusepath{stroke}
\pgfsetlinewidth{1pt}
\pgfpathmoveto{\pgfpoint{0.3\pgf@xa}{0\pgf@ya}}
\pgfpathlineto{\pgfpoint{0\pgf@xa}{0\pgf@ya}}
\pgfpathlineto{\pgfpointadd{\northeast}{\pgfpoint{-0.7\pgf@xa}{-0.3\pgf@ya}}}
\pgfpathlineto{\pgfpointadd{\northeast}{\pgfpoint{-0.4\pgf@xa}{-0.3\pgf@ya}}}
}
}
With the following result:
Or, if I switch the order:
\pgfdeclareshape{satnode}{
\inheritsavedanchors[from={rectangle}]
\inheritbackgroundpath[from={rectangle}]
\inheritanchorborder[from={rectangle}]
\foreach \x in {center,north east,north west,north,south,south east,south west}{
\inheritanchor[from={rectangle}]{\x}
}
\foregroundpath{
\pgfpointdiff{\northeast}{\southwest}
\pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast
\pgfsetlinewidth{1pt}
\pgfpathmoveto{\pgfpoint{0.3\pgf@xa}{0\pgf@ya}}
\pgfpathlineto{\pgfpoint{0\pgf@xa}{0\pgf@ya}}
\pgfpathlineto{\pgfpointadd{\northeast}{\pgfpoint{-0.7\pgf@xa}{-0.3\pgf@ya}}}
\pgfpathlineto{\pgfpointadd{\northeast}{\pgfpoint{-0.4\pgf@xa}{-0.3\pgf@ya}}}
\pgfusepath{stroke}
\pgfsetlinewidth{0.4pt}
\pgfpathmoveto{\pgfpoint{0}{0.45\pgf@ya}}
\pgfpathlineto{\pgfpoint{0}{-0.45\pgf@ya}}
\pgfpathmoveto{\pgfpoint{-0.4\pgf@xa}{0}}
\pgfpathlineto{\pgfpoint{0.4\pgf@xa}{0}}
}
}
I get the following:
Edit: I am trying to use it like a node for a block diagram in tikz. This would be an example of a use case:
\node[satnode, right of=other_node,draw,minimum size=1cm] (mysatnode) {label};





picshould be used. What are sizes of that figure? do you use it several times in your document? – Black Mild Feb 06 '20 at 23:58