其中“入口”表示-win_width/2< x< win_width/2和-win_height/2 y< win_height/2
我的应用程序会产生乌龟图形窗口的低分辨率字符图。我的主要目标是教授“新手编程”。我发现Turtle中的图形显示是有用的工具。但是,对于盲人,我们还有其他克服障碍。我的应用程序通过将其程序创建的乌龟图形转换为由字符组成的地图来支持盲人程序员。该文本可以发送到盲文压花器,创建一个压花打印输出,程序员可以用手指横穿其生产,例如简单的数字,例如正方形。作为触摸折衷方案,我们选择了一个40个字符的字符网格,高25行高。我们将颜色模拟为颜色文本的第一个字符(英语)。
为了帮助我的分析和开发,该应用程序会产生辅助输出,例如盲文显示窗口。
到目前为止,我的进度包括两个版本,均基于基于Turtle的类Turtlebraille的衍生而产生预期的Turtle图形以及印刷输出(将发送到压花),此外,如果需要,如果需要,Braille窗口窗口显示。
版本:
-
拦截,然后翻译乌龟命令,例如goto():
a。将命令传递到海龟
b。将命令转换为tkinter.canvas命令,例如canvas.create_line()
状态:在大部分时间代码工作:GitHub Raysmith619/resource_lib(在开始)
-
让乌龟命令在大部分时间内传递到乌龟。 /p>
a。我们拦截了一些命令,例如用于调试和分析的goto。
b。在所有命令完成 - at(done(done(),mainloop()))之后,我们“刮擦”了tkinter画布。我们使用canvas.find_overlapping(子部门区域)通过子部门部分循环在画布区域上,以确定应与子层框架相交的哪个项目相交,以选择“ braillecell”。
状态:使用大问题代码工作:GitHub射手619/Turtlebraille
这是我们的问题发生的地方:这些项目的帆布坐标通常出乎意料地具有负坐标,使翻译后的X位置和翻转Y位置。
用盲文窗口覆盖的乌龟情节
说实话,我们必须伪装才能显示图形。我们在github readme中进行了更多描述。
对于有兴趣的人,我们包括工作版本1。TurtlePlot
快照
盲文窗口
印刷输出 - 注定盲文输出设备

Python程序创建图
Where "inbounds" means -win_width/2 < x < win_width/2 and -win_height/2 y < win_height/2
My application produces a low resolution character map of the turtle graphics window. My primary goal is to teach programming to the "new to programming". I've found graphics display in turtle to be a useful tool. But with the blind we have additional obstacles to overcome. My application supports the blind programmer by converting the turtle graphic that their program creates into a map, consisting of characters. This text can be sent to a Braille embosser, creating an embossed printout over which the programmer can traverse with fingers to see their production such as simple figures e.g. squares. As a touch compromise we chose a character grid of 40 characters wide and 25 lines high. We simulate color as the first character of the color text(English).
To aid in my analysis and development, the application produces auxiliary output such as braille display windows.
My progress, so far includes two versions, both based on deriving a class TurtleBraille based on Turtle which generates the expected turtle graphics plus the printed output(to be sent to the embosser), plus, if requested, Braille window display.
Versions:
-
Intercepting and then translating the turtle commands such as goto():
a. passing command to turtle
b. converting command into tkinter.Canvas commands such as canvas.create_line()
Status: Working for the most part code: GitHub raysmith619/resource_lib (At beginning)
-
Letting the turtle commands, for the most part, pass on to turtle.
a. We intercept some of the commands, such as goto for debugging and analysis.
b. After all commands are complete - at (done(), mainloop()), we "scrape" the tkinter Canvas. We loop over the canvas area via subrectangle sections, using canvas.find_overlapping(subrectangle area) to determine which, if any, items intersect with the subrectangle to select the "BrailleCell" should be created for display.
Status: Working, with a Big problem code: GitHub raysmith619/TurtleBraille
Here is where our problem occurs: The Canvas coordinates for the items often unexpectedly have negative coordinates giving translated x position and flipped y position.
Turtle Plot Overlayed with Braille Window

To be honest, we had to fudge in order to get the figure displayed. We describe a bit more in the GitHub readme.
For the interested, we include some shots of the working version 1.
Turtle Plot Snapshot

Braille Window

Printed output - destined for Braille output device

Python program to create plots

发布评论