texlive[66724] Master/texmf-dist: structmech (31mar23)

commits+karl at tug.org commits+karl at tug.org
Fri Mar 31 23:52:32 CEST 2023


Revision: 66724
          http://tug.org/svn/texlive?view=revision&revision=66724
Author:   karl
Date:     2023-03-31 23:52:32 +0200 (Fri, 31 Mar 2023)
Log Message:
-----------
structmech (31mar23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/structmech/README.md
    trunk/Master/texmf-dist/doc/latex/structmech/structmech.pdf
    trunk/Master/texmf-dist/doc/latex/structmech/structmech.tex
    trunk/Master/texmf-dist/tex/latex/structmech/structmech.sty

Modified: trunk/Master/texmf-dist/doc/latex/structmech/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/structmech/README.md	2023-03-31 21:52:20 UTC (rev 66723)
+++ trunk/Master/texmf-dist/doc/latex/structmech/README.md	2023-03-31 21:52:32 UTC (rev 66724)
@@ -17,15 +17,6 @@
 
 ------
 
-**structmech** is a collection of several TikZ commands that allows users to draw basic elements in material/structural mechanics. With one single command, it is capable of drawing member forces, nodal forces/displacements, various boundary conditions, internal force distributions, etc.
+**structmech** is a collection of TikZ commands that allows users to draw basic elements in material/structural mechanics. With one single command, it is capable of drawing member forces, nodal forces/displacements, various boundary conditions, internal force distributions, etc.
 
-Please feel free to redistribute and/or expand the functionality. Please contact me at:
-
-[tlcfem at gmail.com](mailto:tlcfem at gmail.com)
-
-tlc
-
-04/25/2021
-
-
-
+Please feel free to redistribute and/or extend the functionality.

Modified: trunk/Master/texmf-dist/doc/latex/structmech/structmech.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/structmech/structmech.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/structmech/structmech.tex	2023-03-31 21:52:20 UTC (rev 66723)
+++ trunk/Master/texmf-dist/doc/latex/structmech/structmech.tex	2023-03-31 21:52:32 UTC (rev 66724)
@@ -3,13 +3,13 @@
 \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 at gmail.com}{tlcfem at gmail.com}}\\[2mm]\normalsize{}University of Canterbury, Christchurch, NZ}
-\date{\normalsize{}v1.1 released on \today}
+\author{Theodore Chang\footnote{E-mail: \href{tlcfem at gmail.com}{tlcfem at gmail.com}}\\[2mm]\normalsize{}Humboldt-Universität zu Berlin, Berlin, Germany}
+\date{\normalsize{}v1.2 released on \today}
 \newcommand*{\Highlight}[1]{\colorbox{cyan}{\color{red}\texttt{#1}}}
 \begin{document}
 \maketitle
 \section{Introduction}
-This package is under GPL v3 license and/or later version. Please feel free to redistribute, expand or rewrite the functionality.
+This package is under GPL v3 license and/or later versions. Please feel free to redistribute, extend or rewrite the functionality.
 \section{Options}
 To load the package, please use the following command in the preamble.
 \begin{Verbatim}[frame=single,label=Syntax]
@@ -120,7 +120,7 @@
 \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.
+The colours of the 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]{5,0}{8,0}{a}[U_1]
@@ -413,7 +413,7 @@
 \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}
+\IForceB[cyan]{4,0}{0,0}{1.5}{1}{2}{0.5}
 \end{Verbatim}
 \begin{figure}[H]
 \centering
@@ -424,7 +424,7 @@
 \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}
+\IForceB[cyan]{4,0}{0,0}{1.5}{1}{2}{0.5}
 \end{tikzpicture}
 \end{figure}
 \section{Beam Deformation (Perpendicular)}
@@ -483,4 +483,54 @@
 \BeamDeformR[blue]{0,4}{4,4}[20][30]{2}
 \end{tikzpicture}
 \end{figure}
+\section{Dashpot}
+\begin{Verbatim}[frame=single,label=Syntax]
+\Dashpot[1]{2}{3}{4}
+\end{Verbatim}
+\begin{enumerate}
+\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, scale.
+\end{enumerate}
+\begin{Verbatim}[frame=single,label=Example]
+\Dashpot{0,0}{0,3}
+\Dashpot[blue]{2,0}{5,4}{2}
+\setstructmech{linewidth=1mm}
+\Dashpot[purple]{5,0}{10,2}
+\end{Verbatim}
+\begin{figure}[H]
+\centering
+\begin{tikzpicture}
+\Dashpot{0,0}{0,3}
+\Dashpot[blue]{2,0}{5,4}{2}
+\setstructmech{linewidth=1mm}
+\Dashpot[purple]{5,0}{10,2}
+\end{tikzpicture}
+\end{figure}
+\section{Spring}
+\begin{Verbatim}[frame=single,label=Syntax]
+\Spring[1]{2}{3}{4}
+\end{Verbatim}
+\begin{enumerate}
+\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, scale.
+\end{enumerate}
+\begin{Verbatim}[frame=single,label=Example]
+\Spring{0,0}{0,3}
+\Spring[blue]{2,0}{5,4}{2}
+\setstructmech{linewidth=1mm}
+\Spring[purple]{5,0}{10,2}
+\end{Verbatim}
+\begin{figure}[H]
+\centering
+\begin{tikzpicture}
+\Spring{0,0}{0,3}
+\Spring[blue]{2,0}{5,4}{2}
+\setstructmech{linewidth=1mm}
+\Spring[purple]{5,0}{10,2}
+\end{tikzpicture}
+\end{figure}
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/structmech/structmech.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/structmech/structmech.sty	2023-03-31 21:52:20 UTC (rev 66723)
+++ trunk/Master/texmf-dist/tex/latex/structmech/structmech.sty	2023-03-31 21:52:32 UTC (rev 66724)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Copyright (C) 2018-2021 Theodore Chang
+%% Copyright (C) 2018-2023 Theodore Chang
 %%
 %% This program is free software: you can redistribute it and/or modify
 %% it under the terms of the GNU General Public License as published by
@@ -15,10 +15,10 @@
 %% along with this program.  If not, see <http://www.gnu.org/licenses/>.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % structmech: A TikZ command set for structural mechanics drawings
-%                                           v1.1   by   tlc
+%                                           v1.2   by   tlc
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{structmech}[2021/04/25 v1.1 structmech: A TikZ command set for structural mechanics drawings]
+\ProvidesPackage{structmech}[2023/04/01 v1.2 structmech: A TikZ command set for structural mechanics drawings]
 \RequirePackage{ifthen}
 \RequirePackage{kvoptions}
 \RequirePackage{tikz}
@@ -25,7 +25,7 @@
 \RequirePackage{xkeyval}
 \RequirePackage{xparse}
 \RequirePackage{xstring}
-\usetikzlibrary{calc,decorations.pathreplacing,positioning}
+\usetikzlibrary{calc,decorations.pathreplacing,positioning,decorations.pathmorphing}
 \DeclareOptionX<structmech>{fill}[black]{\def\fillColor{#1}}
 \DeclareOptionX<structmech>{line}[black]{\def\lineColor{#1}}
 \DeclareOptionX<structmech>{node}[black]{\def\nodeColor{#1}}
@@ -382,66 +382,37 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NewDocumentCommand{\IForceB}{O{\fillColor} m m m m m G{1}}{
 \coordinate(A)at(#2);\coordinate(B)at(#3);
+\pgfmathsetmacro\height{#6*#7};
+\pgfmathsetmacro\lvla{#4*#7};
+\pgfmathsetmacro\lvlb{#5*#7};
 % 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)$);
-% inclined cord
-\pgfmathanglebetweenpoints{\pgfpointanchor{C}{center}}{\pgfpointanchor{D}{center}}
-\let\AngleB\pgfmathresult
+\coordinate(C)at($(A)+(\Angle+90:\lvla)$);
+\coordinate(D)at($(B)+(\Angle-90:\lvlb)$);
 % original length
 \pgfpointdiff{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}
 \pgfmathparse{veclen(\pgf at x,\pgf at y)/28.45274}
 \let\Length\pgfmathresult
-% inclined length
-\pgfpointdiff{\pgfpointanchor{C}{center}}{\pgfpointanchor{D}{center}}
-\pgfmathparse{veclen(\pgf at x,\pgf at y)/28.45274}
-\let\LengthB\pgfmathresult
-% center of inclined cord
-\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=\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;
+\coordinate(G)at($(A)+(\Angle:\Length/2)$);
+\begin{scope}[rotate around={\Angle:(G)},shift={(G)}]
+\draw[#1,fill=#1,fill opacity=\fillOpacity]plot[domain=-.5*\Length:.5*\Length,samples=100](\x,{\height-4./\Length/\Length*\height*\x*\x-\lvla/\Length*\x-\lvlb/\Length*\x+\lvla/2-\lvlb/2})--(B)--(A)--cycle;
 \end{scope}
 \IfStrEq{\showvalue}{on}{
 \StrLeft{#4}{1}[\SA]
-% \IfStrEq{\SA}{-}
-%     {\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}{-}
-%     {\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$};}
 \IfStrEq{\SA}{-}
-    {\node[NOFILL,\lineColor]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};}
+    {\IfStrEq{\absvalue}{on}
+        {\node[NOFILL,\lineColor]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#4}{-}$};}
+        {\node[NOFILL,\lineColor]at($(C)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#4$};}
+    }
     {\node[NOFILL,\lineColor]at($(C)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#4$};}
-\IfStrEq{#5}{0}{
-	\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};
-}{
-    \StrLeft{#5}{1}[\SB]
-    \IfStrEq{\SB}{-}
-        {\IfStrEq{\absvalue}{on}
-            {\IfStrEq{\SA}{-}
-                {\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};}
-                {\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#5}{-}$};}
-            }
-            {\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};}
-        }
-        {\IfStrEq{\absvalue}{on}
-            {\IfStrEq{\SA}{-}
-                {\node[NOFILL,\lineColor]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$-#5$};}
-                {\node[NOFILL,\lineColor]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};}
-            }
-            {\node[NOFILL,\lineColor]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};}
-        }
-}
+\StrLeft{#5}{1}[\SB]
+\IfStrEq{\SB}{-}
+    {\IfStrEq{\absvalue}{on}
+        {\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$\StrDel[1]{#5}{-}$};}
+        {\node[NOFILL,\lineColor]at($(D)+(\Angle+90:\Length/8)$)[rotate=\Angle]{$#5$};}
+    }
+    {\node[NOFILL,\lineColor]at($(D)+(\Angle-90:\Length/8)$)[rotate=\Angle]{$#5$};}
 }{}
 }
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -470,4 +441,47 @@
 \let\Angle\pgfmathresult
 \draw[#1,line width=\lineWidth](A)to[out=\Angle+#4*#6,in=180+\Angle+#5*#6](B);
 }
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%     Command 14: Dashpot
+% \Dashpot[1]{2}{3}{4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\NewDocumentCommand{\Dashpot}{O{\fillColor} m m G{1}}{
+\coordinate(A)at(#2);\coordinate(B)at(#3);
+% original cord
+\pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}
+\let\Angle\pgfmathresult
+\pgfpointdiff{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}
+\pgfmathparse{veclen(\pgf at x,\pgf at y)/28.45274}
+\let\Length\pgfmathresult
+\pgfmathsetmacro\unitL{#4*\Length/10};
+\coordinate(G)at($(A)+(\Angle:\Length/2)$);
+\begin{scope}[rotate around={\Angle:(G)},shift={(G)}]
+\draw[#1,line width=\lineWidth]
+(-\Length/2,0)--(-.5*\unitL,0)
+(0,0)--(\Length/2,0)
+(0,-.5*\unitL)--++(0,\unitL)
+(.5*\unitL,\unitL)--++(-\unitL,0)--++(0,-2*\unitL)--++(\unitL,0);
+\end{scope}
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%     Command 15: Spring
+% \Spring[1]{2}{3}{4}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\NewDocumentCommand{\Spring}{O{\fillColor} m m G{1}}{
+\coordinate(A)at(#2);\coordinate(B)at(#3);
+% original cord
+\pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}
+\let\Angle\pgfmathresult
+\pgfpointdiff{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}
+\pgfmathparse{veclen(\pgf at x,\pgf at y)/28.45274}
+\let\Length\pgfmathresult
+\pgfmathsetmacro\unitL{#4*\Length/10};
+\coordinate(G)at($(A)+(\Angle:\Length/2)$);
+\begin{scope}[rotate around={\Angle:(G)},shift={(G)}]
+\draw[#1,line width=\lineWidth]
+(-\Length/2,0)--(-2*\unitL,0)
+(2*\unitL,0)--(\Length/2,0);
+\draw[#1,line width=\lineWidth,decorate,decoration={zigzag,segment length=3mm, amplitude=1mm}](-2*\unitL,0)--(2*\unitL,0);
+\end{scope}
+}
 \makeatother
\ No newline at end of file



More information about the tex-live-commits mailing list.