convert asciiart to handwritten sketches
#-------------------.
|[0] |
| .---# .---# #---. |
| |[1]| |[1]| |[2]| |
| #---' #---' '---# |
| ^ ^ ^ |
#---+-----+--=--+---#
| | | | |
| a 2 sketch |
'-------------------#
github.com/arnehilmann/a2sketch
[0]: {"fill": "#933", "a2s:delref": true, "fillStyle": "solid"}
[1]: {"fill": "#bbb", "a2s:delref": true, "fillStyle": "solid"}
[2]: {"fill": "#bbb", "a2s:delref": true, "fillStyle": "solid", "a2s:type": "circle"}
docker pull arne/a2sketch:0.11
docker run -it -p 22357:22357 arne/a2sketch:0.11
curl -s --data-binary "-=-=- tadahh -==-" http://localhost:22753/a2sketch -o sketch.svg
open sketch.svg
see the original How Do I Draw Section of the old asciitosvg readme
To test your asciiart rendering and your custom shapes locally, you can use the following make
targets:
-
start
builds the image and starts the server -
stop
stops the server -
test
runs a small test against a running server, taking .a2s files from the examples folder -
debug
starts the container, but does not start the webserver automatically
In a2s-custom-types
, you can define your own shapes:
-
the filename must be the name of your shape with ".path" extension
example: shape "drop" ->a2s-custom-types/drop.path
-
the file must contain a single path element, with the attributes
width
,height
, andd
example:<path width="100" height="100" d="M 50 0 A 50 50 0 1 0 100 50 V 0 Z" />
Notes: review the Creating Special Objects Section and have a look at some svg path documentation, like the SVG Path Tutorial.
-
asciitosvg: Converting asciiart to crisp svg
-
rough.js: Simulating shaky handwriting