├── .gitignore ├── LICENSE ├── Makefile ├── README.rst ├── example.pdf ├── example.tex ├── figure-01.png ├── figure-02.png ├── stanli.pdf ├── stanli.sty └── stanli.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.acn 2 | *.acr 3 | *.alg 4 | *.aux 5 | *.bbl 6 | *.blg 7 | *.dvi 8 | *.fdb_latexmk 9 | *.glg 10 | *.glo 11 | *.gls 12 | *.idx 13 | *.ilg 14 | *.ind 15 | *.ist 16 | *.lof 17 | *.log 18 | *.lot 19 | *.maf 20 | *.mtc 21 | *.mtc0 22 | *.nav 23 | *.nlo 24 | *.out 25 | *.pdfsync 26 | *.ps 27 | *.snm 28 | *.synctex.gz 29 | *.toc 30 | *.vrb 31 | *.xdy 32 | *.tdo 33 | /auto/stanli.el 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | TikZ Library for Structural Analysis, Version 2.0, 2013 2 | 3 | This program is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | targets = stanli.pdf example.pdf 3 | 4 | default: $(targets) 5 | 6 | %.pdf: %.tex stanli.sty 7 | pdflatex $< 8 | pdflatex $< 9 | [ ! -e $(basename $<).ind ] || makeindex $(basename $<) 10 | pdflatex $< 11 | 12 | clean: 13 | rm -f *.aux *.idx *.ilg *.ind *.log *.toc *.out 14 | rm -f *~ 15 | rm -f \#* 16 | 17 | clean+reset: clean git-reset-pdfs 18 | 19 | git-reset-pdfs: $(targets) 20 | git checkout-index -f $^ 21 | 22 | ifdef FORCE 23 | .PHONY: stanli.tex example.tex 24 | endif 25 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ************************************ 2 | TikZ Library for Structural Analysis 3 | ************************************ 4 | 5 | :Date: 20 Dec 2016 6 | :Authors: Jürgen Hackl 7 | :Contact: hackl.j@gmx.at 8 | :Web site: https://github.com/hackl/TikZ-StructuralAnalysis/ 9 | :Documentation: https://ctan.org/pkg/stanli 10 | :Copyright: This document has been placed in the public domain. 11 | :License: GNU General Public Licence. 12 | :Version: 2.0 13 | 14 | 15 | Purpose 16 | ======= 17 | 18 | At university it is always a very time consuming work to create new 19 | assignments, and tests; especially when those tasks include drawing graphics. 20 | 21 | 22 | In the field of structural engineering those small structures are a key part 23 | for teaching. For this reason I developed, in cooperation with the 24 | `Institute for Structural Analysis`_ at the `Graz University of Technology`_, a TikZ library for Structural Analysis. 25 | 26 | 27 | 28 | There are two different types of libraries available: one for 2D structures 29 | and one for 3D structures, both provided by the ``stanli.sty`` package. 30 | In the following article only the 2D library 31 | will be discussed, but the principles and methods are the same for 3D 32 | structures, as shown in the example at the end of this document. 33 | 34 | 35 | 36 | Principles 37 | ========== 38 | 39 | TikZ is a very powerful tool; however, unfortunately not everyone is used to this part of LaTeX. Therefore, in addition to the creation of the library the second goal was to keep the usage as simple as possible. So that: 40 | 41 | * anyone can use this library without (deeper) knowledge in TikZ 42 | * skilled users can easily modify and customise the code 43 | * the principle of this library can be used for any other library 44 | 45 | 46 | Getting Started 47 | =============== 48 | 49 | Installation 50 | ------------ 51 | 52 | Clone this (or a forked version of this) repository. :: 53 | 54 | $ cd ~ 55 | $ git clone https://github.com/hackl/TikZ-StructuralAnalysis.git 56 | 57 | Put the .sty file in the right directory and add it to the LaTeX file like: :: 58 | 59 | \usepackage{stanli} 60 | 61 | Note 62 | ---- 63 | 64 | The liberaries is also available via `CTAN`_ ! 65 | 66 | LaTeX Environment 67 | ----------------- 68 | 69 | Like every TikZ graph, needs also this library the :: 70 | 71 | \begin{tikzpicture} 72 | ... 73 | \end{tikzpicture} 74 | 75 | environment. 76 | 77 | 78 | Elements 79 | ======== 80 | 81 | Basic Commands 82 | -------------- 83 | 84 | The library provides 10 different commands: 85 | 86 | * ``\point`` 87 | * ``\beam`` 88 | * ``\support`` 89 | * ``\hinge`` 90 | * ``\load`` or ``\lineload`` and ``\temperature`` 91 | * ``\internalforces`` 92 | * ``\dimensioning`` 93 | * ``\influenceline`` 94 | * ``\notation`` 95 | * ``\addon`` 96 | 97 | For each element (command) are different options available. Obligatory options 98 | are marked with {curley brackets} and optional values are marked with [square 99 | brackets]. The first type is a must have criteria. In contrast, the optional 100 | input is not required to be entered. 101 | 102 | An easy example is the following single force: :: 103 | 104 | \load{type}{insertion point}[rotation][length or included angle][loaddistance]; 105 | 106 | 107 | Manual 108 | ------ 109 | 110 | More specific information about the elements and their options can be found in 111 | the manual. The manual is written in German, but section 1 provides a table 112 | with all elements and options; furthermore, the code is also given for each 113 | picture in the manual. 114 | 115 | 116 | Examples 117 | ======== 118 | 119 | The easiest way to create a structure is the list above, starting with ``\point`` 120 | and ending with ``\addon``. 121 | 122 | 123 | The following examples shall give a first impression how drawings can be 124 | generated. In the manual both examples are explained in detail. 125 | 126 | 2D Simplified Roof 127 | ------------------ 128 | 129 | By using the 2D library, the following graph can be created 130 | in a very short time: :: 131 | 132 | \begin{tikzpicture} 133 | \scaling{.65}; 134 | 135 | \point{a}{0}{1}; 136 | \point{b}{3}{1}; 137 | \point{c}{11}{3}; 138 | \point{d}{19}{1}; 139 | \point{e}{22}{1}; 140 | \point{f}{3}{0}; 141 | \point{g}{11}{-2}; 142 | \point{h}{19}{0}; 143 | 144 | \beam{1}{a}{b}[0][1]; 145 | \beam{1}{b}{c}[1][1]; 146 | \beam{1}{c}{d}[1][1]; 147 | \beam{1}{d}{e}[1][0]; 148 | \beam{1}{f}{b}; 149 | \beam{1}{d}{h}; 150 | \beam{2}{f}{g}; 151 | \beam{2}{g}{h}; 152 | \beam{2}{g}{c}; 153 | 154 | \support{1}{f}; 155 | \support{2}{h}; 156 | 157 | \hinge{1}{f}; 158 | \hinge{1}{h}; 159 | \hinge{1}{g}; 160 | \hinge{2}{c}[b][d]; 161 | 162 | \lineload{2}{a}{b}[1][1][.5]; 163 | \lineload{2}{b}{c}; 164 | 165 | \dimensioning{1}{a}{b}{-2.5}[$3.0$]; 166 | \dimensioning{1}{b}{c}{-2.5}[$8.0$]; 167 | \dimensioning{1}{c}{d}{-2.5}[$8.0$]; 168 | \dimensioning{1}{d}{e}{-2.5}[$3.0$]; 169 | \dimensioning{2}{f}{a}{-1}[$1.0$]; 170 | \dimensioning{2}{g}{f}{-1}[$2.0$]; 171 | \dimensioning{2}{a}{c}{-1}[$2.0$]; 172 | 173 | \influenceline{a}{e}{3}[.3]; 174 | 175 | \notation{1}{a}{$1$}[left]; 176 | \notation{1}{b}{$2$}[below right=2mm]; 177 | \notation{1}{c}{$3$}; 178 | \notation{1}{d}{$4$}[above]; 179 | \notation{1}{e}{$5$}[above]; 180 | \notation{1}{f}{$6$}[left=2mm]; 181 | \notation{1}{g}{$7$}[below=2mm]; 182 | \notation{1}{h}{$8$}[right=2mm]; 183 | \notation{4}{f}{g}[$S$]; 184 | 185 | \end{tikzpicture} 186 | 187 | 188 | .. image:: https://github.com/hackl/TikZ-StructuralAnalysis/blob/master/figure-01.png 189 | 190 | 191 | 3D Support Construction 192 | ----------------------- 193 | 194 | By using the 3D library, the following graph can be created 195 | in a very short time: :: 196 | 197 | \setcoords{-25}{10}[1][1.2] 198 | \setaxis{2} 199 | %\showpoint 200 | \begin{tikzpicture}[coords] 201 | 202 | \dpoint{a}{0}{0}{0}; 203 | \dpoint{b}{3}{0}{0}; 204 | \dpoint{c}{6}{0}{0}; 205 | \dpoint{d}{9}{0}{0}; 206 | \dpoint{e}{12}{0}{0}; 207 | \dpoint{f}{0}{3}{0}; 208 | \dpoint{g}{3}{3}{0}; 209 | \dpoint{h}{6}{3}{0}; 210 | \dpoint{i}{9}{3}{0}; 211 | \dpoint{j}{12}{3}{0}; 212 | 213 | \daxis{1}{a}; 214 | 215 | \dbeam{1}{f}{b}; 216 | \dbeam{1}{b}{h}; 217 | \dbeam{1}{h}{d}; 218 | \dbeam{1}{d}{j}; 219 | \dbeam{3}{a}{e}; 220 | \dbeam{3}{f}{j}; 221 | \dbeam{3}{a}{f}; 222 | \dbeam{3}{b}{g}; 223 | \dbeam{3}{c}{h}; 224 | \dbeam{3}{d}{i}; 225 | \dbeam{3}{e}{j}; 226 | 227 | \dsupport{1}{b}; 228 | \dsupport{1}{h}[0][0]; 229 | \dsupport{1}{d}[0]; 230 | 231 | \dhinge{2}{b}[f][h][1]; 232 | \dhinge{2}{h}[b][d][1]; 233 | \dhinge{2}{d}[h][j][1]; 234 | 235 | \dlineload{5}{0}{f}{b}[.5][.5][.11]; 236 | \dlineload{5}{0}{b}{h}[.5][.5][.11]; 237 | \dlineload{5}{0}{h}{d}[.5][.5][.11]; 238 | \dlineload{5}{0}{d}{j}[.5][.5][.11]; 239 | 240 | \ddimensioning{xy}{f}{g}{4.5}[$3$\,m]; 241 | \ddimensioning{xy}{g}{h}{4.5}[$3$\,m]; 242 | \ddimensioning{xy}{h}{i}{4.5}[$3$\,m]; 243 | \ddimensioning{xy}{i}{j}{4.5}[$3$\,m]; 244 | \ddimensioning{yx}{e}{j}{13}[$3$\,m]; 245 | 246 | \dnotation{1}{f}{$q=10$\,kN/m}[above left=3mm]; 247 | \dnotation{1}{b}{$A$}[below left]; 248 | \dnotation{1}{h}{$C$}[right=2mm]; 249 | \dnotation{1}{d}{$B$}[below left]; 250 | 251 | \end{tikzpicture} 252 | 253 | .. image:: https://github.com/hackl/TikZ-StructuralAnalysis/blob/master/figure-02.png 254 | 255 | List of References 256 | ================== 257 | 258 | [Hackl2011a] Hackl, J.: Manual TikZ Library for Structural Analysis, Graz University of Technology, `Institute for Structural Analysis`_, Graz, 2011. 259 | 260 | [Hackl2011b] Hackl, J.: Manual TikZ 3D Library for Structural Analysis, Graz University of Technology, `Institute for Structural Analysis`_, Graz, 2011. 261 | 262 | 263 | 264 | .. _`Institute for Structural Analysis`: http://portal.tugraz.at/portal/page/portal/TU_Graz/Einrichtungen/Institute/i2020 265 | 266 | .. _`Graz University of Technology`: http://tugraz.at/ 267 | 268 | .. _`CTAN`: https://ctan.org/pkg/stanli 269 | -------------------------------------------------------------------------------- /example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackl/TikZ-StructuralAnalysis/eb3b560e99e21288ee178a18df48a707604cab3c/example.pdf -------------------------------------------------------------------------------- /example.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,10pt]{scrartcl} 2 | 3 | \usepackage[utf8]{inputenc} 4 | \usepackage{stanli} 5 | 6 | \setlength{\paperheight}{30cm} 7 | \setlength{\textheight}{24.5cm} 8 | \setlength{\paperwidth}{21cm} 9 | \setlength{\textwidth}{16.8cm} 10 | \setlength{\oddsidemargin}{-0.3cm} 11 | \setlength{\evensidemargin}{-0.3cm} 12 | \setlength{\parindent}{0cm} 13 | \setlength{\topmargin}{-1.9cm} 14 | \setlength{\headsep}{1.3cm} 15 | \setlength{\footskip}{1.5cm} 16 | 17 | \begin{document} 18 | 19 | \vspace*{2cm} 20 | 21 | \begin{tikzpicture} 22 | \scaling{.65}; 23 | 24 | \point{a}{0}{1}; 25 | \point{b}{3}{1}; 26 | \point{c}{11}{3}; 27 | \point{d}{19}{1}; 28 | \point{e}{22}{1}; 29 | \point{f}{3}{0}; 30 | \point{g}{11}{-2}; 31 | \point{h}{19}{0}; 32 | 33 | \beam{1}{a}{b}[0][1]; 34 | \beam{1}{b}{c}[1][1]; 35 | \beam{1}{c}{d}[1][1]; 36 | \beam{1}{d}{e}[1][0]; 37 | \beam{1}{f}{b}; 38 | \beam{1}{d}{h}; 39 | \beam{2}{f}{g}; 40 | \beam{2}{g}{h}; 41 | \beam{2}{g}{c}; 42 | 43 | \support{1}{f}; 44 | \support{2}{h}; 45 | 46 | \hinge{1}{f}; 47 | \hinge{1}{h}; 48 | \hinge{1}{g}; 49 | \hinge{2}{c}[b][d]; 50 | 51 | \lineload{2}{a}{b}[1][1][.5]; 52 | \lineload{2}{b}{c}; 53 | 54 | \dimensioning{1}{a}{b}{-2.5}[$3.0$]; 55 | \dimensioning{1}{b}{c}{-2.5}[$8.0$]; 56 | \dimensioning{1}{c}{d}{-2.5}[$8.0$]; 57 | \dimensioning{1}{d}{e}{-2.5}[$3.0$]; 58 | \dimensioning{2}{f}{a}{-1}[$1.0$]; 59 | \dimensioning{2}{g}{f}{-1}[$2.0$]; 60 | \dimensioning{2}{a}{c}{-1}[$2.0$]; 61 | 62 | \influenceline{a}{e}{3}[.3]; 63 | 64 | \notation{1}{a}{$1$}[left]; 65 | \notation{1}{b}{$2$}[below right=2mm]; 66 | \notation{1}{c}{$3$}; 67 | \notation{1}{d}{$4$}[above]; 68 | \notation{1}{e}{$5$}[above]; 69 | \notation{1}{f}{$6$}[left=2mm]; 70 | \notation{1}{g}{$7$}[below=2mm]; 71 | \notation{1}{h}{$8$}[right=2mm]; 72 | 73 | \notation{4}{f}{g}[$S$]; 74 | 75 | \end{tikzpicture} 76 | 77 | \vspace{5cm} 78 | 79 | \setcoords{-25}{10}[1][1.2] 80 | \setaxis{2} 81 | %\showpoint 82 | \begin{tikzpicture}[coords] 83 | 84 | \dpoint{a}{0}{0}{0}; 85 | \dpoint{b}{3}{0}{0}; 86 | \dpoint{c}{6}{0}{0}; 87 | \dpoint{d}{9}{0}{0}; 88 | \dpoint{e}{12}{0}{0}; 89 | \dpoint{f}{0}{3}{0}; 90 | \dpoint{g}{3}{3}{0}; 91 | \dpoint{h}{6}{3}{0}; 92 | \dpoint{i}{9}{3}{0}; 93 | \dpoint{j}{12}{3}{0}; 94 | 95 | \daxis{1}{a}; 96 | 97 | \dbeam{1}{f}{b}; 98 | \dbeam{1}{b}{h}; 99 | \dbeam{1}{h}{d}; 100 | \dbeam{1}{d}{j}; 101 | \dbeam{3}{a}{e}; 102 | \dbeam{3}{f}{j}; 103 | \dbeam{3}{a}{f}; 104 | \dbeam{3}{b}{g}; 105 | \dbeam{3}{c}{h}; 106 | \dbeam{3}{d}{i}; 107 | \dbeam{3}{e}{j}; 108 | 109 | \dsupport{1}{b}; 110 | \dsupport{1}{h}[0][0]; 111 | \dsupport{1}{d}[0]; 112 | 113 | \dhinge{2}{b}[f][h][1]; 114 | \dhinge{2}{h}[b][d][1]; 115 | \dhinge{2}{d}[h][j][1]; 116 | 117 | \dlineload{5}{0}{f}{b}[.5][.5][.11]; 118 | \dlineload{5}{0}{b}{h}[.5][.5][.11]; 119 | \dlineload{5}{0}{h}{d}[.5][.5][.11]; 120 | \dlineload{5}{0}{d}{j}[.5][.5][.11]; 121 | 122 | \ddimensioning{xy}{f}{g}{4.5}[$3$\,m]; 123 | \ddimensioning{xy}{g}{h}{4.5}[$3$\,m]; 124 | \ddimensioning{xy}{h}{i}{4.5}[$3$\,m]; 125 | \ddimensioning{xy}{i}{j}{4.5}[$3$\,m]; 126 | \ddimensioning{yx}{e}{j}{13}[$3$\,m]; 127 | 128 | \dnotation{1}{f}{$q=10$\,kN/m}[above left=3 129 | mm]; 130 | \dnotation{1}{b}{$A$}[below left]; 131 | \dnotation{1}{h}{$C$}[right=2mm]; 132 | \dnotation{1}{d}{$B$}[below left]; 133 | 134 | \end{tikzpicture} 135 | 136 | \end{document} 137 | 138 | %%% Local Variables: 139 | %%% mode: latex 140 | %%% TeX-master: t 141 | %%% End: 142 | -------------------------------------------------------------------------------- /figure-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackl/TikZ-StructuralAnalysis/eb3b560e99e21288ee178a18df48a707604cab3c/figure-01.png -------------------------------------------------------------------------------- /figure-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackl/TikZ-StructuralAnalysis/eb3b560e99e21288ee178a18df48a707604cab3c/figure-02.png -------------------------------------------------------------------------------- /stanli.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackl/TikZ-StructuralAnalysis/eb3b560e99e21288ee178a18df48a707604cab3c/stanli.pdf -------------------------------------------------------------------------------- /stanli.sty: -------------------------------------------------------------------------------- 1 | %============================================================================= 2 | % File: stanli.tex -- Structural Analysis Library based on PGF/TikZ 3 | % Author(s): Juergen Hackl 4 | % Creation: 21 Dec 2016 5 | % Time-stamp: 6 | % Version: 3.0 (2016-12-21) 7 | % 8 | % Copyright (c) 2016 Juergen Hackl 9 | % 10 | % More information on LaTeX: http://www.latex-project.org/ 11 | %============================================================================= 12 | 13 | %================================================ 14 | % use Package 15 | %================================================ 16 | 17 | \NeedsTeXFormat{LaTeX2e} 18 | \ProvidesPackage{stanli} 19 | 20 | % 21 | %================================================ 22 | % use Package 23 | %================================================ 24 | % 25 | \RequirePackage{ifthen} 26 | \RequirePackage{tikz} 27 | \RequirePackage{xargs} 28 | \usetikzlibrary{shapes,arrows} 29 | \usetikzlibrary{positioning} 30 | \usepackage{verbatim} 31 | \usetikzlibrary{automata} 32 | \usetikzlibrary{arrows} 33 | \usetikzlibrary{calc,3d} 34 | \usetikzlibrary{% 35 | decorations.pathreplacing,% 36 | decorations.pathmorphing% 37 | } 38 | \usetikzlibrary{patterns} 39 | 40 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41 | % 2D Structural Analysis Library base on TikZ 42 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 43 | 44 | %================================================ 45 | % some conditionals 46 | % ================================================ 47 | 48 | % Conditional to check validity of command type option 49 | \newif\ifSTNL@ValidCommandTypeOption 50 | 51 | % 52 | %================================================ 53 | % some variables 54 | %================================================ 55 | % 56 | 57 | %------------------------------------------------ 58 | % colors 59 | %------------------------------------------------ 60 | 61 | \newcommand{\pathdrawcolor}{black} % 62 | \newcommand{\pathfillcolor}{white} % 63 | \newcommand{\colorGray}{gray} % 64 | 65 | %------------------------------------------------ 66 | % line widths 67 | %------------------------------------------------ 68 | 69 | \newcommand{\hugeLineWidth}{2pt} % 70 | \newcommand{\bigLineWidth}{1.5pt} % 71 | \newcommand{\normalLineWidth}{1pt} % 72 | \newcommand{\smallLineWidth}{.7pt} % 73 | \newcommand{\tinyLineWidth}{.3pt} % 74 | 75 | %------------------------------------------------ 76 | % construction parameters 77 | %------------------------------------------------ 78 | 79 | \newcommand{\scalingParameter}{1} % 80 | 81 | \newcommand{\hingeRadius}{1.5mm} % 82 | \newcommand{\hingeAxialLength}{5mm} % 83 | \newcommand{\hingeAxialHeight}{3mm} % 84 | \newcommand{\hingeCornerLength}{3mm} % 85 | 86 | \newcommand{\hatchingAngle}{45} % 87 | \newcommand{\hatchingAmplitude}{1.1cm} % 88 | \newcommand{\hatchingLength}{1.5mm} % 89 | 90 | \newcommand{\springLength}{10mm} % 91 | \newcommand{\springPreLength}{7pt} % 92 | \newcommand{\springPostLength}{3pt} % 93 | \newcommand{\springAmplitude}{2.5mm} % 94 | \newcommand{\springSegmentLength}{5pt} % 95 | \newcommand{\springCoilLength}{10mm} % 96 | \newcommand{\springCoilPreLength}{3pt} % 97 | \newcommand{\springCoilPostLength}{1pt} % 98 | \newcommand{\springCoilAmplitude}{2.5mm} % 99 | \newcommand{\springCoilSegmentLength}{3pt} % 100 | 101 | \newcommand{\supportGap}{1mm} % 102 | \newcommand{\supportBasicLength}{12mm} % 103 | \newcommand{\supportBasicHeight}{3.5mm} % 104 | \newcommand{\supportLength}{8mm} % 105 | \newcommand{\supportHeight}{5mm} % 106 | \newcommand{\supportHatchingLength}{20mm} % 107 | \newcommand{\supportHatchingHeight}{5mm} % 108 | \newcommand{\springTorsionRadius}{6mm} % Maximum radius of torsional spring 109 | 110 | \newcommand{\barGap}{1.5mm} % 111 | \newcommand{\barAngle}{45} % 112 | 113 | %------------------------------------------------ 114 | % load parameters 115 | %------------------------------------------------ 116 | 117 | \newcommand{\forceDistance}{1.5mm} % 118 | \newcommand{\forceLength}{10mm} % 119 | \newcommand{\momentDistance}{4mm} % 120 | \newcommand{\momentAngle}{270} % 121 | \newcommand{\lineloadDistance}{3mm} % 122 | \newcommand{\lineloadForce}{0.15} % 123 | \newcommand{\lineloadInterval}{0.2} % 124 | 125 | %------------------------------------------------ 126 | % temperature parameters 127 | %------------------------------------------------ 128 | 129 | \newcommand{\temperatureHeight}{6mm} % 130 | 131 | %------------------------------------------------ 132 | % dimensioning parameters 133 | %------------------------------------------------ 134 | 135 | \newcommand{\dimensioningBar}{4mm} % 136 | 137 | 138 | %------------------------------------------------ 139 | % help values 140 | %------------------------------------------------ 141 | 142 | \newcommand{\helpVarA}{1} % 143 | \newcommand{\helpVarB}{1} % 144 | 145 | % 146 | %================================================ 147 | % new tikz styles 148 | %================================================ 149 | % 150 | 151 | %------------------------------------------------ 152 | % line styles 153 | %------------------------------------------------ 154 | 155 | \tikzstyle{hugeLine}=[line width=\hugeLineWidth,] 156 | \tikzstyle{bigLine}=[line width=\bigLineWidth,] 157 | \tikzstyle{normalLine}=[line width=\normalLineWidth,] 158 | \tikzstyle{smallLine}=[line width=\smallLineWidth,] 159 | \tikzstyle{tinyLine}=[line width=\tinyLineWidth,] 160 | 161 | %------------------------------------------------ 162 | % beam styles 163 | %------------------------------------------------ 164 | 165 | \tikzset{ 166 | bendingbeam_line/.style args = {#1}{ 167 | line width=#1, 168 | }, 169 | bendingbeam_line/.default=\hugeLineWidth 170 | } 171 | 172 | %------------------------------------------------ 173 | % spring styles 174 | %------------------------------------------------ 175 | 176 | \tikzstyle{spring} = [ 177 | normalLine, 178 | decoration= 179 | { 180 | zigzag, 181 | pre length=\springPreLength, 182 | post length=\springPostLength, 183 | segment length=\springSegmentLength, 184 | amplitude=\springAmplitude 185 | }, 186 | decorate, 187 | ] 188 | 189 | \tikzstyle{coilspring} = [ 190 | normalLine, 191 | decoration= 192 | { 193 | coil, 194 | pre length=\springCoilPreLength, 195 | post length=\springCoilPostLength, 196 | segment length=\springCoilSegmentLength, 197 | amplitude=\springCoilAmplitude 198 | }, 199 | decorate, 200 | ] 201 | 202 | %------------------------------------------------ 203 | % hatch style 204 | %------------------------------------------------ 205 | 206 | \tikzstyle{hatching} = [ 207 | tinyLine, 208 | draw, 209 | decorate, 210 | decoration= 211 | { 212 | border, 213 | angle=\hatchingAngle, 214 | amplitude=\hatchingAmplitude, 215 | segment length=\hatchingLength 216 | } 217 | ] 218 | 219 | %------------------------------------------------ 220 | % hatch style for torsional spring 221 | %------------------------------------------------ 222 | 223 | \tikzstyle{hatchingspring} = [ 224 | tinyLine, 225 | draw, 226 | decorate, 227 | decoration= 228 | { 229 | border, 230 | angle=\hatchingAngle, 231 | amplitude=\hatchingAmplitude/2, 232 | segment length=\hatchingLength/2 233 | } 234 | ] 235 | 236 | %------------------------------------------------ 237 | % force style 238 | %------------------------------------------------ 239 | 240 | \tikzstyle{force}=[>=latex,normalLine] 241 | 242 | % 243 | %================================================ 244 | % library elements 245 | %================================================ 246 | % 247 | 248 | %------------------------------------------------ 249 | % scaling 250 | %------------------------------------------------ 251 | % \scaling{scaling value} 252 | % 253 | 254 | \newcommandx{\scaling}[1]{ 255 | \renewcommand{\scalingParameter}{#1} 256 | } 257 | 258 | %------------------------------------------------ 259 | % point 260 | %------------------------------------------------ 261 | % \point{name}{x-coordinate}{y-coordinate} 262 | % 263 | 264 | \newcommandx{\point}[3]{ 265 | \node[coordinate][ 266 | shift={({#2*\scalingParameter},{#3*\scalingParameter})}](#1){}; 267 | } 268 | 269 | %------------------------------------------------ 270 | % axis 271 | %------------------------------------------------ 272 | % \axis[1st axis length][2nd axis length]{point}{angle}{1st axis label}{2nd axis label}[1st label position][2nd label position] 273 | \newcommandx{\axis}[8][1=1, 2=1, 7=centered, 8=centered, usedefault]{ 274 | \tikzmath{ 275 | \axisAng = #4; 276 | \axisHorXCoord = cos(\axisAng)*#1*\scalingParameter; 277 | \axisHorYCoord = sin(\axisAng)*#1*\scalingParameter; 278 | \axisVertXCoord = -sin(\axisAng)*#2*\scalingParameter; 279 | \axisVertYCoord = cos(\axisAng)*#2*\scalingParameter; 280 | } 281 | \ifthenelse{\equal{#7}{centered}\AND\equal{#8}{centered}} 282 | { 283 | \ifthenelse{{\axisAng = 315}\OR{\axisAng > 315}\OR{\axisAng < 45}} 284 | { 285 | \tikzmath{ 286 | \axisHorLblPos = "below"; 287 | \axisVertLblPos = "left"; 288 | } 289 | } 290 | { 291 | \ifthenelse{{\axisAng = 45}\OR{\axisAng > 45}\AND{\axisAng < 135}} 292 | { 293 | \tikzmath{ 294 | \axisHorLblPos = "right"; 295 | \axisVertLblPos = "below"; 296 | } 297 | } 298 | { 299 | \ifthenelse{{\axisAng = 135}\OR{\axisAng > 135}\AND{\axisAng < 225}} 300 | { 301 | \tikzmath{ 302 | \axisHorLblPos = "above"; 303 | \axisVertLblPos = "right"; 304 | } 305 | } 306 | { 307 | \tikzmath{ 308 | \axisHorLblPos = "left"; 309 | \axisVertLblPos = "above"; 310 | } 311 | } 312 | } 313 | } 314 | } 315 | { 316 | \tikzmath{ 317 | \axisHorLblPos = "#7"; 318 | \axisVertLblPos = "#8"; 319 | } 320 | } 321 | \draw[->,axisarrow] (#3) --++ (\axisHorXCoord,\axisHorYCoord)node[\axisHorLblPos] {#5}; 322 | \draw[->,axisarrow] (#3) --++ (\axisVertXCoord,\axisVertYCoord)node[\axisVertLblPos] {#6}; 323 | \fill (#3) circle (\normalLineWidth/2); 324 | } 325 | 326 | %------------------------------------------------ 327 | % beam 328 | %------------------------------------------------ 329 | % \beam{type}{initial point}{end point}[rounded initial point][rounded end point] 330 | 331 | \newcommandx{\beam}[5][4=0,5=0]{ 332 | \global\STNL@ValidCommandTypeOptionfalse 333 | \ifthenelse{\equal{#1}{1}}{ % bending beam - with characteristic fiber 334 | \draw [bendingbeam_line] (#2) -- (#3); 335 | \coordinate (barVarA) at ($ (#2)!\barGap!-\barAngle:(#3) $); 336 | \coordinate (barVarB) at ($ (#3)!\barGap!\barAngle:(#2) $); 337 | \draw [smallLine,dashed] (barVarA) -- (barVarB); 338 | \ifthenelse{\equal{#4}{0}}{} 339 | {\fill (#2) circle (\hugeLineWidth/2);} 340 | \ifthenelse{\equal{#5}{0}}{} 341 | {\fill (#3) circle (\hugeLineWidth/2);} 342 | \global\STNL@ValidCommandTypeOptiontrue 343 | }{} 344 | 345 | \ifthenelse{\equal{#1}{2}}{ % Truss rod 346 | \draw [bigLine] (#2) -- (#3); 347 | \ifthenelse{\equal{#4}{0}}{} 348 | {\fill (#2) circle (\bigLineWidth/2);} 349 | \ifthenelse{\equal{#5}{0}}{} 350 | {\fill (#3) circle (\bigLineWidth/2);} 351 | \global\STNL@ValidCommandTypeOptiontrue 352 | }{} 353 | 354 | \ifthenelse{\equal{#1}{3}}{ % Invisible (dashed) member 355 | \draw [normalLine,dashed] (#2) -- (#3); 356 | \global\STNL@ValidCommandTypeOptiontrue 357 | }{} 358 | 359 | \ifthenelse{\equal{#1}{4}}{ % bending beam - no characteristic fiber 360 | \draw [bendingbeam_line] (#2) -- (#3); 361 | \ifthenelse{\equal{#4}{0}}{} 362 | {\fill (#2) circle (\hugeLineWidth/2);} 363 | \ifthenelse{\equal{#5}{0}}{} 364 | {\fill (#3) circle (\hugeLineWidth/2);} 365 | \global\STNL@ValidCommandTypeOptiontrue 366 | }{} 367 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::beam: Bad type: #1}\errorstopmode} 368 | } 369 | 370 | %------------------------------------------------ 371 | % support 372 | %------------------------------------------------ 373 | % \support{type}{insertion point}[rotation] 374 | % 375 | 376 | \newcommandx{\support}[3][3=0]{ 377 | \global\STNL@ValidCommandTypeOptionfalse 378 | \ifthenelse{\equal{#1}{1}}{ % 379 | \begin{scope}[rotate around={#3:(#2)}] 380 | \draw [normalLine] (#2) 381 | -- ++(\supportLength/2,-\supportHeight-\supportGap) 382 | -- ++(-\supportLength,0) -- cycle; 383 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$) 384 | -- ++(-\supportBasicLength,0); 385 | \clip 386 | ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-\supportGap)$) 387 | rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$); 388 | \draw[hatching] 389 | ($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-\supportGap)$) 390 | -- ++(-\supportHatchingLength,0); 391 | \end{scope} 392 | \global\STNL@ValidCommandTypeOptiontrue 393 | }{} 394 | 395 | % 2*: Floating bearings. 396 | \ifthenelse{\equal{#1}{2}}{ % 2: Basic representation with slider 397 | \begin{scope}[rotate around={#3:(#2)}] 398 | \draw [normalLine] (#2) -- ++(\supportLength/2,-\supportHeight) -- ++(-\supportLength,0) -- cycle; 399 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight)$) -- ++(-\supportBasicLength,0); 400 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$) -- ++(-\supportBasicLength,0); 401 | \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$); 402 | \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-\supportGap)$) -- ++(-\supportHatchingLength,0); 403 | \end{scope} 404 | \global\STNL@ValidCommandTypeOptiontrue 405 | }{} 406 | 407 | \ifthenelse{\equal{#1}{2oo}}{ % 2oo: Floating bearing with two rollers (Note: letter "o" not zero "0") 408 | \begin{scope}[rotate around={#3:(#2)}] 409 | \draw [normalLine] (#2) 410 | -- ++(\supportLength/2,-\supportHeight+\supportGap) 411 | -- ++(-\supportLength,0) 412 | -- cycle; 413 | \draw[normalLine, fill=white] 414 | ($(#2)+(\supportBasicLength/5,-\supportHeight)$) 415 | circle (0.9*\supportGap); 416 | \draw[normalLine, fill=white] 417 | ($(#2)+(-\supportBasicLength/5,-\supportHeight)$) 418 | circle (0.9*\supportGap); 419 | \draw [normalLine] 420 | ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$) 421 | -- ++(-\supportBasicLength,0); 422 | \clip 423 | ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-\supportGap)$) 424 | rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$); 425 | \draw[hatching] 426 | ($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-\supportGap)$) 427 | -- ++(-\supportHatchingLength,0); 428 | \end{scope} 429 | \global\STNL@ValidCommandTypeOptiontrue 430 | }{} 431 | 432 | \ifthenelse{\equal{#1}{2oowh}}{ % 2oowh: Floating bearing with two rollers MOD: without hatching (Note: letter "o" not zero "0") 433 | \begin{scope}[rotate around={#3:(#2)}] 434 | \draw [normalLine] (#2) 435 | -- ++(\supportLength/2,-\supportHeight+\supportGap) 436 | -- ++(-\supportLength,0) 437 | -- cycle; 438 | \draw[normalLine, fill=white] 439 | ($(#2)+(\supportBasicLength/5,-\supportHeight)$) 440 | circle (0.9*\supportGap); 441 | \draw[normalLine, fill=white] 442 | ($(#2)+(-\supportBasicLength/5,-\supportHeight)$) 443 | circle (0.9*\supportGap); 444 | \end{scope} 445 | \global\STNL@ValidCommandTypeOptiontrue 446 | }{} 447 | 448 | \ifthenelse{\equal{#1}{2ooo}}{ % 2ooo: Floating bearing with three rollers (Note: letter "o" not zero "0") 449 | \begin{scope}[rotate around={#3:(#2)}] 450 | \draw [normalLine] (#2) 451 | -- ++(\supportLength/2,-\supportHeight+\supportGap) 452 | -- ++(-\supportLength,0) 453 | -- cycle; 454 | \draw[normalLine, fill=white] 455 | ($(#2)+(\supportBasicLength/4,-\supportHeight)$) 456 | circle (0.9*\supportGap); 457 | \draw[normalLine, fill=white] 458 | ($(#2)+(0.0,-\supportHeight)$) 459 | circle (0.9*\supportGap); 460 | \draw[normalLine, fill=white] 461 | ($(#2)+(-\supportBasicLength/4,-\supportHeight)$) 462 | circle (0.9*\supportGap); 463 | \draw [normalLine] 464 | ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$) 465 | -- ++(-\supportBasicLength,0); 466 | \clip 467 | ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportHeight-\supportGap)$) 468 | rectangle ($(#2)+1*(\supportBasicLength/2,-\supportHeight-\supportGap)$); 469 | \draw[hatching] 470 | ($(#2)+1*(\supportHatchingLength/2,-\supportHatchingHeight-\supportGap)$) 471 | -- ++(-\supportHatchingLength,0); 472 | \end{scope} 473 | \global\STNL@ValidCommandTypeOptiontrue 474 | }{} 475 | 476 | \ifthenelse{\equal{#1}{3}}{ % 477 | \begin{scope}[rotate around={#3:(#2)}] 478 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,0)$) -- ++(-\supportBasicLength,0); 479 | \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight)$) rectangle ($(#2)+1*(\supportBasicLength/2,0)$); 480 | \draw[hatching]($(#2)+1*(\supportHatchingLength/2,0)$) -- ++(-\supportHatchingLength,0); 481 | \end{scope} 482 | \global\STNL@ValidCommandTypeOptiontrue 483 | }{} 484 | 485 | % 4*: Fixed supports 486 | \ifthenelse{\equal{#1}{4}}{ % 4: Fixed support: Basic representation with slider 487 | \begin{scope}[rotate around={#3:(#2)}] 488 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,0)$) -- ++(-\supportBasicLength,0); 489 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportGap)$) -- ++(-\supportBasicLength,0); 490 | \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportGap)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportGap)$); 491 | \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportGap)$) -- ++(-\supportHatchingLength,0); 492 | \end{scope} 493 | \global\STNL@ValidCommandTypeOptiontrue 494 | }{} 495 | 496 | \ifthenelse{\equal{#1}{4ooo}}{ % 4: Fixed support with three rollers 497 | \begin{scope}[rotate around={#3:(#2)}] 498 | \fill [white] ($(#2)+1*(0,-\supportGap)$) circle (-\supportGap); 499 | \draw [normalLine] ($(#2)+1*(0,-\supportGap)$) circle (-\supportGap) 500 | ; 501 | \fill [white] ($(#2)+1*(\supportBasicLength*0.35,-\supportGap)$) circle (-\supportGap); 502 | \draw [normalLine] ($(#2)+1*(\supportBasicLength*0.35,-\supportGap)$) circle (-\supportGap) 503 | ; 504 | \fill [white] ($(#2)+1*(-\supportBasicLength*0.35,-\supportGap)$) circle (-\supportGap); 505 | \draw [normalLine] ($(#2)+1*(-\supportBasicLength*0.35,-\supportGap)$) circle (-\supportGap) 506 | ; 507 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,0)$) -- ++(-\supportBasicLength,0); 508 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\supportGap*2)$) -- ++(-\supportBasicLength,0); 509 | \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\supportGap*2)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\supportGap*2)$); 510 | \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\supportGap*2)$) -- ++(-\supportHatchingLength,0) 511 | ; 512 | \end{scope} 513 | \global\STNL@ValidCommandTypeOptiontrue 514 | }{} 515 | 516 | \ifthenelse{\equal{#1}{5}}{ % Linear spring with zig-zag 517 | \begin{scope}[rotate around={#3:(#2)}] 518 | \draw [spring] (#2) -- ++(0,-\springLength); 519 | \draw [normalLine] ($(#2)+1*(\supportBasicLength/2,-\springLength)$) -- ++(-\supportBasicLength,0); 520 | \clip ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\springLength)$) rectangle ($(#2)+1*(\supportBasicLength/2,-\springLength)$); 521 | \draw[hatching]($(#2)+1*(\supportHatchingLength/2,-\springLength)$) -- ++(-\supportHatchingLength,0); 522 | \end{scope} 523 | \global\STNL@ValidCommandTypeOptiontrue 524 | }{} 525 | 526 | \ifthenelse{\equal{#1}{5c}}{ % Linear spring with coil 527 | \begin{scope}[rotate around={#3:(#2)}] 528 | \draw [coilspring] 529 | (#2) -- ++(0,-\springCoilLength); 530 | \draw [normalLine] 531 | ($(#2)+1*(\supportBasicLength/2,-\springLength)$) 532 | -- ++(-\supportBasicLength,0); 533 | \clip 534 | ($(#2)+1*(-\supportBasicLength/2,-\supportBasicHeight-\springLength)$) 535 | rectangle ($(#2)+1*(\supportBasicLength/2,-\springLength)$); 536 | \draw[hatching] 537 | ($(#2)+1*(\supportHatchingLength/2,-\springLength)$) 538 | -- ++(-\supportHatchingLength,0); 539 | \end{scope} 540 | \global\STNL@ValidCommandTypeOptiontrue 541 | }{} 542 | 543 | \ifthenelse{\equal{#1}{6}}{ % Torsion spring 544 | \begin{scope}[rotate around={#3:(#2)}] 545 | % Will convert \springTorsionRadius to pt before calc 546 | % 17.007874pt are 6mm 547 | \pgfmathsetmacro{\SpiralScale}{\springTorsionRadius/17.007874} 548 | \begin{scope}[scale=\SpiralScale] 549 | \draw (#2) [normalLine] % A fake spiral 550 | arc [start angle=-180,end angle=0,radius=0.6mm] 551 | arc [start angle=0,end angle=180,radius=1.2mm] 552 | arc [start angle=-180,end angle=0,radius=2mm] 553 | arc [start angle=0,end angle=180,radius=3mm] 554 | arc [start angle=-180,end angle=0,radius=4.2mm] 555 | arc [start angle=0,end angle=180,radius=5.6mm]; 556 | \end{scope} 557 | \draw [normalLine] 558 | ($(#2)+1*(-\springTorsionRadius -\supportBasicLength/7, 0)$) 559 | -- ++(\supportBasicLength/3.5, 0); 560 | \clip 561 | ($(#2)+1*(-\springTorsionRadius-\supportBasicLength/7,0)$) 562 | rectangle ++(\supportBasicLength/3.5,-\supportBasicHeight/2); 563 | \draw[hatchingspring] 564 | ($(#2)+1*(0,0)$) 565 | -- ++(-\supportHatchingLength/2,0); 566 | \end{scope} 567 | \global\STNL@ValidCommandTypeOptiontrue 568 | }{} 569 | 570 | \ifthenelse{\equal{#1}{6cw}}{ % Torsion spring 571 | \begin{scope}[rotate around={#3:(#2)}] 572 | % Will convert \springTorsionRadius to pt before calc 573 | % 17.007874pt are 6mm 574 | \pgfmathsetmacro{\SpiralScale}{\springTorsionRadius/17.007874} 575 | \begin{scope}[scale=\SpiralScale] 576 | \draw (#2) [normalLine] % A fake spiral 577 | arc [start angle=0,end angle=-180,radius=0.6mm] 578 | arc [start angle=180,end angle=0,radius=1.2mm] 579 | arc [start angle=0,end angle=-180,radius=2mm] 580 | arc [start angle=180,end angle=0,radius=3mm] 581 | arc [start angle=0,end angle=-180,radius=4.2mm] 582 | arc [start angle=180,end angle=0,radius=5.6mm]; 583 | \end{scope} 584 | \draw [normalLine] 585 | ($(#2)+1*(\springTorsionRadius -\supportBasicLength/7, 0)$) 586 | -- ++(\supportBasicLength/3.5, 0); 587 | \clip 588 | ($(#2)+1*(\springTorsionRadius-\supportBasicLength/7,0)$) 589 | rectangle ++(\supportBasicLength/3.5,-\supportBasicHeight/2); 590 | \draw[hatchingspring] 591 | ($(#2)+1*(2*\springTorsionRadius ,0)$) 592 | -- ++(-\supportHatchingLength/2,0); 593 | \end{scope} 594 | \global\STNL@ValidCommandTypeOptiontrue 595 | }{} 596 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::support: Bad type: #1}\errorstopmode} 597 | } 598 | 599 | %------------------------------------------------ 600 | % hinge 601 | %------------------------------------------------ 602 | % \hinge{type}{insertion point}[rotation][initial point][end point] 603 | % [rotation][initial point][end point] are optional 604 | % 605 | 606 | \newcommandx{\hinge}[5][3=0,4=0,5=0]{ 607 | \global\STNL@ValidCommandTypeOptionfalse 608 | \ifthenelse{\equal{#1}{1}}{ % 609 | \begin{scope}[rotate around={#3:(#2)}] 610 | \fill [white] (#2) circle (\hingeRadius); 611 | \draw [normalLine] (#2) circle (\hingeRadius); 612 | \end{scope} 613 | \global\STNL@ValidCommandTypeOptiontrue 614 | }{} 615 | 616 | \ifthenelse{\equal{#1}{2}}{ % 617 | \begin{scope}[even odd rule] 618 | \ifthenelse{\equal{#5}{1}}{ 619 | \clip (#2) circle (\hingeRadius+\normalLineWidth) 620 | (#2)--(#3)--($(#3)!\hingeRadius+\normalLineWidth!-90:(#2)$)--($(#4)!\hingeRadius+\normalLineWidth!90:(#2)$)--(#4)-- cycle; 621 | }{ 622 | \clip (#2)--(#3)--($(#3)!\hingeRadius+\normalLineWidth!-90:(#2)$)--($(#4)!\hingeRadius+\normalLineWidth!90:(#2)$)--(#4)-- cycle; 623 | } 624 | \filldraw [fill=white,normalLine] (#2) circle (\hingeRadius); 625 | \end{scope} 626 | \draw[hugeLine] ($(#2)!\hingeRadius!(#3)$)--(#2)--($(#2)!\hingeRadius!(#4)$); 627 | \global\STNL@ValidCommandTypeOptiontrue 628 | }{} 629 | 630 | \ifthenelse{\equal{#1}{3}}{ % 631 | \begin{scope}[rotate around={#3:(#2)}] 632 | \fill [white] (#2) circle (\supportGap/1.5); 633 | \draw [normalLine] ($(#2)+1*(\supportGap/2,\supportBasicLength/2)$) -- ++(0,-\supportBasicLength); 634 | \draw [normalLine] ($(#2)+1*(-\supportGap/2,\supportBasicLength/2)$) -- ++(0,-\supportBasicLength); 635 | \end{scope} 636 | \global\STNL@ValidCommandTypeOptiontrue 637 | }{} 638 | 639 | \ifthenelse{\equal{#1}{3ooo}}{ % 640 | \begin{scope}[rotate around={#3:(#2)}] 641 | \draw [normalLine] ($(#2)+1*(\hingeRadius*0.5,\supportBasicLength/2)$) -- ++(0,-\supportBasicLength); 642 | \draw [normalLine] ($(#2)+1*(-\hingeRadius*0.5,\supportBasicLength/2)$) -- ++(0,-\supportBasicLength); 643 | \fill [white] ($(#2)+1*(0,\supportBasicLength*0.35)$) circle (\hingeRadius*0.5); 644 | \draw [normalLine] ($(#2)+1*(0,\supportBasicLength*0.35)$) circle (\hingeRadius*0.5); 645 | \fill [white] ($(#2)+1*(0,0)$) circle (\hingeRadius*0.5); 646 | \draw [normalLine] ($(#2)+1*(0,0)$) circle (\hingeRadius*0.5); 647 | \fill [white] ($(#2)+1*(0,-\supportBasicLength*0.35)$) circle (\hingeRadius*0.5); 648 | \draw [normalLine] ($(#2)+1*(0,-\supportBasicLength*0.35)$) circle (\hingeRadius*0.5); 649 | \end{scope} 650 | \global\STNL@ValidCommandTypeOptiontrue 651 | }{} 652 | 653 | \ifthenelse{\equal{#1}{4}}{ % 654 | \begin{scope}[rotate around={#3:(#2)}] 655 | \fill [white] ($(#2)+1*(-\hingeAxialLength/3,\hingeAxialHeight/2)$) rectangle ($(#2)+1*(0,-\hingeAxialHeight/2)$); 656 | \draw [normalLine] ($(#2)+1*(2*\hingeAxialLength/3,\hingeAxialHeight/2)$) 657 | -- ++(-\hingeAxialLength,0) 658 | -- ++(0,-\hingeAxialHeight) 659 | -- ++(\hingeAxialLength,0); 660 | \end{scope} 661 | \global\STNL@ValidCommandTypeOptiontrue 662 | }{} 663 | 664 | \ifthenelse{\equal{#1}{5}}{ % 665 | \coordinate (hingeVarA) at ($ (#2)!\hingeCornerLength!(#3) $); 666 | \coordinate (hingeVarB) at ($ (#2)!\hingeCornerLength!(#4) $); 667 | \fill[black] (#2) -- (hingeVarA) -- (hingeVarB) -- cycle; 668 | \fill[black] (#2)circle (\hugeLineWidth/2); 669 | \global\STNL@ValidCommandTypeOptiontrue 670 | }{} 671 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::hinge: Bad type: #1}\errorstopmode} 672 | } 673 | 674 | %------------------------------------------------ 675 | % load 676 | %------------------------------------------------ 677 | % \load{type}{insertion point}[rotation][length or included angle][load distance] 678 | % [rotation][length or included angle][load distance] are optional 679 | % 680 | 681 | \newcommandx{\load}[5][3=0,4=0,5=0]{ 682 | \global\STNL@ValidCommandTypeOptionfalse 683 | \ifthenelse{\equal{#1}{1}}{ % 684 | \ifthenelse{\equal{#5}{0}} 685 | {\renewcommand{\helpVarA}{\forceDistance}} 686 | {\renewcommand{\helpVarA}{#5}} 687 | \ifthenelse{\equal{#4}{0}} 688 | {\renewcommand{\helpVarB}{\forceLength}} 689 | {\renewcommand{\helpVarB}{#4}} 690 | \draw[force,<-] ($(#2)+1*(#3:\helpVarA)$) --++($(#3:\helpVarB)$); 691 | \global\STNL@ValidCommandTypeOptiontrue 692 | }{} 693 | 694 | \ifthenelse{\equal{#1}{2}}{ % 695 | \ifthenelse{\equal{#5}{0}} 696 | {\renewcommand{\helpVarA}{\momentDistance}} 697 | {\renewcommand{\helpVarA}{#5}} 698 | \ifthenelse{\equal{#4}{0}} 699 | {\renewcommand{\helpVarB}{\momentAngle}} 700 | {\renewcommand{\helpVarB}{#4}} 701 | \begin{scope}[rotate around={#3:(#2)}] 702 | \draw[<-,normalLine] ($(#2)+1*(\helpVarA,0)$) arc (0:\helpVarB:\helpVarA); 703 | \end{scope} 704 | \global\STNL@ValidCommandTypeOptiontrue 705 | }{} 706 | 707 | \ifthenelse{\equal{#1}{3}}{ % 708 | \ifthenelse{\equal{#5}{0}} 709 | {\renewcommand{\helpVarA}{\momentDistance}} 710 | {\renewcommand{\helpVarA}{#5}} 711 | \ifthenelse{\equal{#4}{0}} 712 | {\renewcommand{\helpVarB}{\momentAngle}} 713 | {\renewcommand{\helpVarB}{#4}} 714 | \begin{scope}[rotate around={#3:(#2)}] 715 | \draw[->,normalLine] ($(#2)+1*(\helpVarA,0)$) arc (0:\helpVarB:\helpVarA); 716 | \end{scope} 717 | \global\STNL@ValidCommandTypeOptiontrue 718 | }{} 719 | 720 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::load: Bad type: #1}\errorstopmode} 721 | } 722 | 723 | %------------------------------------------------ 724 | % lineload 725 | %------------------------------------------------ 726 | % \lineload{type}{initial point}{end point}[initial force value][end force value][force interval] 727 | % [initial force value][end force value][force interval] are optional 728 | % 729 | % and accordingly for type 3 730 | % 731 | % \lineload{type}{initial point}{end point}[initial force value][end force value][lineload distance from inital point][force interval] 732 | % [initial force value][end force value][lineload distance from inital point][force interval] are optional 733 | % 734 | % and accordingly for type 4 735 | % 736 | % \lineload{type}{initial point}{end point}[force interval][force length] 737 | % [force interval][force length] are optional 738 | 739 | \newcommandx{\lineload}[7][4=1,5=1,6=\lineloadInterval,7=\lineloadInterval]{ 740 | \global\STNL@ValidCommandTypeOptionfalse 741 | \ifthenelse{\equal{#1}{1}}{ % 742 | \coordinate (lineloadVarA1) at ($ (#2)!\lineloadDistance!90:(#3) $); 743 | \coordinate (lineloadVarB1) at ($ (#3)!\lineloadDistance!-90:(#2) $); 744 | \coordinate (lineloadVarA2) at ($ (#2)!{\lineloadDistance +#4cm}!90:(#3) $); 745 | \coordinate (lineloadVarB2) at ($ (#3)!{\lineloadDistance+#5cm}!-90:(#2) $); 746 | \ifthenelse{\equal{#4}{0}}{} 747 | { 748 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 749 | } 750 | \ifthenelse{\equal{#5}{0}}{} 751 | { 752 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 753 | } 754 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 755 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 756 | \fill (lineloadVarA2) circle (\normalLineWidth/2); 757 | \fill (lineloadVarB2) circle (\normalLineWidth/2); 758 | \pgfmathsetmacro{\lineloadIntervalBegin}{#6/\scalingParameter} 759 | \pgfmathsetmacro{\lineloadIntervalStep}{#6/\scalingParameter*2} 760 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#6/\scalingParameter} 761 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 762 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 763 | \global\STNL@ValidCommandTypeOptiontrue 764 | }{} 765 | 766 | \ifthenelse{\equal{#1}{2}}{ % 767 | \coordinate (lineloadVarA1) at ($ (#2)+1*(0,\lineloadDistance) $); 768 | \coordinate (lineloadVarB1) at ($ (#3)+1*(0,\lineloadDistance) $); 769 | \coordinate (lineloadVarA2) at ($ (#2)+1*(0,\lineloadDistance+#4cm) $); 770 | \coordinate (lineloadVarB2) at ($ (#3)+1*(0,\lineloadDistance+#5cm) $); 771 | \ifthenelse{\equal{#4}{0}}{} 772 | { 773 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 774 | } 775 | \ifthenelse{\equal{#5}{0}}{} 776 | { 777 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 778 | } 779 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 780 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 781 | \fill (lineloadVarA2) circle (\normalLineWidth/2); 782 | \fill (lineloadVarB2) circle (\normalLineWidth/2); 783 | \pgfmathsetmacro{\lineloadIntervalBegin}{#6} 784 | \pgfmathsetmacro{\lineloadIntervalStep}{#6*2} 785 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#6} 786 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 787 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 788 | \global\STNL@ValidCommandTypeOptiontrue 789 | }{} 790 | 791 | \ifthenelse{\equal{#1}{3}}{ % 792 | \ifthenelse{\equal{#6}{\lineloadInterval}} 793 | {\renewcommand{\helpVarA}{0cm}} 794 | {\renewcommand{\helpVarA}{#6cm}} 795 | \path 796 | let 797 | \p1 = (#2), 798 | \p2 = (#3) 799 | in 800 | coordinate (lineloadVarA1) at ($(\p1)+1*(0,\lineloadDistance+\helpVarA)$) 801 | coordinate (lineloadVarB1) at ($(\x2,\y1)+1*(0,\lineloadDistance+\helpVarA)$) 802 | coordinate (lineloadVarA2) at ($ (\p1)+1*(0,\lineloadDistance+\helpVarA+#4cm)$) 803 | coordinate (lineloadVarB2) at ($ (\x2,\y1)+1*(0,\lineloadDistance+\helpVarA+#5cm)$); 804 | \draw [tinyLine,loosely dotted] (lineloadVarA1)--($(#2)+1*(0,\hingeRadius)$); 805 | \draw [tinyLine,loosely dotted] (lineloadVarB1)--($(#3)+1*(0,\hingeRadius)$); 806 | \ifthenelse{\equal{#4}{0}}{} 807 | { 808 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 809 | } 810 | \ifthenelse{\equal{#5}{0}}{} 811 | { 812 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 813 | } 814 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 815 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 816 | \fill (lineloadVarA2) circle (\normalLineWidth/2); 817 | \fill (lineloadVarB2) circle (\normalLineWidth/2); 818 | \pgfmathsetmacro{\lineloadIntervalBegin}{#7} 819 | \pgfmathsetmacro{\lineloadIntervalStep}{#7*2} 820 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#7} 821 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 822 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 823 | \global\STNL@ValidCommandTypeOptiontrue 824 | }{} 825 | 826 | \ifthenelse{\equal{#1}{4}}{ % 827 | \coordinate (lineloadVarA1) at ($ (#2)+1*(0,\lineloadDistance) $); 828 | \coordinate (lineloadVarB1) at ($ (#3)+1*(0,\lineloadDistance) $); 829 | \ifthenelse{\equal{#4}{1}} 830 | {\pgfmathsetmacro{\lineloadIntervalStep}{\lineloadInterval} 831 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-\lineloadInterval/2}} 832 | {\pgfmathsetmacro{\lineloadIntervalStep}{#4} 833 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#4/2}} 834 | \ifthenelse{\equal{#5}{1}} 835 | {\pgfmathsetmacro{\lineloadForceLength}{\lineloadForce}} 836 | {\pgfmathsetmacro{\lineloadForceLength}{#5}} 837 | \foreach \i in {0,\lineloadIntervalStep,...,\lineloadIntervalEnd} 838 | \draw [force,->] ($(lineloadVarA1)!\i!(lineloadVarB1)$) -- ($(lineloadVarA1)!\i+\lineloadForceLength!(lineloadVarB1)$); 839 | \global\STNL@ValidCommandTypeOptiontrue 840 | }{} 841 | 842 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::lineload: Bad type: #1}\errorstopmode} 843 | } 844 | 845 | %------------------------------------------------ 846 | % dimensioning 847 | %------------------------------------------------ 848 | % \dimensioning{type}{initial point}{end point}{distance from point of origin}[measure] 849 | % 850 | 851 | \newcommandx{\dimensioning}[5][5]{ 852 | \global\STNL@ValidCommandTypeOptionfalse 853 | \ifthenelse{\equal{#1}{1}}{ % 854 | \path 855 | let 856 | \p1 = (#2), 857 | \p2 = (#3) 858 | in 859 | coordinate (dimensioningVarA) at (\x1,#4) 860 | coordinate (dimensioningVarB) at (\x2,#4); 861 | \draw [smallLine] (dimensioningVarA)--++(0,\dimensioningBar/2)--++(0,-\dimensioningBar) 862 | (dimensioningVarA)--++(\dimensioningBar/4,\dimensioningBar/4)--++(-\dimensioningBar/2,-\dimensioningBar/2) 863 | (dimensioningVarB)--++(0,\dimensioningBar/2)--++(0,-\dimensioningBar) 864 | (dimensioningVarB)--++(\dimensioningBar/4,\dimensioningBar/4)--++(-\dimensioningBar/2,-\dimensioningBar/2) 865 | (dimensioningVarA)--(dimensioningVarB) node [sloped,midway,above] {#5}; 866 | \global\STNL@ValidCommandTypeOptiontrue 867 | }{} 868 | 869 | \ifthenelse{\equal{#1}{2}}{ % 870 | \path 871 | let 872 | \p1 = (#2), 873 | \p2 = (#3) 874 | in 875 | coordinate (dimensioningVarA) at (#4,\y1) 876 | coordinate (dimensioningVarB) at (#4,\y2); 877 | \draw [smallLine] (dimensioningVarA)--++(\dimensioningBar/2,0)--++(-\dimensioningBar,0) 878 | (dimensioningVarA)--++(\dimensioningBar/4,\dimensioningBar/4)--++(-\dimensioningBar/2,-\dimensioningBar/2) 879 | (dimensioningVarB)--++(\dimensioningBar/2,0)--++(-\dimensioningBar,0) 880 | (dimensioningVarB)--++(\dimensioningBar/4,\dimensioningBar/4)--++(-\dimensioningBar/2,-\dimensioningBar/2) 881 | (dimensioningVarA)--(dimensioningVarB) node [sloped,midway,above] {#5}; 882 | \global\STNL@ValidCommandTypeOptiontrue 883 | }{} 884 | 885 | \ifthenelse{\equal{#1}{3}}{ % 886 | \coordinate (dimensioningVarA) at ($ (#2)!{#4cm}!90:(#3) $); 887 | \coordinate (dimensioningVarB) at ($ (#3)!{#4cm}!-90:(#2) $); 888 | \draw [smallLine] ($ (dimensioningVarA)!{-\dimensioningBar/3}!90:(dimensioningVarB) $) -- ($ (dimensioningVarA)!{\dimensioningBar/3}!90:(dimensioningVarB) $); 889 | \draw [smallLine,<-] (dimensioningVarB) -- (dimensioningVarA)node [sloped,midway,above] {#5}; 890 | \global\STNL@ValidCommandTypeOptiontrue 891 | }{} 892 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dimensioning: Bad type: #1}\errorstopmode} 893 | } 894 | 895 | %------------------------------------------------ 896 | % influenceline 897 | %------------------------------------------------ 898 | % \influenceline{initial point}{end point}{distance from initial point}[arrow distance] 899 | % 900 | 901 | \newcommandx{\influenceline}[5][4=.5]{% 902 | \path 903 | let 904 | \p1 = (#1), 905 | \p2 = (#2) 906 | in 907 | coordinate (influencelineVarA) at ($(\p1)+1*(0,\lineloadDistance+#3cm)$) 908 | coordinate (influencelineVarB) at ($(\x2,\y1)+1*(0,\lineloadDistance+#3cm)$); 909 | \draw [smallLine] (influencelineVarA)--++(0,\dimensioningBar/2)--++(0,-\dimensioningBar) 910 | (influencelineVarB)--++(0,\dimensioningBar/2)--++(0,-\dimensioningBar); 911 | \draw [smallLine,<->] (influencelineVarA)--(influencelineVarB); 912 | \draw [smallLine] ($(influencelineVarA)!#4!(influencelineVarB)$)--++(\hingeRadius,0) arc (0:360:\hingeRadius); 913 | \draw [force,->] ($(influencelineVarA)!#4!(influencelineVarB)+1*(0,\forceLength/2)$) 914 | --($(influencelineVarA)!#4!(influencelineVarB)+1*(0,-\forceLength/2)$); 915 | } 916 | 917 | %------------------------------------------------ 918 | % internalforces 919 | %------------------------------------------------ 920 | % \internalforces{initial point}{end point}{initial value}{end value}[parabola height][color][bend position] 921 | % [parabola height][color][bend position] are optional 922 | % 923 | 924 | 925 | \newcommandx{\internalforces}[7][5=0,6=red,7=.6667]{% 926 | \coordinate (internalforcesVarA) at ($ (#1)!#3cm!-90:(#2) $); 927 | \coordinate (internalforcesVarB) at ($ (#2)!#4cm!90:(#1)$); 928 | \coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); 929 | \coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,#5)$); 930 | \coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!#7!(internalforcesVarC)$); 931 | \coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!#7!(internalforcesVarC)$); 932 | \ifthenelse{\equal{#5}{0}}{ 933 | \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) -- (internalforcesVarB) (internalforcesVarB) -- (#2); 934 | \fill [color=#6] (internalforcesVarA) circle (\bigLineWidth/2); 935 | \fill [color=#6] (internalforcesVarB) circle (\bigLineWidth/2); 936 | \fill [color=#6] (#1) circle (\bigLineWidth/2); 937 | \fill [color=#6] (#2) circle (\bigLineWidth/2); 938 | } 939 | { 940 | %\draw [bigLine,color=#6](internalforcesVarA) parabola[parabola height=#5cm] (internalforcesVarB); 941 | %\draw [bigLine,color=#6](internalforcesVarA)--(internalforcesVarAC)--(internalforcesVarBC)--(internalforcesVarB); 942 | %\draw [bigLine,color=blue](internalforcesVarA)--(internalforcesVarB) 943 | %(internalforcesVarAB) -- (internalforcesVarC); 944 | \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) .. controls (internalforcesVarAC) and (internalforcesVarBC) .. (internalforcesVarB) (internalforcesVarB) -- (#2); 945 | \fill [color=#6] (internalforcesVarA) circle (\bigLineWidth/2); 946 | \fill [color=#6] (internalforcesVarB) circle (\bigLineWidth/2); 947 | \fill [color=#6] (#1) circle (\bigLineWidth/2); 948 | \fill [color=#6] (#2) circle (\bigLineWidth/2); 949 | } 950 | 951 | } 952 | 953 | %------------------------------------------------ 954 | % temperature 955 | %------------------------------------------------ 956 | % \temperature{initial point}{end point}{temperature below}{temperature above}[temperature position][temperature value below][temperature value above][text orientation below][text orientation above] 957 | % [temperature position][temperature value above][temperature value below][text orientation below][text orientation above] are optional 958 | % 959 | 960 | \newcommandx{\temperature}[9][5=.5,6,7,8=below,9=above]{ 961 | \coordinate (temperatureVarA1) at ($ (#1)!#5!(#2) $); 962 | \coordinate (temperatureVarB1) at ($ (temperatureVarA1)!\temperatureHeight/2!90:(#2) $); 963 | \coordinate (temperatureVarB2) at ($ (temperatureVarA1)!-\temperatureHeight/2!90:(#2) $); 964 | \coordinate (temperatureVarC1) at ($ (temperatureVarB2)!-#3!90:(temperatureVarB1) $); 965 | \coordinate (temperatureVarC2) at ($ (temperatureVarB1)!#4!90:(temperatureVarB2) $); 966 | 967 | \filldraw[fill=\colorGray!20!white,smallLine] (temperatureVarB1) -- (temperatureVarC2) -- (temperatureVarC1) -- (temperatureVarB2) -- cycle; 968 | 969 | \draw (temperatureVarC1) node [#8]{#6}; 970 | \draw (temperatureVarC2) node [#9]{#7}; 971 | } 972 | 973 | %------------------------------------------------ 974 | % addon 975 | %------------------------------------------------ 976 | % \addon{type}{insertion point}{}{}[] 977 | % [] are optional 978 | % 979 | 980 | \newcommandx{\addon}[5][5=1]{ 981 | \global\STNL@ValidCommandTypeOptionfalse 982 | \ifthenelse{\equal{#1}{1}}{ % \addon{type}{insertion point}{end point}{position} 983 | \coordinate (addonVarA1) at ($ (#2)!#4!(#3) $); 984 | \coordinate (addonVarB1) at ($ (addonVarA1)!\dimensioningBar/2!45:(#3) $); 985 | \coordinate (addonVarB2) at ($ (addonVarA1)!\dimensioningBar/2!225:(#3) $); 986 | \draw[smallLine] (addonVarB1)--(addonVarB2) 987 | ($(addonVarB1)+1*(\supportGap,0)$)--($(addonVarB2)+1*(\supportGap,0)$); 988 | \global\STNL@ValidCommandTypeOptiontrue 989 | }{} 990 | 991 | \ifthenelse{\equal{#1}{2}}{ % \addon{type}{insertion point}{initial point}{end point}[position-1/+1] 992 | \coordinate (addonVarA1) at ($ (#2)!\dimensioningBar!(#3) $); 993 | \coordinate (addonVarB1) at ($ (#2)!\dimensioningBar!(#4) $); 994 | \ifthenelse{\equal{#5}{1}} 995 | { 996 | \coordinate (addonVarC1) at ($ (addonVarA1)!\dimensioningBar!90:(#3) $); 997 | \coordinate (addonVarD1) at ($ (#2)!1.414*\dimensioningBar/2!45:(#3) $); 998 | } 999 | { 1000 | \coordinate (addonVarC1) at ($ (addonVarA1)!\dimensioningBar!-90:(#3) $); 1001 | \coordinate (addonVarD1) at ($ (#2)!1.414*\dimensioningBar/2!-45:(#3) $); 1002 | } 1003 | \draw[smallLine] (addonVarA1)--(addonVarC1)-- (addonVarB1); 1004 | \filldraw (addonVarD1) circle (\smallLineWidth); 1005 | \global\STNL@ValidCommandTypeOptiontrue 1006 | }{} 1007 | 1008 | \ifthenelse{\equal{#1}{3}}{ % \addon{type}{insertion point}{initial point}{end point}[position-1/+1] 1009 | \begin{scope}[even odd rule] 1010 | \ifthenelse{\equal{#5}{1}}{ 1011 | \clip (#2) circle (\dimensioningBar+\normalLineWidth) 1012 | (#2)--(#3)--($(#3)!\dimensioningBar+\normalLineWidth!-90:(#2)$)--($(#4)!\dimensioningBar+\normalLineWidth!90:(#2)$)--(#4)-- cycle; 1013 | }{ 1014 | \clip (#2)--(#3)--($(#3)!\dimensioningBar+\normalLineWidth!-90:(#2)$)--($(#4)!\dimensioningBar+\normalLineWidth!90:(#2)$)--(#4)-- cycle; 1015 | } 1016 | \draw [smallLine] (#2) circle (\dimensioningBar) 1017 | (#2) circle (\dimensioningBar-\normalLineWidth-\normalLineWidth); 1018 | \end{scope} 1019 | \global\STNL@ValidCommandTypeOptiontrue 1020 | }{} 1021 | 1022 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::addon: Bad type: #1}\errorstopmode} 1023 | } 1024 | 1025 | %------------------------------------------------ 1026 | % notation 1027 | %------------------------------------------------ 1028 | % \notation{type}{insertion point}{}[][][] 1029 | % [] are optional 1030 | % 1031 | 1032 | \newcommandx{\notation}[7][4=above right,5=.5,6=above,7=sloped]{ 1033 | \global\STNL@ValidCommandTypeOptionfalse 1034 | \ifthenelse{\equal{#1}{1}}{ % \notation{1}{insertion point}{labelling}[orientation]; 1035 | \begin{scope} 1036 | \draw (#2) node [#4]{#3}; 1037 | \end{scope} 1038 | \global\STNL@ValidCommandTypeOptiontrue 1039 | }{} 1040 | 1041 | \ifthenelse{\equal{#1}{2}}{ % \notation{2}{insertion point}{labelling}[orientation]; 1042 | \begin{scope} 1043 | \draw (#2) node [#4]{#3}; 1044 | \draw[bigLine] (#2)--++(0,\dimensioningBar/2)--++(0,-\dimensioningBar); 1045 | \end{scope} 1046 | \global\STNL@ValidCommandTypeOptiontrue 1047 | }{} 1048 | 1049 | \ifthenelse{\equal{#1}{3}}{ % 1050 | \coordinate (notationVarA1) at ($ (#2)!#5!(#3) $); 1051 | \coordinate (notationVarB1) at ($ (notationVarA1)!\dimensioningBar/2!90:(#3) $); 1052 | \coordinate (notationVarB2) at ($ (notationVarA1)!\dimensioningBar/2!-90:(#3) $); 1053 | \draw[bigLine] (notationVarB1)--(notationVarB2); 1054 | \draw (notationVarA1) node [#6]{#4}; 1055 | \global\STNL@ValidCommandTypeOptiontrue 1056 | }{} 1057 | 1058 | \ifthenelse{\equal{#1}{4}}{ % 1059 | \ifthenelse{\equal{#7}{1}} 1060 | {\renewcommand{\helpVarB}{}} 1061 | {\renewcommand{\helpVarB}{sloped}} 1062 | \begin{scope} 1063 | \path (#2) -- (#3) node[inner sep=0mm,rectangle,smallLine,fill=white,draw,minimum size=2.5*\hingeRadius,midway,#6,\helpVarB,pos=#5] {#4}; 1064 | \end{scope} 1065 | \global\STNL@ValidCommandTypeOptiontrue 1066 | }{} 1067 | 1068 | \ifthenelse{\equal{#1}{5}}{ % 1069 | \ifthenelse{\equal{#7}{1}} 1070 | {\renewcommand{\helpVarB}{}} 1071 | {\renewcommand{\helpVarB}{sloped}} 1072 | \begin{scope} 1073 | \path (#2) -- (#3) node[midway,#6,\helpVarB,pos=#5] {#4}; 1074 | \end{scope} 1075 | \global\STNL@ValidCommandTypeOptiontrue 1076 | }{} 1077 | 1078 | \ifthenelse{\equal{#1}{6}}{ % 1079 | \begin{scope} 1080 | \draw (#2) node [inner sep=0mm,circle,smallLine,fill=white,draw,minimum size=2.5*\hingeRadius]{#3}; 1081 | \end{scope} 1082 | \global\STNL@ValidCommandTypeOptiontrue 1083 | }{} 1084 | 1085 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::notation: Bad type: #1}\errorstopmode} 1086 | } 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1099 | % 3D Structural Analysis Library base on TikZ 1100 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1101 | 1102 | % 1103 | %================================================ 1104 | % some variables 1105 | %================================================ 1106 | % 1107 | 1108 | %------------------------------------------------ 1109 | % line widths 1110 | %------------------------------------------------ 1111 | 1112 | \newcommand{\DhugeLineWidth}{2pt} 1113 | \newcommand{\DbigLineWidth}{1.5pt} 1114 | \newcommand{\DnormalLineWidth}{1pt} 1115 | \newcommand{\DsmallLineWidth}{.7pt} 1116 | \newcommand{\DtinyLineWidth}{.3pt} 1117 | 1118 | %------------------------------------------------ 1119 | % coords parameters 1120 | %------------------------------------------------ 1121 | 1122 | \newcommand{\DxAngle}{-12} 1123 | \newcommand{\DxLength}{1} 1124 | \newcommand{\DyAngle}{37} 1125 | \newcommand{\DyLength}{1} 1126 | \newcommand{\DzAngle}{90} 1127 | \newcommand{\DzLength}{1} 1128 | 1129 | %------------------------------------------------ 1130 | % axis parameters 1131 | %------------------------------------------------ 1132 | 1133 | \newcommand{\DxVarA}{$x$} 1134 | \newcommand{\DyVarA}{$y$} 1135 | \newcommand{\DzVarA}{$z$} 1136 | 1137 | \newcommand{\DxVarB}{$x^\prime$} 1138 | \newcommand{\DyVarB}{$y^\prime$} 1139 | \newcommand{\DzVarB}{$z^\prime$} 1140 | 1141 | \newcommand{\DxNodePos}{below} 1142 | \newcommand{\DyNodePos}{left} 1143 | \newcommand{\DzNodePos}{above} 1144 | 1145 | %------------------------------------------------ 1146 | % construction parameters 1147 | %------------------------------------------------ 1148 | 1149 | \newcommand{\DscalingParameter}{1} 1150 | \newcommand{\DshowPointParameter}{0} 1151 | 1152 | \newcommand{\DhingeBigRadius}{1.5mm} 1153 | \newcommand{\DhingeRadius}{1mm} 1154 | \newcommand{\DhingeAxialLength}{.5} 1155 | \newcommand{\DhingeAxialHeight}{.4} 1156 | \newcommand{\DhingeCornerLength}{3mm} 1157 | 1158 | \newcommand{\DspringLength}{10mm} 1159 | \newcommand{\DspringPreLength}{7pt} 1160 | \newcommand{\DspringPostLength}{5pt} 1161 | \newcommand{\DspringAmplitude}{1.5mm} 1162 | \newcommand{\DspringSegmentLength}{3pt} 1163 | 1164 | \newcommand{\DsupportGap}{1mm} 1165 | \newcommand{\DsupportLength}{1} 1166 | 1167 | \newcommand{\DaxisLength}{1.5} 1168 | \newcommand{\DlocalaxisLength}{.5} 1169 | \newcommand{\DaxisDistance}{.2} 1170 | 1171 | %------------------------------------------------ 1172 | % load parameters 1173 | %------------------------------------------------ 1174 | 1175 | \newcommand{\DforceDistance}{.15} 1176 | \newcommand{\DforceLength}{1.0} 1177 | \newcommand{\DlineloadDistance}{.3} 1178 | \newcommand{\DlineloadForce}{0.15} 1179 | \newcommand{\DlineloadInterval}{0.2} 1180 | \newcommand{\DlineloadDistanceMM}{3mm} 1181 | 1182 | %------------------------------------------------ 1183 | % dimensioning parameters 1184 | %------------------------------------------------ 1185 | 1186 | \newcommand{\DdimensioningBar}{4mm} 1187 | \newcommand{\DnoteRadius}{1.5mm} 1188 | 1189 | %------------------------------------------------ 1190 | % addon parameters 1191 | %------------------------------------------------ 1192 | 1193 | \newcommand{\DaddonLength}{4mm} 1194 | 1195 | %------------------------------------------------ 1196 | % help values 1197 | %------------------------------------------------ 1198 | 1199 | \newcommand{\DhelpVarA}{1} 1200 | \newcommand{\DhelpVarB}{1} 1201 | \newcommand{\DhelpVarC}{1} 1202 | 1203 | % 1204 | %================================================ 1205 | % new tikz styles 1206 | %================================================ 1207 | % 1208 | 1209 | %------------------------------------------------ 1210 | % line styles 1211 | %------------------------------------------------ 1212 | 1213 | \tikzstyle{hugeLine}=[line width=\DhugeLineWidth,] 1214 | \tikzstyle{bigLine}=[line width=\DbigLineWidth,] 1215 | \tikzstyle{normalLine}=[line width=\DnormalLineWidth,] 1216 | \tikzstyle{smallLine}=[line width=\DsmallLineWidth,] 1217 | \tikzstyle{tinyLine}=[line width=\DtinyLineWidth,] 1218 | 1219 | %------------------------------------------------ 1220 | % coords styles 1221 | %------------------------------------------------ 1222 | 1223 | \tikzset{coords/.style={x={(\DxAngle:\DxLength cm)}, y={(\DyAngle:\DyLength cm)}, z={(\DzAngle:\DzLength cm)}}} 1224 | 1225 | %------------------------------------------------ 1226 | % axis styles 1227 | %------------------------------------------------ 1228 | 1229 | \tikzstyle{axisarrow}=[>=open triangle 45 ,normalLine] 1230 | 1231 | %------------------------------------------------ 1232 | % dspring style 1233 | %------------------------------------------------ 1234 | 1235 | \tikzstyle{Dspring} = [ 1236 | normalLine, 1237 | decoration= 1238 | { 1239 | zigzag, 1240 | pre length=\DspringPreLength, 1241 | post length=\DspringPostLength, 1242 | segment length=\DspringSegmentLength, 1243 | amplitude=\DspringAmplitude 1244 | }, 1245 | decorate, 1246 | ] 1247 | 1248 | %------------------------------------------------ 1249 | % force style 1250 | %------------------------------------------------ 1251 | 1252 | \tikzstyle{force}=[>=latex,normalLine] 1253 | 1254 | % 1255 | %================================================ 1256 | % library elements 1257 | %================================================ 1258 | % 1259 | 1260 | %------------------------------------------------ 1261 | % setcoords 1262 | %------------------------------------------------ 1263 | % \setcoords{x-angle}{y-angle}[x-direction][y-direction][z-direction][z-angle]; 1264 | % 1265 | 1266 | \newcommandx{\setcoords}[6][3=1,4=1,5=1,6=90]{ 1267 | \renewcommand{\DxAngle}{#1} 1268 | \renewcommand{\DxLength}{#3} 1269 | \renewcommand{\DyAngle}{#2} 1270 | \renewcommand{\DyLength}{#4} 1271 | \renewcommand{\DzAngle}{#6} 1272 | \renewcommand{\DzLength}{#5} 1273 | } 1274 | 1275 | %------------------------------------------------ 1276 | % setaxis 1277 | %------------------------------------------------ 1278 | % \setaxis{type}[][][][][][]; 1279 | % 1280 | % Type 1 1281 | % \setaxis{1}; 1282 | % set global axis to xyz and local axis to x'y'z' 1283 | % Type 2 1284 | % \setaxis{2}; 1285 | % set global axis to XYZ and local axis to xyz 1286 | % Type 3 1287 | % \setaxis{3}[X-labelling][Y-labelling][Z-labelling][x-labelling][y-labelling][z-labelling]; 1288 | % set global axis to [][][] and local axis to [][][] 1289 | % Type 4 1290 | % \setaxis{4}[x-orientation][y-orientation][z-orientation]; 1291 | % Change the xyz-orientation from \daxis{4} 1292 | 1293 | \newcommandx{\setaxis}[7][2,3,4,5,6,7]{ 1294 | \global\STNL@ValidCommandTypeOptionfalse 1295 | \ifthenelse{\equal{#1}{1}}{ 1296 | \renewcommand{\DxVarA}{$x$} 1297 | \renewcommand{\DyVarA}{$y$} 1298 | \renewcommand{\DzVarA}{$z$} 1299 | \renewcommand{\DxVarB}{$x^\prime$} 1300 | \renewcommand{\DyVarB}{$y^\prime$} 1301 | \renewcommand{\DzVarB}{$z^\prime$} 1302 | \global\STNL@ValidCommandTypeOptiontrue 1303 | }{} 1304 | 1305 | \ifthenelse{\equal{#1}{2}}{ 1306 | \renewcommand{\DxVarA}{$X$} 1307 | \renewcommand{\DyVarA}{$Y$} 1308 | \renewcommand{\DzVarA}{$Z$} 1309 | \renewcommand{\DxVarB}{$x$} 1310 | \renewcommand{\DyVarB}{$y$} 1311 | \renewcommand{\DzVarB}{$z$} 1312 | \global\STNL@ValidCommandTypeOptiontrue 1313 | }{} 1314 | 1315 | \ifthenelse{\equal{#1}{3}}{ 1316 | \renewcommand{\DxVarA}{#2} 1317 | \renewcommand{\DyVarA}{#3} 1318 | \renewcommand{\DzVarA}{#4} 1319 | \renewcommand{\DxVarB}{#5} 1320 | \renewcommand{\DyVarB}{#6} 1321 | \renewcommand{\DzVarB}{#7} 1322 | \global\STNL@ValidCommandTypeOptiontrue 1323 | }{} 1324 | 1325 | \ifthenelse{\equal{#1}{4}}{ 1326 | \renewcommand{\DxNodePos}{#2} 1327 | \renewcommand{\DyNodePos}{#3} 1328 | \renewcommand{\DzNodePos}{#4} 1329 | \global\STNL@ValidCommandTypeOptiontrue 1330 | }{} 1331 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::setaxis: Bad type: #1}\errorstopmode} 1332 | } 1333 | 1334 | %------------------------------------------------ 1335 | % showpoint 1336 | %------------------------------------------------ 1337 | % \showpoint 1338 | % 1339 | 1340 | \newcommandx{\showpoint}{ 1341 | \renewcommand{\DshowPointParameter}{1} 1342 | } 1343 | 1344 | %------------------------------------------------ 1345 | % dscaling 1346 | %------------------------------------------------ 1347 | % \dscaling{type}{scaling value}; 1348 | % 1349 | % Type 1 1350 | % \dscaling{1}{scaling value}; 1351 | % scaling the distance between two points 1352 | % Type 2 1353 | % \dscaling{2}{scaling value}; 1354 | % scaling supports and hinges 1355 | % Type 3 1356 | % \dscaling{3}{scaling value}; 1357 | % scaling axis 1358 | % Type 4 1359 | % \dscaling{4}{scaling value}; 1360 | % scaling loads and lineloads 1361 | % Type 5 1362 | % \dscaling{5}{scaling value}; 1363 | % scaling the dimensionings 1364 | % Type 6 1365 | % \dscaling{6}{scaling value}; 1366 | % scaling the addons 1367 | 1368 | \newcommandx{\dscaling}[2]{ 1369 | \global\STNL@ValidCommandTypeOptionfalse 1370 | \ifthenelse{\equal{#1}{1}}{ 1371 | \renewcommand{\DscalingParameter}{#2} 1372 | \global\STNL@ValidCommandTypeOptiontrue 1373 | }{} 1374 | 1375 | \ifthenelse{\equal{#1}{2}}{ 1376 | \pgfmathsetmacro{\DhingeBigRadiusPTtoMM}{\DhingeBigRadius/2.83527} 1377 | \pgfmathsetmacro{\DhingeRadiusPTtoMM}{\DhingeRadius/2.83527} 1378 | \pgfmathsetmacro{\DhingeAxialLengthPT}{\DhingeAxialLength} 1379 | \pgfmathsetmacro{\DhingeAxialHeightPT}{\DhingeAxialHeight} 1380 | \pgfmathsetmacro{\DhingeCornerLengthPTtoMM}{\DhingeCornerLength/2.83527} 1381 | % 1382 | \renewcommand{\DhingeBigRadius}{\DhingeBigRadiusPTtoMM*#2mm} 1383 | \renewcommand{\DhingeRadius}{\DhingeRadiusPTtoMM*#2mm} 1384 | \renewcommand{\DhingeAxialLength}{\DhingeAxialLengthPT*#2} 1385 | \renewcommand{\DhingeAxialHeight}{\DhingeAxialHeightPT*#2} 1386 | \renewcommand{\DhingeCornerLength}{\DhingeCornerLengthPTtoMM*#2mm} 1387 | % 1388 | \pgfmathsetmacro{\DspringLengthPTtoMM}{\DspringLength/2.83527} 1389 | \pgfmathsetmacro{\DspringPreLengthPT}{\DspringPreLength} 1390 | \pgfmathsetmacro{\DspringPostLengthPT}{\DspringPostLength} 1391 | \pgfmathsetmacro{\DspringAmplitudePTtoMM}{\DspringAmplitude/2.83527} 1392 | \pgfmathsetmacro{\DspringSegmentLengthPT}{\DspringSegmentLength} 1393 | % 1394 | \renewcommand{\DspringLength}{\DspringLengthPTtoMM*#2mm} 1395 | \renewcommand{\DspringPreLength}{\DspringPreLengthPT*#2} 1396 | \renewcommand{\DspringPostLength}{\DspringPostLengthPT*#2} 1397 | \renewcommand{\DspringAmplitude}{\DspringAmplitudePTtoMM*#2mm} 1398 | \renewcommand{\DspringSegmentLength}{\DspringSegmentLengthPT*#2} 1399 | % 1400 | \pgfmathsetmacro{\DsupportGapPTtoMM}{\DsupportGap/2.83527} 1401 | \pgfmathsetmacro{\DsupportLengthPT}{\DsupportLength} 1402 | % 1403 | \renewcommand{\DsupportGap}{\DsupportGapPTtoMM*#2mm} 1404 | \renewcommand{\DsupportLength}{\DsupportLengthPT*#2} 1405 | \global\STNL@ValidCommandTypeOptiontrue 1406 | }{} 1407 | 1408 | \ifthenelse{\equal{#1}{3}}{ 1409 | \pgfmathsetmacro{\DaxisLengthPT}{\DaxisLength} 1410 | \pgfmathsetmacro{\DlocalaxisLengthPT}{\DlocalaxisLength} 1411 | \pgfmathsetmacro{\DaxisDistancePT}{\DaxisDistance} 1412 | % 1413 | \renewcommand{\DaxisLength}{\DaxisLengthPT*#2} 1414 | \renewcommand{\DlocalaxisLength}{\DlocalaxisLengthPT*#2} 1415 | \renewcommand{\DaxisDistance}{\DaxisDistancePT*#2} 1416 | \global\STNL@ValidCommandTypeOptiontrue 1417 | }{} 1418 | 1419 | \ifthenelse{\equal{#1}{4}}{ 1420 | \pgfmathsetmacro{\DforceDistancePT}{\DforceDistance} 1421 | \pgfmathsetmacro{\DforceLengthPT}{\DforceLength} 1422 | \pgfmathsetmacro{\DlineloadDistancePT}{\DlineloadDistance} 1423 | \pgfmathsetmacro{\DlineloadForcePT}{\DlineloadForce} 1424 | \pgfmathsetmacro{\DlineloadIntervalPT}{\DlineloadInterval} 1425 | \pgfmathsetmacro{\DlineloadDistanceMMPTtoMM}{\DlineloadDistanceMM/2.83527} 1426 | % 1427 | \renewcommand{\DforceDistance}{\DforceDistancePT*#2} 1428 | \renewcommand{\DforceLength}{\DforceLengthPT*#2} 1429 | \renewcommand{\DlineloadDistance}{\DlineloadDistancePT*#2} 1430 | \renewcommand{\DlineloadForce}{\DlineloadForcePT*#2} 1431 | \renewcommand{\DlineloadInterval}{\DlineloadIntervalPT*#2} 1432 | \renewcommand{\DlineloadDistanceMM}{\DlineloadDistanceMMPTtoMM*#2mm} 1433 | \global\STNL@ValidCommandTypeOptiontrue 1434 | }{} 1435 | 1436 | \ifthenelse{\equal{#1}{5}}{ 1437 | \pgfmathsetmacro{\DdimensioningBarPTtoMM}{\DdimensioningBar/2.83527} 1438 | % 1439 | \renewcommand{\DdimensioningBar}{\DdimensioningBarPTtoMM*#2mm} 1440 | \global\STNL@ValidCommandTypeOptiontrue 1441 | }{} 1442 | 1443 | \ifthenelse{\equal{#1}{6}}{ 1444 | \pgfmathsetmacro{\DaddonLengthPTtoMM}{\DaddonLength/2.83527} 1445 | % 1446 | \renewcommand{\DaddonLength}{\DaddonLengthPTtoMM*#2mm} 1447 | \global\STNL@ValidCommandTypeOptiontrue 1448 | }{} 1449 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dscaling: Bad type: #1}\errorstopmode} 1450 | } 1451 | 1452 | %------------------------------------------------ 1453 | % 3dpoint 1454 | %------------------------------------------------ 1455 | % \point{name}{x-coordinate}{y-coordinate}{z-coordinate}; 1456 | % 1457 | 1458 | \newcommandx{\dpoint}[4]{ 1459 | \node[coordinate][ 1460 | shift={(#2*\DscalingParameter,#3*\DscalingParameter,#4*\DscalingParameter)}](#1){}; 1461 | \ifthenelse{\equal{\DshowPointParameter}{1}}{ 1462 | \draw (#2*\DscalingParameter,#3*\DscalingParameter,#4*\DscalingParameter) node [above,red]{#1}; 1463 | }{} 1464 | } 1465 | 1466 | %------------------------------------------------ 1467 | % 3daxis 1468 | %------------------------------------------------ 1469 | % \daxis{type}{}[][][][][][][]; 1470 | % 1471 | % Type 1: Global Axis 1472 | % \daxis{1}{insertion point}[X-orientation][Y-orientation][Z-orientation]; 1473 | % 1474 | % Type 2: Local Axis in plane 1475 | % \daxis{2}{plane}[insertion point][end point][position][x-orientation][y-orientation][z-orientation][change y with z]; 1476 | % plane e.g. xy, yx, xz, zx, yz or zy 1477 | % Type 3: Local Axis in space 1478 | % \daxis{3}{rotation A}[insertion point][end point][position][rotation 1][rotation 2][rotation 3][rotation B]; 1479 | % rotation A and B to positioning the local axis around the beam (spherical coordinates) 1480 | % rotation 1 about the world z axis, 1481 | % rotation 2 about the (unrotated) world y axis, and 1482 | % rotation 3 about the (unrotated) world z axis. 1483 | % to change the xyz-orientation use \setaxis{4}[x-orientation][y-orientation][z-orientation]; 1484 | 1485 | \newcommandx{\daxis}[9][3,4,5=.5,6=right,7=below,8=left,9=0]{ 1486 | \global\STNL@ValidCommandTypeOptionfalse 1487 | \ifthenelse{\equal{#1}{1}}{ % 1488 | \ifthenelse{\equal{#3}{}} 1489 | {\renewcommand{\DhelpVarA}{below}} 1490 | {\renewcommand{\DhelpVarA}{#3}} 1491 | \ifthenelse{\equal{#4}{}} 1492 | {\renewcommand{\DhelpVarB}{above}} 1493 | {\renewcommand{\DhelpVarB}{#4}} 1494 | \ifthenelse{\equal{#5}{.5}} 1495 | {\renewcommand{\DhelpVarC}{above}} 1496 | {\renewcommand{\DhelpVarC}{#5}} 1497 | \draw[axisarrow,->] (#2) --++ (\DaxisLength,0,0)node[\DhelpVarA] {\DxVarA}; 1498 | \draw[axisarrow,->] (#2) --++ (0,\DaxisLength,0)node[\DhelpVarB] {\DyVarA}; 1499 | \draw[axisarrow,->] (#2) --++ (0,0,\DaxisLength)node[\DhelpVarC] {\DzVarA}; 1500 | \global\STNL@ValidCommandTypeOptiontrue 1501 | }{} 1502 | 1503 | \ifthenelse{\equal{#1}{2}}{ % 1504 | \ifthenelse{\equal{#2}{xy}} 1505 | {\renewcommand{\DhelpVarA}{z}}{} 1506 | \ifthenelse{\equal{#2}{yx}} 1507 | {\renewcommand{\DhelpVarA}{z}}{} 1508 | \ifthenelse{\equal{#2}{xz}} 1509 | {\renewcommand{\DhelpVarA}{y}}{} 1510 | \ifthenelse{\equal{#2}{zx}} 1511 | {\renewcommand{\DhelpVarA}{y}}{} 1512 | \ifthenelse{\equal{#2}{yz}} 1513 | {\renewcommand{\DhelpVarA}{x}}{} 1514 | \ifthenelse{\equal{#2}{zy}} 1515 | {\renewcommand{\DhelpVarA}{x}}{} 1516 | 1517 | \ifthenelse{\equal{#2}{xy}}{ 1518 | \begin{scope}[canvas is yx plane at \DhelpVarA=0]} 1519 | {\begin{scope}[canvas is #2 plane at \DhelpVarA=0]} 1520 | 1521 | \pgfmathsetmacro{\DaxisDistanceLO}{\DaxisDistance/0.283527} 1522 | 1523 | \ifthenelse{\equal{#2}{xy}} 1524 | {\renewcommand{\DhelpVarA}{\DaxisDistanceLO*-3mm}} 1525 | {\renewcommand{\DhelpVarA}{\DaxisDistanceLO*3mm}} 1526 | 1527 | \pgfmathsetmacro{\DlocalaxisLengthLO}{\DlocalaxisLength/0.283527} 1528 | \renewcommand{\DhelpVarB}{\DlocalaxisLengthLO*3mm} 1529 | 1530 | \coordinate (axisVarA1) at ($ (#3)!#5!(#4) $); 1531 | \coordinate (axisVarB1) at ($ (axisVarA1)!{\DhelpVarB}!(#4) $); 1532 | \coordinate (axisVarA2) at ($ (axisVarA1)!\DhelpVarA!90:(#4) $); 1533 | \coordinate (axisVarB2) at ($ (axisVarB1)!\DhelpVarA!90:(#4) $); 1534 | \coordinate (axisVarC2) at ($ (axisVarA2)!1!90:(axisVarB2) $); 1535 | 1536 | \ifthenelse{\equal{#9}{0}} 1537 | {\renewcommand{\DhelpVarB}{\DyVarB}} 1538 | {\renewcommand{\DhelpVarB}{\DzVarB}} 1539 | 1540 | \draw[thin,->] (axisVarA2) -- (axisVarB2)node[#6] {\DxVarB}; 1541 | \draw[thin,->] (axisVarA2) -- (axisVarC2)node[#7] {\DhelpVarB}; 1542 | \end{scope} 1543 | 1544 | \ifthenelse{\equal{#9}{0}} 1545 | {\renewcommand{\DhelpVarB}{\DzVarB}} 1546 | {\renewcommand{\DhelpVarB}{\DyVarB}} 1547 | 1548 | \ifthenelse{\equal{#2}{xy}} 1549 | {\draw[thin,->] (axisVarA2) --++ (0,0,-\DlocalaxisLength)node[#8] {\DhelpVarB};}{} 1550 | \ifthenelse{\equal{#2}{yx}} 1551 | {\draw[thin,->] (axisVarA2) --++ (0,0,-\DlocalaxisLength)node[#8] {\DhelpVarB};}{} 1552 | \ifthenelse{\equal{#2}{xz}} 1553 | {\draw[thin,->] (axisVarA2) --++ (0,-\DlocalaxisLength,0)node[#8] {\DhelpVarB};}{} 1554 | \ifthenelse{\equal{#2}{zx}} 1555 | {\draw[thin,->] (axisVarA2) --++ (0,\DlocalaxisLength,0)node[#8] {\DhelpVarB};}{} 1556 | \ifthenelse{\equal{#2}{yz}} 1557 | {\draw[thin,->] (axisVarA2) --++ (\DlocalaxisLength,0,0)node[#8] {\DhelpVarB};}{} 1558 | \ifthenelse{\equal{#2}{zy}} 1559 | {\draw[thin,->] (axisVarA2) --++ (-\DlocalaxisLength,0,0)node[#8] {\DhelpVarB};}{} 1560 | \global\STNL@ValidCommandTypeOptiontrue 1561 | }{} 1562 | 1563 | \ifthenelse{\equal{#1}{3}}{ 1564 | \ifthenelse{\equal{#6}{right}} 1565 | {\renewcommand{\DhelpVarA}{0}} 1566 | {\renewcommand{\DhelpVarA}{#6}} 1567 | 1568 | \ifthenelse{\equal{#7}{below}} 1569 | {\renewcommand{\DhelpVarB}{0}} 1570 | {\renewcommand{\DhelpVarB}{#7}} 1571 | 1572 | \ifthenelse{\equal{#8}{left}} 1573 | {\renewcommand{\DhelpVarC}{0}} 1574 | {\renewcommand{\DhelpVarC}{#8}} 1575 | 1576 | \coordinate (axisVarA1) at ($ (#3)!#5!(#4) $); 1577 | \coordinate (axisVarA2) at ($(axisVarA1)+1*({\DaxisDistance*cos(#9)*sin(#2)},{\DaxisDistance*sin(#9)*sin(#2)},{\DaxisDistance*cos(#2)})$); 1578 | 1579 | \xtdplotsetrotatedcoords{\DhelpVarA}{\DhelpVarB}{\DhelpVarC}; 1580 | 1581 | \xtdplotsetrotatedcoordsorigin{(axisVarA2)} 1582 | \draw[thin,xtdplot_rotated_coords,->] (0,0,0) -- (.5,0,0) node[\DxNodePos]{\DxVarB}; 1583 | \draw[thin,xtdplot_rotated_coords,->] (0,0,0) -- (0,.5,0) node[\DyNodePos]{\DyVarB}; 1584 | \draw[thin,xtdplot_rotated_coords,->] (0,0,0) -- (0,0,.5) node[\DzNodePos]{\DzVarB}; 1585 | \global\STNL@ValidCommandTypeOptiontrue 1586 | }{} 1587 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::daxis: Bad type: #1}\errorstopmode} 1588 | } 1589 | 1590 | %------------------------------------------------ 1591 | % 3dbeam 1592 | %------------------------------------------------ 1593 | % \dbeam{type}{initial point}{end point}[rounded initial point][rounded end point]; 1594 | % with rounded initial point or/and rounded end point: 1 or nothing = true, 0=false, 1595 | 1596 | \newcommandx{\dbeam}[5][4=1,5=1]{ 1597 | \global\STNL@ValidCommandTypeOptionfalse 1598 | \ifthenelse{\equal{#1}{1}}{ % 1599 | \draw [hugeLine] (#2) -- (#3); 1600 | \ifthenelse{\equal{#4}{0}}{} 1601 | {\fill (#2) circle (\DhugeLineWidth/2);} 1602 | \ifthenelse{\equal{#5}{0}}{} 1603 | {\fill (#3) circle (\DhugeLineWidth/2);} 1604 | \global\STNL@ValidCommandTypeOptiontrue 1605 | }{} 1606 | 1607 | \ifthenelse{\equal{#1}{2}}{ % 1608 | \draw [bigLine] (#2) -- (#3); 1609 | \ifthenelse{\equal{#4}{0}}{} 1610 | {\fill (#2) circle (\DbigLineWidth/2);} 1611 | \ifthenelse{\equal{#5}{0}}{} 1612 | {\fill (#3) circle (\DbigLineWidth/2);} 1613 | \global\STNL@ValidCommandTypeOptiontrue 1614 | }{} 1615 | 1616 | \ifthenelse{\equal{#1}{3}}{ % 1617 | \draw [normalLine,dashed] (#2) -- (#3); 1618 | \global\STNL@ValidCommandTypeOptiontrue 1619 | }{} 1620 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dbeam: Bad type: #1}\errorstopmode} 1621 | } 1622 | 1623 | %------------------------------------------------ 1624 | % 3dsupport 1625 | %------------------------------------------------ 1626 | % \dsupport{type}{insertion point}[][][][]; 1627 | % 1628 | % Type 1 1629 | % \dsupport{1}{insertion point}[x-direction][y-direction][z-direction]; 1630 | % with xyz-direction: 1=true, 0=false, -1=other direction 1631 | % Type 2 1632 | % \dsupport{2}{insertion point}[plane][normal-direction]; 1633 | % 1634 | % Type 3 1635 | % \dsupport{3}{insertion point}[x-direction][y-direction][z-direction]; 1636 | % in combination with \dhinge{3} 1637 | % with xyz-direction: 1=true, 0=false, -1=other direction 1638 | % Type 4 1639 | % \dsupport{4}{insertion point}[x-direction][y-direction][z-direction]; 1640 | % same as type 1 but with springs 1641 | % Type 5 1642 | % \dsupport{5}{insertion point}[x-direction][y-direction][z-direction]; 1643 | % same as type 3 but with springs 1644 | 1645 | \newcommandx{\dsupport}[6][3=1,4=1,5=1,6=1]{ 1646 | \global\STNL@ValidCommandTypeOptionfalse 1647 | \ifthenelse{\equal{#1}{1}}{ % 1648 | \ifthenelse{\equal{#3}{0}}{}{ 1649 | \draw [normalLine] (#2)-- ++(-\DsupportLength*#3,0,0); 1650 | \filldraw [normalLine,fill=white] ($(#2)+1*(-\DsupportLength*#3,0,0)$) circle (\DhingeRadius); 1651 | } 1652 | \ifthenelse{\equal{#4}{0}}{}{ 1653 | \draw [normalLine] (#2)-- ++(0,-\DsupportLength*#4,0); 1654 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,-\DsupportLength*#4,0)$) circle (\DhingeRadius); 1655 | } 1656 | \ifthenelse{\equal{#5}{0}}{}{ 1657 | \draw [normalLine] (#2)-- ++(0,0,-\DsupportLength*#5); 1658 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,0,-\DsupportLength*#5)$) circle (\DhingeRadius); 1659 | } 1660 | \global\STNL@ValidCommandTypeOptiontrue 1661 | }{} 1662 | 1663 | \ifthenelse{\equal{#1}{2}}{ % 1664 | \ifthenelse{\equal{#3}{xy}} 1665 | {\renewcommand{\DhelpVarA}{z}}{} 1666 | \ifthenelse{\equal{#3}{yx}} 1667 | {\renewcommand{\DhelpVarA}{z}}{} 1668 | \ifthenelse{\equal{#3}{xz}} 1669 | {\renewcommand{\DhelpVarA}{y}}{} 1670 | \ifthenelse{\equal{#3}{zx}} 1671 | {\renewcommand{\DhelpVarA}{y}}{} 1672 | \ifthenelse{\equal{#3}{yz}} 1673 | {\renewcommand{\DhelpVarA}{x}}{} 1674 | \ifthenelse{\equal{#3}{zy}} 1675 | {\renewcommand{\DhelpVarA}{x}}{} 1676 | 1677 | \begin{scope}[canvas is #3 plane at \DhelpVarA=#4] 1678 | \draw [hugeLine] (#2)-- ++(-\DsupportLength/2,0)--++(\DsupportLength,0); 1679 | \draw [hugeLine] (#2)-- ++(0,-\DsupportLength/2)--++(0,\DsupportLength); 1680 | \end{scope} 1681 | \global\STNL@ValidCommandTypeOptiontrue 1682 | }{} 1683 | 1684 | \ifthenelse{\equal{#1}{3}}{ % 1685 | 1686 | \ifthenelse{\equal{#3}{0}}{}{ 1687 | \draw [normalLine] ($(#2)+1*(0,0,-\DhingeAxialHeight*2/3)$)-- ++(-\DsupportLength*#3,0,0); 1688 | \filldraw [normalLine,fill=white] ($(#2)+1*(-\DsupportLength*#3,0,-\DhingeAxialHeight*2/3)$) circle (\DhingeRadius); 1689 | } 1690 | \ifthenelse{\equal{#4}{0}}{}{ 1691 | \draw [normalLine] ($(#2)+1*(0,0,-\DhingeAxialHeight*2/3)$)-- ++(0,-\DsupportLength*#4,0); 1692 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,-\DsupportLength*#4,-\DhingeAxialHeight*2/3)$) circle (\DhingeRadius); 1693 | } 1694 | \ifthenelse{\equal{#5}{0}}{}{ 1695 | \draw [normalLine] ($(#2)+1*(0,0,-\DhingeAxialHeight/2.5)$)-- ++(0,0,-\DsupportLength*#5+\DhingeAxialHeight/2); 1696 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,0,-\DsupportLength*#5)$) circle (\DhingeRadius); 1697 | } 1698 | \global\STNL@ValidCommandTypeOptiontrue 1699 | 1700 | }{} 1701 | 1702 | \ifthenelse{\equal{#1}{4}}{ % 1703 | \ifthenelse{\equal{#3}{0}}{}{ 1704 | \draw [Dspring] (#2)-- ++(-\DsupportLength*#3,0,0); 1705 | \filldraw [normalLine,fill=white] ($(#2)+1*(-\DsupportLength*#3,0,0)$) circle (\DhingeRadius); 1706 | } 1707 | \ifthenelse{\equal{#4}{0}}{}{ 1708 | \draw [Dspring] (#2)-- ++(0,-\DsupportLength*#4,0); 1709 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,-\DsupportLength*#4,0)$) circle (\DhingeRadius); 1710 | } 1711 | \ifthenelse{\equal{#5}{0}}{}{ 1712 | \draw [Dspring] (#2)-- ++(0,0,-\DsupportLength*#5); 1713 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,0,-\DsupportLength*#5)$) circle (\DhingeRadius); 1714 | } 1715 | \global\STNL@ValidCommandTypeOptiontrue 1716 | 1717 | }{} 1718 | 1719 | \ifthenelse{\equal{#1}{5}}{ % 1720 | 1721 | \ifthenelse{\equal{#3}{0}}{}{ 1722 | \draw [Dspring] ($(#2)+1*(0,0,-\DhingeAxialHeight*2/3)$)-- ++(-\DsupportLength*#3,0,0); 1723 | \filldraw [normalLine,fill=white] ($(#2)+1*(-\DsupportLength*#3,0,-\DhingeAxialHeight*2/3)$) circle (\DhingeRadius); 1724 | } 1725 | \ifthenelse{\equal{#4}{0}}{}{ 1726 | \draw [Dspring] ($(#2)+1*(0,0,-\DhingeAxialHeight*2/3)$)-- ++(0,-\DsupportLength*#4,0); 1727 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,-\DsupportLength*#4,-\DhingeAxialHeight*2/3)$) circle (\DhingeRadius); 1728 | } 1729 | \ifthenelse{\equal{#5}{0}}{}{ 1730 | \draw [Dspring] ($(#2)+1*(0,0,-\DhingeAxialHeight/2.5)$)-- ++(0,0,-\DsupportLength*#5+\DhingeAxialHeight/2); 1731 | \filldraw [normalLine,fill=white] ($(#2)+1*(0,0,-\DsupportLength*#5)$) circle (\DhingeRadius); 1732 | } 1733 | \global\STNL@ValidCommandTypeOptiontrue 1734 | }{} 1735 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dsupport: Bad type: #1}\errorstopmode} 1736 | } 1737 | 1738 | %------------------------------------------------ 1739 | % 3dhinge 1740 | %------------------------------------------------ 1741 | % \dhinge{type}{insertion point}[][][]; 1742 | % 1743 | % Type 1 1744 | % \dhinge{1}{insertion point}; 1745 | % 1746 | % Type 2 1747 | % \dhinge{2}{insertion point}[initial point][end point][orientation]; 1748 | % with orientation: 0=standard, 1=other direction 1749 | % Type 3 1750 | % \dhinge{3}{insertion point}[rotation]; 1751 | % in combination with \dsupport{3} 1752 | % Type 4 1753 | % \dhinge{4}{insertion point}[initial point][end point]; 1754 | % 1755 | 1756 | \newcommandx{\dhinge}[5][3=0,4=0,5=0]{ 1757 | \global\STNL@ValidCommandTypeOptionfalse 1758 | \ifthenelse{\equal{#1}{1}}{ % 1759 | \begin{scope}[rotate around={#3:(#2)}] 1760 | \fill [white] (#2) circle (\DhingeRadius); 1761 | \draw [normalLine] (#2) circle (\DhingeRadius); 1762 | \end{scope} 1763 | \global\STNL@ValidCommandTypeOptiontrue 1764 | }{} 1765 | 1766 | \ifthenelse{\equal{#1}{2}}{ % 1767 | \begin{scope}[even odd rule] 1768 | \ifthenelse{\equal{#5}{1}}{ 1769 | \clip (#2) circle (\DhingeBigRadius+\DnormalLineWidth) 1770 | (#2)--(#3)--($(#3)!\DhingeBigRadius+\DnormalLineWidth!-90:(#2)$)--($(#4)!\DhingeBigRadius+\DnormalLineWidth!90:(#2)$)--(#4)-- cycle; 1771 | }{ 1772 | \clip (#2)--(#3)--($(#3)!\DhingeBigRadius+\DnormalLineWidth!-90:(#2)$)--($(#4)!\DhingeBigRadius+\DnormalLineWidth!90:(#2)$)--(#4)-- cycle; 1773 | } 1774 | \filldraw [fill=white,normalLine] (#2) circle (\DhingeBigRadius); 1775 | \end{scope} 1776 | \draw[hugeLine] ($(#2)!\DhingeBigRadius!(#3)$)--(#2)--($(#2)!\DhingeBigRadius!(#4)$); 1777 | \global\STNL@ValidCommandTypeOptiontrue 1778 | }{} 1779 | 1780 | \ifthenelse{\equal{#1}{3}}{ % 1781 | \begin{scope} 1782 | \draw [normalLine] ($(#2)+1*({0*cos(#3+90)-\DhingeAxialHeight/2*sin(#3+90)},{0*sin(#3+90)+\DhingeAxialHeight/2*cos(#3+90)},2*\DhingeAxialLength/3)$) 1783 | -- ++(0,0,-\DhingeAxialLength) 1784 | -- ++({0*cos(#3+90)+\DhingeAxialHeight*sin(#3+90)},{0*sin(#3+90)-\DhingeAxialHeight*cos(#3+90)}) 1785 | -- ++(0,0,\DhingeAxialLength); 1786 | \end{scope} 1787 | \global\STNL@ValidCommandTypeOptiontrue 1788 | }{} 1789 | 1790 | \ifthenelse{\equal{#1}{4}}{ % 1791 | \coordinate (hingeVarA) at ($ (#2)!\DhingeCornerLength!(#3) $); 1792 | \coordinate (hingeVarB) at ($ (#2)!\DhingeCornerLength!(#4) $); 1793 | \fill[black] (#2) -- (hingeVarA) -- (hingeVarB) -- cycle; 1794 | \fill[black] (#2)circle (\DhugeLineWidth/2); 1795 | \global\STNL@ValidCommandTypeOptiontrue 1796 | }{} 1797 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dhinge: Bad type: #1}\errorstopmode} 1798 | } 1799 | 1800 | %------------------------------------------------ 1801 | % 3dload 1802 | %------------------------------------------------ 1803 | % \dload{type}{insertion point}[rotation A][rotation B][load length][load distance]; 1804 | % rotation A and B to positioning the load around the insertion point (spherical coordinates) 1805 | % 1806 | 1807 | \newcommandx{\dload}[6][3=0,4=0,5=0,6=0]{ 1808 | \global\STNL@ValidCommandTypeOptionfalse 1809 | \ifthenelse{\equal{#1}{1}}{ % 1810 | \ifthenelse{\equal{#6}{0}} 1811 | {\renewcommand{\DhelpVarA}{\DforceDistance}} 1812 | {\renewcommand{\DhelpVarA}{#6}} 1813 | \ifthenelse{\equal{#5}{0}} 1814 | {\renewcommand{\DhelpVarB}{\DforceLength}} 1815 | {\renewcommand{\DhelpVarB}{#5}} 1816 | \draw[force,<-] ($(#2)+1*({\DhelpVarA*cos(#4)*sin(#3)},{\DhelpVarA*sin(#4)*sin(#3)},{\DhelpVarA*cos(#3)})$) --++({\DhelpVarB*cos(#4)*sin(#3)},{\DhelpVarB*sin(#4)*sin(#3)},{\DhelpVarB*cos(#3)}); 1817 | \global\STNL@ValidCommandTypeOptiontrue 1818 | }{} 1819 | 1820 | 1821 | \ifthenelse{\equal{#1}{2}}{ % 1822 | \ifthenelse{\equal{#6}{0}} 1823 | {\renewcommand{\DhelpVarA}{\DforceDistance}} 1824 | {\renewcommand{\DhelpVarA}{#6}} 1825 | \ifthenelse{\equal{#5}{0}} 1826 | {\renewcommand{\DhelpVarB}{\DforceLength}} 1827 | {\renewcommand{\DhelpVarB}{#5}} 1828 | \draw[force,->] ($(#2)+1*({\DhelpVarA*cos(#4)*sin(#3)},{\DhelpVarA*sin(#4)*sin(#3)},{\DhelpVarA*cos(#3)})$) --++({\DhelpVarB*cos(#4)*sin(#3)},{\DhelpVarB*sin(#4)*sin(#3)},{\DhelpVarB*cos(#3)}); 1829 | \global\STNL@ValidCommandTypeOptiontrue 1830 | }{} 1831 | 1832 | \ifthenelse{\equal{#1}{3}}{ % 1833 | \ifthenelse{\equal{#6}{0}} 1834 | {\renewcommand{\DhelpVarA}{\DforceDistance}} 1835 | {\renewcommand{\DhelpVarA}{#6}} 1836 | \ifthenelse{\equal{#5}{0}} 1837 | {\renewcommand{\DhelpVarB}{\DforceLength}} 1838 | {\renewcommand{\DhelpVarB}{#5}} 1839 | \draw[force,<<-] ($(#2)+1*({\DhelpVarA*cos(#4)*sin(#3)},{\DhelpVarA*sin(#4)*sin(#3)},{\DhelpVarA*cos(#3)})$) --++({\DhelpVarB*cos(#4)*sin(#3)},{\DhelpVarB*sin(#4)*sin(#3)},{\DhelpVarB*cos(#3)}); 1840 | \global\STNL@ValidCommandTypeOptiontrue 1841 | }{} 1842 | 1843 | \ifthenelse{\equal{#1}{4}}{ % 1844 | \ifthenelse{\equal{#6}{0}} 1845 | {\renewcommand{\DhelpVarA}{\DforceDistance}} 1846 | {\renewcommand{\DhelpVarA}{#6}} 1847 | \ifthenelse{\equal{#5}{0}} 1848 | {\renewcommand{\DhelpVarB}{\DforceLength}} 1849 | {\renewcommand{\DhelpVarB}{#5}} 1850 | \draw[force,->>] ($(#2)+1*({\DhelpVarA*cos(#4)*sin(#3)},{\DhelpVarA*sin(#4)*sin(#3)},{\DhelpVarA*cos(#3)})$) --++({\DhelpVarB*cos(#4)*sin(#3)},{\DhelpVarB*sin(#4)*sin(#3)},{\DhelpVarB*cos(#3)}); 1851 | \global\STNL@ValidCommandTypeOptiontrue 1852 | }{} 1853 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dload: Bad type: #1}\errorstopmode} 1854 | 1855 | } 1856 | 1857 | %------------------------------------------------ 1858 | % 3dlineload 1859 | %------------------------------------------------ 1860 | % \dlineload{type}{}[]{initial point}{end point}[][][][]; 1861 | % 1862 | % Type 1: in plane 1863 | % \dlineload{1}{plane}[plane distance]{initial point}{end point}[initial force value][end force value][force interval]; 1864 | % 1865 | % Type 2: in plane 1866 | % \dlineload{2}{plane}[plane distance]{initial point}{end point}[initial force value][end force value][force interval]; 1867 | % 1868 | % Type 3: in plane 1869 | % \dlineload{3}{plane}[plane distance]{initial point}{end point}[initial force value][end force value][lineload distance from inital point][force interval]; 1870 | % 1871 | % Type 4: in plane 1872 | % \dlineload{4}{plane}[plane distance]{initial point}{end point}[force interval][force length]; 1873 | % 1874 | % Type 5: in space 1875 | % \dlineload{5}{rotation A}[rotation B]{initial point}{end point}[initial force value][end force value][force interval]; 1876 | % rotation A and B to positioning the lineload around the initial point (spherical coordinates) 1877 | % Type 6: in space 1878 | % \dlineload{6}{rotation A}[rotation B]{initial point}{end point}[force interval][force length]; 1879 | % rotation A and B to positioning the lineload around the initial point (spherical coordinates) 1880 | 1881 | \newcommandx{\dlineload}[9][3=0,6=1,7=1,8=\DlineloadInterval,9=\DlineloadInterval]{ 1882 | % 1883 | \ifthenelse{\equal{#2}{xy}} 1884 | {\renewcommand{\DhelpVarA}{z}}{} 1885 | \ifthenelse{\equal{#2}{yx}} 1886 | {\renewcommand{\DhelpVarA}{z}}{} 1887 | \ifthenelse{\equal{#2}{xz}} 1888 | {\renewcommand{\DhelpVarA}{y}}{} 1889 | \ifthenelse{\equal{#2}{zx}} 1890 | {\renewcommand{\DhelpVarA}{y}}{} 1891 | \ifthenelse{\equal{#2}{yz}} 1892 | {\renewcommand{\DhelpVarA}{x}}{} 1893 | \ifthenelse{\equal{#2}{zy}} 1894 | {\renewcommand{\DhelpVarA}{x}}{} 1895 | % 1896 | \ifthenelse{\equal{#1}{5}} 1897 | {\sublineload{#1}{#4}{#5}[#6][#7][#8][#9][#2][#3];} 1898 | {\ifthenelse{\equal{#1}{6}} 1899 | {\sublineload{#1}{#4}{#5}[#6][#7][#8][#9][#2][#3];} 1900 | { 1901 | \begin{scope}[canvas is #2 plane at \DhelpVarA=#3] 1902 | \sublineload{#1}{#4}{#5}[#6][#7][#8][#9]; 1903 | \end{scope} 1904 | } 1905 | } 1906 | } 1907 | 1908 | \newcommandx{\sublineload}[9][4=1,5=1,6=\DlineloadInterval,7=\DlineloadInterval,8=0,9=0]{ 1909 | \global\STNL@ValidCommandTypeOptionfalse 1910 | \ifthenelse{\equal{#1}{1}}{ % 1911 | \coordinate (lineloadVarA1) at ($ (#2)!\DlineloadDistanceMM!90:(#3) $); 1912 | \coordinate (lineloadVarB1) at ($ (#3)!\DlineloadDistanceMM!-90:(#2) $); 1913 | \coordinate (lineloadVarA2) at ($ (#2)!{\DlineloadDistanceMM +#4cm}!90:(#3) $); 1914 | \coordinate (lineloadVarB2) at ($ (#3)!{\DlineloadDistanceMM+#5cm}!-90:(#2) $); 1915 | \ifthenelse{\equal{#4}{0}}{} 1916 | { 1917 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 1918 | } 1919 | \ifthenelse{\equal{#5}{0}}{} 1920 | { 1921 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 1922 | } 1923 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 1924 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 1925 | \fill (lineloadVarA2) circle (\DnormalLineWidth/2); 1926 | \fill (lineloadVarB2) circle (\DnormalLineWidth/2); 1927 | \pgfmathsetmacro{\lineloadIntervalBegin}{#6/\DscalingParameter} 1928 | \pgfmathsetmacro{\lineloadIntervalStep}{#6/\DscalingParameter*2} 1929 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#6/\DscalingParameter} 1930 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 1931 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 1932 | \global\STNL@ValidCommandTypeOptiontrue 1933 | }{} 1934 | 1935 | \ifthenelse{\equal{#1}{2}}{ % 1936 | \coordinate (lineloadVarA1) at ($ (#2)+1*(0,\DlineloadDistanceMM) $); 1937 | \coordinate (lineloadVarB1) at ($ (#3)+1*(0,\DlineloadDistanceMM) $); 1938 | \coordinate (lineloadVarA2) at ($ (#2)+1*(0,\DlineloadDistanceMM+#4cm) $); 1939 | \coordinate (lineloadVarB2) at ($ (#3)+1*(0,\DlineloadDistanceMM+#5cm) $); 1940 | \ifthenelse{\equal{#4}{0}}{} 1941 | { 1942 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 1943 | } 1944 | \ifthenelse{\equal{#5}{0}}{} 1945 | { 1946 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 1947 | } 1948 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 1949 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 1950 | \fill (lineloadVarA2) circle (\DnormalLineWidth/2); 1951 | \fill (lineloadVarB2) circle (\DnormalLineWidth/2); 1952 | \pgfmathsetmacro{\lineloadIntervalBegin}{#6} 1953 | \pgfmathsetmacro{\lineloadIntervalStep}{#6*2} 1954 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#6} 1955 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 1956 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 1957 | \global\STNL@ValidCommandTypeOptiontrue 1958 | }{} 1959 | 1960 | \ifthenelse{\equal{#1}{3}}{ % 1961 | \ifthenelse{\equal{#6}{\DlineloadInterval}} 1962 | {\renewcommand{\DhelpVarA}{0cm}} 1963 | {\renewcommand{\DhelpVarA}{#6cm}} 1964 | \path 1965 | let 1966 | \p1 = (#2), 1967 | \p2 = (#3) 1968 | in 1969 | coordinate (lineloadVarA1) at ($(\p1)+1*(0,\DlineloadDistanceMM+\DhelpVarA)$) 1970 | coordinate (lineloadVarB1) at ($(\x2,\y1)+1*(0,\DlineloadDistanceMM+\DhelpVarA)$) 1971 | coordinate (lineloadVarA2) at ($ (\p1)+1*(0,\DlineloadDistanceMM+\DhelpVarA+#4cm)$) 1972 | coordinate (lineloadVarB2) at ($ (\x2,\y1)+1*(0,\DlineloadDistanceMM+\DhelpVarA+#5cm)$); 1973 | \draw [tinyLine,loosely dotted] (lineloadVarA1)--($(#2)+1*(0,\DhingeBigRadius)$); 1974 | \draw [tinyLine,loosely dotted] (lineloadVarB1)--($(#3)+1*(0,\DhingeBigRadius)$); 1975 | \ifthenelse{\equal{#4}{0}}{} 1976 | { 1977 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 1978 | } 1979 | \ifthenelse{\equal{#5}{0}}{} 1980 | { 1981 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 1982 | } 1983 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 1984 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 1985 | \fill (lineloadVarA2) circle (\DnormalLineWidth/2); 1986 | \fill (lineloadVarB2) circle (\DnormalLineWidth/2); 1987 | \pgfmathsetmacro{\lineloadIntervalBegin}{#7} 1988 | \pgfmathsetmacro{\lineloadIntervalStep}{#7*2} 1989 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#7} 1990 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 1991 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 1992 | \global\STNL@ValidCommandTypeOptiontrue 1993 | }{} 1994 | 1995 | \ifthenelse{\equal{#1}{4}}{ % 1996 | \coordinate (lineloadVarA1) at ($ (#2)+1*(0,\DlineloadDistanceMM) $); 1997 | \coordinate (lineloadVarB1) at ($ (#3)+1*(0,\DlineloadDistanceMM) $); 1998 | \ifthenelse{\equal{#4}{1}} 1999 | {\pgfmathsetmacro{\lineloadIntervalStep}{\DlineloadInterval} 2000 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-\DlineloadInterval/2}} 2001 | {\pgfmathsetmacro{\lineloadIntervalStep}{#4} 2002 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#4/2}} 2003 | \ifthenelse{\equal{#5}{1}} 2004 | {\pgfmathsetmacro{\lineloadForceLength}{\DlineloadForce}} 2005 | {\pgfmathsetmacro{\lineloadForceLength}{#5}} 2006 | \foreach \i in {0,\lineloadIntervalStep,...,\lineloadIntervalEnd} 2007 | \draw [force,->] ($(lineloadVarA1)!\i!(lineloadVarB1)$) -- ($(lineloadVarA1)!\i+\lineloadForceLength!(lineloadVarB1)$); 2008 | \global\STNL@ValidCommandTypeOptiontrue 2009 | }{} 2010 | 2011 | \ifthenelse{\equal{#1}{5}}{ % 2012 | \coordinate (lineloadVarA1) at ($(#2)+1*({\DlineloadDistance*cos(#9)*sin(#8)},{\DlineloadDistance*sin(#9)*sin(#8)},{\DlineloadDistance*cos(#8)})$); 2013 | \coordinate (lineloadVarB1) at ($(#3)+1*({\DlineloadDistance*cos(#9)*sin(#8)},{\DlineloadDistance*sin(#9)*sin(#8)},{\DlineloadDistance*cos(#8)})$); 2014 | \coordinate (lineloadVarA2) at ($(#2)+1*({(\DlineloadDistance+#4)*cos(#9)*sin(#8)},{(\DlineloadDistance+#4)*sin(#9)*sin(#8)},{(\DlineloadDistance+#4)*cos(#8)})$); 2015 | \coordinate (lineloadVarB2) at ($(#3)+1*({(\DlineloadDistance+#5)*cos(#9)*sin(#8)},{(\DlineloadDistance+#5)*sin(#9)*sin(#8)},{(\DlineloadDistance+#5)*cos(#8)})$); 2016 | \ifthenelse{\equal{#4}{0}}{} 2017 | { 2018 | \draw [force,->] (lineloadVarA2) -- (lineloadVarA1); 2019 | } 2020 | \ifthenelse{\equal{#5}{0}}{} 2021 | { 2022 | \draw [force,->] (lineloadVarB2) -- (lineloadVarB1); 2023 | } 2024 | \draw [smallLine] (lineloadVarA1) -- (lineloadVarB1) node(xline)[right] {}; 2025 | \draw [normalLine] (lineloadVarA2) -- (lineloadVarB2); 2026 | \fill (lineloadVarA2) circle (\DnormalLineWidth/2); 2027 | \fill (lineloadVarB2) circle (\DnormalLineWidth/2); 2028 | \pgfmathsetmacro{\lineloadIntervalBegin}{#6/\DscalingParameter} 2029 | \pgfmathsetmacro{\lineloadIntervalStep}{#6/\DscalingParameter*2} 2030 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#6/\DscalingParameter} 2031 | \foreach \i in {\lineloadIntervalBegin,\lineloadIntervalStep,...,\lineloadIntervalEnd} 2032 | \draw [force,->] ($(lineloadVarA2)!\i!(lineloadVarB2)$)-- ($(lineloadVarA1)!\i!(lineloadVarB1)$); 2033 | \global\STNL@ValidCommandTypeOptiontrue 2034 | }{} 2035 | 2036 | 2037 | \ifthenelse{\equal{#1}{6}}{ % 2038 | \coordinate (lineloadVarA1) at ($(#2)+1*({\DlineloadDistance*cos(#9)*sin(#8)},{\DlineloadDistance*sin(#9)*sin(#8)},{\DlineloadDistance*cos(#8)})$); 2039 | \coordinate (lineloadVarB1) at ($(#3)+1*({\DlineloadDistance*cos(#9)*sin(#8)},{\DlineloadDistance*sin(#9)*sin(#8)},{\DlineloadDistance*cos(#8)})$); 2040 | \ifthenelse{\equal{#4}{1}} 2041 | {\pgfmathsetmacro{\lineloadIntervalStep}{\DlineloadInterval} 2042 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-\DlineloadInterval/2}} 2043 | {\pgfmathsetmacro{\lineloadIntervalStep}{#4} 2044 | \pgfmathsetmacro{\lineloadIntervalEnd}{1-#4/2}} 2045 | \ifthenelse{\equal{#5}{1}} 2046 | {\pgfmathsetmacro{\lineloadForceLength}{\DlineloadForce}} 2047 | {\pgfmathsetmacro{\lineloadForceLength}{#5}} 2048 | \foreach \i in {0,\lineloadIntervalStep,...,\lineloadIntervalEnd} 2049 | \draw [force,->] ($(lineloadVarA1)!\i!(lineloadVarB1)$) -- ($(lineloadVarA1)!\i+\lineloadForceLength!(lineloadVarB1)$); 2050 | \global\STNL@ValidCommandTypeOptiontrue 2051 | }{} 2052 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dlineload: Bad type: #1}\errorstopmode} 2053 | 2054 | } 2055 | 2056 | %------------------------------------------------ 2057 | % 3dinternalforces 2058 | %------------------------------------------------ 2059 | % \dinternalforces{plane}[plane distance]{initial point}{end point}{initial value}{end value}[parabola height][color][bend position]; 2060 | % 2061 | 2062 | \newcommandx{\dinternalforces}[9][2=0,7=0,8=red,9=.6667]{ 2063 | % 2064 | \ifthenelse{\equal{#1}{xy}} 2065 | {\renewcommand{\DhelpVarA}{z}}{} 2066 | \ifthenelse{\equal{#1}{yx}} 2067 | {\renewcommand{\DhelpVarA}{z}}{} 2068 | \ifthenelse{\equal{#1}{xz}} 2069 | {\renewcommand{\DhelpVarA}{y}}{} 2070 | \ifthenelse{\equal{#1}{zx}} 2071 | {\renewcommand{\DhelpVarA}{y}}{} 2072 | \ifthenelse{\equal{#1}{yz}} 2073 | {\renewcommand{\DhelpVarA}{x}}{} 2074 | \ifthenelse{\equal{#1}{zy}} 2075 | {\renewcommand{\DhelpVarA}{x}}{} 2076 | 2077 | \begin{scope}[canvas is #1 plane at \DhelpVarA=#2] 2078 | \subinternalforces{#3}{#4}{#5}{#6}[#7][#8][#9]; 2079 | \end{scope} 2080 | } 2081 | 2082 | \newcommandx{\subinternalforces}[7][5=0,6=red,7=.6667]{% 2083 | \coordinate (internalforcesVarA) at ($ (#1)!#3cm!-90:(#2) $); 2084 | \coordinate (internalforcesVarB) at ($ (#2)!#4cm!90:(#1)$); 2085 | \coordinate (internalforcesVarAB) at ($ (internalforcesVarA)!.5!(internalforcesVarB)$); 2086 | \coordinate (internalforcesVarC) at ($ (internalforcesVarAB)+2*(0,#5)$); 2087 | \coordinate (internalforcesVarAC) at ($ (internalforcesVarA)!#7!(internalforcesVarC)$); 2088 | \coordinate (internalforcesVarBC) at ($ (internalforcesVarB)!#7!(internalforcesVarC)$); 2089 | \ifthenelse{\equal{#5}{0}}{ 2090 | \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) -- (internalforcesVarB) (internalforcesVarB) -- (#2); 2091 | \fill [color=#6] (internalforcesVarA) circle (\DbigLineWidth/2); 2092 | \fill [color=#6] (internalforcesVarB) circle (\DbigLineWidth/2); 2093 | \fill [color=#6] (#1) circle (\DbigLineWidth/2); 2094 | \fill [color=#6] (#2) circle (\DbigLineWidth/2); 2095 | } 2096 | { 2097 | \draw [bigLine,color=#6] (#1) -- (internalforcesVarA) (internalforcesVarA) .. controls (internalforcesVarAC) and (internalforcesVarBC) .. (internalforcesVarB) (internalforcesVarB) -- (#2); 2098 | \fill [color=#6] (internalforcesVarA) circle (\DbigLineWidth/2); 2099 | \fill [color=#6] (internalforcesVarB) circle (\DbigLineWidth/2); 2100 | \fill [color=#6] (#1) circle (\DbigLineWidth/2); 2101 | \fill [color=#6] (#2) circle (\DbigLineWidth/2); 2102 | } 2103 | 2104 | } 2105 | 2106 | %------------------------------------------------ 2107 | % 3ddimensioning 2108 | %------------------------------------------------ 2109 | % \ddimensioning{plane}[plane distance]{initial point}{end point}{distance from point of origin}[measure][help line length]; 2110 | % 2111 | 2112 | \newcommandx{\ddimensioning}[7][2=0,6,7=0]{ 2113 | % 2114 | \ifthenelse{\equal{#1}{xy}} 2115 | {\renewcommand{\DhelpVarA}{z}}{} 2116 | \ifthenelse{\equal{#1}{yx}} 2117 | {\renewcommand{\DhelpVarA}{z}}{} 2118 | \ifthenelse{\equal{#1}{xz}} 2119 | {\renewcommand{\DhelpVarA}{y}}{} 2120 | \ifthenelse{\equal{#1}{zx}} 2121 | {\renewcommand{\DhelpVarA}{y}}{} 2122 | \ifthenelse{\equal{#1}{yz}} 2123 | {\renewcommand{\DhelpVarA}{x}}{} 2124 | \ifthenelse{\equal{#1}{zy}} 2125 | {\renewcommand{\DhelpVarA}{x}}{} 2126 | 2127 | \subdimensioning{#1}{#3}{#4}{#5}[#6][#7][#2][\DhelpVarA]; 2128 | } 2129 | 2130 | \newcommandx{\subdimensioning}[8][5,6=0,7=0,8]{ 2131 | \ifthenelse{\equal{#1}{xy}}{ 2132 | \begin{scope}[canvas is yx plane at #8=#7] 2133 | \path 2134 | let 2135 | \p1 = (#2), 2136 | \p2 = (#3) 2137 | in 2138 | coordinate (dimensioningVarA) at (#4,\y1) 2139 | coordinate (dimensioningVarB) at (#4,\y2); 2140 | \draw [smallLine] (dimensioningVarA)--++(\DdimensioningBar/2,0)--++(-\DdimensioningBar,0) 2141 | (dimensioningVarA)--++(\DdimensioningBar/4,\DdimensioningBar/4)--++(-\DdimensioningBar/2,-\DdimensioningBar/2) 2142 | (dimensioningVarB)--++(\DdimensioningBar/2,0)--++(-\DdimensioningBar,0) 2143 | (dimensioningVarB)--++(\DdimensioningBar/4,\DdimensioningBar/4)--++(-\DdimensioningBar/2,-\DdimensioningBar/2); 2144 | \end{scope} 2145 | \draw [smallLine] (dimensioningVarA)--(dimensioningVarB) node [sloped,midway,above] {#5}; 2146 | \draw [tinyLine,dotted] (dimensioningVarA)--($ (dimensioningVarA)!{#6cm}!(#2) $) 2147 | (dimensioningVarB)--($ (dimensioningVarB)!{#6cm}!(#3) $); 2148 | }{ 2149 | \begin{scope}[canvas is #1 plane at #8=#7] 2150 | \path 2151 | let 2152 | \p1 = (#2), 2153 | \p2 = (#3) 2154 | in 2155 | coordinate (dimensioningVarA) at (\x1,#4) 2156 | coordinate (dimensioningVarB) at (\x2,#4); 2157 | \draw [smallLine] (dimensioningVarA)--++(0,\DdimensioningBar/2)--++(0,-\DdimensioningBar) 2158 | (dimensioningVarA)--++(\DdimensioningBar/4,\DdimensioningBar/4)--++(-\DdimensioningBar/2,-\DdimensioningBar/2) 2159 | (dimensioningVarB)--++(0,\DdimensioningBar/2)--++(0,-\DdimensioningBar) 2160 | (dimensioningVarB)--++(\DdimensioningBar/4,\DdimensioningBar/4)--++(-\DdimensioningBar/2,-\DdimensioningBar/2); 2161 | \end{scope} 2162 | \draw [smallLine] (dimensioningVarA)--(dimensioningVarB) node [sloped,midway,above] {#5}; 2163 | \draw [tinyLine,dotted] (dimensioningVarA)--($ (dimensioningVarA)!{#6cm}!(#2) $) 2164 | (dimensioningVarB)--($ (dimensioningVarB)!{#6cm}!(#3) $); 2165 | } 2166 | } 2167 | 2168 | %------------------------------------------------ 2169 | % 3dnotation 2170 | %------------------------------------------------ 2171 | % \dnotation{type}{insertion point}{}[][][]; 2172 | % 2173 | % Type 1 2174 | % \dnotation{1}{insertion point}{labelling}[orientation]; 2175 | % 2176 | % Type 2 2177 | % \dnotation{2}{insertion point}{labelling}[orientation]; 2178 | % 2179 | % Type 3 2180 | % \dnotation{3}{initial point}{end point}[labelling][position][orientation]; 2181 | % 2182 | % Type 4 2183 | % \dnotation{4}{initial point}{end point}[labelling][position][orientation][text orientation]; 2184 | % with text orientation: 0 or nothing = parallel to beam, 1=parallel to axis 2185 | % Type 5 2186 | % \dnotation{5}{initial point}{end point}[labelling][position][orientation][text orientation]; 2187 | % with text orientation: 0 or nothing = parallel to beam, 1=parallel to axis 2188 | % Type 6 2189 | % \dnotation{6}{insertion point}{labelling}; 2190 | % 2191 | 2192 | \newcommandx{\dnotation}[7][4=above right,5=.5,6=above,7=sloped]{ 2193 | \global\STNL@ValidCommandTypeOptionfalse 2194 | \ifthenelse{\equal{#1}{1}}{ 2195 | \begin{scope} 2196 | \draw (#2) node [#4]{#3}; 2197 | \end{scope} 2198 | \global\STNL@ValidCommandTypeOptiontrue 2199 | }{} 2200 | 2201 | \ifthenelse{\equal{#1}{2}}{ 2202 | \begin{scope} 2203 | \draw (#2) node [#4]{#3}; 2204 | \draw[bigLine] (#2)--++(0,\DdimensioningBar/2)--++(0,-\DdimensioningBar); 2205 | \end{scope} 2206 | \global\STNL@ValidCommandTypeOptiontrue 2207 | }{} 2208 | 2209 | \ifthenelse{\equal{#1}{3}}{ 2210 | \coordinate (notationVarA1) at ($ (#2)!#5!(#3) $); 2211 | \coordinate (notationVarB1) at ($ (notationVarA1)!\DdimensioningBar/2!90:(#3) $); 2212 | \coordinate (notationVarB2) at ($ (notationVarA1)!\DdimensioningBar/2!-90:(#3) $); 2213 | \draw[bigLine] (notationVarB1)--(notationVarB2); 2214 | \draw (notationVarA1) node [#6]{#4}; 2215 | \global\STNL@ValidCommandTypeOptiontrue 2216 | }{} 2217 | 2218 | \ifthenelse{\equal{#1}{4}}{ 2219 | \ifthenelse{\equal{#7}{1}} 2220 | {\renewcommand{\DhelpVarB}{}} 2221 | {\renewcommand{\DhelpVarB}{sloped}} 2222 | \begin{scope} 2223 | \path (#2) -- (#3) node[inner sep=0mm,rectangle,smallLine,fill=white,draw,minimum size=2.5*\DnoteRadius,midway,#6,\DhelpVarB,pos=#5] {#4}; 2224 | \end{scope} 2225 | \global\STNL@ValidCommandTypeOptiontrue 2226 | }{} 2227 | 2228 | \ifthenelse{\equal{#1}{5}}{ 2229 | \ifthenelse{\equal{#7}{1}} 2230 | {\renewcommand{\DhelpVarB}{}} 2231 | {\renewcommand{\DhelpVarB}{sloped}} 2232 | \begin{scope} 2233 | \path (#2) -- (#3) node[midway,#6,\DhelpVarB,pos=#5] {#4}; 2234 | \end{scope} 2235 | \global\STNL@ValidCommandTypeOptiontrue 2236 | }{} 2237 | 2238 | \ifthenelse{\equal{#1}{6}}{ 2239 | \begin{scope} 2240 | \draw (#2) node [inner sep=0mm,circle,smallLine,fill=white,draw,minimum size=2.5*\DnoteRadius]{#3}; 2241 | \end{scope} 2242 | \global\STNL@ValidCommandTypeOptiontrue 2243 | }{} 2244 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::dnotation: Bad type: #1}\errorstopmode} 2245 | 2246 | } 2247 | 2248 | %------------------------------------------------ 2249 | % 3daddon 2250 | %------------------------------------------------ 2251 | % \daddon{type}{plane}[plane distance]{}{}{}[]; 2252 | % 2253 | % Type 1 2254 | % \daddon{1}{plane}[plane distance]{insertion point}{end point}{position}; 2255 | % 2256 | % Type 2 2257 | % \daddon{2}{plane}[plane distance]{insertion point}{initial point}{end point}[orientation]; 2258 | % with orientation: 1=standard, -1 or 0 = other direction 2259 | % Type 3 2260 | % \daddon{3}{plane}[plane distance]{insertion point}{initial point}{end point}[orientation]; 2261 | % with orientation: 1=standard, -1 or 0 = other direction 2262 | 2263 | \newcommandx{\daddon}[7][3=0,7=1]{ 2264 | 2265 | \ifthenelse{\equal{#2}{xy}} 2266 | {\renewcommand{\DhelpVarA}{z}}{} 2267 | \ifthenelse{\equal{#2}{yx}} 2268 | {\renewcommand{\DhelpVarA}{z}}{} 2269 | \ifthenelse{\equal{#2}{xz}} 2270 | {\renewcommand{\DhelpVarA}{y}}{} 2271 | \ifthenelse{\equal{#2}{zx}} 2272 | {\renewcommand{\DhelpVarA}{y}}{} 2273 | \ifthenelse{\equal{#2}{yz}} 2274 | {\renewcommand{\DhelpVarA}{x}}{} 2275 | \ifthenelse{\equal{#2}{zy}} 2276 | {\renewcommand{\DhelpVarA}{x}}{} 2277 | 2278 | \begin{scope}[canvas is #2 plane at \DhelpVarA=#3] 2279 | \subaddon{#1}{#4}{#5}{#6}[#7]; 2280 | \end{scope} 2281 | } 2282 | 2283 | \newcommandx{\subaddon}[5][5=1]{ 2284 | \global\STNL@ValidCommandTypeOptionfalse 2285 | \ifthenelse{\equal{#1}{1}}{ 2286 | \coordinate (addonVarA1) at ($ (#2)!#4!(#3) $); 2287 | \coordinate (addonVarB1) at ($ (addonVarA1)!\DaddonLength/2!45:(#3) $); 2288 | \coordinate (addonVarB2) at ($ (addonVarA1)!\DaddonLength/2!225:(#3) $); 2289 | \draw[smallLine] (addonVarB1)--(addonVarB2) 2290 | ($(addonVarB1)+1*(\DsupportGap,0)$)--($(addonVarB2)+1*(\DsupportGap,0)$); 2291 | \global\STNL@ValidCommandTypeOptiontrue 2292 | }{} 2293 | 2294 | \ifthenelse{\equal{#1}{2}}{ 2295 | \coordinate (addonVarA1) at ($ (#2)!\DaddonLength!(#3) $); 2296 | \coordinate (addonVarB1) at ($ (#2)!\DaddonLength!(#4) $); 2297 | \ifthenelse{\equal{#5}{1}} 2298 | { 2299 | \coordinate (addonVarC1) at ($ (addonVarA1)!\DaddonLength!90:(#3) $); 2300 | \coordinate (addonVarD1) at ($ (#2)!1.414*\DaddonLength/2!45:(#3) $); 2301 | } 2302 | { 2303 | \coordinate (addonVarC1) at ($ (addonVarA1)!\DaddonLength!-90:(#3) $); 2304 | \coordinate (addonVarD1) at ($ (#2)!1.414*\DaddonLength/2!-45:(#3) $); 2305 | } 2306 | \draw[smallLine] (addonVarA1)--(addonVarC1)-- (addonVarB1); 2307 | \filldraw (addonVarD1) circle (\DsmallLineWidth); 2308 | \global\STNL@ValidCommandTypeOptiontrue 2309 | }{} 2310 | 2311 | \ifthenelse{\equal{#1}{3}}{ 2312 | \begin{scope}[even odd rule] 2313 | \ifthenelse{\equal{#5}{1}}{ 2314 | \clip (#2) circle (\DdimensioningBar+\DnormalLineWidth) 2315 | (#2)--(#3)--($(#3)!\DaddonLength+\DnormalLineWidth!-90:(#2)$)--($(#4)!\DaddonLength+\DnormalLineWidth!90:(#2)$)--(#4)-- cycle; 2316 | }{ 2317 | \clip (#2)--(#3)--($(#3)!\DaddonLength+\DnormalLineWidth!-90:(#2)$)--($(#4)!\DaddonLength+\DnormalLineWidth!90:(#2)$)--(#4)-- cycle; 2318 | } 2319 | \draw [smallLine] (#2) circle (\DaddonLength) 2320 | (#2) circle (\DaddonLength-\DnormalLineWidth-\DnormalLineWidth); 2321 | \end{scope} 2322 | \global\STNL@ValidCommandTypeOptiontrue 2323 | }{} 2324 | \ifthenelse{\boolean{STNL@ValidCommandTypeOption}}{}{\errmessage{stanli::daddon: Bad type: #1}\errorstopmode} 2325 | 2326 | } 2327 | 2328 | %================================================ 2329 | % Modified commands of the 3dplot.sty by Jeff Hein 2009 2330 | %================================================ 2331 | 2332 | %------------------------------------------------ 2333 | % \xtdplotsinandcos{sin}{cos}{theta} 2334 | %------------------------------------------------ 2335 | %determines the sin and cos of the specified angle (in degrees). 2336 | %#1: returns sin(#3) 2337 | %#2: returns cos(#3) 2338 | %#3: user-specified angle 2339 | \newcommand{\xtdplotsinandcos}[3]{% 2340 | \pgfmathsetmacro{#1}{sin(#3)}% 2341 | \pgfmathsetmacro{#2}{cos(#3)}% 2342 | } 2343 | 2344 | %------------------------------------------------ 2345 | % \xtdplotmult{result}{multiplicand}{multiplicator} 2346 | %------------------------------------------------ 2347 | %determines the multiplication of specified values. 2348 | %#1: returns #2*#3 2349 | %#2: user-specified multiplicand 2350 | %#3: user-specified multiplicator 2351 | \newcommand{\xtdplotmult}[3]{% 2352 | \pgfmathsetmacro{#1}{#2*#3}% 2353 | } 2354 | 2355 | %------------------------------------------------ 2356 | % \xtdplotsetrotatedcoords{\alpha}{\beta}{\gamma} 2357 | %------------------------------------------------ 2358 | %generates the coordinate transformation for the rotated coordinate system within the display coordinate system. This should be called only after the display coordinate system has been defined. If the display coordinate system changes, this will have to be updated. 2359 | %#1: user-specified euler angle \alpha. 2360 | %#2: user-specified euler angle \beta. 2361 | %#3: user-specified euler angle \gamma. 2362 | \newcommand{\xtdplotsetrotatedcoords}[3]{% 2363 | % 2364 | \pgfmathsetmacro{\alphaeul}{#1} 2365 | \pgfmathsetmacro{\betaeul}{#2} 2366 | \pgfmathsetmacro{\gammaeul}{#3} 2367 | % 2368 | %perform some trig for the Euler transformation 2369 | \xtdplotsinandcos{\sinalpha}{\cosalpha}{\alphaeul} 2370 | \xtdplotsinandcos{\sinbeta}{\cosbeta}{\betaeul} 2371 | \xtdplotsinandcos{\singamma}{\cosgamma}{\gammaeul} 2372 | % 2373 | \xtdplotmult{\sasb}{\sinalpha}{\sinbeta} 2374 | \xtdplotmult{\sbsg}{\sinbeta}{\singamma} 2375 | \xtdplotmult{\sasg}{\sinalpha}{\singamma} 2376 | \xtdplotmult{\sasbsg}{\sasb}{\singamma} 2377 | % 2378 | \xtdplotmult{\sacb}{\sinalpha}{\cosbeta} 2379 | \xtdplotmult{\sacg}{\sinalpha}{\cosgamma} 2380 | \xtdplotmult{\sbcg}{\sinbeta}{\cosgamma} 2381 | \xtdplotmult{\sacbsg}{\sacb}{\singamma} 2382 | \xtdplotmult{\sacbcg}{\sacb}{\cosgamma} 2383 | % 2384 | \xtdplotmult{\casb}{\cosalpha}{\sinbeta} 2385 | \xtdplotmult{\cacb}{\cosalpha}{\cosbeta} 2386 | \xtdplotmult{\cacg}{\cosalpha}{\cosgamma} 2387 | \xtdplotmult{\casg}{\cosalpha}{\singamma} 2388 | % 2389 | \xtdplotmult{\cacbsg}{\cacb}{\singamma} 2390 | \xtdplotmult{\cacbcg}{\cacb}{\cosgamma} 2391 | % 2392 | %determine rotation matrix elements for Euler transformation 2393 | \pgfmathsetmacro{\raaeul}{\cacbcg - \sasg} 2394 | \pgfmathsetmacro{\rabeul}{-\cacbsg - \sacg} 2395 | \pgfmathsetmacro{\raceul}{\casb} 2396 | \pgfmathsetmacro{\rbaeul}{\sacbcg + \casg} 2397 | \pgfmathsetmacro{\rbbeul}{-\sacbsg + \cacg} 2398 | \pgfmathsetmacro{\rbceul}{\sasb} 2399 | \pgfmathsetmacro{\rcaeul}{-\sbcg} 2400 | \pgfmathsetmacro{\rcbeul}{\sbsg} 2401 | \pgfmathsetmacro{\rcceul}{\cosbeta} 2402 | % 2403 | % transformation from polar coordinates to Cartesian coordinates 2404 | \pgfmathsetmacro{\xxcart}{\DxLength*cos(\DxAngle)} 2405 | \pgfmathsetmacro{\xycart}{\DxLength*sin(\DxAngle)} 2406 | \pgfmathsetmacro{\yxcart}{\DyLength*cos(\DyAngle)} 2407 | \pgfmathsetmacro{\yycart}{\DyLength*sin(\DyAngle)} 2408 | \pgfmathsetmacro{\zxcart}{\DzLength*cos(\DzAngle)} 2409 | \pgfmathsetmacro{\zycart}{\DzLength*sin(\DzAngle)} 2410 | % 2411 | \pgfmathsetmacro{\raarot}{\xxcart} 2412 | \pgfmathsetmacro{\rbarot}{\xycart} 2413 | \pgfmathsetmacro{\rabrot}{\yxcart} 2414 | \pgfmathsetmacro{\rbbrot}{\yycart} 2415 | \pgfmathsetmacro{\racrot}{\zxcart} 2416 | \pgfmathsetmacro{\rbcrot}{\zycart} 2417 | % 2418 | %now, determine master rotation matrix to define euler-rotated coordinates within the display coordinate frame 2419 | \xtdplotmult{\raaeaa}{\raarot}{\raaeul} 2420 | \xtdplotmult{\rabeba}{\rabrot}{\rbaeul} 2421 | \xtdplotmult{\raceca}{\racrot}{\rcaeul} 2422 | % 2423 | \xtdplotmult{\raaeab}{\raarot}{\rabeul} 2424 | \xtdplotmult{\rabebb}{\rabrot}{\rbbeul} 2425 | \xtdplotmult{\racecb}{\racrot}{\rcbeul} 2426 | % 2427 | \xtdplotmult{\raaeac}{\raarot}{\raceul} 2428 | \xtdplotmult{\rabebc}{\rabrot}{\rbceul} 2429 | \xtdplotmult{\racecc}{\racrot}{\rcceul} 2430 | % 2431 | \xtdplotmult{\rbaeaa}{\rbarot}{\raaeul} 2432 | \xtdplotmult{\rbbeba}{\rbbrot}{\rbaeul} 2433 | \xtdplotmult{\rbceca}{\rbcrot}{\rcaeul} 2434 | % 2435 | \xtdplotmult{\rbaeab}{\rbarot}{\rabeul} 2436 | \xtdplotmult{\rbbebb}{\rbbrot}{\rbbeul} 2437 | \xtdplotmult{\rbcecb}{\rbcrot}{\rcbeul} 2438 | % 2439 | \xtdplotmult{\rbaeac}{\rbarot}{\raceul} 2440 | \xtdplotmult{\rbbebc}{\rbbrot}{\rbceul} 2441 | \xtdplotmult{\rbcecc}{\rbcrot}{\rcceul} 2442 | % 2443 | %set up the master rotation matrix elements 2444 | \pgfmathsetmacro{\raarc}{\raaeaa + \rabeba + \raceca} 2445 | \pgfmathsetmacro{\rabrc}{\raaeab + \rabebb + \racecb} 2446 | \pgfmathsetmacro{\racrc}{\raaeac + \rabebc + \racecc} 2447 | \pgfmathsetmacro{\rbarc}{\rbaeaa + \rbbeba + \rbceca} 2448 | \pgfmathsetmacro{\rbbrc}{\rbaeab + \rbbebb + \rbcecb} 2449 | \pgfmathsetmacro{\rbcrc}{\rbaeac + \rbbebc + \rbcecc} 2450 | % 2451 | \tikzset{xtdplot_rotated_coords/.append style={x={(\raarc cm,\rbarc cm)},y={(\rabrc cm, \rbbrc cm)},z={(\racrc cm, \rbcrc cm)}}}% 2452 | } 2453 | 2454 | %------------------------------------------------ 2455 | % \xtdplotsetrotatedcoordsorigin{point} 2456 | %------------------------------------------------ 2457 | %this translates the rotated coordinate system to the specified point. 2458 | %#1: user-specified coordinate 2459 | \newcommand{\xtdplotsetrotatedcoordsorigin}[1]{% 2460 | %\pgfmathsetmacro{\xtdplotrotatedcoordsorigin}{#1}% 2461 | \tikzset{xtdplot_rotated_coords/.append style={shift=#1}}% 2462 | } 2463 | 2464 | %------------------------------------------------ 2465 | % \xtdplotresetrotatedcoordsorigin 2466 | %------------------------------------------------ 2467 | %this resets the rotated coordinate system translation back to the origin of the main coordinate system 2468 | \newcommand{\xtdplotresetrotatedcoordsorigin}{% 2469 | %\pgfmathsetmacro{\xtdplotrotatedcoordsorigin}{#1}% 2470 | \tikzset{xtdplot_rotated_coords/.append style={shift={(0,0,0)}}}% 2471 | } 2472 | 2473 | %============================================================================= 2474 | %%% Local Variables: 2475 | %%% mode: latex 2476 | %%% TeX-master: t 2477 | %%% End: 2478 | 2479 | 2480 | 2481 | 2482 | 2483 | 2484 | --------------------------------------------------------------------------------