Blog

 

Animator, 2d interactive drawing

animator by Tibor 'Igor2' Palinkas on 2020-02-13

Tags: tool, draw

node source

 

 

Abstract: n/a

 

Datasheet

Project animator
Scope CLI driven 2D vector drawing/animation
Status works; finished (not actively developed)
License GPL2+
Web http://www.repo.hu/projects/animator
VCS svn://svn.repo.hu/animator/trunk

UNIX background

In 2010 a new task writer team was gathering the small office room of Mave. Third of the people came from the previous task writer team, mostly to pass on the experience. Another third were university students with years of experience entering programming contests. Finally, the last third, also veteran contestants, came from the software industry and happened to have strong UNIX background. I was part of this third group.

Most of the previous task writers gradually faded away from the meetings with a few notable exceptions. For the pre-EC and EC in 2010, the task evaluation infrastructure was provided by the UNIX guys. During preparations and after the first two successful events, the rest of the team started to like the UNIX idea of building from small, independent tools instead of relying on large frameworks.

Animator

Most of our code, input generators, solvers, evaluators were command line utilities because they mostly had to process some (usually plain text) input on stdin and had to emit (usually also plain text) output on stdout. However, debugging the code was a bit different. One of the problem we faced was lack of being to easily visualize things. This mostly meant simple, static 2d drawings, or in a few cases even animation: a sequence of such 2d drawn frames showing how a solver progressed.

I was one of those who faced this problem first. It happened while I was working on the 2010/EC/E Bridge building problem. I could really use a drawing of grid structures and forces. I could generate postscript files, but viewing them wouldn't be too convenient back then and animation would be impossible.

I discussed this problem with Mate Nagy who had a very good idea he then started to implement. The idea, called animator , is an open source command line tool that implements a domain specific language designed for drawing 2d vector graphics. It can draw the result using SDL. It reads commands on stdin to control drawing multiple frames in a sequence, even in real-time manner. Plus it has an option for interactivity, reporting back keyboard and mouse activity on stdout. It can also render into png, running on a server.

We used it every now and then for various challenge24 tasks or even outside of the contest. For example edakrill generates some of the previews using animator. An extreme example is 2012/final/L Wheelchair where Mate wrote an interactive level editor (sort of a CAD) using python, plumb and animator.

Next level of this idea is projector, which implements a similar language for 3d software rendering.