Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created July 19, 2009 23:49
Show Gist options
  • Save eklitzke/150085 to your computer and use it in GitHub Desktop.
Save eklitzke/150085 to your computer and use it in GitHub Desktop.
for i in range(0, len(sample_data) - 2):
x0, y0 = mat.transform_point(*sample_data[i])
x1, y1 = mat.transform_point(*sample_data[i+1])
x2, y2 = mat.transform_point(*sample_data[i+2])
#cr.arc(x0, y0, 6, 0, 2 * math.pi)
#cr.fill()
qx1 = (x1 - x0) * fit + x0
qy1 = (y1 - y0) * fit + y0
qx2 = (x1 - x2) * fit + x1
qy2 = (y1 - y2) * fit + y1
cr.curve_to(qx1, qy1, qx2, qy2, x1, y1)
#cr.line_to(*mat.transform_point(*sample_data[-1]))
cr.stroke()
cr.set_source_rgba(0, 0, 1, 0.6)
for x, y in sample_data[:-1]:
x, y = mat.transform_point(x, y)
cr.move_to(x, y)
cr.arc(x, y, 4, 0, 2 * math.pi)
cr.fill()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment