Created
October 2, 2014 06:34
-
-
Save Orbifold/a418ea354e01f76a6018 to your computer and use it in GitHub Desktop.
Penrose drawing style
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
g3 = Graphics3D[{Gray, KnotData[{6, 2}, "ImageData"]}, | |
Lighting -> "Neutral", Boxed -> False]; | |
img = ColorConvert[Rasterize[g3, "Image", ImageResolution -> 72], | |
"GrayLevel"]; | |
edge = ColorNegate@EdgeDetect[img]; | |
Manipulate[ | |
dots = Image@ | |
Map[RandomChoice[{#, 1 - #} -> {1, 0}] &, | |
ImageData@ImageAdjust[img, {0, c, g}], {2}]; | |
ImageMultiply[dots, edge], {c, 0, 2}, {g, 1, 3}] | |
ImageMultiply[ | |
ColorNegate@ | |
Dilation[Thinning@ | |
EdgeDetect@ | |
ColorConvert[Rasterize[g3, "Image", ImageResolution -> 3.3 72], | |
"GrayLevel"], 1], | |
Binarize@ImageResize[ | |
Image@Map[RandomChoice[{#, 1 - #} -> {1, 0}] &, | |
ImageData@ImageAdjust[img, {0, 1.1, 1.65}], {2}], Scaled[3.3]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more info see Numerics.io or Orbifold's site