1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
%%
%% This is file `pst-stru.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-stru.tex'
%%
%% Authors : Giuseppe Matarazza <joematara@hotmail.com>
%% Manuel LUQUE <Mluque5130@aol.com>
%% Herbert Voss <voss@pstricks.de> (pst-xkey)
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%% `pst-stru' is a PSTricks package for civil engineers
%%
\csname PSTCircLoaded\endcsname
\let\PSTCircLoaded\endinput
% Require PSTricks and pst-node packages
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-plot.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey\fi
%
\def\fileversion{0.12}%
\def\filedate{2006/10/26}%
\message{`PST-Stru v\fileversion, \filedate\space (GM, ML)}%
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\pst@addfams{pst-stru}
%
\SpecialCoor
\psset{dimen=middle}
\newdimen\Start
\newdimen\debut
\newdimen\fin
\newdimen\Pst@Pos
\newcount\PAS
%
\define@boolkey[psset]{pst-stru}[Pst@]{node}[true]{}
\define@key[psset]{pst-stru}{position}{\def\psk@circuit@Pos{#1}}
\define@key[psset]{pst-stru}{OffsetLabel}{\def\psk@Label@Offset{#1}}
\define@key[psset]{pst-stru}{OffsetDipole}{\def\psk@Dipole@Offset{#1}}
\define@key[psset]{pst-stru}{AngleLabel}{\def\psk@Angle@Label{#1}}
\psset{position=0.5,node=false,OffsetLabel=0.70,OffsetDipole=0,AngleLabel=0}
%Commande permettant de placer un dipôle entre deux noeuds
%
\def\circput{\@ifnextchar[{\pst@circput}{\pst@circput[]}}
\def\pst@circput[#1](#2)(#3)#4#5{{%
\psset{#1}
\Pst@Pos=\psk@circuit@Pos pt
\multiply\Pst@Pos by 2
\def\Position{\pst@number\Pst@Pos}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/k \psk@circuit@Pos\space def
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/XM X1 1 k sub mul X2 k mul add def
/YM Y1 1 k sub mul Y2 k mul add def
/deno X2 X1 sub def
/num Y2 Y1 sub def
/angle num deno Atan def
/XE1 XM 1 angle cos mul sub def
/YE1 YM 1 angle sin mul sub def
/XE2 XM 1 angle cos mul add def
/YE2 YM 1 angle sin mul add def
XM YM){M@}
\pnode(! XE1 YE1){E@1}
\pnode(! XE2 YE2){E@2}
\pcline(E@1)(#2)
\pcline(E@2)(#3)
\ncline[linestyle=none]{#2}{#3}
\ncput[npos=\Position]{\pnode{Temp}}
\pcline[linestyle=none,offset=\psk@Dipole@Offset](#2)(Temp)
\lput{:U}{#4}
\pcline[linestyle=none,offset=\psk@Label@Offset](#2)(Temp)
\lput{\psk@Angle@Label}{#5}
}}
% Commande permettant de dessiner une flèche de longueur variable
% entre deux noeuds
\define@key[psset]{pst-stru}{length}{\edef\psk@circuit@Arrowlenght{#1}}
\define@key[psset]{pst-stru}{start}{\edef\psk@circuit@start{#1}}
\psset{length=1,start=0.5}
%
\def\psArrow{\@ifnextchar[{\pst@Arrow}{\pst@Arrow[]}}
\def\pst@Arrow[#1](#2)(#3)#4{{%
\psset{#1}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/length \psk@circuit@Arrowlenght\space def
/K \psk@circuit@start\space def
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/XM X1 1 K sub mul X2 K mul add def
/YM Y1 1 K sub mul Y2 K mul add def
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/Angle Y2 Y1 sub X2 X1 sub Atan def
/XE1 XM length Angle cos mul add def
/YE1 YM length Angle sin mul add def
XE1 YE1){E@}%
\pnode(! XM YM){M@@}
\psset{arrows=->}
\psline[#1](M@@)(E@)%
\pcline[linestyle=none,offset=\psk@Label@Offset,arrows=-](M@@)(E@)
\lput{\psk@Angle@Label}{#4}
}}
%
\def\node(#1){%
\pscircle*(#1){2\pslinewidth}
}
\def\arrow{%
\psline[arrowinset=0,arrowscale=1.0,linewidth=0.75\pslinewidth]{->}(-2,0)(0,0)%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Structural Engineering: MACROs
% Updating:
% 7-10-2003 1) \def\fixedend
% 7-10-2003 2) macro \psArrowCivil
% 8-10-2003 3) macro \psArrowCivil: revised on loads label position
% 11-10-2003 4) \def\hinge, \def\roller, \def\guide, \interhinge,
% \def\clockCouple, \def\noclockCouple
%
% 25-10-2003 5) macro \triload for Parameterized Structure ps_01
% 2-11-2003 6) updating the above macro
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\fixedend{%
\psframe[fillstyle=vlines,linestyle=none,hatchwidth=0.5\pslinewidth](-0.5,0)(0.5,-0.2)
\psline[linewidth=1.5\pslinewidth](-0.5,0)(0.5,0)
}
\def\hinge{%
\psframe[fillstyle=vlines,linestyle=none,hatchwidth=0.5\pslinewidth](-0.3,-0.45)(0.3,-0.3)
\psline[linewidth=1.5\pslinewidth](-0.3,-0.3)(0.3,-0.3)
\psline(0,0)(-0.3,-0.3)
\psline(0,0)(0.3,-0.3)
}
\def\interhinge{%
\pscircle[fillstyle=solid](0,0){0.1}
}
\def\guide{%
\psframe[fillstyle=vlines,linestyle=none,hatchwidth=0.5\pslinewidth](-0.3,-0.3)(0.3,-0.1)
\psline[linewidth=1.5\pslinewidth](-0.3,-0.1)(0.3,-0.1)
\psline[linewidth=1.5\pslinewidth](-0.3,0.1)(0.3,0.1)
\psframe[fillstyle=vlines,linestyle=none,hatchwidth=0.5\pslinewidth](-0.3,0.3)(0.3,0.1)
}
\def\roller{%
\psframe[fillstyle=vlines,linestyle=none,hatchwidth=0.5\pslinewidth](-0.3,-0.7)(0.3,-0.5)
\psline[linewidth=1.5\pslinewidth](-0.3,-0.3)(0.3,-0.3)
\psline(0,0)(-0.3,-0.3)
\psline(0,0)(0.3,-0.3)
\psline(-0.3,-0.5)(0.3,-0.5)
\pscircle(-0.15,-0.4){0.1}
\pscircle(0.15,-0.4){0.1}
}
\def\noclockCouple{%
\psset{arrowsize=1.8mm}
\psarc{->}(0,0){0.5}{280}{60}
}
\def\clockCouple{%
\psset{arrowsize=1.8mm}
\psarc{<-}(0,0){0.5}{120}{260}
}
%% Macro \psArrowCivil
%% ===================
\define@key[psset]{pst-stru}{RotArrows}{\edef\psk@circ@RotArrows{#1}}
\psset{RotArrows=0}
\def\psArrowCivil{\@ifnextchar[{\pst@ArrowCivil}{\pst@ArrowCivil[]}}
\def\pst@ArrowCivil[#1](#2)(#3)#4{{%
\psset{#1}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/length \psk@circuit@Arrowlenght\space def
/K \psk@circuit@start\space def
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/XM X1 1 K sub mul X2 K mul add def
/YM Y1 1 K sub mul Y2 K mul add def
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/Angle Y2 Y1 sub X2 X1 sub Atan def
/RotArrows 180 90 \psk@circ@RotArrows\space add Angle add sub def
/XC XM length RotArrows cos mul sub def
/YC YM length RotArrows sin mul add def
XC YC){C@}%
\pnode(! XM YM){M@@}
\psset{arrows=->}
\psline[#1](C@)(M@@)%
\pcline[linestyle=none,offset=\psk@Label@Offset,arrows=-](C@)(M@@)
%\lput{\psk@Angle@Label}{#4}
\lput{:U}{#4}
}}
%%
%% End: Macro \psArrowCivil %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Starting Macro \triload
%% =======================
%
\define@key[psset]{pst-stru}{K}{\edef\psk@triload@K{#1}}
\define@key[psset]{pst-stru}{L}{\edef\psk@triload@L{#1}}
\define@key[psset]{pst-stru}{P}{\edef\psk@triload@P{#1}}
\define@key[psset]{pst-stru}{scaleFactor}{\edef\psk@triload@F{#1}}
\psset{K=3,L=6,P=6,scaleFactor=0.15}
\def\triload{\@ifnextchar[{\pst@triload}{\pst@triload[]}}
\def\pst@triload[#1]{{%
\psset{#1}
\pnode(0,0){A}
\pnode(! /xB \psk@triload@L\space \psk@triload@K\space mul def xB 0){B}
\pnode(! /xC \psk@triload@K\space 1 add \psk@triload@L\space mul def xC 0){C}
%
\pnode(! /xB1 \psk@triload@L\space \psk@triload@K\space mul def xB1 -1){B1}
\pnode(! /xC1 \psk@triload@K\space 1 add \psk@triload@L\space mul def xC1 -1){C1}
%
\pnode(! /xB2 \psk@triload@L\space \psk@triload@K\space mul def xB2 -3){B2}
\pnode(! /xC2 \psk@triload@K\space 1 add \psk@triload@L\space mul def xC2 -3){C2}
%
\pnode(! /xC3 \psk@triload@K\space 1 add \psk@triload@L\space mul 0.25 add def xC3 0.5){C3}
%
\rput{0}(C){\hinge}
\rput{0}(B){\roller}
\psline[linecolor=red,fillcolor=yellow,fillstyle=solid](0,0)(!xC 0)(! xC 1)(0,0)
%
%
\rput(1,-2){$k=\psk@triload@K\space \quad l=\psk@triload@L\space$}
\rput(C3){\Large p}
\rput(0,-0.4){\Large A}
\rput(B1){\Large B}
\rput(C1){\Large C}
%
\pcline[offset=0,linecolor=blue]{|-|}(0,-3)(B2)
\lput*{:U}{\bf $k\cdot l$}
\pcline[offset=0,linecolor=blue]{|-|}(B2)(C2)
\lput*{:U}{\bf $l$}
% --------- Triangular Distributed Load -------------------------
\multido{\nStart=1.00+0.025}{-37}{%
\psArrowCivil[RotArrows=0,length=\nStart,start=\nStart,%
linecolor=magenta](A)(C){}}
% définir les fonctions ici
\pnode(! /func1 {\psk@triload@K\space 1 add \psk@triload@P\space exch div
-6.0 div \psk@triload@L\space div x mul x mul x mul
\psk@triload@F\space mul neg} def
/func2 {\psk@triload@K\space 1 add \psk@triload@P\space exch div
-2.0 div \psk@triload@L\space div x mul x mul
\psk@triload@F\space mul} def
/func3 {\psk@triload@K\space 1 add \psk@triload@P\space exch div
-6.0 div \psk@triload@L\space div x mul x mul x mul
\psk@triload@K\space \psk@triload@L\space mul neg x add
\psk@triload@K\space 1 add mul
\psk@triload@K\space 1 add mul
\psk@triload@P\space mul 6.0 div \psk@triload@L\space mul add
\psk@triload@F\space mul neg} def
/func4 {\psk@triload@K\space 1 add \psk@triload@P\space exch div
-2.0 div \psk@triload@L\space div x mul x mul
\psk@triload@K\space 1 add
\psk@triload@K\space 1 add mul 6.0 div
\psk@triload@P\space mul \psk@triload@L\space mul add
\psk@triload@F\space mul} def
0 0){Temp}
%----------- Bending Moment in span AB ----------------------
\pscustom[linecolor=blue,linewidth=1pt,fillstyle=hlines]{
\psplot{0}{xB}{func1}
\psline(B)(A)}
%----------- Shear in span AB ----------------------
\pscustom[linecolor=green,linewidth=1pt,fillstyle=crosshatch]{
\psplot{0}{xB}{func2}
\psline(B)(A)}
%
% ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
%
% ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
%
%----------- Bending Moment in span BC ----------------------
\pscustom[linecolor=blue,linewidth=1pt,fillstyle=hlines]{
\psplot{xB}{xC}{func3}
\psline(C)(B)}
%----------- Shear in span BC ----------------------
\pscustom[linecolor=green,linewidth=1pt,fillstyle=crosshatch]{
\psplot{xB}{xC}{func4}
% Closing Shear diagram in bearing B (right side)
\psline(C)(B)(! xB /x xB def func4)}
}}
\catcode`\@=\PstAtCode\relax
%%
%% End: Macro \triload %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END: pst-stru.tex
|