I need to draw first a rectangle with curvy looking edges. Then I need a rectangle with curvy looking edges and also rounded corners. But the corners need to be inverted (pointing inwards). I have made a handmade drawing for illustration:
-
2You should load your sketch into your question. And also show what you try so far. Your shapes can be drawn with bending lines.– ZarkoCommented Dec 1, 2016 at 21:45
-
1@Zarko I'm not sure new users can do this. They can upload it and post a link, but I don't think they can allow it to be displayed. (But I'm not certain about this.)– cfrCommented Dec 2, 2016 at 13:41
-
1@cfr, new user can't do this, it had to earned some minimal reputation (15) for this. I'm also not certain about the limit ...– ZarkoCommented Dec 2, 2016 at 13:53
-
2I'm voting to close this question as off-topic because this is a just-do-it-for-me question (-1).– Raaja_is_at_topanswers.xyzCommented Jun 26, 2019 at 12:06
2 Answers
Note that I think I ought not answer 'do-it-all-for-me's such as this one. Also, be aware that I am much less likely to be responsive to follow-ups in such cases, unless your follow-up happens to appeal to me. If you want any adjustments, I therefore recommend that you desire the addition of one or more of the following:
- one or more cats, sitting or lying;
- one or more cauldrons;
- one or more trams or single-decker buses.
\documentclass[tikz,border=10pt]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) coordinate (a) [bend right=15] to +(2,0) coordinate (b) [bend right] to +(0,-1) coordinate (c) [bend right] to (a |- c) [bend right=15] to cycle ;
\begin{scope}
\clip (3,0) coordinate (A) +(.1,0) coordinate (A1) -- +(1.9,0) coordinate (B1) arc (180:270:.1) coordinate (B2) -- +(0,-.8) coordinate (C1) arc (90:190:.1) coordinate (C2) -- (C2 -| A1) arc (0:90:.1) -- (B2 -| A) arc (270:360:.1) ;
\draw (A) coordinate (a') [bend right=15] to +(2,0) coordinate (b') [bend right] to +(0,-1) coordinate (c') [bend right] to (a' |- c') [bend right=15] to cycle ;
\end{scope}
\clip (a') [bend right=15] to (b') [bend right] to (c') [bend right] to (a' |- c') [bend right=15] to cycle ;
\draw (B1) arc (180:270:.1) (C1) arc (90:190:.1) (C2 -| A1) arc (0:90:.1) (B2 -| A) arc (270:360:.1) ;
\end{tikzpicture}
\end{document}
-
you are good soul and hard worker bee (+1) /literally translated, i don't know the adequate English phrase/– ZarkoCommented Dec 1, 2016 at 23:47
-
@Zarko I was just slightly intrigued, for some reason. No good if you want them to be nodes, of course, but I liked the idea of a bitten-bendy-box.– cfrCommented Dec 1, 2016 at 23:55
-
@Zarko I don't know if there is an exact English phrase, but I think I get the idea. We shall have to ask Alan Munn.– cfrCommented Dec 1, 2016 at 23:56
-
Thank you cfr! There is no need for cats or buses. But thanks for the offer. ;-) Commented Dec 2, 2016 at 8:42
This is not a full answer unfortunately, but I needed a very similar shape: a rectangle with inverted corners, but not the convex edges. I made a shape (see here: myshape.tex) for it, in which the corners to invert can be selected:
The test script is rather small:
\RequirePackage{luatex85}
\documentclass[tikz,convert=false]{standalone}
\tikzset{
shape example/.style={
color=black!30,
draw,
fill=yellow!30,
line width=.5cm,
},
}
\input{myshape}
\begin{document}
\begin{tikzpicture}\Huge
\node[rectangle with inverted corners, rectangle with inverted corners radius=20pt,
rectangle with inverted corners selected={north west, north east},
shape example, minimum height=6cm, inner ysep=1cm, inner xsep=.75cm] (s)
{Rectangle with inverted corners\vrule width1pt height2cm};
\foreach \anchor/\placement in
{text/below, center/above, 70/above,
base/below, base east/below, base west/below,
mid/above, mid east/above, mid west/above,
north/below, south/above, east/above, west/above,
before north east/above, north east/below, after north east/above,
before north west/above, north west/below, after north west/above,
before south west/above, south west/above, after south west/below,
before south east/below, south east/above, after south east/above}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement=0mm] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{document}
'''