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