Skip to content
Tools for pen plotting in Python
Jupyter Notebook Python
Branch: master
Clone or download
Latest commit aa524db Aug 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs more changes Dec 10, 2017
examples more changes Dec 10, 2017
gallery add sample images Dec 11, 2017
optimizer optimizer updates Jul 25, 2019
penkit nan when impossible Aug 3, 2019
tutorial switch svg embedding Dec 11, 2017
.gitignore added optimizer Mar 26, 2018
.travis.yml cheapo literate programming Dec 16, 2017
LICENSE Create LICENSE Dec 9, 2017
README.rst cheapo literate programming Dec 16, 2017
publish.sh publish script Jul 25, 2019
regen_docs.sh more changes Dec 10, 2017
requirements.txt 0.0.3 Dec 11, 2017
requirements_travis.txt cheapo literate programming Dec 16, 2017
setup.py use flipud instead of flip for better numpy compatibility Dec 27, 2017

README.rst

Penkit

Penkit is a library of utility functions generating pen plots from Python/numpy.

Installation

Requirements: Python 2.7 or 3.x, numpy, scipy. Preview modules require ipython or matplotlib.

# pip install penkit

Documentation

Examples

Grid Surface Projection

from penkit.textures import make_grid_texture
from penkit.textures.util import rotate_texture
from penkit.surfaces import make_noise_surface
from penkit.write import write_plot
from penkit.projection import project_and_occlude_texture

# create a texture
grid_density = 68
texture = make_grid_texture(grid_density, grid_density, 100)

# rotate the texture
texture = rotate_texture(texture, rotation=65)

# create the surface
surface = make_noise_surface(blur=28, seed=12345) * 10

# project the texture onto the surface
proj = project_and_occlude_texture(texture, surface, angle=69)

# plot the result
write_plot([proj], 'examples/grid_surface.svg')

Hilbert Curve Surface Projection

from penkit.fractal import hilbert_curve
from penkit.textures.util import fit_texture, rotate_texture
from penkit.surfaces import make_noise_surface
from penkit.projection import project_and_occlude_texture
from penkit.write import write_plot

# create a texture
texture = hilbert_curve(7)

# rotate the texture
texture = rotate_texture(texture, 30)
texture = fit_texture(texture)

# create the surface
surface = make_noise_surface(blur=30) * 5

# project the texture onto the surface
proj = project_and_occlude_texture(texture, surface, 50)

# plot the result
write_plot([proj], 'examples/hilbert_surface.svg')


https://travis-ci.org/paulgb/penkit.svg?branch=master
You can’t perform that action at this time.