aUCBLogo Demos and Tests / testfillrect2
be testfillrect2
cs
perspective
axes
wireframe=true
pu
fillRect2 [-10 -20][200 100] 50
rotatescene2
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