1

The roller support produced by stanli package is very similar to that of hinged support and confusing most of the time, and hence I want to change or modify the output of the roller support, like the roller supports typesetted in the standard structural analysis textbooks, so I created a modified file stanli-myaddon.sty file by adding a new support called "support 7", but I could increase the support gap to incorporate the rollers or circles but could not add the rollers (or circles), I am drawing that arbitrarily all the time and its perplexing, could you help me to update the rollers or circles in the modified support (support no. 7) in the stanli-myaddon.sty package? Please find attached the illustrations for additional information.

enter image description here

\documentclass[12pt,border=12pt]{standalone}
\usepackage{tikz}
\usepackage{stanli-myaddon}
\begin{document}
\begin{tikzpicture}
\point{a}{0}{0};
\point{b}{3}{0};
\point{c}{6}{0};
\support{2}{a};
\support{7}{b};%Support 7 will not be available in the default stanli.sty, see the modifications done in the stanli.sty below
\support{7}{c};
\draw [thick] (5.70,-0.6) circle [radius=0.1];
\draw [thick] (6.00,-0.6) circle [radius=0.1];
\draw [thick] (6.30,-0.6) circle [radius=0.1];
\end{tikzpicture}
\end{document}

The modified stanli-myaddon.sty file content, i.e., the support 7 is as follows.

\ifthenelse{\equal{#1}{7}}{     %
\begin{scope}[rotate around={#3:(#2)}]
    \draw [normalLine] (#2) -- ++(\supportLength/2,-\supportHeight) -- ++(-\supportLength,0) -- cycle;
    \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$) -- ++(-\supportBasicLength,0);
    \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight-2*\supportGap)$) -- ++(-\supportBasicLength,0);
    \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-2*\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$);
    \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-2*\supportGap)$) -- ++(-\supportHatchingLength,0);
\end{scope}

Kindly provide a solution to automatically load these circles into the stanli-myaddon.sty package. Thank you.

rakatex
  • 489
  • 2
  • 13
  • 4
    I think "Kindly provide a solution to automatically load these circles into the package itself." should be a request to the package author. You could write your own additional or modified styles and put them in stabil-myaddon.sty, say, and load this style where needed. –  May 17 '20 at 13:47
  • @Schrödinger's cat could you provide the solution so that I could incorporate into stanli-myaddon.sty – rakatex May 17 '20 at 17:57

2 Answers2

1

Here is what you might want to do for now: save

\renewcommandx{\support}[3][3=0]{
    \ifthenelse{\equal{#1}{1}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \draw [normalLine] (#2) -- ++(\supportLength/2,-\supportHeight) -- ++(-\supportLength,0) -- cycle;
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$) -- ++(-\supportBasicLength,0);
            \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$);
            \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight)$) -- ++(-\supportHatchingLength,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{2}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \draw [normalLine] (#2) -- ++(\supportLength/2,-\supportHeight) -- ++(-\supportLength,0) -- cycle;
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$) -- ++(-\supportBasicLength,0);
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$) -- ++(-\supportBasicLength,0);
            \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$);
            \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-\supportGap)$) -- ++(-\supportHatchingLength,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{3}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,0)$) -- ++(-\supportBasicLength,0);
            \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight)$) rectangle ($(#2)+1*(\supportBasicLength/2,0)$);
            \draw[hatching]($(#2)+1*(\supportHatchingLength/2,0)$) -- ++(-\supportHatchingLength,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{4}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,0)$) -- ++(-\supportBasicLength,0);
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportGap)$) -- ++(-\supportBasicLength,0);
            \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportGap)$);
            \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportGap)$) -- ++(-\supportHatchingLength,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{5}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \draw [spring] (#2) -- ++(0,-\springLength);
            \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\springLength)$) -- ++(-\supportBasicLength,0);
            \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\springLength)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\springLength)$);
            \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\springLength)$) -- ++(-\supportHatchingLength,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{6}}{     %
        \begin{scope}[rotate around={#3:(#2)}]
            \begin{scope}[rotate around={-90:(#2)},shift={(#2)}]
                \draw[normalLine,scale=0.035,domain=0:18.85,variable=\t,smooth,]
                plot({\t*sin(\t r)},{-\t*cos(\t r)});
            \end{scope}
            \draw [normalLine] ($(#2)+1*(-\supportBasicLength/2.5,0)$) -- ++(-\supportBasicLength/3.5,0);
            \clip ($(#2)+1*(-\supportBasicLength/2.5,0)$) rectangle ($(#2)+1*(-\supportBasicLength/1.47,-\supportBasicHeight/2)$);
            \draw[hatchingspring]($(#2)+1*(0,0)$) -- ++(-\supportHatchingLength/2,0);
        \end{scope}
    }{}

    \ifthenelse{\equal{#1}{7}}{     %
    \begin{scope}[rotate around={#3:(#2)}]
        \draw [normalLine] (#2) -- ++(\supportLength/2,-\supportHeight) -- ++(-\supportLength,0) -- cycle;
        \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$) -- ++(-\supportBasicLength,0);
        \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight-2*\supportGap)$) -- ++(-\supportBasicLength,0);
        \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-2*\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$);
        \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-2*\supportGap)$) -- ++(-\supportHatchingLength,0);
    \end{scope}
    }{} 
}

as stanli-myaddon.sty. Then load this package after loading stanli,

\documentclass[12pt,border=12pt]{standalone}
\usepackage{tikz}
\usepackage{stanli}
\usepackage{stanli-myaddon}
\begin{document}
\begin{tikzpicture}
\point{a}{0}{0};
\point{b}{3}{0};
\point{c}{6}{0};
\support{2}{a};
\support{7}{b};%Support 7 will not be available in the default stanli.sty, see the modifications done in the stanli.sty below
\support{7}{c};
\draw [thick] (5.70,-0.6) circle [radius=0.1];
\draw [thick] (6.00,-0.6) circle [radius=0.1];
\draw [thick] (6.30,-0.6) circle [radius=0.1];
\end{tikzpicture}
\end{document}

to get

enter image description here

Notice that there are advanced possibilities to patch commands, e.g. using etoolbox. Yet I am not sure I would use them here. Rather, I hope that there is a chance that the author adds your suggestion (you can find his email address in the manual). Perhaps there is then also a way to update the package a bit (no more \tikzstyle and arrows library, use pgf keys instead of globally defined macros, perhaps replace the above series of \ifthenelse by a simple \ifcase and so on and so forth). Of course, the functionality of the package looks good but there may be some room for improvement in the implementation details.

  • Schrödinger's cat, thank you very much. – rakatex May 17 '20 at 19:36
  • @Schrödinger's cat,I notice that the above modification did not add the 3 manually drawn circles in the stanly-myaddon.sty. I noticed that in the answer you still had to draw the circles representing the roller support manually instead of generating them autoatically. So what is the difference between the answer and the solution proposed in the original question? (In the answer you used \draw [thick] (5.70,-0.6) circle [radius=0.1]; - \draw [thick] (6.00,-0.6) circle [radius=0.1]; - \draw [thick] (6.30,-0.6) circle [radius=0.1];)?? – Silva Oct 22 '20 at 23:13
  • https://tex.stackexchange.com/questions/568148/internalforces-command-in-stanli-package – Silva Oct 24 '20 at 20:16
0

Adding the three lines below, before \clip ($(#2... etc in stanli-myaddon.sty works for me

        \draw [normalLine] ($(#2)+1*(-\supportGap*3,-\supportHeight-\supportGap)$) circle [radius=\supportGap)];
        \draw [normalLine] ($(#2)+1*(0,-\supportHeight-\supportGap)$) circle [radius=\supportGap)];
        \draw [normalLine] ($(#2)+1*(\supportGap*3,-\supportHeight-\supportGap)$) circle [radius=\supportGap)];
nzqma
  • 1