Skip to content

Instantly share code, notes, and snippets.

@debreczeni
Created May 13, 2014 00:21
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 debreczeni/805d420df70f1c377510 to your computer and use it in GitHub Desktop.
Save debreczeni/805d420df70f1c377510 to your computer and use it in GitHub Desktop.
∞ in prawn
# infinity symbol
fill_color(card_color)
if(render_infinity)
fill_color(card_color)
x, y = width / 2, height * (barcode_height_ratio + 0.15)
s = width / 6
m = s / 2
n = m/2
move_to [x, y - n/2]
curve_to [x + s / 4, y - m/2], :bounds => [[x + n / 5 * KAPPA, y - (m/2)*KAPPA], [x + (s / 4) * (1-KAPPA), y - m/2]]
curve_to [x + s / 2, y ], :bounds => [[x + (s / 4) * (1+KAPPA), y - m/2], [x + s / 2 , y - m/2*KAPPA]]
curve_to [x + s / 4, y + m/2 ], :bounds => [[x + s / 2 , y + m/2*KAPPA], [x + (s / 4) * (1+KAPPA), y + m/2]]
curve_to [x , y + n/2 ], :bounds => [[x + (s / 4) * (1-KAPPA), y + m/2], [x + n / 5 * KAPPA, y + (m/2)*KAPPA]]
curve_to [x - s / 4, y + m/2 ], :bounds => [[x - n / 5 * KAPPA, y + (m/2)*KAPPA], [x - (s / 4) * (1-KAPPA), y + m/2]]
curve_to [x - s / 2, y ], :bounds => [[x - (s / 4) * (1+KAPPA), y + m/2], [x - s / 2 , y + m/2*KAPPA]]
curve_to [x - s / 4, y - m/2], :bounds => [[x - s / 2 , y - m/2*KAPPA], [x - (s / 4) * (1+KAPPA), y - m/2]]
curve_to [x, y - n/2], :bounds => [[x - (s / 4) * (1-KAPPA), y - m/2], [x - n / 5 * KAPPA, y - (m/2)*KAPPA]]
fill
fill_color 'FFFFFF'
move_to [x + n/2, y]
curve_to [x + s / 4, y - n/3], :bounds => [[x + n/2 + n / 10 * KAPPA, y - n/10 *KAPPA], [x + (s / 4) - n / 2 * (1-KAPPA), y - n/3]]
curve_to [x + s / 4, y + n/3], :bounds => [[x + (s / 4) + n * (1-KAPPA), y - n/3], [x + (s / 4) + n * (1-KAPPA), y + n/3]]
curve_to [x + n/2, y], :bounds => [[x + (s / 4) - n / 2 * (1-KAPPA), y + n/3], [x + n/2 + n / 10 * KAPPA, y + n/10 *KAPPA]]
fill
move_to [x - n/2, y]
curve_to [x - s / 4, y - n/3], :bounds => [[x - n/2 - n / 10 * KAPPA, y - n/10 *KAPPA], [x - (s / 4) + n / 2 * (1-KAPPA), y - n/3]]
curve_to [x - s / 4, y + n/3], :bounds => [[x - (s / 4) - n * (1-KAPPA), y - n/3], [x - (s / 4) - n * (1-KAPPA), y + n/3]]
curve_to [x - n/2, y], :bounds => [[x - (s / 4) + n / 2 * (1-KAPPA), y + n/3], [x - n/2 - n / 10 * KAPPA, y + n/10 *KAPPA]]
fill
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment