toctahedron-bg.py - polygen - generative drawing of polygonal patterns
 (HTM) git clone git://src.adamsgaard.dk/polygen
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       toctahedron-bg.py (793B)
       ---
            1 #!/usr/bin/env python
            2 import polygen
            3 import matplotlib.pyplot as plt
            4 
            5 # Generate regular polygon with eight corners (octahedron)
            6 octahedron = polygen.regular_star_polygon(8)
            7 
            8 # Create the polygon plotting object
            9 p = polygen.polyplot(figure_size_inches=(25.50,14.40), dpi=160)
           10 
           11 # Pass the octahedron points to the plot object
           12 p.set_points(octahedron.points)
           13 
           14 # Plot octahedron, do not draw lines to opposite points. Use custom colors.
           15 p.plot_all_to_all(line_width=4, line_color='#666666',
           16         exceptions=[[0,4], [1,5], [2,6], [3,7]])
           17 
           18 # Place red dot in center
           19 p.plot_circle([0,0], 0.34, color='#993333')
           20 
           21 # Save figure as file
           22 p.save_plot('octahedron-bg',
           23         background_color='#002b36', transparent_background=False)
           24         #background_color='#333333', transparent_background=False)