Last active
August 29, 2015 13:55
-
-
Save ashmind/8762877 to your computer and use it in GitHub Desktop.
Canvas version of http://www.seanmichaelragan.com/files/MC_Escher_single_lizard_tile.svg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawLizard(context, size) { | |
var c = context; | |
var s = size; | |
c.save(); | |
c.strokeStyle = '#000000'; | |
c.fillStyle = '#000000'; | |
var m = c.moveTo.bind(c); | |
var l = c.lineTo.bind(c); | |
c.beginPath(); | |
m(0.39*s, 1*s); | |
l(0.305*s, 0.915*s); | |
l(0.327*s,0.883*s); | |
m(0.525*s,0.828*s); | |
l(0.423*s,0.921*s); | |
l(0.39*s,1*s); | |
m(0.327*s,0.883*s); | |
l(0.419*s,0.773*s); | |
l(0.354*s,0.708*s); | |
l(0.305*s,0.638*s); | |
l(0.215*s,0.638*s); | |
m(0.444*s, 0.625*s); | |
l(0.559*s, 0.594*s); | |
l(0.577*s,0.629*s); | |
m(0.525*s,0.828*s); | |
l(0.496*s,0.693*s); | |
l(0.444*s,0.625*s); | |
m(0.577*s,0.629*s); | |
l(0.626*s,0.763*s); | |
l(0.714*s,0.74*s); | |
l(0.799*s,0.732*s); | |
l(0.844*s,0.654*s); | |
l(0.738*s,0.602*s); | |
l(0.71*s,0.642*s); | |
l(0.669*s,0.646*s); | |
l(0.662*s,0.586*s); | |
l(0.65*s,0.543*s); | |
l(0.659*s,0.517*s); | |
l(0.666*s,0.503*s); | |
l(0.813*s,0.557*s); | |
l(0.925*s,0.472*s); | |
l(0.925*s,0.453*s); | |
l(0.93*s,0.421*s); | |
l(0.801*s,0.292*s); | |
m(0.467*s,0.149*s); | |
l(0.564*s,0.083*s); | |
l(0.544*s,0.039*s); | |
l(0.561*s,0.001*s); | |
l(0.616*s,0.025*s); | |
l(0.66*s,0.036*s); | |
l(0.678*s,0.057*s); | |
l(0.686*s,0.07*s); | |
l(0.566*s,0.17*s); | |
l(0.584*s,0.31*s); | |
l(0.6*s,0.32*s); | |
l(0.625*s,0.34*s); | |
l(0.801*s,0.292*s); | |
m(0.467*s,0.149*s); | |
l(0.486*s,0.179*s); | |
l(0.486*s,0.206*s); | |
l(0.499*s,0.268*s); | |
l(0.501*s,0.302*s); | |
l(0.411*s,0.429*s); | |
l(0.436*s,0.305*s); | |
l(0.388*s,0.2*s); | |
l(0.336*s,0.167*s); | |
l(0.228*s,0.21*s); | |
l(0.174*s,0.195*s); | |
l(0.096*s,0.253*s); | |
l(0.2*s,0.321*s); | |
m(0.215*s,0.638*s); | |
l(0.18*s,0.639*s); | |
l(0.157*s,0.626*s); | |
l(0.096*s,0.606*s); | |
l(0.066*s,0.591*s); | |
l(0.001*s,0.45*s); | |
l(0.096*s,0.533*s); | |
l(0.21*s,0.544*s); | |
l(0.265*s,0.516*s); | |
l(0.282*s,0.4*s); | |
l(0.322*s,0.361*s); | |
l(0.311*s,0.265*s); | |
l(0.2*s,0.321*s); | |
m(0.305*s,0.638*s); | |
l(0.342*s,0.633*s); | |
l(0.367*s,0.65*s); | |
l(0.385*s,0.657*s); | |
m(0.444*s,0.625*s); | |
l(0.414*s,0.584*s); | |
m(0.336*s,0.946*s); | |
l(0.356*s,0.911*s); | |
m(0.369*s,0.979*s); | |
l(0.387*s,0.931*s); | |
m(0.669*s,0.646*s); | |
l(0.657*s,0.669*s); | |
l(0.646*s,0.694*s); | |
m(0.777*s,0.621*s); | |
l(0.76*s,0.648*s); | |
l(0.748*s,0.66*s); | |
m(0.805*s,0.635*s); | |
l(0.788*s,0.671*s); | |
m(0.65*s,0.543*s); | |
l(0.644*s,0.518*s); | |
l(0.632*s,0.492*s); | |
m(0.559*s,0.594*s); | |
l(0.604*s,0.602*s); | |
m(0.694*s,0.465*s); | |
l(0.724*s,0.479*s); | |
l(0.751*s,0.498*s); | |
l(0.811*s,0.494*s); | |
l(0.82*s,0.497*s); | |
l(0.85*s,0.461*s); | |
l(0.897*s,0.458*s); | |
l(0.906*s,0.455*s); | |
m(0.805*s,0.357*s); | |
l(0.846*s,0.401*s); | |
l(0.862*s,0.409*s); | |
l(0.891*s,0.415*s); | |
l(0.901*s,0.422*s); | |
m(0.805*s,0.357*s); | |
l(0.768*s,0.357*s); | |
l(0.75*s,0.352*s); | |
l(0.722*s,0.372*s); | |
l(0.704*s,0.38*s); | |
l(0.694*s,0.389*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.755*s,0.353*s); | |
c.bezierCurveTo(0.755*s,0.353*s,0.755*s,0.352*s,0.755*s,0.352*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.755*s,0.352*s); | |
c.bezierCurveTo(0.755*s,0.339*s,0.766*s,0.329*s,0.78*s,0.329*s); | |
c.bezierCurveTo(0.793*s,0.329*s,0.804*s,0.339*s,0.804*s,0.352*s); | |
c.bezierCurveTo(0.804*s,0.353*s,0.804*s,0.355*s,0.804*s,0.356*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.767*s,0.357*s); | |
c.bezierCurveTo(0.766*s,0.355*s,0.765*s,0.353*s,0.765*s,0.35*s); | |
c.bezierCurveTo(0.765*s,0.343*s,0.772*s,0.337*s,0.779*s,0.337*s); | |
c.bezierCurveTo(0.787*s,0.337*s,0.794*s,0.343*s,0.794*s,0.35*s); | |
c.bezierCurveTo(0.794*s,0.353*s,0.793*s,0.355*s,0.792*s,0.357*s); | |
c.fill(); | |
c.stroke(); | |
c.beginPath(); | |
m(0.811*s,0.494*s); | |
c.bezierCurveTo(0.811*s,0.496*s,0.811*s,0.496*s,0.811*s,0.497*s); | |
c.bezierCurveTo(0.811*s,0.51*s,0.8*s,0.52*s,0.787*s,0.52*s); | |
c.bezierCurveTo(0.773*s, 0.52*s, 0.762*s, 0.51*s, 0.762*s, 0.497*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.801*s,0.495*s); | |
c.bezierCurveTo(0.801*s,0.495*s,0.801*s,0.496*s,0.801*s,0.497*s); | |
c.bezierCurveTo(0.801*s,0.504*s,0.794*s,0.51*s,0.785*s,0.51*s); | |
c.bezierCurveTo(0.776*s, 0.51*s, 0.769*s, 0.504*s, 0.769*s, 0.497*s); | |
c.fill(); | |
c.stroke(); | |
c.beginPath(); | |
m(0.584*s,0.31*s); | |
l(0.591*s,0.343*s); | |
l(0.591*s,0.364*s); | |
m(0.566*s,0.17*s); | |
l(0.542*s,0.164*s); | |
m(0.501*s,0.302*s); | |
l(0.514*s,0.279*s); | |
l(0.532*s,0.253*s); | |
m(0.593*s,0.015*s); | |
l(0.596*s,0.041*s); | |
l(0.598*s,0.063*s); | |
l(0.604*s,0.074*s); | |
m(0.642*s,0.032*s); | |
l(0.639*s,0.05*s); | |
l(0.644*s,0.061*s); | |
l(0.64*s,0.072*s); | |
m(0.411*s,0.429*s); | |
l(0.409*s,0.447*s); | |
l(0.405*s,0.463*s); | |
l(0.402*s,0.472*s); | |
m(0.311*s,0.265*s); | |
l(0.313*s,0.255*s); | |
l(0.323*s,0.247*s); | |
l(0.326*s,0.237*s); | |
l(0.326*s,0.23*s); | |
m(0.133*s,0.277*s); | |
l(0.176*s,0.246*s); | |
m(0.169*s,0.301*s); | |
l(0.213*s,0.27*s); | |
m(0.265*s,0.516*s); | |
l(0.286*s,0.508*s); | |
l(0.299*s,0.488*s); | |
l(0.306*s,0.473*s); | |
l(0.315*s,0.464*s); | |
m(0.315*s,0.464*s); | |
l(0.315*s,0.453*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.764*s,0.396*s); | |
c.bezierCurveTo(0.717*s,0.437*s,0.629*s,0.412*s,0.573*s,0.428*s); | |
c.bezierCurveTo(0.523*s,0.442*s,0.455*s,0.466*s,0.414*s,0.496*s); | |
c.bezierCurveTo(0.361*s,0.535*s,0.307*s,0.56*s,0.243*s,0.574*s); | |
c.bezierCurveTo(0.194*s, 0.585*s, 0.094*s, 0.573*s, 0.068*s, 0.522*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.069*s,0.524*s); | |
c.bezierCurveTo(0.13*s,0.639*s,0.303*s,0.591*s,0.391*s,0.548*s); | |
c.bezierCurveTo(0.505*s,0.493*s,0.64*s,0.405*s,0.773*s,0.456*s); | |
c.stroke(); | |
c.beginPath(); | |
m(0.315*s,0.453*s); | |
l(0.32*s,0.443*s); | |
c.stroke(); | |
c.restore(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment