Skip to content

Instantly share code, notes, and snippets.



Last active Jul 23, 2019
What would you like to do?
Flat, randomness, curves, asemic writing
name: rwet
- conda-forge
- python
- numpy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This comment has been minimized.

Copy link

@Singularity3 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