<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Daniel D. Johnson (Posts about parsing)</title><link>https://www.danieldjohnson.com/</link><description></description><atom:link href="https://www.danieldjohnson.com/categories/parsing.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:daniel.dw.johnson@gmail.com"&gt;Daniel D. Johnson&lt;/a&gt; </copyright><lastBuildDate>Mon, 01 Sep 2025 09:09:05 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Whiteboard Drawing Bot - Part 3: Editor</title><link>https://www.danieldjohnson.com/2014/08/04/whiteboard-drawing-bot-part-3-editor/</link><dc:creator>Daniel D. Johnson</dc:creator><description>&lt;div&gt;&lt;p&gt;After completing the basic design and software for the whiteboard drawing bot, I decided to make an interactive simulator and shape editor to allow people to generate their own commands. I thought it would be cool to share it as well, in case other people wanted to play with the stroking/filling algorithms or use it to run their own drawing robots or do something else with it entirely.&lt;/p&gt;

&lt;p&gt;For the simulator, I wrote a parser to parse the command sequence, and then animated it drawing the command out onto the screen. The parser is written with PEG.js, which I'll be discussing a bit later. The parameters for the generation and rendering are controlled using &lt;a href="http://workshop.chromeexperiments.com/examples/gui/"&gt;DAT.gui&lt;/a&gt;, and the drawing itself is done using two layered canvases: the bottom one to hold the actual drawing that persists from frame to frame, and the top one to render the arms, which are cleared and redrawn each frame. I separated them because I did not want to have to re-render the entire drawing each time the simulator drew anything new. &lt;/p&gt;&lt;p&gt;&lt;a href="https://www.danieldjohnson.com/2014/08/04/whiteboard-drawing-bot-part-3-editor/"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>canvas</category><category>javascript</category><category>parsing</category><category>project writeup</category><category>simulation</category><category>Uncategorized</category><guid>https://www.danieldjohnson.com/2014/08/04/whiteboard-drawing-bot-part-3-editor/</guid><pubDate>Mon, 04 Aug 2014 02:47:16 GMT</pubDate></item></channel></rss>