aUCBLogo Demos and Tests / mixerdrawing
be mixerdrawing
mm=3
scrunchx=0.97
scrunchy=1
scrunchz=1
pin=2.54*mm
size=200*mm
width=56.3*mm
height=25*mm
bthick=3.8*mm
sthick=6.5*mm
fthick=23.5*mm
f2thick=35.5*mm
sowidth=8*mm
sothick=3.6*mm
erad=7*mm
psize=135*mm ;max. 137*mm
pwidth=38.3*mm ;max. 43.5*mm
pthick=1.5*mm
msize=51*mm
mwidth=38.3*mm
mheight=13.3*mm
pssize=32*mm
pswidth=20.5*mm
psheight=10.5*mm
screwheadr=2*mm
sclen=mheight+pthick+sothick+bthick-0.5*mm ;sclen=21.7*mm
scd=1*mm
height2=height-bthick ;21.2*mm
height3=height2-sothick ;17.6*mm
alpha=0.8
local [cklotz csocket cplatine cmixer cpowersupply cscrew cterm]
singleshot=Name? "framenr
setscrunch scrunchx scrunchy scrunchz
perspective
cs
setPenSize [1 1]
setMaterialSpecular HSB 70 0.5 0.5
setMaterialShininess 100
setLightSpotExponent 1
hideTurtle
PenUp
; enableCylinderLines
setColors alpha
;ignore [
wireframe=false
disableLighting
disableDepthTest
draw
enableLighting
enableDepthTest
setColors alpha/2
home
draw
(rotatescene2 1 0 1)
if singleshot [stop]
wireframe=true
setColors alpha
clearScreen
orthographic
disableDepthTest
setEye {0 0 1000}{0 0 0}{0 1 0}
draw
setEye {1000 0 0}{0 0 0}{0 1 0}
home setRelPos 0 150 0
draw
setEye {0 1000 0}{0 0 0}{0 0 1}
home setRelPos 0 0 -150
draw
ignore [
cs
unperspective
home
platine
]
be setColors alpha
cklotz=HSBA 240 0.1 0.7 alpha
csocket=HSBA 240 0.2 0.7 alpha
cplatine=HSBA 20 0.6 0.7 alpha
cmixer=HSBA 40 0.3 1 alpha
cpowersupply=HSBA 0 0 1 alpha
cscrew=HSBA 0 0 0.1 alpha
cterm=HSBA 30 0.5 1 alpha
end
be draw
down 90
setFC cklotz
setPC cklotz
fillRect2 List -size/2 -width/2 List size/2 width/2 bthick
setRelPos 0 0 bthick
p1=PosO
fd width/2
up 90
fillRect2
List -size/2+fthick 0
List size/2-f2thick height2 sthick
down 90
back width
rt 180
up 90
fillRect2
List -size/2+f2thick 0
List size/2-fthick height2 sthick
down 90
back width/2
rt 90
fd size/2
up 90
fillRect2 List -width/2 0 List width/2 height2 fthick
down 90
back size
rt 180
up 90
fillRect2 List -width/2 0 List width/2 height2 f2thick
down 90
setPosO p1
setFC csocket
fillRect2
List -size/2+fthick width/2-sthick-sowidth
List size/2-f2thick width/2-sthick
sothick
fillRect2
List -size/2+fthick -(width/2-sthick-sowidth)
List size/2-f2thick -(width/2-sthick)
sothick
left 90
setRelPos width/2-sthick-erad size/2-fthick-erad sothick
up 90
(Cylinder height3 erad erad 0 90)
down 90
left 90 fd width-2*(sthick+erad)
up 90
(Cylinder height3 erad erad 0 90)
down 90
setPosO p1
rt 90
setRelPos width/2-sthick-erad size/2-f2thick-erad sothick
up 90
(Cylinder height3 erad erad 0 90)
down 90
left 90 fd width-2*(sthick+erad)
up 90
(Cylinder height3 erad erad 0 90)
down 90
setPosO p1
setRelPos size/2-f2thick-(size-fthick-f2thick)/2 0 bthick
pplatine=PosO
setFC cplatine
fillRect2 List -psize/2 -pwidth/2 List psize/2 pwidth/2 pthick
setRelPos psize/2-msize/2 0 pthick+0.1*mm
rt 180
setFC cmixer
pm1=PosO
fillRect2 List -msize/2 -mwidth/2 List msize/2 mwidth/2 mheight
setRelPos msize+0.1*mm 0 0
pm2=PosO
fillRect2 List -msize/2 -mwidth/2 List msize/2 mwidth/2 mheight
setFC cpowersupply
setRelPos msize/2+3*pin 0 0
fillRect2 List 0 -pssize/2 List pswidth pssize/2 psheight
setPosO pm1
screws
setPosO pm2
screws
setPosO pm1
terminals
setPosO pm2
rt 180
terminals
be screws
setPC cscrew
setFC cscrew
setRelPos msize/2-3*mm 7.5*mm mheight
screw
setRelPos 0 -2*7.5*mm 0
screw
setRelPos -msize+2*3*mm 0 0
screw
setRelPos 0 2*7.5*mm 0
screw
be screw
pd Circle screwheadr pu
down 90
Cylinder sclen scd/2
ifelse not wireframe
[ (Cylinder screwheadr screwheadr 0)
][ sphere 1
]
up 90
end
end
be terminals
termlen=18*mm
termd=8*mm
termspace=13*mm
setPC cterm
setFC cterm
setRelPos termspace/2 mwidth/2 5.5*mm
terminal
setRelPos -termspace*2 0 0
terminal
setRelPos termspace*2.5 -mwidth 0
rt 180
terminal
be terminal
local [p c]
p=PosO
Cylinder termlen termd/2
fd termlen
up 90 fillCircle termd/2 down 90
c=PC
setPC cscrew
pd back termlen pu
setPC c
setPosO p
end
end
end
be platine
local [p0 pm1 pm2 pps]
setFC cplatine
setPC cplatine
rect List -psize/2 -pwidth/2 List psize/2 pwidth/2
p0=PosO
setRelPos -psize/2+msize/2 0 0
pm1=PosO
rect List -msize/2 -mwidth/2 List msize/2 mwidth/2
setRelPos msize+0.1*mm 0 0
pm2=PosO
rect List -msize/2 -mwidth/2 List msize/2 mwidth/2
setRelPos msize/2+3*pin 0 0
pps=PosO
rect List 0 -pssize/2 List pswidth pssize/2
setPosO p
st
setPosO pm1
setRelPos msize/2-7.5*mm 7.5*mm 0
end
be fillRect2 p1 p2 thickness
ifelse wireframe
[ local [p]
p=PosO
rect p1 p2
setRelPos p1.1 p1.2 0
leftroll 90
rect [0 0] List thickness p2.2-p1.2
down 90
rect [0 0] List thickness p2.1-p1.1
up 90
setRelPos 0 p2.2-p1.2 p1.1-p2.1
down 180
rect [0 0] List thickness p2.2-p1.2
down 90
rect [0 0] List thickness p2.1-p1.1
setPosO p
][
fillRect p1 p2
p=PosO
fd p2.2
right 90
fd p2.1
rightroll 90
fillRect [0 0] List -thickness p1.1-p2.1
down 90
fillRect [0 0] List -thickness p1.2-p2.2
fd p1.2-p2.2
down 90
fillRect [0 0] List -thickness p2.1-p1.1
fd p2.1-p1.1
down 90
fillRect [0 0] List -thickness p1.2-p2.2
setPosO p
up 90
fd thickness
down 90
fillRect p1 p2
down 90
fd thickness
up 90
]
end
end
be PosO
output List PosXYZ Orientation
end
be setPosO p
setPosXYZ p.1
setOrientation p.2
end
be setRelPos x y z
fd y
rt 90 fd x left 90
up 90 fd z down 90
end
be rect p1 p2
local [p]
p=PosO
setRelPos p1.1 p1.2 0
PenDown
setRelPos 0 p2.2-p1.2 0
setRelPos p2.1-p1.1 0 0
setRelPos 0 p1.2-p2.2 0
setRelPos p1.1-p2.1 0 0
PenUp
setPosO p
end