diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-28 22:26:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-28 22:26:36 +0000 |
commit | ca9120d93c497003e1ae261a1b9f1b33b568386c (patch) | |
tree | b950e2c50c4b55ba918eb02758c48e620346e009 /Master/texmf-dist | |
parent | 045d2337f4b99044ed7a5f95c3c2958a807c4a2a (diff) |
structmech (28may18)
git-svn-id: svn://tug.org/texlive/trunk@47859 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/structmech/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/structmech/doc/structmech.pdf | bin | 250787 -> 158828 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/structmech/doc/structmech.tex | 445 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/structmech/tex/structmech.sty | 421 |
4 files changed, 429 insertions, 439 deletions
diff --git a/Master/texmf-dist/doc/latex/structmech/README.md b/Master/texmf-dist/doc/latex/structmech/README.md index 05fe080a8e6..7424ead97b9 100644 --- a/Master/texmf-dist/doc/latex/structmech/README.md +++ b/Master/texmf-dist/doc/latex/structmech/README.md @@ -25,7 +25,7 @@ Please feel free to redistribute and/or expand the functionality. Please contact tlc -06/04/2018 +05/29/2018 diff --git a/Master/texmf-dist/doc/latex/structmech/doc/structmech.pdf b/Master/texmf-dist/doc/latex/structmech/doc/structmech.pdf Binary files differindex 98c4601616b..ccf117258a0 100644 --- a/Master/texmf-dist/doc/latex/structmech/doc/structmech.pdf +++ b/Master/texmf-dist/doc/latex/structmech/doc/structmech.pdf diff --git a/Master/texmf-dist/doc/latex/structmech/doc/structmech.tex b/Master/texmf-dist/doc/latex/structmech/doc/structmech.tex index 799645f7156..9cf875ffe3a 100644 --- a/Master/texmf-dist/doc/latex/structmech/doc/structmech.tex +++ b/Master/texmf-dist/doc/latex/structmech/doc/structmech.tex @@ -1,74 +1,80 @@ -\documentclass[a4paper,10pt]{scrartcl} -\usepackage[margin=20mm]{geometry} -\usepackage[convention=sign]{structmech}\usepackage{amsmath,amsfonts,amssymb,indentfirst,fancyvrb,mathpazo,zi4,listings,float} -\usepackage[colorlinks]{hyperref} -\lstset{xleftmargin=2mm,numbers=left,numbersep=4mm,numberstyle=\color{0066CC},keywordstyle=\bfseries\color{CC0066},commentstyle=\color{CC6600},stringstyle=\bfseries\color{00CC66},stepnumber=1,frame=shadowbox,breaklines,frameround=tttt,basicstyle=\ttfamily\footnotesize} -\addtokomafont{disposition}{\rmfamily} -\title{structmech}\subtitle{A TikZ command set for structural mechanics drawings} -\author{Theodore Chang\footnote{E-mail: \href{tlcfem@gmail.com}{tlcfem@gmail.com}}\\\normalsize{}University of Canterbury, Christchurch, NZ} -\date{\normalsize{}v0.1 released on \today} -\newcommand*{\Highlight}[1]{\colorbox{00CC66}{\color{CC0066}#1}} -\begin{document}\maketitle\tableofcontents -\section{Intro} -\Highlight{structmech} is a collection of several commands to draw basic elements in structural mechanics with TikZ. It can be used to draw illustrations that may be used for teaching and excising purposes. The GPL v3 license is used for this package. +\documentclass[10pt,a4paper]{article} +\usepackage[margin=30mm]{geometry} +\usepackage{amsmath,fancyvrb,float,hyperref,structmech} +\usepackage{mathpazo} +\title{structmech\\\large{}A TikZ command set for structural mechanics drawings} +\author{Theodore Chang\footnote{E-mail: \href{tlcfem@gmail.com}{tlcfem@gmail.com}}\\[2mm]\normalsize{}University of Canterbury, Christchurch, NZ} +\date{\normalsize{}v1.0 released on \today} +\newcommand*{\Highlight}[1]{\colorbox{cyan}{\color{red}\texttt{#1}}} +\begin{document} +\maketitle +\section{Introduction} +When I was preparing lecture notes on structural mechanics related topics, it took me a lot of time to draw simple beam systems and distributions of internal forces, such as shear force diagram (SFD) and bending moment diagram (BMD), using basic TikZ. I thus tried to write some generalised commands that can draw key elements with simple syntax. That's how this package is created. This package is under GPL v3 license and/or later version. Please feel free to redistribute, expand or rewrite the functionality. \section{Options} -Use following command to load the package. +To load the package, please use the following command in the preamble. \begin{Verbatim}[frame=single,label=Syntax] \usepackage[key=val]{structmech} \end{Verbatim} -Available options are: +Some options are available for controlling the parameters used during plotting, they are: \begin{enumerate} -\item axial: Define the axial force color. \Highlight{axial=colorValue}. Any predefined color value is acceptable. -\item rotation: Define the rotation arc color. \Highlight{rotation=colorValue}. Any predefined color value is acceptable. -\item node: Define the nodal force/displacement color. \Highlight{node=colorValue}. Any predefined color value is acceptable. -\item fill: Define the fill patch color. \Highlight{fill=colorValue}. Any predefined color value is acceptable. -\item convention: Define the sign convention. Value \Highlight{convention=sign} draws all quantities along positive direction and indicate negative quantities with minus sign $-$. Value \Highlight{convention=direction} label all numbers as positive but draw the negative quantities along negative directions. +\item \Highlight{fill} defines the default fill patch colour, any predefined colour value is acceptable. +\item \Highlight{line} defines the default line colour, any predefined colour value is acceptable. +\item \Highlight{node} defines the nodal force/displacement colour, any predefined colour value is acceptable. +\item \Highlight{axis} defines the axial force/displacement colour, any predefined colour value is acceptable. +\item \Highlight{rotation} defines the rotation force/displacement colour, any predefined colour value is acceptable. +\item \Highlight{convention} defines the sign convention, value \Highlight{convention=sign} draws all quantities along the positive direction and indicates the negative quantities with minus sign $-$, value \Highlight{convention=direction} labels all numbers as positive values but draws the negative quantities along the negative direction. +\item \Highlight{showvalue} defines whether to show the values when plotting the diagrams of the internal forces, possible values are \Highlight{showvalue=on} and \Highlight{showvalue=off}. +\item \Highlight{absvalue} defines whether to show the absolute values when plotting the diagrams of the internal forces, possible values are \Highlight{absvalue=on} and \Highlight{absvalue=off}. +\item \Highlight{opacity} defines the fill patch opacity, default value is $0.4$. +\item \Highlight{linewidth} defines the line width, default value is $0.4$ millimetre. \end{enumerate} -Use following command to change option values. +These options can be changed in the document via the following command. \begin{Verbatim}[frame=single,label=Syntax] -\setstructmech{axial=red} +\setstructmech{key=val} \end{Verbatim} -Some examples. +Here are some examples that use the basic force command to show how the user can control the property of the diagram elements. Other options can be changed in a similar fashion. \begin{Verbatim}[frame=single,label=Example] -\setstructmech{axial=red} -\BasicForce{0,3}{3,3}{} -\setstructmech{axial=blue} -\BasicForce{0,2}{3,2}{} -\setstructmech{axial=black} -\BasicForce{0,1}{3,1}{} +\setstructmech{axis=red} +\BasicForce{0,0}{3,0}{} +\setstructmech{axis=blue,rotation=green} +\BasicForce{4,0}{7,0}{} +\setstructmech{axis=black} +\BasicForce{8,0}{11,0}{} \end{Verbatim} \begin{figure}[H] \centering \begin{tikzpicture} -\setstructmech{axial=red} -\BasicForce{0,3}{3,3}{} -\setstructmech{axial=blue} -\BasicForce{0,2}{3,2}{} -\setstructmech{axial=black} -\BasicForce{0,1}{3,1}{} +\setstructmech{axis=red} +\BasicForce{0,0}{3,0}{} +\setstructmech{axis=blue,rotation=green} +\BasicForce{4,0}{7,0}{} +\setstructmech{axis=black} +\BasicForce{8,0}{11,0}{} \end{tikzpicture} \end{figure} \section{Nodal Forces/Displacements} \begin{Verbatim}[frame=single,label=Syntax] \NodalForce[1]{2}[3][4][5]{6}[7] \end{Verbatim} -\begin{enumerate} -\item[1.][1] --- Color of arrows, optional. Any existing color value, either build-in (refer to \texttt{xcolor}) or user-defined color is acceptable. Default value is \Highlight{\texttt{CC0066}}. -\item[2.]\{2\} --- Node coordinates. Accept two coordinates of the target node in the form of \Highlight{$x,y$}. -\item[3.][3] --- Label for horizontal force/displacement, optional. If not assigned or left blank, only the arrow (without label) will be drew. Assign \Highlight{\texttt{N}} for drawing nothing along horizontal direction. -\item[4.][4] --- Label for vertical force/displacement, optional. If not assigned or left blank, only the arrow (without label) will be drew. Assign \Highlight{\texttt{N}} for drawing nothing along vertical direction. -\item[5.][5] --- Label for rotational force/displacement, optional. If not assigned or left blank, only the arrow (without label) will be drew. Assign \Highlight{\texttt{N}} for drawing nothing along rotational direction. -\item[6.]\{6\} --- Rotation angle, optional. Default value is \Highlight{$0$}. -\item[7.][7] --- Scale, optional. -\end{enumerate} +\begin{itemize} +\item[][1] --- optional, colour of arrows, any existing colour value is acceptable, default value is the colour defined by the \Highlight{node} option. +\item[]\{2\} --- node coordinate pair, accepts two coordinates of the target node in the form of \Highlight{$x,y$}. +\item[][3] --- optional, label for local horizontal force/displacement, if not assigned or left blank, only the arrow (without label) will be drew, assign \Highlight{N} for drawing nothing along horizontal direction. +\item[][4] --- optional, label for local vertical force/displacement, if not assigned or left blank, only the arrow (without label) will be drew, assign \Highlight{N} for drawing nothing along horizontal direction. +\item[][5] --- optional, label for local rotational force/displacement, if not assigned or left blank, only the arrow (without label) will be drew, assign \Highlight{N} for drawing nothing along horizontal direction. +\item[]\{6\} --- optional, rotation, default value is \Highlight{$0$}. +\item[][7] --- optional, scale, default value is \Highlight{$1$}. +\end{itemize} \begin{Verbatim}[frame=single,label=Example] \NodalForce{0,0} \NodalForce[red]{2,0} \NodalForce[blue]{4,0}[][][] +\setstructmech{node=green} \NodalForce{6,0}[N] \NodalForce{8,0}[][N] \NodalForce{10,0}[][][N] \NodalForce{12,0}[N][] +\setstructmech{node=orange} \setstructmech{convention=direction} \NodalForce{0,-3}[-V_1][-V_2][-V_3] \setstructmech{convention=sign} @@ -84,10 +90,12 @@ Some examples. \NodalForce{0,0} \NodalForce[red]{2,0} \NodalForce[blue]{4,0}[][][] +\setstructmech{node=green} \NodalForce{6,0}[N] \NodalForce{8,0}[][N] \NodalForce{10,0}[][][N] \NodalForce{12,0}[N][] +\setstructmech{node=orange} \setstructmech{convention=direction} \NodalForce{0,-3}[-V_1][-V_2][-V_3] \setstructmech{convention=sign} @@ -103,33 +111,33 @@ Some examples. \BasicForce[1]{2}{3}{4}{5}[6][7][8] \end{Verbatim} \begin{enumerate} -\item[1.][1] --- The number of forces to draw, optional. \Highlight{\texttt{1}} for axial force only, \Highlight{\texttt{2L}} for lower end bending moment only, \Highlight{\texttt{2H}} for high end bending moment only, \Highlight{\texttt{2}} for both two end moments, \Highlight{\texttt{3}} for all three force components. Default value is \Highlight{\texttt{3}}. -\item[2.]\{2\} --- The coordinate for the lower end in the form of \Highlight{$x,y$}. -\item[3.]\{3\} --- The coordinate for the high end in the form of \Highlight{$x,y$}. -\item[4.]\{4\} --- Label for the member, leave blank if not required. -\item[5.]\{5\} --- Further adjustment of the member label, optional, parameters used for TikZ positioning are acceptable, such as \Highlight{\texttt{right=2mm}} or \Highlight{\texttt{anchor=north}}. The default value is \Highlight{\texttt{above=2mm}}, leave blank if not required. -\item[6.][6] --- Label for first force drew. Available for all four values for \Highlight{\texttt{\#1}}, leave blank if not required. -\item[7.][7] --- Label for second force drew. Available for \Highlight{\texttt{\#1=2}}, leave blank if not required. -\item[8.][8] --- Label for third force drew. Available for \Highlight{\texttt{\#1=3}}, leave blank if not required. -\item[9.]Note the color is configured in the package option. +\item[][1] --- optional, the number of forces to draw, \Highlight{1} for axial force only, \Highlight{2L} for lower end bending moment only, \Highlight{2H} for high end bending moment only, \Highlight{2} for both two end moments, \Highlight{3} for all three force components, default value is \Highlight{3}. +\item[]\{2\} --- the coordinates of the lower end in the form of \Highlight{$x,y$}. +\item[]\{3\} --- the coordinates of the high end in the form of \Highlight{$x,y$}. +\item[]\{4\} --- label for the member, leave blank if not required. +\item[]\{5\} --- optional, further adjustment of the member label, parameters used for TikZ positioning are acceptable, such as \Highlight{right=2mm} or \Highlight{anchor=north}, the default value is \Highlight{above=2mm}, leave blank if not required. +\item[][6] --- label for the first force drew, available for all four values for the first parameter \Highlight{\#1}, leave blank if not required. +\item[][7] --- label for the second force drew, available for \Highlight{\#1=2}, leave blank if not required. +\item[][8] --- label for the third force drew, available for \Highlight{\#1=3}, leave blank if not required. \end{enumerate} +The colours of three components can be configured using global options. Here are a few examples, please find out the order and the difference in the following fourteen examples. \begin{Verbatim}[frame=single,label=Example] \BasicForce{0,0}{3,0}{} -\BasicForce[1]{0,2}{3,2}{} -\BasicForce[2]{0,4}{3,4}{} -\BasicForce[3]{0,6}{3,6}{} -\BasicForce[2L]{0,8}{3,8}{} -\BasicForce[2H]{0,10}{3,10}{} \BasicForce[1]{5,0}{8,0}{a}[U_1] +\BasicForce[1]{0,2}{3,2}{} \BasicForce[2]{5,2}{8,2}{a}[U_1][U_2] +\setstructmech{axis=red,rotation=green} +\BasicForce[2]{0,4}{3,4}{} \BasicForce[2L]{5,4}{8,4}{a}[U_1] +\BasicForce[3]{0,6}{3,6}{} \BasicForce[2H]{5,6}{8,6}{a}[U_1] +\BasicForce[2L]{0,8}{3,8}{} \BasicForce{5,8}{8,8}{a}[U_1][U_2][U_3] -\BasicForce{5,10}{8,10}{a}{above left=2mm and 6mm,0066CC}[U_1][U_2][U_3] +\BasicForce[2H]{0,10}{3,10}{} +\BasicForce{5,10}{8,10}{a}{above left=2mm and 6mm}[U_1][U_2][U_3] \setstructmech{convention=direction} \BasicForce[3]{0,12}{3,12}{a}[-U_1][-U_2][-U_3] \BasicForce[3]{5,12}{8,12}{a}[U_1][U_2][-U_3] -\setstructmech{convention=sign} \end{Verbatim} \begin{figure}[H] \centering @@ -137,72 +145,87 @@ Some examples. \draw[dashed](-1,1)--(9,1)(-1,3)--(9,3)(-1,5)--(9,5)(-1,7)--(9,7)(-1,9)--(9,9)(-1,11)--(9,11); \draw[line width=.6mm](-1,0)--(9,0)(-1,2)--(9,2)(-1,4)--(9,4)(-1,6)--(9,6)(-1,8)--(9,8)(-1,10)--(9,10)(-1,12)--(9,12); \BasicForce{0,0}{3,0}{} -\BasicForce[1]{0,2}{3,2}{} -\BasicForce[2]{0,4}{3,4}{} -\BasicForce[3]{0,6}{3,6}{} -\BasicForce[2L]{0,8}{3,8}{} -\BasicForce[2H]{0,10}{3,10}{} \BasicForce[1]{5,0}{8,0}{a}[U_1] +\BasicForce[1]{0,2}{3,2}{} \BasicForce[2]{5,2}{8,2}{a}[U_1][U_2] +\setstructmech{axis=red,rotation=green} +\BasicForce[2]{0,4}{3,4}{} \BasicForce[2L]{5,4}{8,4}{a}[U_1] +\BasicForce[3]{0,6}{3,6}{} \BasicForce[2H]{5,6}{8,6}{a}[U_1] +\BasicForce[2L]{0,8}{3,8}{} \BasicForce{5,8}{8,8}{a}[U_1][U_2][U_3] -\BasicForce{5,10}{8,10}{a}{above left=2mm and 6mm,0066CC}[U_1][U_2][U_3] +\BasicForce[2H]{0,10}{3,10}{} +\BasicForce{5,10}{8,10}{a}{above left=2mm and 6mm}[U_1][U_2][U_3] \setstructmech{convention=direction} \BasicForce[3]{0,12}{3,12}{a}[-U_1][-U_2][-U_3] \BasicForce[3]{5,12}{8,12}{a}[U_1][U_2][-U_3] -\setstructmech{convention=sign} \end{tikzpicture} \end{figure} -\section{UDL} +\section{Uniformly Distributed Load} \begin{Verbatim}[frame=single,label=Syntax] \UDL[1]{2}{3}[4]{5} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Flip the side \Highlight{F}, optional. -\item[2.]\{2\} --- Coordinate for lower end node, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Coordinate for higher end node, in form of \Highlight{$x,y$}. -\item[4.][4] --- Label, optional. -\item[5.]\{5\} --- Scale, optional. +\item[][1] --- optional, flip the side, assign value \Highlight{F} if the default behaviour is not the one you want. +\item[]\{2\} --- the coordinates of the lower end node in form of \Highlight{$x,y$}. +\item[]\{3\} --- the coordinates of the higher end node in form of \Highlight{$x,y$}. +\item[][4] --- optional, label. +\item[]\{5\} --- optional, scale, default value is \Highlight{$1$}. \end{enumerate} \begin{Verbatim}[frame=single,label=Example] \UDL{-4,0}{-1,4}[10] \UDL{-2,0}{1,4}[-10] -\setstructmech{fill=CC6600,convention=direction} +\setstructmech{fill=red,convention=direction} \UDL{0,0}{3,4}[-10] -\setstructmech{fill=CC0066,convention=sign} -\UDL[F]{2,0}{5,4} -\UDL{5,0}{8,4}[20] -\UDL{8,0}{11,4}{2} +\setstructmech{fill=red,convention=sign} +\UDL[F]{1,0}{4,4} +\UDL{6,0}{9,4}{2} \end{Verbatim} \begin{figure}[H] \centering \begin{tikzpicture} +\draw[line width=.6mm](-4,0)--++(3,4)(-2,0)--++(3,4)(0,0)--++(3,4)(1,0)--++(3,4)(6,0)--++(3,4); \UDL{-4,0}{-1,4}[10] \UDL{-2,0}{1,4}[-10] -\setstructmech{fill=CC6600,convention=direction} +\setstructmech{fill=red,convention=direction} \UDL{0,0}{3,4}[-10] -\setstructmech{fill=CC0066,convention=sign} -\UDL[F]{2,0}{5,4} -\UDL{5,0}{8,4}[20] -\UDL{8,0}{11,4}{2} +\setstructmech{fill=red,convention=sign} +\UDL[F]{1,0}{4,4} +\UDL{6,0}{9,4}{2} \end{tikzpicture} \end{figure} \section{Supports} -\subsection{Hinge Support} +\subsection{Hinge/Fixed/Roller/Slider Support} \begin{Verbatim}[frame=single,label=Syntax] \HingeSupport[1]{2}{3} +\FixedSupport[1]{2}{3} +\RollerSupport[1]{2}{3} +\SliderSupport[1]{2}{3} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. +\item[][1] --- optional, rotation, default value is \Highlight{$0$}. +\item[]\{2\} --- node coordinates in form of \Highlight{$x,y$}. +\item[]\{3\} --- optional, scale, default value is \Highlight{$1$}. \end{enumerate} \begin{Verbatim}[frame=single,label=Example] \HingeSupport{0,0} \HingeSupport[75]{2,0}{1.5} \HingeSupport[150]{2,2}{2} \HingeSupport[225]{0,2}{2.5} +\FixedSupport{4,0} +\FixedSupport[75]{6,0}{1.5} +\FixedSupport[150]{6,2}{2} +\FixedSupport[225]{4,2}{2.5} +\setstructmech{linewidth=.2mm,line=red} +\RollerSupport{6,-5} +\RollerSupport[75]{8,-5}{1.5} +\RollerSupport[150]{8,-3}{2} +\RollerSupport[225]{6,-3}{2.5} +\SliderSupport{0,-5} +\SliderSupport[75]{2,-5}{1.5} +\SliderSupport[150]{2,-3}{2} +\SliderSupport[225]{0,-3}{2.5} \end{Verbatim} \begin{figure}[H] \centering @@ -212,97 +235,39 @@ Some examples. \HingeSupport[150]{2,2}{2} \HingeSupport[225]{0,2}{2.5} \draw - (0,0)node[draw,circle,fill=white,inner sep=0,minimum size=2mm]{}-- - (2,0)node[draw,circle,fill=white,inner sep=0,minimum size=2mm]{}-- - (2,2)node[draw,circle,fill=white,inner sep=0,minimum size=2mm]{}-- - (0,2)node[draw,circle,fill=white,inner sep=0,minimum size=2mm]{}--cycle; -\end{tikzpicture} -\end{figure} -\subsection{Fixed Support} -\begin{Verbatim}[frame=single,label=Syntax] -\FixedSupport[1]{2}{3} -\end{Verbatim} -\begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. -\end{enumerate} -\begin{Verbatim}[frame=single,label=Example] -\FixedSupport{0,0} -\FixedSupport[75]{2,0}{1.5} -\FixedSupport[150]{2,2}{2} -\FixedSupport[225]{0,2}{2.5} -\end{Verbatim} -\begin{figure}[H] -\centering -\begin{tikzpicture} -\FixedSupport{0,0} -\FixedSupport[75]{2,0}{1.5} -\FixedSupport[150]{2,2}{2} -\FixedSupport[225]{0,2}{2.5} -\draw - (0,0)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (2,0)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (2,2)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (0,2)node[draw,fill=white,inner sep=0,minimum size=3mm]{}--cycle; -\end{tikzpicture} -\end{figure} -\subsection{Roller Support} -\begin{Verbatim}[frame=single,label=Syntax] -\RollerSupport[1]{2}{3} -\end{Verbatim} -\begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. -\end{enumerate} -\begin{Verbatim}[frame=single,label=Example] -\RollerSupport{0,0} -\RollerSupport[75]{2,0}{1.5} -\RollerSupport[150]{2,2}{2} -\RollerSupport[225]{0,2}{2.5} -\end{Verbatim} -\begin{figure}[H] -\centering -\begin{tikzpicture} -\RollerSupport{0,0} -\RollerSupport[75]{2,0}{1.5} -\RollerSupport[150]{2,2}{2} -\RollerSupport[225]{0,2}{2.5} -\draw (0,0)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- (2,0)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- (2,2)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- (0,2)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}--cycle; -\end{tikzpicture} -\end{figure} -\subsection{Slider Support} -\begin{Verbatim}[frame=single,label=Syntax] -\SliderSupport[1]{2}{3} -\end{Verbatim} -\begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. -\end{enumerate} -\begin{Verbatim}[frame=single,label=Example] -\SliderSupport{0,0} -\SliderSupport[75]{2,0}{1.5} -\SliderSupport[150]{2,2}{2} -\SliderSupport[225]{0,2}{2.5} -\end{Verbatim} -\begin{figure}[H] -\centering -\begin{tikzpicture} -\SliderSupport{0,0} -\SliderSupport[75]{2,0}{1.5} -\SliderSupport[150]{2,2}{2} -\SliderSupport[225]{0,2}{2.5} +\FixedSupport{6,0} +\FixedSupport[75]{8,0}{1.5} +\FixedSupport[150]{8,2}{2} +\FixedSupport[225]{6,2}{2.5} +\setstructmech{linewidth=.2mm,line=red} \draw - (0,0)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (2,0)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (2,2)node[draw,fill=white,inner sep=0,minimum size=3mm]{}-- - (0,2)node[draw,fill=white,inner sep=0,minimum size=3mm]{}--cycle; + (6,0)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (8,0)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (8,2)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (6,2)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}--cycle; +\RollerSupport{6,-5} +\RollerSupport[75]{8,-5}{1.5} +\RollerSupport[150]{8,-3}{2} +\RollerSupport[225]{6,-3}{2.5} +\draw + (6,-5)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (8,-5)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (8,-3)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (6,-3)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}--cycle; +\SliderSupport{0,-5} +\SliderSupport[75]{2,-5}{1.5} +\SliderSupport[150]{2,-3}{2} +\setstructmech{linewidth=.2mm} +\SliderSupport[225]{0,-3}{2.5} +\draw + (0,-5)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (2,-5)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (2,-3)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}-- + (0,-3)node[draw,fill=white,circle,inner sep=0,minimum size=2mm]{}--cycle; \end{tikzpicture} \end{figure} \subsection{Sleeve Support} @@ -310,10 +275,10 @@ Some examples. \SleeveSupport[1]{2}[3]{4} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.][3] --- Gap width, optional. -\item[4.]\{4\} --- Scale, optional. +\item[][1] --- optional, rotation. +\item[]\{2\} --- node coordinates in form of \Highlight{$x,y$}. +\item[][3] --- optional, gap width. +\item[]\{4\} --- optional, scale. \end{enumerate} \begin{Verbatim}[frame=single,label=Example] \SleeveSupport{0,0} @@ -340,13 +305,15 @@ Some examples. \Rigid[1]{2}{3} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. +\item[][1] --- optional, rotation. +\item[]\{2\} --- node coordinates in form of \Highlight{$x,y$}. +\item[]\{3\} --- optional, scale. \end{enumerate} +The colour is controlled by the \Highlight{fill} option instead of the \Highlight{line} option due to the fill patch is used in this command. \begin{Verbatim}[frame=single,label=Example] \Rigid{0,0} \Rigid[-90]{2,0}{1.5} +\setstructmech{fill=yellow} \Rigid[0]{2,2}{2} \Rigid[90]{0,2}{2.5} \end{Verbatim} @@ -355,6 +322,7 @@ Some examples. \begin{tikzpicture} \Rigid{0,0} \Rigid[-90]{2,0}{1.5} +\setstructmech{fill=green} \Rigid[0]{2,2}{2} \Rigid[90]{0,2}{2.5} \draw @@ -366,16 +334,18 @@ Some examples. \end{figure} \section{Coordinate System Frame} \begin{Verbatim}[frame=single,label=Syntax] -\CoorOrigin[1]{2}{3} +\CoorOrigin[1]{2}[3][4]{5} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Rotation angle, optional. -\item[2.]\{2\} --- Node coordinate, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Scale, optional. +\item[][1] --- optional, rotation, default value is \Highlight{$0$}. +\item[]\{2\} --- node coordinates in form of \Highlight{$x,y$}. +\item[][3] --- optional, label for $x$ axis, default value is \Highlight{$x$}. +\item[][4] --- optional, label for $y$ axis, default value is \Highlight{$y$}. +\item[]\{5\} --- optional, scale. \end{enumerate} \begin{Verbatim}[frame=single,label=Example] \CoorOrigin{0,0} -\CoorOrigin[75]{4,0}{1.5} +\CoorOrigin[75]{4,0}[\xi][\eta]{1.5} \CoorOrigin[150]{8,0}{2} \CoorOrigin[225]{12,0}{2.5} \end{Verbatim} @@ -383,9 +353,9 @@ Some examples. \centering \begin{tikzpicture} \CoorOrigin{0,0} -\CoorOrigin[75]{4,0}{1.5} +\CoorOrigin[75]{4,0}[\xi][\eta]{1.5} \CoorOrigin[150]{8,0}{2} -\CoorOrigin[225]{12,0}{2.5} +\CoorOrigin[225]{12,0}[x(\xi)][y(\eta)]{2.5} \end{tikzpicture} \end{figure} \section{Internal Force Diagram} @@ -394,28 +364,32 @@ Some examples. \IForceA[1]{2}{3}{4}{5}{6} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Fill color, optional -\item[2.]\{2\} --- Node coordinate of lower end, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Node coordinate of higher end, in form of \Highlight{$x,y$}. -\item[4.]\{4\} --- Bending moment value of lower end, can be negative. -\item[5.]\{5\} --- Bending moment value of higher end, can be negative. -\item[6.]\{6\} --- Scale, optional. +\item[][1] --- optional, fill colour. +\item[]\{2\} --- node coordinates of the lower end in form of \Highlight{$x,y$}. +\item[]\{3\} --- node coordinates of the higher end in form of \Highlight{$x,y$}. +\item[]\{4\} --- force value of the lower end, can be negative. +\item[]\{5\} --- force value of the higher end, can be negative. +\item[]\{6\} --- optional, scale. \end{enumerate} -Caveat: it shall be noted that all internal forces follow the sign convention that is adopted in finite element method, instead of the one used in material mechanics. All quantities are defined in the local coordinate system, and the anticlockwise moment is taken as positive value. +Caveat: it shall be noted that all internal forces follow the sign convention that is adopted in finite element method, instead of the one used in material mechanics. All quantities are defined in the local coordinate system. \begin{Verbatim}[frame=single,label=Example] -\IForceA{0,0}{0,4}{1}{-2}{0.5} +\IForceA{0,0}{0,4}{1}{-2} +\setstructmech{absvalue=on} \IForceA[blue]{0,4}{4,4}{2}{-0.5}{0.5} -\IForceA{4,4}{4,0}{0.5}{1}{0.5} -\IForceA[cyan]{4,0}{0,0}{-1}{-1}{0.5} +\IForceA[cyan]{4,4}{4,0}{0.5}{2} +\setstructmech{showvalue=off,opacity=.8} +\IForceA[red]{4,0}{0,0}{-1}{-1} \end{Verbatim} \begin{figure}[H] \centering \begin{tikzpicture} \draw[line width=.4mm](0,0)rectangle(4,4); -\IForceA{0,0}{0,4}{1}{-2}{0.5} +\IForceA{0,0}{0,4}{1}{-2} +\setstructmech{absvalue=on} \IForceA[blue]{0,4}{4,4}{2}{-0.5}{0.5} -\IForceA{4,4}{4,0}{0.5}{1}{0.5} -\IForceA[cyan]{4,0}{0,0}{-1}{-1}{0.5} +\IForceA[cyan]{4,4}{4,0}{0.5}{2} +\setstructmech{showvalue=off,opacity=.8} +\IForceA[red]{4,0}{0,0}{-1}{-1} \end{tikzpicture} \end{figure} \subsection{Parabolic Internal Force} @@ -423,28 +397,33 @@ Caveat: it shall be noted that all internal forces follow the sign convention th \IForceB[1]{2}{3}{4}{5}{6}{7} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Fill color, optional -\item[2.]\{2\} --- Node coordinate of the lower end, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Node coordinate of the higher end, in form of \Highlight{$x,y$}. -\item[4.]\{4\} --- Bending moment value of the lower end, can be negative. -\item[5.]\{5\} --- Bending moment value of the higher end, can be negative. -\item[6.]\{6\} --- The difference of the moment value of the centre point. -\item[7.]\{7\} --- Scale, optional. +\item[][1] --- optional, fill colour. +\item[]\{2\} --- node coordinates of the lower end in form of \Highlight{$x,y$}. +\item[]\{3\} --- node coordinates of the higher end in form of \Highlight{$x,y$}. +\item[]\{4\} --- bending moment value of the lower end, can be negative. +\item[]\{5\} --- bending moment value of the higher end, can be negative. +\item[]\{6\} --- the increment of the moment value of the centre point. +\item[]\{7\} --- optional, scale. \end{enumerate} It should be noted that parameter \Highlight{\#6} defines the difference of the true moment value and the corresponding value of an assumed linear distribution. The positive value indicates that the parabola bends towards the local positive direction. Since this command draws a parabola, the load should be a uniformly distributed load. So this value \Highlight{\#6} is $\pm\dfrac{wl^2}{8}$, the sign depends on the direction of the UDL. \begin{Verbatim}[frame=single,label=Example] -\IForceB{0,0}{0,4}{1}{-2}{1}{0.5} -\IForceB{0,4}{4,4}{-1}{1}{2}{0.5} -\IForceB{4,4}{4,0}{0.5}{1}{0}{0.5} +\draw[line width=.4mm](0,0)rectangle(4,4); +\IForceB{0,0}{0,4}{1}{-4}{1}{0.5} +\IForceB[red]{0,4}{4,4}{-2}{-1}{-2}{0.5} +\setstructmech{absvalue=on} +\IForceB[purple]{4,4}{4,0}{3}{-1}{2}{0.5} +\setstructmech{showvalue=off,opacity=.8} \IForceB[cyan]{4,0}{0,0}{1.5}{0}{2}{0.5} \end{Verbatim} \begin{figure}[H] \centering \begin{tikzpicture} \draw[line width=.4mm](0,0)rectangle(4,4); -\IForceB{0,0}{0,4}{1}{-2}{1}{0.5} -\IForceB{0,4}{4,4}{-1}{1}{2}{0.5} -\IForceB{4,4}{4,0}{0.5}{1}{0}{0.5} +\IForceB{0,0}{0,4}{1}{-4}{1}{0.5} +\IForceB[red]{0,4}{4,4}{-2}{-1}{-2}{0.5} +\setstructmech{absvalue=on} +\IForceB[purple]{4,4}{4,0}{3}{-1}{2}{0.5} +\setstructmech{showvalue=off,opacity=1} \IForceB[cyan]{4,0}{0,0}{1.5}{0}{2}{0.5} \end{tikzpicture} \end{figure} @@ -453,19 +432,20 @@ It should be noted that parameter \Highlight{\#6} defines the difference of the \BeamDeformP[1]{2}{3}{4}[5]{6}[7]{8} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Line color, optional -\item[2.]\{2\} --- Node coordinate of the lower end, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Node coordinate of the higher end, in form of \Highlight{$x,y$}. -\item[4.]\{4\} --- Perpendicular displacement of the lower end, can be negative, leave zero if not required. -\item[5.][5] --- Rotation value of the lower end, can be negative, optional. -\item[6.]\{6\} --- Perpendicular displacement of the high end, can be negative, leave zero if not required. -\item[7.][7] --- Rotation value of the high end, can be negative, optional. -\item[8.]\{8\} --- Scale, optional. +\item[][1] --- optional, line colour. +\item[]\{2\} --- node coordinates of the lower end in form of \Highlight{$x,y$}. +\item[]\{3\} --- node coordinates of the higher end in form of \Highlight{$x,y$}. +\item[]\{4\} --- perpendicular displacement of the lower end, can be negative, leave zero if not required. +\item[][5] --- optional, rotation value of the lower end, can be negative. +\item[]\{6\} --- perpendicular displacement of the high end, can be negative, leave zero if not required. +\item[][7] --- optional, rotation value of the high end, can be negative. +\item[]\{8\} --- optional, scale. \end{enumerate} -This command draws deformation based on local coordinate system. The translations are perpendicular to the member cord. +Caveat: This command draws deformation based on local coordinate system. The translations are perpendicular to the member cord. \begin{Verbatim}[frame=single,label=Example] \BeamDeformP{0,0}{0,4}{.5}{-1} \BeamDeformP[blue]{0,4}{4,4}{0}[30]{0}[50]{1} +\setstructmech{linewidth=.6mm} \BeamDeformP[red]{4,4}{4,0}{.5}[30]{0}[50]{2} \end{Verbatim} \begin{figure}[H] @@ -474,6 +454,7 @@ This command draws deformation based on local coordinate system. The translation \draw[line width=.4mm](0,0)rectangle(4,4); \BeamDeformP{0,0}{0,4}{.5}{-1} \BeamDeformP[blue]{0,4}{4,4}{0}[30]{0}[50]{1} +\setstructmech{linewidth=.6mm} \BeamDeformP[red]{4,4}{4,0}{.5}[30]{0}[50]{2} \end{tikzpicture} \end{figure} @@ -482,26 +463,24 @@ This command draws deformation based on local coordinate system. The translation \BeamDeformR[1]{2}{3}[4][5]{6} \end{Verbatim} \begin{enumerate} -\item[1.][1] --- Line color, optional -\item[2.]\{2\} --- Node coordinate of the lower end, in form of \Highlight{$x,y$}. -\item[3.]\{3\} --- Node coordinate of the higher end, in form of \Highlight{$x,y$}. -\item[4.][4] --- Rotation value of the lower end, can be negative, optional. -\item[5.][5] --- Rotation value of the high end, can be negative, optional. -\item[6.]\{6\} --- Scale, optional. +\item[][1] --- optional, line colour. +\item[]\{2\} --- node coordinates of the lower end in form of \Highlight{$x,y$}. +\item[]\{3\} --- node coordinates of the higher end in form of \Highlight{$x,y$}. +\item[][4] --- optional, rotation value of the lower end, can be negative. +\item[][5] --- optional, rotation value of the high end, can be negative. +\item[]\{6\} --- optional, scale. \end{enumerate} -Caveat: if the nodal translations are expressed as global values, they can be readily combined into parameters \Highlight{\#2} and \Highlight{\#3}, so there is no need to provide another command to plot the deformation in the global coordinate system. +Caveat: If the nodal translations are expressed as global values, they can be readily combined into parameters \Highlight{\#2} and \Highlight{\#3}, so there is no need to provide another command to plot the deformation in the global coordinate system. \begin{Verbatim}[frame=single,label=Example] -\BeamDeformR{0,0}{0,4}[20][30] +\BeamDeformR{0,0}{0,4}[50][30] \BeamDeformR[blue]{0,4}{4,4}[20][30]{2} \end{Verbatim} \begin{figure}[H] \centering \begin{tikzpicture} \draw[line width=.4mm](0,0)rectangle(4,4); -\BeamDeformR{0,0}{0,4}[20][30] +\BeamDeformR{0,0}{0,4}[50][30] \BeamDeformR[blue]{0,4}{4,4}[20][30]{2} \end{tikzpicture} \end{figure} -\section{Implementation} -\lstinputlisting[language=tex]{structmech.sty} \end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/structmech/tex/structmech.sty b/Master/texmf-dist/doc/latex/structmech/tex/structmech.sty index 21dd1f60495..bb7356bf5f5 100644 --- a/Master/texmf-dist/doc/latex/structmech/tex/structmech.sty +++ b/Master/texmf-dist/doc/latex/structmech/tex/structmech.sty @@ -15,33 +15,33 @@ %% along with this program. If not, see <http://www.gnu.org/licenses/>. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % structmech: A TikZ command set for structural mechanics drawings -% v0.1 by tlc +% v1.0 by tlc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{structmech}[2018/04/07 structmech: A TikZ command set for structural mechanics drawings] -\RequirePackage{tikz} -\RequirePackage{tikz-3dplot} +\ProvidesPackage{structmech}[2018/05/29 v1.0 structmech: A TikZ command set for structural mechanics drawings] \RequirePackage{ifthen} -\RequirePackage{xparse} -\RequirePackage{xstring} \RequirePackage{kvoptions} +\RequirePackage{tikz} \RequirePackage{xkeyval} -\usetikzlibrary{backgrounds,calc,positioning,arrows.meta,decorations.pathreplacing,decorations.pathmorphing,shapes.arrows} -\definecolor{0066CC}{RGB}{0,102,204} -\definecolor{00CC66}{RGB}{0,204,102} -\definecolor{CC0066}{RGB}{204,0,102} -\definecolor{CC6600}{RGB}{204,102,0} -\DeclareOptionX<structmech>{axial}[CC0066]{\def\axialColor{#1}} -\DeclareOptionX<structmech>{rotation}[00CC66]{\def\rotColor{#1}} -\DeclareOptionX<structmech>{node}[0066CC]{\def\nodalColor{#1}} -\DeclareOptionX<structmech>{fill}[CC0066]{\def\fillColor{#1}} -\DeclareOptionX<structmech>{convention}[sign]{\IfStrEq{#1}{sign}{\def\convention{#1}}{}\IfStrEq{#1}{direction}{\def\convention{#1}}{}} -\ExecuteOptionsX<structmech>{axial,rotation,node,convention,fill} +\RequirePackage{xparse} +\RequirePackage{xstring} +\usetikzlibrary{calc,decorations.pathreplacing,positioning} +\DeclareOptionX<structmech>{fill}[black]{\def\fillColor{#1}} +\DeclareOptionX<structmech>{line}[black]{\def\lineColor{#1}} +\DeclareOptionX<structmech>{node}[black]{\def\nodeColor{#1}} +\DeclareOptionX<structmech>{axis}[black]{\def\axisColor{#1}} +\DeclareOptionX<structmech>{rotation}[black]{\def\rotationColor{#1}} +\DeclareOptionX<structmech>{convention}[sign]{\IfStrEq{#1}{sign}{\def\convention{sign}}{\def\convention{direction}}} +\DeclareOptionX<structmech>{showvalue}[on]{\IfStrEq{#1}{on}{\def\showvalue{on}}{\def\showvalue{off}}} +\DeclareOptionX<structmech>{absvalue}[off]{\IfStrEq{#1}{on}{\def\absvalue{on}}{\def\absvalue{off}}} +\DeclareOptionX<structmech>{opacity}[.4]{\def\fillOpacity{#1}} +\DeclareOptionX<structmech>{linewidth}[.4mm]{\def\lineWidth{#1}} +\ExecuteOptionsX<structmech>{fill,line,node,axis,rotation,convention,showvalue,absvalue,opacity,linewidth} \ProcessOptionsX<structmech> \tikzset{ - BMD/.style={draw=0066CC,fill=0066CC,fill opacity=.4}, NOFILL/.style={fill=none,fill opacity=1}, -RotBasic/.style={\rotColor,line width=.4mm,->}, + DIAGRAM/.style={draw=\lineColor,fill=\fillColor,fill opacity=\fillOpacity}, +ROTATION/.style={draw=\rotationColor,line width=\lineWidth,->}, FIXED/.style={postaction={draw,decorate,decoration={border,pre length=1mm,post length=1mm,angle=-60,amplitude=1mm,segment length=1mm}}} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -53,44 +53,44 @@ RotBasic/.style={\rotColor,line width=.4mm,->}, % Command 1: Label All Nodal Forces. % \NodalForce[1]{2}[3][4][5]{6}[7] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\NewDocumentCommand{\NodalForce}{O{\nodalColor} m O{} O{} O{} G{0} O{1}}{ +\NewDocumentCommand{\NodalForce}{O{\nodeColor} m O{} O{} O{} G{0} O{1}}{ \begin{scope}[rotate around={#6:(#2)},shift={(#2)},scale=#7] \IfEq{#3}{} - {\draw[#1,line width=.4mm,->](-1,0)--(-.2,0);} - {\IfEq{#3}{N} - {} - {\IfStrEq{\convention}{sign} - {\draw[#1,line width=.4mm,->](-1,0)--(-.2,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$#3$};} - {\StrLeft{#3}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[#1,line width=.4mm,->](-.2,0)--(-1,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$\StrDel[1]{#3}{-}$};} - {\draw[#1,line width=.4mm,->](-1,0)--(-.2,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$#3$};} - } - } - } + {\draw[#1,line width=\lineWidth,->](-1,0)--(-.2,0);} + {\IfEq{#3}{N} + {} + {\IfStrEq{\convention}{sign} + {\draw[#1,line width=\lineWidth,->](-1,0)--(-.2,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$#3$};} + {\StrLeft{#3}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[#1,line width=\lineWidth,->](-.2,0)--(-1,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$\StrDel[1]{#3}{-}$};} + {\draw[#1,line width=\lineWidth,->](-1,0)--(-.2,0);\node[fill=none,#1]at(-1.4,0){\footnotesize$#3$};} + } + } + } \IfEq{#4}{} - {\draw[#1,line width=.4mm,->](0,-1)--(0,-.2);} - {\IfEq{#4}{N} - {} - {\IfStrEq{\convention}{sign} - {\draw[#1,line width=.4mm,->](0,-1)--(0,-.2);\node[fill=none,#1]at(0,-1.4){\footnotesize$#4$};} - {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[#1,line width=.4mm,->](0,-.2)--(0,-1);\node[fill=none,#1]at(0,-1.4){\footnotesize$\StrDel[1]{#4}{-}$};} - {\draw[#1,line width=.4mm,->](0,-1)--(0,-.2);\node[fill=none,#1]at(0,-1.4){\footnotesize$#4$};} - } - } - } + {\draw[#1,line width=\lineWidth,->](0,-1)--(0,-.2);} + {\IfEq{#4}{N} + {} + {\IfStrEq{\convention}{sign} + {\draw[#1,line width=\lineWidth,->](0,-1)--(0,-.2);\node[fill=none,#1]at(0,-1.4){\footnotesize$#4$};} + {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[#1,line width=\lineWidth,->](0,-.2)--(0,-1);\node[fill=none,#1]at(0,-1.4){\footnotesize$\StrDel[1]{#4}{-}$};} + {\draw[#1,line width=\lineWidth,->](0,-1)--(0,-.2);\node[fill=none,#1]at(0,-1.4){\footnotesize$#4$};} + } + } + } \IfEq{#5}{} - {\draw[#1,line width=.4mm,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];} - {\IfEq{#5}{N} - {} - {\IfStrEq{\convention}{sign} - {\draw[#1,line width=.4mm,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$#5$};} - {\StrLeft{#5}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[#1,line width=.4mm,<-](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$\StrDel[1]{#5}{-}$};} - {\draw[#1,line width=.4mm,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$#5$};} - } - } - } + {\draw[#1,line width=\lineWidth,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];} + {\IfEq{#5}{N} + {} + {\IfStrEq{\convention}{sign} + {\draw[#1,line width=\lineWidth,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$#5$};} + {\StrLeft{#5}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[#1,line width=\lineWidth,<-](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$\StrDel[1]{#5}{-}$};} + {\draw[#1,line width=\lineWidth,->](.2121,-.2121)arc[#1,start angle=-45,end angle=135,radius=3mm];\node[#1,fill=none]at(-.5303,.5303){\footnotesize$#5$};} + } + } + } \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -109,100 +109,100 @@ EndRotC/.style={start angle=\Angle+270,end angle=\Angle+90,radius=3mm}, EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, } \IfEq{#1}{1} - { - \IfNoValueTF{#6} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$};} - {\IfStrEq{\convention}{sign} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} - {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[\axialColor,line width=.4mm,>-<](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$\StrDel[1]{#6}{-}$};} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} - } - } - } - {} + { + \IfNoValueTF{#6} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$};} + {\IfStrEq{\convention}{sign} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} + {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[\axisColor,line width=\lineWidth,>-<](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$\StrDel[1]{#6}{-}$};} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} + } + } + } + {} \IfEq{#1}{2L} - { - \draw[\axialColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; - \IfNoValueTF{#6} - {\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[RotBasic]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - } - } - } - {} + { + \draw[\axisColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; + \IfNoValueTF{#6} + {\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[ROTATION]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + } + } + } + {} \IfEq{#1}{2H} - { - \draw[\axialColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; - \IfNoValueTF{#6} - {\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[RotBasic]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - } - } - } - {} + { + \draw[\axisColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; + \IfNoValueTF{#6} + {\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[ROTATION]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + } + } + } + {} \IfEq{#1}{2} - { - \draw[\axialColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; - \IfNoValueTF{#6} - {\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[RotBasic]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - } - } - \IfNoValueTF{#7} - {\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#7$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\StrLeft{#7}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#7}{-}$};\draw[RotBasic]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#7$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - } - } - } - {} + { + \draw[\axisColor,draw=none](#2)--(#3)node[midway,fill=none,#5]{$#4$}; + \IfNoValueTF{#6} + {\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#6}{-}$};\draw[ROTATION]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#6$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + } + } + \IfNoValueTF{#7} + {\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#7$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\StrLeft{#7}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#7}{-}$};\draw[ROTATION]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#7$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + } + } + } + {} \IfEq{#1}{3} - { - \IfNoValueTF{#6} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$};} - {\IfStrEq{\convention}{sign} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} - {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[\axialColor,line width=.4mm,>-<](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$\StrDel[1]{#6}{-}$};} - {\draw[\axialColor,line width=.4mm,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} - } - } - \IfNoValueTF{#7} - {\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#7$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - {\StrLeft{#7}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#7}{-}$};\draw[RotBasic]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} - {\node[fill=none,\rotColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#7$};\draw[RotBasic]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} - } - } - \IfNoValueTF{#8} - {\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\IfStrEq{\convention}{sign} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#8$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - {\StrLeft{#8}{1}[\SS]\IfStrEq{\SS}{-} - {\node[fill=none,\rotColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#8}{-}$};\draw[RotBasic]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} - {\node[fill=none,\rotColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#8$};\draw[RotBasic]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} - } - } - } - {} + { + \IfNoValueTF{#6} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$};} + {\IfStrEq{\convention}{sign} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} + {\StrLeft{#6}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[\axisColor,line width=\lineWidth,>-<](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$\StrDel[1]{#6}{-}$};} + {\draw[\axisColor,line width=\lineWidth,<->](#2)--(#3)node[midway,fill=none,#5]{$#4$}node[midway,fill=white]{\footnotesize$#6$};} + } + } + \IfNoValueTF{#7} + {\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#7$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + {\StrLeft{#7}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle-90:.6)$){\footnotesize$\StrDel[1]{#7}{-}$};\draw[ROTATION]($(#2)+(\Angle-90:.3)$)arc[EndRotC];} + {\node[fill=none,\rotationColor]at($(#2)+(\Angle+90:.6)$){\footnotesize$#7$};\draw[ROTATION]($(#2)+(\Angle+90:.3)$)arc[EndRotA];} + } + } + \IfNoValueTF{#8} + {\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\IfStrEq{\convention}{sign} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#8$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + {\StrLeft{#8}{1}[\SS]\IfStrEq{\SS}{-} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle+90:.6)$){\footnotesize$\StrDel[1]{#8}{-}$};\draw[ROTATION]($(#3)+(\Angle+90:.3)$)arc[EndRotD];} + {\node[fill=none,\rotationColor]at($(#3)+(\Angle-90:.6)$){\footnotesize$#8$};\draw[ROTATION]($(#3)+(\Angle-90:.3)$)arc[EndRotB];} + } + } + } + {} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Command 3: Hinge support @@ -210,8 +210,8 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\HingeSupport}{O{0} m G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[line width=.2mm](0,0)--++(-.25,-.4)--++(.5,0)--cycle; -\draw[line width=.2mm,FIXED](-.4,-.4)--++(.8,0); +\draw[line width=\lineWidth](0,0)--++(-.25,-.4)--++(.5,0)--cycle; +\draw[line width=\lineWidth,FIXED](-.4,-.4)--++(.8,0); \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -228,27 +228,27 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, \pgfpointdiff{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} \pgfmathparse{veclen(\pgf@x,\pgf@y)/28.45274} \let\Length\pgfmathresult -\draw[\fillColor,fill=\fillColor,fill opacity=.4](#2)--(#3)--($(#3)+(\Angle+\FAC*90:\Length/10*#5)$)--($(#2)+(\Angle+\FAC*90:\Length/10*#5)$)--cycle; +\draw[\fillColor,fill=\fillColor,fill opacity=\fillOpacity](#2)--(#3)--($(#3)+(\Angle+\FAC*90:#5)$)--($(#2)+(\Angle+\FAC*90:#5)$)--cycle; \IfNoValueTF{#4} - {} - {\IfStrEq{\convention}{sign} - {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:\Length/5*#5)$)[rotate=\Angle]{$#4$};} - {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} - {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:\Length/5*#5)$)[rotate=\Angle]{$\StrDel[1]{#4}{-}$};} - {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:\Length/5*#5)$)[rotate=\Angle]{$#4$};} - } - } + {} + {\IfStrEq{\convention}{sign} + {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:1.2*#5)$)[rotate=\Angle]{$#4$};} + {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} + {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:1.2*#5)$)[rotate=\Angle]{$\StrDel[1]{#4}{-}$};} + {\node[NOFILL]at($(#2)!.5!(#3)+(\Angle+\FAC*90:1.2*#5)$)[rotate=\Angle]{$#4$};} + } + } \foreach\x in{0,.1,.2,...,1}{ \coordinate(C)at($(#2)!\x!(#3)$); \IfNoValueTF{#4} - {\draw[<-](C)--++($(\Angle+\FAC*90:\Length/10*#5)$);} - {\IfStrEq{\convention}{sign} - {\draw[<-](C)--++($(\Angle+\FAC*90:\Length/10*#5)$);} - {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} - {\draw[->](C)--++($(\Angle+\FAC*90:\Length/10*#5)$);} - {\draw[<-](C)--++($(\Angle+\FAC*90:\Length/10*#5)$);} - } - } + {\draw[<-](C)--++($(\Angle+\FAC*90:#5)$);} + {\IfStrEq{\convention}{sign} + {\draw[<-](C)--++($(\Angle+\FAC*90:#5)$);} + {\StrLeft{#4}{1}[\SS]\IfStrEq{\SS}{-} + {\draw[->](C)--++($(\Angle+\FAC*90:#5)$);} + {\draw[<-](C)--++($(\Angle+\FAC*90:#5)$);} + } + } }; } \makeatother @@ -258,7 +258,7 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\FixedSupport}{O{0} m G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[line width=.2mm,FIXED](-.4,0)--++(.8,0); +\draw[draw=\lineColor,line width=\lineWidth,FIXED](-.4,0)--++(.8,0); \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -267,12 +267,12 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\RollerSupport}{O{0} m G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[line width=.2mm] - (0,0)--++(-.25,-.3)--++(.5,0)--cycle - (-.15,-.35)circle(.05) - (+.15,-.35)circle(.05); -\draw[line width=.2mm,FIXED] - (-.4,-.4)--++(.8,0); +\draw[draw=\lineColor,line width=\lineWidth] + (0,0)--++(-.25,-.3)--++(.5,0)--cycle + (-.15,-.35)circle(.05) + (+.15,-.35)circle(.05); +\draw[draw=\lineColor,line width=\lineWidth,FIXED] + (-.4,-.4)--++(.8,0); \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -281,15 +281,15 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\SliderSupport}{O{0} m G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[line width=.2mm] - (-.25,-.1/#3)--++(.5,0) - (-.15,-.14/#3)--++(0,-.22) - (+.15,-.14/#3)--++(0,-.22); -\draw[line width=.2mm,fill=white] - (-.15,-.14/#3)circle(.04)++(0,-.22)circle(.04) - (+.15,-.14/#3)circle(.04)++(0,-.22)circle(.04); -\draw[line width=.2mm,FIXED] - (-.4,-.14/#3-.26)--++(.8,0); +\draw[draw=\lineColor,line width=\lineWidth] + (-.25,-.1/#3)--++(.5,0) + (-.15,-.14/#3)--++(0,-.22) + (+.15,-.14/#3)--++(0,-.22); +\draw[draw=\lineColor,line width=\lineWidth,fill=white] + (-.15,-.14/#3)circle(.04)++(0,-.22)circle(.04) + (+.15,-.14/#3)circle(.04)++(0,-.22)circle(.04); +\draw[draw=\lineColor,line width=\lineWidth,FIXED] + (-.4,-.14/#3-.26)--++(.8,0); \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -298,18 +298,17 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\SleeveSupport}{O{0} m O{.4} G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#4] -\draw[line width=.2mm,FIXED](#3/2,-.4)--++(0,.8); -\draw[line width=.2mm,FIXED](-#3/2,.4)--++(0,-.8); +\draw[draw=\lineColor,line width=\lineWidth,FIXED](#3/2,-.4)--++(0,.8)(-#3/2,.4)--++(0,-.8); \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Command 9: Coordinate system frame % \CoorOrigin[1]{2}{3} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\NewDocumentCommand{\CoorOrigin}{O{0} m G{1}}{ -\begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[line width=.2mm,->](-.2,0)--++(1,0);\node[fill=none,draw=none]at(1.1,0){\footnotesize$x$}; -\draw[line width=.2mm,->](0,-.2)--++(0,1);\node[fill=none,draw=none]at(0,1.1){\footnotesize$y$}; +\NewDocumentCommand{\CoorOrigin}{O{0} m O{x} O{y} G{1}}{ +\begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#5] +\draw[draw=\lineColor,line width=\lineWidth,->](-.2,0)--++(1,0);\node[fill=none,draw=none]at(1.1,0){\footnotesize$#3$}; +\draw[draw=\lineColor,line width=\lineWidth,->](0,-.2)--++(0,1);\node[fill=none,draw=none]at(0,1.1){\footnotesize$#4$}; \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -318,7 +317,7 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\Rigid}{O{0} m G{1}}{ \begin{scope}[rotate around={#1:(#2)},shift={(#2)},scale=#3] -\draw[fill=black,rounded corners=.2mm](0,0)--(.25,.4)--(.4,.25)--cycle; +\draw[draw=\fillColor,fill=\fillColor,rounded corners=.2mm](0,0)--(.25,.4)--(.4,.25)--cycle; \end{scope} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -333,32 +332,39 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, \let\Angle\pgfmathresult \coordinate(C)at($(A)+(\Angle+90:#4*#6)$); \coordinate(D)at($(B)+(\Angle-90:#5*#6)$); -\draw[#1,fill=#1,fill opacity=.3](A)--(C)--(D)--(B)--cycle; +\draw[#1,fill=#1,fill opacity=\fillOpacity](A)--(C)--(D)--(B)--cycle; \pgfpointdiff{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} \pgfmathparse{veclen(\pgf@x,\pgf@y)/28.45274} \let\Length\pgfmathresult +\IfStrEq{\showvalue}{on}{ \StrLeft{#4}{1}[\SA] \IfStrEq{\SA}{-} - {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};} - {\node[NOFILL]at($(C)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#4$};} + {\IfStrEq{\absvalue}{on} + {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#4}{-}$};} + {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};} + } + {\node[NOFILL]at($(C)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#4$};} \StrLeft{#5}{1}[\SB] \IfStrEq{\SB}{-} - {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};} - {\node[NOFILL]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};} + {\IfStrEq{\absvalue}{on} + {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#5}{-}$};} + {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};} + } + {\node[NOFILL]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};} +}{} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Command 12: Parabolic Internal Force % \IForceB[1]{2}{3}{4}{5}{6}{7} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\IForceB}{O{\fillColor} m m m m m G{1}}{ -\coordinate(A)at(#2); -\coordinate(B)at(#3); +\coordinate(A)at(#2);\coordinate(B)at(#3); % original cord \pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} \let\Angle\pgfmathresult \coordinate(C)at($(A)+(\Angle+90:#4*#7)$); \coordinate(D)at($(B)+(\Angle-90:#5*#7)$); -% shape cord +% inclined cord \pgfmathanglebetweenpoints{\pgfpointanchor{C}{center}}{\pgfpointanchor{D}{center}} \let\AngleB\pgfmathresult % original length @@ -373,25 +379,31 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, \coordinate(G)at($(C)+(\AngleB:\LengthB/2)$); \pgfmathsetmacro\height{#6*#7}; \begin{scope}[rotate around={\AngleB:(G)},shift={(G)}] -\draw[#1,fill=#1,fill opacity=.3](-.5*\LengthB,0)parabola bend(0,\height)(.5*\LengthB,0)--++(\Angle-\AngleB+90:#5*#7)--($(-.5*\LengthB,0)+(\Angle-\AngleB-90:#4*#7)$)--cycle; +\draw[#1,fill=#1,fill opacity=\fillOpacity](-.5*\LengthB,0)parabola bend(0,\height)(.5*\LengthB,0)--++(\Angle-\AngleB+90:#5*#7)--($(-.5*\LengthB,0)+(\Angle-\AngleB-90:#4*#7)$)--cycle; \end{scope} - +\IfStrEq{\showvalue}{on}{ \StrLeft{#4}{1}[\SA] \IfStrEq{\SA}{-} - {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};} - {\node[NOFILL]at($(C)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#4$};} + {\IfStrEq{\absvalue}{on} + {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#4}{-}$};} + {\node[NOFILL]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};} + } + {\node[NOFILL]at($(C)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#4$};} \StrLeft{#5}{1}[\SB] \IfStrEq{\SB}{-} - {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};} - {\node[NOFILL]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};} + {\IfStrEq{\absvalue}{on} + {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#5}{-}$};} + {\node[NOFILL]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};} + } + {\node[NOFILL]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};} +}{} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Command 13: Beam Deformation (perpendicular) % \BeamDeformP[1]{2}{3}{4}[5]{6}[7]{8} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\BeamDeformP}{O{\fillColor} m m m O{0} m O{0} G{1}}{ -\coordinate(A)at(#2); -\coordinate(B)at(#3); +\coordinate(A)at(#2);\coordinate(B)at(#3); % original cord \pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} \let\Angle\pgfmathresult @@ -399,18 +411,17 @@ EndRotD/.style={start angle=\Angle+90,end angle=\Angle-90,radius=3mm}, \coordinate(D)at($(B)+(\Angle-90:#6*#8)$); \pgfmathanglebetweenpoints{\pgfpointanchor{C}{center}}{\pgfpointanchor{D}{center}} \let\AngleB\pgfmathresult -\draw[#1,line width=.8mm](C)to[out=\AngleB+#5*#8,in=180+\AngleB+#7*#8](D); +\draw[#1,line width=\lineWidth](C)to[out=\AngleB+#5*#8,in=180+\AngleB+#7*#8](D); } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Command 13: Beam Deformation (Rotation Only) % \BeamDeformR[1]{2}{3}[4][5]{6} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewDocumentCommand{\BeamDeformR}{O{\fillColor} m m O{0} O{0} G{1}}{ -\coordinate(A)at(#2); -\coordinate(B)at(#3); +\coordinate(A)at(#2);\coordinate(B)at(#3); % original cord \pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}} \let\Angle\pgfmathresult -\draw[#1,line width=.8mm](A)to[out=\Angle+#4*#6,in=180+\Angle+#5*#6](B); +\draw[#1,line width=\lineWidth](A)to[out=\Angle+#4*#6,in=180+\Angle+#5*#6](B); } \makeatother
\ No newline at end of file |