<jupyter_start><jupyter_text>3D Modelling with PythonInstalling the necessary packages: `pip install viewscad solidpython`<jupyter_code>#skiptest
from solid import *
from solid.utils import *  # Not required, but the utils module is useful
#skiptest
import viewscad
#skiptest
d = difference()(
    cube(10),  # Note the comma between each element!
    sphere(12)
)
scad_render(d)
#skiptest
r = viewscad.Renderer()
r.render(d)
#skiptest
from math import cos, radians, sin, pi, tau

o = translate([0, 1, 0])(sphere(r=0.2))
for i in range(int(tau*3)):
    a = i/3
    o += translate([sin(a), cos(a), 0])(sphere(r=0.2))
r.render(o)<jupyter_output><empty_output><jupyter_text>Bringing in some data<jupyter_code>#skiptest
import pandas as pd
df = pd.read_csv('data/day_counts.csv', parse_dates=['Date']).fillna(0)
df.head()
#skiptest
chunks = []
for i in range(0, len(df), 28):
    chunks.append(df['Count'].values[i:i+28])
chunks[0]
#skiptest
def draw_chunk(c):
    o = sphere(r=0.2)
    for i, v in enumerate(c):
        o += translate([sin(i*tau/28), cos(i*tau/28), 0])(sphere(r=0.15 + 0.05*v))
    o -= sphere(r=0.3)
    return o
r.render(draw_chunk(chunks[0]))
#skiptest
o = draw_chunk(chunks[0])
for i, c in enumerate(chunks[1:4]):
    o += translate([0, 0, i/4])(draw_chunk(c))
r.render(o)
#skiptest
scad_render_to_file(o, 'outputs/test1.scad')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16872727272727273, 'fraction_numerical': 0.03272727272727273, 'mean_word_length': 5.226244343891403, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '643857', 'license': 'Apache-2.0', 'n_tokens_mistral': 591, 'n_tokens_neox': 565, 'n_words': 125, 'path': 'notebooks/10_Going_3D.ipynb', 'repo_name': 'johnowhitaker/days_of_code', 'size': '1375'}