<jupyter_start><jupyter_text>try 2<jupyter_code>paper_size = '11x14 inches'
border:float=35
paper = utils.Paper(paper_size)

drawbox = paper.get_drawbox(border)
buffer_style = 2

poly = drawbox
pg = PerlinGrid(poly, xstep=1, ystep=1, lod=10, falloff=None, noise_scale=0.053, noiseSeed=5)
start_point = pg.p.centroid
start_buffer = 10
n_nodes = 400
n_steps = 70
circ = start_point.buffer(start_buffer).boundary
pts = [circ.interpolate(d, normalized=True) for d in np.linspace(0., 1., n_nodes)]
particles = [Particle(pos=pos, grid=pg, stepsize=1) for pos in pts if pg.p.contains(pos)]
    


linestrings = []
_ls = LineString([p.pos for p in particles])
nodes = np.array(_ls)
ls = BezierCurve(nodes).linestring
linestrings.append(ls)

for ii in tqdm(range(n_steps)):
    for p in particles:
        p.pos = sa.translate(p.pos, xoff=1.3, yoff=0.4)
        p.step()

    _ls = LineString([p.pos for p in particles])
    nodes = np.array(_ls)
    ls = BezierCurve(nodes = nodes).linestring
    
    linestrings.append(ls)

layer = MultiLineString(linestrings)

layer = gp.make_like(layer, drawbox)
buffer_gen = ss.uniform(loc=1, scale=6).rvs
d_buffer_gen = functools.partial(np.random.uniform, low=-0.8, high=-0.2)
angles_gen = ss.uniform(loc=0, scale=360).rvs
angles_gen = gp.make_callable(80)
d_translate_factor_gen = ss.uniform(loc=0.2, scale=0.6).rvs
fills = []
all_polys = Polygon()
for l in layer:
    p = l.buffer(0.5, cap_style=2, join_style=3)
    p = p.buffer(buffer_gen(), cap_style=2, join_style=2)
    
    stp = gp.ScaleTransPrms(d_buffer=d_buffer_gen(),angles=angles_gen(),d_translate_factor=d_translate_factor_gen(), n_iters=300)
    stp.d_buffers += np.random.uniform(-0.15, 0.15, size=stp.d_buffers.shape)
    P = gp.Poly(p)
    P.fill_scale_trans(**stp.prms)
    visible_area = p.difference(all_polys)
    visible_fill = P.fill.intersection(visible_area.buffer(1e-6))
        
    
    fills.append(visible_fill)
    all_polys = so.unary_union([all_polys, p])
L1 = gp.merge_LineStrings([f for f in fills if f.length > 0.1])
buffer_gen = ss.uniform(loc=1, scale=6).rvs
d_buffer_gen = functools.partial(np.random.uniform, low=-2, high=-1.2)
angles_gen = ss.uniform(loc=0, scale=360).rvs
angles_gen = gp.make_callable(80)
d_translate_factor_gen = ss.uniform(loc=0.2, scale=0.6).rvs
fills = []
all_polys = Polygon()
for l in layer:
    p = l.buffer(0.5, cap_style=2, join_style=3)
    p = p.buffer(buffer_gen(), cap_style=2, join_style=2)
    
    stp = gp.ScaleTransPrms(d_buffer=d_buffer_gen(),angles=angles_gen(),d_translate_factor=d_translate_factor_gen(), n_iters=300)
    stp.d_buffers += np.random.uniform(-0.15, 0.15, size=stp.d_buffers.shape)
    P = gp.Poly(p)
    P.fill_scale_trans(**stp.prms)
    visible_area = p.difference(all_polys)
    visible_fill = P.fill.intersection(visible_area.buffer(1e-6))
        
    
    fills.append(visible_fill)
    all_polys = so.unary_union([all_polys, p])
L2 = gp.merge_LineStrings([f for f in fills if f.length > 0.1])
sk = vsketch.Vsketch()
sk.size(paper.page_format_mm)
sk.scale('1mm')
sk.penWidth('0.25mm')
sk.stroke(1)
sk.geometry(L1)
sk.stroke(2)
sk.geometry(L1)
sk.vpype('linesimplify linemerge linesort')
sk.display(color_mode='layer')
savepath = '/Users/naka/code/side/plotter_images/oned_outputs/0345_perlin_repeater_buffered_fills_2color.svg'

sk.save(savepath)<jupyter_output><empty_output><jupyter_text>try 2<jupyter_code>paper_size = '11x14 inches'
border:float=35
paper = utils.Paper(paper_size)

drawbox = paper.get_drawbox(border)
buffer_style = 2

poly = drawbox
pg = PerlinGrid(poly, xstep=1, ystep=1, lod=10, falloff=None, noise_scale=0.053, noiseSeed=5)
start_point = pg.p.centroid
start_buffer = 10
n_nodes = 400
n_steps = 70
circ = start_point.buffer(start_buffer).boundary
pts = [circ.interpolate(d, normalized=True) for d in np.linspace(0., 1., n_nodes)]
particles = [Particle(pos=pos, grid=pg, stepsize=1) for pos in pts if pg.p.contains(pos)]
    


linestrings = []
_ls = LineString([p.pos for p in particles])
nodes = np.array(_ls)
ls = BezierCurve(nodes).linestring
linestrings.append(ls)

for ii in tqdm(range(n_steps)):
    for p in particles:
        p.pos = sa.translate(p.pos, xoff=1.3, yoff=0.4)
        p.step()

    _ls = LineString([p.pos for p in particles])
    nodes = np.array(_ls)
    ls = BezierCurve(nodes = nodes).linestring
    
    linestrings.append(ls)

layer = MultiLineString(linestrings)

layer = gp.make_like(layer, drawbox)
layer = layer.buffer(0.01, join_style=2, cap_style=2).buffer(-0.01).boundary
layer = [l for l in layer if l.length>0.1]
buffer_gen = ss.uniform(loc=1, scale=6).rvs
d_buffer_gen = functools.partial(np.random.uniform, low=-0.8, high=-0.2)
angles_gen = ss.uniform(loc=0, scale=360).rvs
angles_gen = gp.make_callable(80)
d_translate_factor_gen = ss.uniform(loc=0.2, scale=0.6).rvs
fills = []
all_polys = Polygon()
for l in tqdm(layer):
    p = l.buffer(0.5, cap_style=2, join_style=3)
    p = p.buffer(buffer_gen(), cap_style=2, join_style=2)
    
    stp = gp.ScaleTransPrms(d_buffer=d_buffer_gen(),angles=angles_gen(),d_translate_factor=d_translate_factor_gen(), n_iters=300)
    stp.d_buffers += np.random.uniform(-0.15, 0.15, size=stp.d_buffers.shape)
    P = gp.Poly(p)
    P.fill_scale_trans(**stp.prms)
    visible_area = p.difference(all_polys)
    visible_fill = P.fill.intersection(visible_area.buffer(1e-6))
        
    
    fills.append(visible_fill)
    all_polys = so.unary_union([all_polys, p])
L1 = gp.merge_LineStrings([f for f in fills if f.length > 0.1])
sk = vsketch.Vsketch()
sk.size(paper.page_format_mm)
sk.scale('1mm')
sk.penWidth('0.25mm')
sk.stroke(1)
sk.geometry(L1)
# sk.stroke(2)
# sk.geometry(L1)
sk.vpype('linesimplify linemerge linesort')
sk.display(color_mode='layer')
savepath = '/Users/naka/code/side/plotter_images/oned_outputs/0346_perlin_repeater_buffered_fills_spikedout.svg'

sk.save(savepath)<jupyter_output><empty_output><jupyter_text>try 2<jupyter_code>paper_size = '11x14 inches'
border:float=35
paper = utils.Paper(paper_size)

drawbox = paper.get_drawbox(border)
buffer_style = 2

poly = drawbox
pg = PerlinGrid(poly, xstep=1, ystep=1, lod=10, falloff=None, noise_scale=0.053, noiseSeed=5)
start_point = pg.p.centroid
start_buffer = 6
n_nodes = 200

circ = start_point.buffer(start_buffer).boundary
pts = [circ.interpolate(d, normalized=True) for d in np.linspace(0.1, 0.99, n_nodes)]
particles = [Particle(pos=pos, grid=pg, stepsize=1) for pos in pts if pg.p.contains(pos)]
    


_ls = LineString([p.pos for p in particles])
nodes = np.array(_ls)
ls = BezierCurve(nodes).linestring
linestrings.append(ls)
n_steps = 80
linestrings = []
for ii in tqdm(range(n_steps)):
    for p in particles:
        p.pos = sa.translate(p.pos, xoff=0., yoff=1)
        p.step()

    _ls = LineString([p.pos for p in particles])
    nodes = np.array(_ls)
    ls = BezierCurve(nodes = nodes).linestring
    
    linestrings.append(ls)

layer = MultiLineString(linestrings)

layer = gp.make_like(layer, drawbox)
d=1e-1
mlayer = layer.buffer(d, join_style=1, cap_style=1).buffer(-d).boundary
mlayer = [l for l in mlayer if l.length>0.01]
buffer_gen = ss.uniform(loc=1, scale=6).rvs
d_buffer_gen = functools.partial(np.random.uniform, low=-0.8, high=-0.2)
angles_gen = ss.uniform(loc=0, scale=360).rvs
angles_gen = gp.make_callable(80)
d_translate_factor_gen = ss.uniform(loc=0.2, scale=0.6).rvs
buffer_gen = functools.partial(np.interp, xp=[-2, 1], fp=[1,3])
d_buffer_gen = functools.partial(np.interp, xp=[-1, 1], fp=[-0.2, -0.7])
fills = []
all_polys = Polygon()
for l in tqdm(mlayer):
#     p = l.buffer(0.5, cap_style=2, join_style=3)
    p = l.buffer(buffer_gen(np.log10(l.length)), cap_style=2, join_style=2)
    
    stp = gp.ScaleTransPrms(
        d_buffer=d_buffer_gen(np.log10(l.length)),
        angles=angles_gen(),
        d_translate_factor=d_translate_factor_gen(), 
        n_iters=300)
    stp.d_buffers += np.random.uniform(-0.15, 0.15, size=stp.d_buffers.shape)
    P = gp.Poly(p)
    P.fill_scale_trans(**stp.prms)
    visible_area = p.difference(all_polys)
    visible_fill = P.fill.intersection(visible_area.buffer(1e-6))
        
    
    fills.append(visible_fill)
    all_polys = so.unary_union([all_polys, p])
L2 = gp.merge_LineStrings([f for f in fills if f.length > 0.1])
n_steps = 55
linestrings = []
for ii in tqdm(range(n_steps)):
    for p in particles:
        p.pos = sa.translate(p.pos, xoff=0., yoff=0.6)
        p.step()

    _ls = LineString([p.pos for p in particles])
    nodes = np.array(_ls)
    ls = BezierCurve(nodes = nodes).linestring
    
    linestrings.append(ls)

layer = MultiLineString(linestrings)

layer = gp.make_like(layer, drawbox)
buffer_gen = ss.uniform(loc=1, scale=6).rvs
d_buffer_gen = functools.partial(np.random.uniform, low=-0.8, high=-0.2)
angles_gen = ss.uniform(loc=0, scale=360).rvs
angles_gen = gp.make_callable(80)
d_translate_factor_gen = ss.uniform(loc=0.2, scale=0.6).rvs
fills = []
# all_polys = Polygon()
for l in tqdm(layer):
    p = l.buffer(0.5, cap_style=2, join_style=3)
    p = p.buffer(buffer_gen(), cap_style=2, join_style=2)
    
    stp = gp.ScaleTransPrms(d_buffer=d_buffer_gen(),angles=angles_gen(),d_translate_factor=d_translate_factor_gen(), n_iters=300)
    stp.d_buffers += np.random.uniform(-0.15, 0.15, size=stp.d_buffers.shape)
    P = gp.Poly(p)
    P.fill_scale_trans(**stp.prms)
    visible_area = p.difference(all_polys)
    visible_fill = P.fill.intersection(visible_area.buffer(1e-6))
        
    
    fills.append(visible_fill)
    all_polys = so.unary_union([all_polys, p])
L1 = gp.merge_LineStrings([f for f in fills if f.length > 0.1])
sk = vsketch.Vsketch()
sk.size(paper.page_format_mm)
sk.scale('1mm')
sk.penWidth('0.25mm')
sk.stroke(1)
sk.geometry(L1)
sk.stroke(2)
sk.geometry(L2)
sk.vpype('linesimplify linemerge linesort')
sk.display(color_mode='layer')
savepath = '/Users/naka/code/side/plotter_images/oned_outputs/0348_perlin_repeater_buffered_fills_spikedout_2col.svg'

sk.save(savepath)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14732946589317863, 'fraction_numerical': 0.03460692138427685, 'mean_word_length': 4.564273789649416, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '34269', 'license': 'MIT', 'n_tokens_mistral': 4228, 'n_tokens_neox': 4046, 'n_words': 679, 'path': 'scratch/036_white_on_yellow.ipynb', 'repo_name': 'ANaka/genpen2', 'size': '9998'}