Skip to content

Instantly share code, notes, and snippets.

@aparrish
Last active April 2, 2022 19:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aparrish/2209201ed3ecf35332d96264e66ce681 to your computer and use it in GitHub Desktop.
Save aparrish/2209201ed3ecf35332d96264e66ce681 to your computer and use it in GitHub Desktop.
Flat, randomness, curves, asemic writing
name: rwet
channels:
- conda-forge
dependencies:
- python
- numpy
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Singularity3
Copy link

Singularity3 commented Jul 23, 2019

Here's an overly parameterized version of the make_char function:

def make_char(xoffset, yoffset, size, grid_num=3, grid_num_y = -1, line_count_dist = t_normal(4, 12, 8, 2), rand_offset = 0, y_width = 1):
    pts = []
    ywidth = size*y_width
    if grid_num_y == -1:
        grid_num_y = grid_num
    for i in range(int(line_count_dist)):
        x = xoffset + (choice([i/(grid_num-1) for i in range(0, grid_num)]) * size) + normal(0, rand_offset)*size
        y = yoffset + (choice([i/(grid_num_y-1) for i in range(0, grid_num_y)]) * ywidth) + normal(0, rand_offset)*ywidth
        pts.append([x, y])
    return pts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment