ExampleBeam2

Drawj2d output

 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
#! drawj2d -T svg -r96  -W 100 -H 100 -X 40 -Y 10 ExampleBeam2.hcl

unitlength 10

set A {-2.0 0}
set B {4.1 0}
set q 10.0

set L [X [-- $B $A]]
set M0 [expr $q * $L^2 / 8]
set V0 [expr $q * $L]


# procedure to draw the base line
proc drawBaseline {from to lb} {
    set XY0 [here]
    moverel $from 0
    label $lb W
    linerel [- $to $from] 0
    moveto $XY0
}

# procedure to draw a bearing
proc lager {pos} {
    moveto $pos
    linerel -[mm 1.5] [mm 3]
    linerel [mm 3] 0
    lineto $pos
}

# Draw the static system
pen 1.0
line $A $B

pen 0.5
lager $A
lager $B

dimline [geom.parallel $A $B [mm 12]]
label "q = $q kN/m" $A $B

# Draw the shear V
moveto [++ [geom.online $A $B 0.5] "0 [mm 40]"]
set cV [here]
set sV 0.05; # Scaling factor
pen dashdotted 0.35
drawBaseline [/ -$L 2.] [/ $L 2.] {V [kN]}
pen
mr [expr -$L /2] [expr $V0 /2 * $sV]
linerel $L [expr -1 * $V0 * $sV]
m $cV

pen 0.35
moverel [expr $L /2 + [mm 8]] [expr $sV * -$V0 /2]
dimlinerel 0 [expr $sV * $V0 /2]  "[nf [/ $V0 2.] 1]"
dimlinerel 0 [expr $sV * $V0 /2]  "[nf [/ $V0 2.] 1]"

# Draw the moment M
moveto [++ [geom.online $A $B 0.5] "0 [mm 65]"]
set cM [here]
set sM 0.05; # Scaling factor
pen dashdotted 0.35
drawBaseline [/ -$L 2.] [/ $L 2.] {M [kNm]}
pen
quadcurve [-- $cM "[/ $L 2.] 0"] [++ $cM "0 [* 2 $M0 $sM]"] [++ $cM "[/ $L 2.] 0"]
moveto $cM

pen 0.35
moverel [expr $L /2 + [mm 8]] 0
dimlinerel 0 [expr $sM * $M0]  "[nf $M0 1]"

Related

Wiki: Examples

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.