Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
∞ 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