<commit_before>
$lines = []
$len = 100.0

def tree(pt, d, l)
  pp = pt + d * l
  e = Build::line(pt, pp)
  $lines.push(e)
  if l < $len / 10.0
    return 1
  end
  l = l * 0.75
  tree(pp, d.rotate(Vec::origin, Vec::ydir, Math::PI / 6.0), l)
  tree(pp, d.rotate(Vec::origin, Vec::ydir, -Math::PI / 6.0), l)
end

tree Vec::origin, Vec::zdir, $len

comp = Build.compound $lines
IGES.save [comp], "test.igs"
<commit_msg>Update tree.rb.<commit_after>#!/usr/bin/siren
# coding: utf-8
#
# fractal tree
#

$start_len = 100.0

def tree(cur_pt, dir, len)
  nxt_pt = cur_pt + dir * len
  edges = [ Build::line(cur_pt, nxt_pt) ]
  len *= 0.75
  if len > $start_len / 10.0
    edges.concat tree(nxt_pt, dir.rotate(Vec::ydir, 30.0.to_rad), len)
    edges.concat tree(nxt_pt, dir.rotate(Vec::ydir, -30.0.to_rad), len)
  end
  return edges
end

lines = tree(Vec::origin, Vec::zdir, $start_len)

comp = Build.compound lines
IGES.save [comp], "tree.igs"

puts "done."

{'fraction_non_alphanumeric': 0.18526315789473685, 'fraction_numerical': 0.03368421052631579, 'mean_word_length': 3.3824884792626726, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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}}
{'dir': 'git-commits-cleaned', 'id': '1818175', 'n_tokens_mistral': 443, 'n_tokens_neox': 420, 'n_words': 100}