<jupyter_start><jupyter_text>Sub-sketchThe `sketch()` method draws the content of a sub-sketch in the main sketch, preserving formatting (ie. layers) but applying the current transformation matrix. This makes it easy to create reusable drawing elements<jupyter_code>import vsketch

# create a stick figurestick figure
sub = vsketch.Vsketch()
sub.detail(0.01)
sub.rect(0, 0, 1, 2)
sub.circle(0.5, -0.5, 1)
sub.line(0, 0, -0.5, 1)
sub.line(1, 0, 1.5, 1)
sub.line(0, 2, -0.3, 4)
sub.line(1, 2, 1.3, 4)

# use the stick figure
vsk = vsketch.Vsketch()
vsk.size("a4", landscape=True)
vsk.scale("1cm")


for i in range(8):
    with vsk.pushMatrix():
        vsk.scale(0.95 ** i)
        vsk.rotate(8 * i, degrees=True)
        vsk.sketch(sub)
    
    vsk.translate(3, 0)


vsk.display(mode="matplotlib")
vsk.save("subsketch_basic.svg")<jupyter_output><empty_output><jupyter_text>Self inclusion work as well, but leads to hard to predict results 🙂<jupyter_code>vsk = vsketch.Vsketch()

vsk.scale(1.5)
vsk.rect(-5, -5, 10, 10)

for i in range(10):
    vsk.rotate(10, degrees=True)
    vsk.sketch(vsk)
    
vsk.display(mode="matplotlib")
vsk.save("subsketch_recursive.svg")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1490787269681742, 'fraction_numerical': 0.04438860971524288, 'mean_word_length': 4.287610619469026, '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': '386393', 'license': 'MIT', 'n_tokens_mistral': 516, 'n_tokens_neox': 484, 'n_words': 116, 'path': 'examples/_notebooks/subsketch.ipynb', 'repo_name': 'DaAwesomeP/vsketch', 'size': '1194'}