Skip to content

Instantly share code, notes, and snippets.

@dyoo
Created February 17, 2013 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyoo/4973820 to your computer and use it in GitHub Desktop.
Save dyoo/4973820 to your computer and use it in GitHub Desktop.
#lang racket
(require racket/draw racket/gui/base)
(define instructions
'((move 61.17578125 98.36328125)
(curve 62.4765625 99.390625 64.015625 99.90234375 65.7890625 99.90234375)
(curve 67.953125 99.90234375 70.05078125 99.40234375 72.078125 98.3984375)
(curve 75.49609375 96.734375 77.20703125 94.01171875 77.20703125 90.23046875)
(line 77.20703125 85.2734375)
(curve 76.453125 85.75390625 75.48828125 86.15234375 74.30078125 86.47265625)
(curve 73.1171875 86.7890625 71.953125 87.01953125 70.81640625 87.15234375)
(line 67.08984375 87.6328125)
(curve 64.85546875 87.9296875 63.18359375 88.39453125 62.06640625 89.03515625)
(curve 60.17578125 90.10546875 59.2265625 91.8125 59.2265625 94.16015625)
(curve 59.2265625 95.9375 59.87890625 97.33984375 61.17578125 98.36328125)
(close)
(move 74.1328125 81.71875)
(curve 75.54296875 81.53515625 76.48828125 80.9453125 76.96875 79.94140625)
(curve 77.2421875 79.39453125 77.37890625 78.609375 77.37890625 77.58203125)
(curve 77.37890625 75.48828125 76.6328125 73.96484375 75.140625 73.01953125)
(curve 73.6484375 72.07421875 71.51171875 71.6015625 68.73046875 71.6015625)
(curve 65.515625 71.6015625 63.23828125 72.46875 61.89453125 74.19921875)
(curve 61.140625 75.15625 60.65234375 76.58203125 60.42578125 78.47265625)
(line 54.68359375 78.47265625)
(curve 54.796875 73.9609375 56.26171875 70.8203125 59.07421875 69.0546875)
(curve 61.890625 67.2890625 65.15234375 66.40625 68.8671875 66.40625)
(curve 73.171875 66.40625 76.671875 67.2265625 79.359375 68.8671875)
(curve 82.02734375 70.5078125 83.359375 73.0625 83.359375 76.5234375)
(line 83.359375 97.61328125)
(curve 83.359375 98.25 83.4921875 98.765625 83.75390625 99.15234375)
(curve 84.015625 99.5390625 84.56640625 99.73046875 85.41015625 99.73046875)
(curve 85.68359375 99.73046875 85.9921875 99.71484375 86.33203125 99.6796875)
(curve 86.67578125 99.64453125 87.0390625 99.59765625 87.42578125 99.52734375)
(line 87.42578125 104.07421875)
(curve 86.46875 104.34765625 85.7421875 104.51953125 85.23828125 104.5859375)
(curve 84.73828125 104.65234375 84.0546875 104.6875 83.1875 104.6875)
(curve 81.0703125 104.6875 79.53125 103.9375 78.57421875 102.43359375)
(curve 78.07421875 101.63671875 77.71875 100.5078125 77.515625 99.05078125)
(curve 76.26171875 100.69140625 74.4609375 102.11328125 72.11328125 103.3203125)
(curve 69.765625 104.52734375 67.1796875 105.1328125 64.35546875 105.1328125)
(curve 60.9609375 105.1328125 58.1875 104.1015625 56.03125 102.0390625)
(curve 53.87890625 99.9765625 52.8046875 97.3984375 52.8046875 94.296875)
(curve 52.8046875 90.90234375 53.86328125 88.26953125 55.98046875 86.40234375)
(curve 58.1015625 84.53515625 60.87890625 83.3828125 64.3203125 82.94921875)
(close)
(move 50.0 103.90234375)))
(define bm
#;(make-screen-bitmap 150 150)
#;(make-platform-bitmap 150 150)
(make-bitmap 150 150))
(define dc (send bm make-dc))
(define path (new dc-path%))
(for ([inst instructions])
(match inst
[(list 'close)
(send path close)]
[(list 'move x y)
(send path move-to x y)]
[(list 'line x y)
(send path line-to x y)]
[(list 'curve x1 y1 x2 y2 x3 y3)
(send path curve-to x1 y1 x2 y2 x3 y3)]))
(send dc draw-path path)
bm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment