aUCBLogo Demos and Tests / testwritecoordinates
to testWriteCoordinates
initGraph
render
printCoors coors
rotatescene
writeFile "tmp.dat coors
end
to initGraph
perspective
clearScreen
enableCylinderLines
setPenSize [5 5]
setPenColor "red
end
to render
fd2 100
right 30
fd2 50
down 60
PenUp
fd2 50
leftRoll 45
left 45
PenDown2
fd2 50
end
to writeFile filename coors
openWrite filename
setWriter filename
printCoors coors
(print)
setWriter []
close filename
end
to printCoors coors
foreach coors
[ type "<
(type first ?)
foreach butFirst ?
[ (type ",\ ?)
]
print ">
]
end
to appendPos
ifElse Name? "coors
[ coors=lPut PosXYZ coors
][ coors=(list PosXYZ)
]
end
to fd2 l
fd l
if PenDown?
[ appendPos
]
end
to PenDown2
if not PenDown?
[ appendPos
]
PenDown
end