Created
June 2, 2015 17:21
-
-
Save adusak/247bae3d75913cc04e49 to your computer and use it in GitHub Desktop.
MRCM examples
This file contains hidden or 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
| from python.less9.mrcm import * | |
| from python.less9.transformations import rotation | |
| _size = 300 | |
| sierp_transformations = [[np.identity(3) for x in range(3)], | |
| [rotation(90), np.identity(3), rotation(-90)], | |
| [rotation(180), np.identity(3), rotation(180)], | |
| [rotation(-90), np.identity(3), rotation(90)], | |
| [np.identity(3), rotation(180), np.identity(3)], | |
| [rotation(90), rotation(180), rotation(-90)], | |
| [rotation(180) for _ in range(3)], | |
| [rotation(-90), rotation(180), rotation(90)]] | |
| for i in range(len(sierp_transformations)): | |
| serp_relatives(sierp_transformations[i], _size, name="sierpinsky_" + str(i)) | |
| scale = scaling(0.381966, 0.381966) | |
| mcworters_pentigree = [combine(scale, rotation(36)), | |
| combine(scale, rotation(108), translation(0.309 * _size, 0.225 * _size)), | |
| combine(scale, rotation(-36), translation(0.191 * _size, 0.588 * _size)), | |
| combine(scale, rotation(-108), translation(0.500 * _size, 0.363 * _size)), | |
| combine(scale, rotation(-36), translation(0.382 * _size, 0.0 * _size)), | |
| combine(scale, rotation(36), translation(0.691 * _size, -0.225 * _size))] | |
| mrcm(triangle(_size), mcworters_pentigree, 5, "mcworters_pentigree") | |
| scale = scaling(0.381966, 0.381966) | |
| pentagram = [combine(scale), | |
| combine(scale, translation(0.618 * _size, 0.0 * _size)), | |
| combine(scale, translation(0.809 * _size, 0.588 * _size)), | |
| combine(scale, translation(0.309 * _size, 0.951 * _size)), | |
| combine(scale, translation(-0.191 * _size, 0.588 * _size))] | |
| mrcm(triangle(_size), pentagram, 5, "pentagram") | |
| tree(_size, 0.7, 30, "tree_bushy") | |
| tree(_size, 0.57, 45, "tree_ugly") | |
| tree(_size, 0.7, 120, "tree_triangle") | |
| tree(_size, 0.8, 150, "tree_weird") | |
| sierpinsky_triangle(1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment