File: gen_issue2342-template.py

package info (click to toggle)
openscad 2021.01-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,012 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (18 lines) | stat: -rwxr-xr-x 522 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! ${PYTHON_EXECUTABLE}
# # This python script generates a large output .scad file (3.1MB) for stress testing the parser.
# See Issue #2342 / Pull Request #2343

from __future__ import print_function

xcount = 100
ycount = 100
zcount = 10
totalcount = xcount*ycount*zcount

for x in range(1, xcount):
    for y in range(1, ycount):
        for z in range(1, zcount):
            print("translate([{}, {}, {}])".format(x,y,z))
            print("  cube(0.5);")

print("echo(\"{} elements processed\");".format(totalcount))