0

Regarding drawing internal force diagrams through the use of the Stanli package. The following parameters are required:

  • Start point
  • End point
  • Value at start point
  • Value at end point
  • Parabola height
  • Color
  • Bend position

The issue is with the optional parameters (Parabola height) and (Bend position). How do I set them, what do they represent from a graphical point of view. The MWE below represents a simple beam with triangular load. In order to draw the shear force and bending moment diagrams for such beam, I set the values of reactions to be 2 values one of them is double the other.... Yet

  • how do I set the curve for the shear force diagram
  • How do I set the curve for the bending moment diagram since in this case of loading the BMD curve is not symmetrical, also you can only set start and end values for the curve formula
  • How do I set the bend position parameter
  • How do I define third and fourth degree Parabola
  • Finally, is there a way to define a parabolic load rather than a triangular one?

If there is any visual representation for those 2 parameters (Parabola height and bend position) this would be helpful. Also is there a way to define parabolic laod?

\documentclass{article}
\usepackage{amsmath} 
\usepackage{stanli}

\begin{document}

\begin{center} \begin{tikzpicture}

\drawhelp lines,step=0.5 grid(15,24);

%%%%%%%%%%%%%%%%%%%%%%%%Loading%%%%%%%%%%%%%%%%

\point{a-LD}{0}{22.5}; \point{b-LD}{10}{22.5}; \point{su-LD}{2}{22.5+1.5}; \point{s-LD}{2}{22.5}; \point{sl-LD}{2}{22.5-0.5}; \point{TL-LD}{10}{22.5+2}; \point{CAP-LD}{10/2}{22.5-2.5};

% Elements

\beam{4}{a-LD}{b-LD};

%Supports

\support {1}{a-LD}; \support {2}{b-LD};

%Loads

\lineload{1}{a-LD}{b-LD}[0][2][0.035]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%First diagram%%%%%%%%%%%%%%%%%%

\point{a-FBD}{0}{22.5-6}; \point{b-FBD}{10}{22.5-6}; \point{TL-FBD}{210/3}{22.5-6}; \point{TLA-FBD}{210/3}{22.5-6+1.75}; \point{HR}{0-1.5}{22.5-6}; \point{VRA}{0}{22.5-6-1}; \point{VRB}{10}{22.5-6-1}; \point{CAP-FBD}{10/2}{22.5-6-3.5};

% Elements

\beam{4}{a-FBD}{b-FBD};

%%%%%%%%%%%%%%%%%Second diagram%%%%%%%%%%%%%%%%%%

\internalforces{a-FBD}{b-FBD}{-3}{6}[0][red]%[0]

\point{a-SFD}{0}{22.5-14}; \point{b-SFD}{10}{22.5-14}; \point{TL-SFD}{210/3}{22.5-14}; \point{TLA-SFD}{210/3}{22.5-14+1.75}; \point{VRA}{0}{22.5-14-1}; \point{VRB}{10}{22.5-14-1}; \point{CAP-SFD}{10/2}{22.5-14-3.5};

% Elements

\beam{4}{a-SFD}{b-SFD};

\internalforces{a-SFD}{b-SFD}{-3}{6}[3][red]%[0]

\end{tikzpicture} \end{center}

\end{document}

I was able to obtain the macro for such command from the package .sty file, but since it used a lot of TIKZ programming, I have a problem analyzing it.


%------------------------------------------------
%       internalforces
%------------------------------------------------
%           \internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position]
%               [parabola height][color][bend position] are optional
%

\newcommandx{\internalforces}[7][5=0,6=red,7=.6667]{% \coordinate (internalforcesVarA) at ($ (#1)!#3cm!-90:(#2) $); \coordinate (internalforcesVarB) at ($ (#2)!#4cm!90:(#1)$); \coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); \coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,#5)$); \coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!#7!(internalforcesVarC)$); \coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!#7!(internalforcesVarC)$); \ifthenelse{\equal{#5}{0}}{ \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) -- (internalforcesVarB) (internalforcesVarB) -- (#2); \fill [color=#6] (internalforcesVarA) circle (\bigLineWidth/2); \fill [color=#6] (internalforcesVarB) circle (\bigLineWidth/2); \fill [color=#6] (#1) circle (\bigLineWidth/2); \fill [color=#6] (#2) circle (\bigLineWidth/2); } { %\draw bigLine,color=#6 parabola[parabola height=#5cm] (internalforcesVarB); %\draw bigLine,color=#6--(internalforcesVarAC)--(internalforcesVarBC)--(internalforcesVarB); %\draw bigLine,color=blue--(internalforcesVarB) %(internalforcesVarAB) -- (internalforcesVarC); \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) .. controls (internalforcesVarAC) and (internalforcesVarBC) .. (internalforcesVarB) (internalforcesVarB) -- (#2); \fill [color=#6] (internalforcesVarA) circle (\bigLineWidth/2); \fill [color=#6] (internalforcesVarB) circle (\bigLineWidth/2); \fill [color=#6] (#1) circle (\bigLineWidth/2); \fill [color=#6] (#2) circle (\bigLineWidth/2); }

}


What I understood is that:

- \coordinate (internalforcesVarA) at ($ (#1)!#3cm!-90:(#2) $); makes point along the vertical projection of {initial value} from the {start point} in cm along the line connecting {initial point} and {end point}

- \coordinate (internalforcesVarB) at ($ (#2)!#4cm!90:(#1)$); makes a point along the vertical projection of {end value} from the {end point} in cm along the line connecting {initial point} and {end point}

- \coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); makes a mid-point along the line joining {initial value} and the {end value}  

- \coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!#7!(internalforcesVarC)$); makes a point along the line AC with offset set according to [bend position]

- \coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!#7!(internalforcesVarC)$); makes a point along the line BC with offset set according to [bend position]

After that it gets messy

enter image description here

Silva
  • 743

1 Answers1

2

Before the general answer, I need to say a prerequisite.

  1. Introduction
  2. Answer the question
  3. Other examples to understand

  1. Please see this question to remind you of the math topic.

In pgfmanual.pdf, 13.5.3 The Syntax of Partway Modifiers

<coordinate>!<number>!<angle>:<second coordinate>

One could write for instance (1,2)!.75!(3,4) The meaning of this is: “Use the coordinate that is three quarters on the way from (1,2) to (3,4).” In general, <coordinate x>!<number>!<coordinate y> yields the coordinate (1- <number>)<coordinate x> +<number><coordinate y>.

code exam1a:

\documentclass[tikz,varwidth,border=3.14mm]{standalone}
\usepackage{amsmath} 
\usetikzlibrary{calc,decorations.pathreplacing}

\begin{document}

\begin{tikzpicture} \draw[help lines,line width=.4pt,step=1] (0,0) grid (3,4);

\node [left] at (0,0) {o}; % exam for point (1,2)!.75!(3,4) \coordinate [label=left:$A$] (A) at (1,2); \coordinate label=right:$B$ at (3,4); \draw ->--(B);

\coordinate [label=above left:\tiny $AB$] (AB) at ($(A)!.75!(B)$); % (1-.75)(A) + .75(B) % Result AB=(2.5,3.5)

\fill red circle(1pt); % draw brace \draw [decorate,decoration={brace,amplitude=6pt},xshift=-2pt,red] (A) -- (AB) node [above,blue,font=\footnotesize,midway,rotate=45,yshift=5pt] {$0.75$} ;

\end{tikzpicture}

\end{document}

output: enter image description here

The <second coordinate> may be prefixed by an <angle>, separated with a colon, as in (1,1)!.5!60:(2,2). The general meaning of <a>!<factor>!<angle>:<b> is: “First, consider the line from <a> to <b>. Then rotate this line by around the point <a>. Then the two endpoints of this line will be <a> and some point <c>. Use this point <c> for the subsequent computation, namely the partway computation.”

code exam1b:

\documentclass[tikz,varwidth,border=3.14mm]{standalone}
\usepackage{amsmath} 
\usetikzlibrary{calc,decorations.pathreplacing}

\begin{document}

\begin{tikzpicture} \draw[help lines,line width=.6pt,step=1] (0,0) grid (3,4); \node [left] at (0,0) {o};

% exam for point (1,1)!.5! 60:(2,2) \coordinate [label=below right:$A$] (A) at (1,1); \coordinate label=right:$B$ at (2,2); \draw[->] (A) -- (B);

\coordinate [label=left:$c$] (c) at ($ (A)!1! 60:(B) $); % Result c=(0.63397,2.36603) \draw[->,red] (A) -- (c);

\draw cyan,-> arc (45:105:4mm)node [above,midway] {\tiny $60^{\circ}$};

\path let \p{1} = (c) in (c) node[yshift=2mm,label=above:\tiny\pgfmathparse{\x1/28.45274}${x_c=}\pgfmathresult $]{} circle (0pt)node[label=above:\tiny\pgfmathparse{\y1/28.45274}${y_c=} \pgfmathresult $]{}; \draw [decorate,decoration={brace,amplitude=4pt},xshift=-1pt,green] (A) -- (0.63397,1) node [below,blue,font=\footnotesize,midway] {$x_c$} ; \draw [decorate,decoration={brace,amplitude=4pt},xshift=-1pt,green] (0.63397,1)--(0.63397,2.36603) node [left,blue,font=\footnotesize,midway] {$y_c$} ;

% (1,1)!.5!60:(2,2) \fill [blue]($ (A)!.5! 60:(B) $) circle (1.5pt); % (1-.5)(A) + .5(0.63397,2.36603) % Result Ac=(.81699,1.68301)

\end{tikzpicture}

\end{document}

output: enter image description here

note: The calculations of the above coordinates can also be done as follows.

\def\xa{1}
\def\ya{1}
\def\xb{2}
\def\yb{2}
%
\pgfmathsetmacro{\xnewResults}{{add(multiply(sqrt(add(pow(subtract(\xb,\xa),2),pow(subtract(\yb,\ya),2))),cos(105)),1) }}
\pgfmathsetmacro{\ynewResults}{{add(multiply(sqrt(add(pow(subtract(\xb,\xa),2),pow(subtract(\yb,\ya),2))),sin(105)),1) }}
\begin{equation*}
c=
\begin{cases}
x_c=\xnewResults 
\\
y_c=\ynewResults 
\end{cases}
\end{equation*}
%
\def\num{.5}
\def\xa{1}
\def\ya{1}
\def\xb{0.63397}
\def\yb{2.36603}
%
\pgfmathsetmacro{\xpointResults}{{add(multiply(subtract(1,\num),\xa),multiply(\num,\xb)) }}
\pgfmathsetmacro{\ypointResults}{{add(multiply(subtract(1,\num),\ya),multiply(\num,\yb)) }}
\begin{equation*}
P_{Ac}=
\begin{cases}
x_p=\xpointResults 
\\
y_p=\ypointResults 
\end{cases}
\end{equation*}

output: enter image description here

see pgfmanual.pdf, 13.5.4 The Syntax of Distance Modifiers

<coordinate>!<dimension>!<angle>:<second coordinate>

code exam1c:

\documentclass[tikz,varwidth,border=2mm]{standalone}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture} \draw [help lines] (0,0) grid (3,2); \coordinate[label=below:$a$] (a) at (1,0); \coordinate [label=below:$b$] (b) at (3,1); \draw (a) -- (b);

\coordinate (c) at ($ (a)!.25!(b) $); \fill [red] (c) circle(1pt)node[below]{$c$};

\coordinate (d) at ($ (c)!1cm!90:(b) $); \fill [blue] (d) circle(1pt)node[above]{$d$};

\draw [<->] (c) -- (d) node [sloped,midway,above] {1cm}; \end{tikzpicture}

\end{document}

output: enter image description here


Part 2: Please consider the minimum code, first drawn with the stanli package and then with the tikz package

code exam2a: draw with stanli

\documentclass[border=12mm]{standalone}
\usepackage{amsmath} 
\usepackage{stanli}

\begin{document}

\begin{tikzpicture} \drawhelp lines,line width=.6pt,step=1 grid(10,14); \point{o}{0}{0}; \notation {1}{o}{$o$}[left];

\point{a-SFD}{0}{22.5-14}; %(0,8.5) \point{b-SFD}{10}{22.5-14};%(10,8.5) \notation {1}{a-SFD}{$a-SFD$}[left]; \notation {1}{b-SFD}{$b-SFD$}[right];

\beam{4}{a-SFD}{b-SFD};

%\internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position] % Default :parabola height=0, color=red, bend position=.6667 %draw \internalforces{a-SFD}{b-SFD}{-3}{6}[3][red]%[0]

\node [red,below] at (5,0){draw with stanli};

\end{tikzpicture}

\end{document}

draw with tikz:

\documentclass[tikz,border=12mm]{standalone}
\usepackage{amsmath} 
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture} \draw[help lines,line width=.6pt,step=1] (0,0) grid(10,14); \node at (0,0)[left]{$o$}; \draw [thick] (0,8.5)node[left]{$a-SFD$}--(10,8.5)node[right]{$b-SFD$};

% def stanli.sty \coordinate (internalforcesVarA) at ($ (0,8.5)!-3cm!-90:(10,8.5) $);%#3 ,initial value=-3 % (0,8.5)!1!-90:(10,8.5) first rotate -90 , next -3cm above (0,8.5)+(0,3) %Result: A=(0,11.5)

\coordinate (internalforcesVarB) at ($ (10,8.5)!6cm!90:(0,8.5)$);%#4 ,end value=6 % (10,8.5)!1!90:(0,8.5) first rotate 90 , next 6cm below (10,8.5)+(0,-6) %Result: B=(10,2.5)

\coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); %Result: AB=(1-.5)A + .5(B)=(5,7)

\coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,3)$);%#5 ,parabola height=3 %Result: C=AB +(0,6) =(5,13)

\coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!.6667!(internalforcesVarC)$);%#7, bend position=.6667 %Result: AC=(1-.6667)A+ .6667(C)=(3.3335,12.50005)

\coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!.6667!(internalforcesVarC)$); %#7, bend position=.6667 %Result: BC=(1-.6667)B+ .6667(C)=(6.6665,9.50035)

\draw [line width=1.5pt,color=red] (0,8.5) -- (internalforcesVarA) % Left Line (internalforcesVarA) .. controls (internalforcesVarAC) and (internalforcesVarBC) .. (internalforcesVarB) %controls (internalforcesVarB) -- (10,8.5); %Right Line % \draw [thin] (internalforcesVarA)--(internalforcesVarB); % \draw [thin,magenta] (internalforcesVarA)--(internalforcesVarC); \draw [thin,magenta] (internalforcesVarB)--(internalforcesVarC); % \fill [color=blue] (internalforcesVarA) circle (.75pt)node[above,font=\small]{A}; \fill [color=blue] (internalforcesVarB) circle (.75pt)node[below,font=\small]{B}; \fill [color=blue] (0,8.5) circle (.75pt); \fill [color=blue] (10,8.5) circle (.75pt); % \fill [color=blue] (internalforcesVarAC) circle (1pt) node[above,font=\small]{AC};
\fill [color=blue] (internalforcesVarBC) circle (1pt) node[right,font=\small]{BC};
% \fill [color=cyan] (internalforcesVarAB) circle (1pt) node[above,font=\small]{AB};
\fill [color=cyan] (internalforcesVarC) circle (1pt) node[above,font=\small]{C};

\node [blue,below] at (5,0){draw with tikz};

\end{tikzpicture}

\end{document}

output:

enter image description here

code example2b: draw stanli and tikz

\documentclass[12pt,a4paper]{report}
%\usepackage{tikz}
%\usetikzlibrary{calc}
\usepackage{stanli}

\begin{document}

\begin{center} \begin{tikzpicture} \draw[help lines,line width=.6pt,step=1] (0,-2) grid (4,3); \point{a}{0}{0}; \point{b}{4}{0}; %\internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position] % Default :parabola height=0, color=red, bend position=.6667 \internalforces{a}{b}{1}{-1}[1][black];

\node [font=\small,blue,below] at (2,-1.5){draw with stanli}; \end{tikzpicture} \hspace*{1cm} \begin{tikzpicture} \draw[help lines,line width=.6pt,step=1] (0,-2) grid (4,3);

\coordinate (A) at ($ (0,0)!1cm!-90:(4,0) $);%#3 ,initial value=1 %Result: A=(0,-1)

\coordinate (B) at ($ (4,0)!-1cm!90:(0,0)$);%#4 ,end value=-1
%Result: B=(4,1) \draw [thin] (A)--(B);

\coordinate (AB) at ($ (A)!.5!(B)$); %Result: AB=(2,0)

\coordinate (C) at ($ (AB)+2*(0,1)$);% #5 parabola height=1 %Result: C=(2,2)

\coordinate (AC) at ($ (A)!.6667!(C)$);%#7, bend position=.6667 %Result: AC=(1.334,1) \draw [thin] (A)--(C); \draw [thin] (B)--(C);

\coordinate (BC) at ($ (B)!.6667!(C)$); %#7, bend position=.6667 %Result: BC=(2.6665,1.666)

\draw [line width=1.5pt,color=red] (0,0) -- (A) % Left Line (A) .. controls (AC) and (BC) .. (B) %controls (B) -- (4,0); %Right Line

\fill [color=blue] (A) circle (.75pt) node[below,font=\small]{A}; \fill [color=blue] (B) circle (.75pt) node[above,font=\small]{B}; \fill [color=blue] (0,0) circle (.75pt) node[left,font=\small]{0}; \fill [color=blue] (4,0) circle (.75pt) node[right,font=\small]{4}; % \fill [color=cyan] (AB) circle (1pt) node[above,font=\small]{AB};
\fill [color=cyan] (C) circle (1pt) node[above,font=\small]{C}; \fill [color=blue] (AC) circle (1pt) node[above,font=\small]{AC};
\fill [color=blue] (BC) circle (1pt) node[above,font=\small]{BC};

\node [font=\small,red,below] at (2,-1.5){draw with tikz};
\end{tikzpicture} \end{center}

\end{document}

output: enter image description here


part 3:

code exam3a:

\documentclass[tikz,varwidth,border=3.14mm]{standalone}
\usepackage{amsmath}
\usetikzlibrary{calc}

\begin{document}

\foreach \Pline in {.1,.2,...,.9}{%Point Line \begin{tikzpicture} \useasboundingbox (-.5,-2)rectangle (4.5,3); \draw[help lines,line width=.6pt,step=1] (0,-2) grid (4,3); \coordinate [label=left:$o$,font=\small] (o) at (0,0); \draw [thick,->,blue] (o)--(4,0); \draw [thick,->,blue] (0,-2)--(0,3);

\coordinate [label=left:$A$] (A) at (0,-1); \coordinate label=right:$B$ at (4,1); \coordinate label=above:$C$ at (2,2);

\draw [thin,->] (A)--(B); \draw [thin,->] (B)--(C); \draw [thin,->] (C)--(A);

\coordinate (AB) at ($(A)!\Pline!(B)$); \fill red circle (1pt) node[below,font=\small]{$AB$};

\coordinate (BC) at ($(B)!\Pline!(C)$); \fill magenta circle (1pt) node[above right,font=\small]{$BC$};

\coordinate (CA) at ($(C)!\Pline!(A)$); \fill cyan circle (1pt) node[above left,font=\small]{$CA$}; \end{tikzpicture} }

\end{document}

output: enter image description here

code exam3b:

\documentclass[tikz,varwidth,border=3.14mm]{standalone}
\usepackage{amsmath} 
\usepackage{stanli}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

%\internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position] % Default :parabola height=0, color=red, bend position=.6667 %Example 1: Suppose, -2< initial value <2 , -2<end value<2 , parabola height=0 \foreach \fa in {-2,-1,...,2}{% \foreach \fb in {-2,-1,...,2}{% \begin{tikzpicture} \useasboundingbox (-1,-3)rectangle (5,3); \draw[help lines,line width=.6pt,step=1,black] (-1,-3) grid (5,3); \draw[help lines,line width=.3pt,step=.5,gray] (-1,-3) grid (5,3);

\point{a}{0}{0}; \point{b}{4}{0}; \beam{2}{a}{b}[0][3]; \notation {1}{a}{\small $x_a$}[left]; \notation {1}{b}{\small $x_b$}[right];

\internalforces{a}{b}{\fa}{\fb}[0][blue];

\def\xa{0} \ifnum \fa>0 \draw [decorate,decoration={brace,amplitude=6pt},xshift=-2pt,red] (0,-\fa)node [left,red,font=\footnotesize] {$F_{\fa}^a$} -- (0,0) ; \else \draw [decorate,decoration={brace,amplitude=6pt},xshift=-2pt,red] (0,0) -- (0,-\fa) node [left,red,font=\footnotesize] {$F_{\fa}^a$}; \fi % \def\xb{4} \ifnum \fb>0 \draw [decorate,decoration={brace,amplitude=6pt},xshift=2pt,cyan] (\xb,0) -- (\xb,-\fb) node [right,cyan,font=\footnotesize] {$F_{\fb}^b$}; \else \draw [decorate,decoration={brace,amplitude=6pt},xshift=2pt,cyan] (\xb,-\fb)node [right,cyan,font=\footnotesize] {$F_{\fb}^b$} -- (\xb,0) ; \fi \end{tikzpicture} }}

\end{document}

output: enter image description here

code exam3c:

\documentclass[tikz,varwidth,border=3.14mm]{standalone}
\usepackage{amsmath} 
\usepackage{stanli}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

%\internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position] % Default :parabola height=0, color=red, bend position=.6667 %Example 1: Suppose, -3< initial value <3 , -3<end value<6 , parabola height=3 \foreach \fa in {-3,-1,...,3}{% \foreach \fb in {-3,-2,...,6}{% \begin{tikzpicture} \useasboundingbox (-1,-7)rectangle (11,7); \draw[help lines,line width=.6pt,step=1,black] (-1,-7) grid (11,7); \draw[help lines,line width=.3pt,step=.5,gray] (-1,-7) grid (11,7);

\point{a}{0}{0}; \point{b}{10}{0}; \beam{2}{a}{b}[0][3]; \notation {1}{a}{$x_a$}[left]; \notation {1}{b}{$x_b$}[right];

\internalforces{a}{b}{\fa}{\fb}[3][blue];

\def\xa{0} \ifnum \fa>0 \draw [thick,decorate,decoration={brace,amplitude=6pt},xshift=-2pt,red] (0,-\fa)node [left,red,font=\small] {$F_{\fa}^a$} -- (0,0) ; \else \draw [thick,decorate,decoration={brace,amplitude=6pt},xshift=-2pt,red] (0,0) -- (0,-\fa) node [left,red,font=\small] {$F_{\fa}^a$}; \fi

\def\xb{10} \ifnum \fb>0 \draw [thick,decorate,decoration={brace,amplitude=6pt},xshift=2pt,,cyan] (\xb,0) -- (\xb,-\fb) node [right,purple,font=\small] {$F_{\fb}^b$}; \else \draw [thick,decorate,decoration={brace,amplitude=6pt},xshift=2pt,cyan] (\xb,-\fb)node [right,purple,font=\small] {$F_{\fb}^b$} -- (\xb,0) ; \fi

\end{tikzpicture} }}

\end{document}

output:

enter image description here

please see 2.4 Curved Path Construction for controls.

Edit: 2020-10-30 exam for bend position change.

\documentclass[tikz,border=12mm]{standalone}
\usepackage{amsmath} 
\usetikzlibrary{calc}

\begin{document}

\foreach \bendpos in {0,.1,.2,...,1}{%bend position \begin{tikzpicture} \draw[help lines,line width=.6pt,step=1] (0,0) grid(10,14); \node at (0,0)[left]{$o$}; \draw [thick] (0,8.5)node[left]{$a-SFD$}--(10,8.5)node[right]{$b-SFD$};

% def stanli.sty \coordinate (internalforcesVarA) at ($ (0,8.5)!-3cm!-90:(10,8.5) $);%#3 ,initial value=-3 % (0,8.5)!1!-90:(10,8.5) first rotate -90 , next -3cm above (0,8.5)+(0,3) %Result: A=(0,11.5)

\coordinate (internalforcesVarB) at ($ (10,8.5)!6cm!90:(0,8.5)$);%#4 ,end value=6 % (10,8.5)!1!90:(0,8.5) first rotate 90 , next 6cm below (10,8.5)+(0,-6) %Result: B=(10,2.5)

\coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); %Result: AB=(1-.5)A + .5(B)=(5,7)

\coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,3)$);%#5 ,parabola height=3 %Result: C=AB +(0,6) =(5,13)

\coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!\bendpos!(internalforcesVarC)$);%#7, bend position=.6667 %Result: AC=(1-.6667)A+ .6667(C)=(3.3335,12.50005)

\coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!\bendpos!(internalforcesVarC)$); %#7, bend position=.6667 %Result: BC=(1-.6667)B+ .6667(C)=(6.6665,9.50035)

\draw [line width=1.5pt,color=red] (0,8.5) -- (internalforcesVarA) % Left Line (internalforcesVarA) .. controls (internalforcesVarAC) and (internalforcesVarBC) .. (internalforcesVarB) %controls (internalforcesVarB) -- (10,8.5); %Right Line % \draw [thin] (internalforcesVarA)--(internalforcesVarB); % \draw [thin,magenta] (internalforcesVarA)--(internalforcesVarC); \draw [thin,magenta] (internalforcesVarB)--(internalforcesVarC); % \fill [color=blue] (internalforcesVarA) circle (.75pt)node[above,font=\small]{A}; \fill [color=blue] (internalforcesVarB) circle (.75pt)node[below,font=\small]{B}; \fill [color=blue] (0,8.5) circle (.75pt); \fill [color=blue] (10,8.5) circle (.75pt); % \fill [color=blue] (internalforcesVarAC) circle (1pt) node[above,font=\small]{AC};
\fill [color=blue] (internalforcesVarBC) circle (1pt) node[right,font=\small]{BC};
% \fill [color=cyan] (internalforcesVarAB) circle (1pt) node[above,font=\small]{AB};
\fill [color=cyan] (internalforcesVarC) circle (1pt) node[above,font=\small]{C};

\node [blue,below] at (5,0){draw with tikz};

\end{tikzpicture} }

\end{document}

output:

enter image description here

M.Ahmadi
  • 1,477
  • Quite an effort made by your side to obtain a detailed response. So, in order to be sure. The optional parameter "Parabola height" is equal to half the distance connecting point "C" and point "AB" shown in example 2, given that the parabola is drawn by the tangent method. However, sorry for the inconvenience, regarding the "bend position" parameter, is this variable discussed in the answer? It would be great if it is emphasized, since this is that part where the code comes a bit complicated. – Silva Oct 29 '20 at 16:30
  • it's true,parameter "Parabola height" is equal to half the distance connecting point "C" and point "AB": \coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,#5)$); . That "bend position" parameter, Ponts \coordinate(internalforcesVarAC) at ($ (internalforcesVarA)!#7!(internalforcesVarC)$); \coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!#7!(internalforcesVarC)$); It controls. However, if the Parabola height is zero, the points AB, C, AC and BC are not calculated in the condition ifthenelse is specified. – M.Ahmadi Oct 30 '20 at 07:53
  • So, I am sorry, but also to confirm the bend position optional parameter. This paramter changes the coordinate of point "AC" along the line AC and the coordinate of point "BC" along of the line BC. It changes it such that the disraance from A to AC and B to BC is equal to the value of the bend position. HOwever, the total length of line AC and BC remain the same? So the effect is manifested in the following code "(A) .. controls (AC) and (BC) .. (B)"? It would be truly nice if there is any graphical representation emphasizing the effect of such parameter, although, I know it is a lengthly task – Silva Oct 30 '20 at 15:16
  • edit add example for bend position change – M.Ahmadi Oct 30 '20 at 15:39
  • I would be grateful if you can take a look at: https://tex.stackexchange.com/questions/568948/using-tikz-package-to-extracting-length-coordinates-and-assigning-them-to-varia – Silva Oct 30 '20 at 16:10
  • How can I hatch the 2 areas: THe area above the horizontal axis "A- (a-sfd) - the parabola" and the area below the horizontal axis "B- (b-SFD) - the parabola". How can it be hatched in case such shape is drawn using the "Stanli" package. Hatching similar to https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQTUsOt8-FE-BNBX2J2u048kNAsX4wj0dimmg&usqp=CAU – Silva Oct 31 '20 at 11:16
  • https://tex.stackexchange.com/questions/569051/hatching-shear-and-moment-diagrams-using-stanli-package – Silva Oct 31 '20 at 14:06