ExampleAnchorPlate

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
unitlength 0.2 mm;    # Das heisst Massstab 1:5, Einheit Millimeter


# Eingaben
# --------

# SI-Einheiten: mm, kN
# Nullpunkt ist Plattenmittelpunkt

set b           350;    # Plattenbreite
set h           350;    # Plattenhöhe
set d           12; # zu zeichnender Dübeldurchmesser im Durchgangsloch
set df          20; # Durchgangsloch in Ankerplatte
set c           40; # nomineller Randabstand Dübel

# Profil zeichnen
box -50 -50  50 50
box -45 -45  45 45



# Eingabekontrollen
assert "$b > 4*$c"  {Eingabekontrolle Plattenbreite}
assert "$h > 4*$c"  {Eingabekontrolle Plattenhöhe}
assert "$d > 5"     {Eingabekontrolle Dübeldurchmesser}
assert "$df > 5"    {Eingabekontrolle Durchgangsloch}

# Zeichnen der Achsen
set achsueberstand  10
pen gray dashdotted 0.35
line [expr -$b /2 - $achsueberstand] 0   [expr $b /2 + $achsueberstand] 0
line 0 [expr -$h /2 - $achsueberstand]   0 [expr $h /2 + $achsueberstand]

# Zeichnen der Ankerplatte
set TL [// "-$b -$h" 2]; set TR [// "$b -$h" 2]
set BL [// "-$b  $h" 2]; set BR [// "$b  $h" 2]
pen black solid 0.7;
box $TL $BR

# Zeichnen des Dübels
set DbTL [++ $TL "$c $c"];      set DbTR [++ $TR "-$c $c"]
set DbBL [++ $BL "$c -$c"];     set DbBR [-- $BR "$c $c"]
pen gray 0.5;
fillcircle $DbTL  [/ $d 2.];    fillcircle $DbTR  [/ $d 2.]
fillcircle $DbBL  [/ $d 2.];    fillcircle $DbBR  [/ $d 2.]
pen 0.35 black
circle $DbTL  [/ $df 2.];       circle $DbTR  [/ $df 2.]
circle $DbBL  [/ $df 2.];       circle $DbBR  [/ $df 2.]

# Vermassung
dimline ticks
set xdim  [mm 8]
# Ankerplatte
pen 0.35
dimline [geom.parallel $BL $BR $xdim]
dimline [geom.parallel $TL $BL $xdim]
# Dübel
pen gray
m [++ $TR "$xdim 0"]
dimlinerel 0 $c
dimlinerel 0 [expr $h - 2*$c]
dimlinerel 0 $c
m [++ $TL "0 -$xdim"]
dimlinerel $c 0
dimlinerel [expr $b - 2*$c] 0
dimlinerel $c 0

Related

Wiki: Examples