jmerc77 / remix-of-Russian-Doll-Maze-Puzzle-Box

generator for thingiverse thing 2980535
Other
2 stars 3 forks source link

Error while generating #6

Closed rkarlsba closed 4 years ago

rkarlsba commented 5 years ago

While running latest from github, it crashed

Roys-MacBook-Pro-1840:4 roy$ ./main.py
Usage: /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD [ -o output_file [ -d deps_file ] ]\
                                                          [ -m make_command ] [ -D var=val [..] ] \
                                                          [ --help ] print this help message and exit \
                                                          [ --version ] [ --info ] \
                                                          [ --camera=translatex,y,z,rotx,y,z,dist | \
                                                            --camera=eyex,y,z,centerx,y,z ] \
                                                          [ --autocenter ] \
                                                          [ --viewall ] \
                                                          [ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \
                                                          [ --render | --preview[=throwntogether] ] \
                                                          [ --colorscheme=[Cornfield|Sunset|Metallic|Starnight|BeforeDawn|Nature|DeepOcean] ] \
                                                          [ --csglimit=num ]\
                                                          filename

difficulty (length of path); 0.0 (easy) to 100.0 (hard): 10
shift mode (0=none 1=random 2=random change 3=twist):3
twist amount:60
part: 1
Executing OpenSCAD script...
part: 2
Executing OpenSCAD script...
part: 3
Executing OpenSCAD script...
part: 4
Traceback (most recent call last):
  File "./main.py", line 545, in <module>
    while not gen():
  File "./main.py", line 376, in gen
    marr = genmaze(int(mw), int(mh), stag)
  File "./main.py", line 162, in genmaze
    r = rd.randint(0, len(v) - 1)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py", line 222, in randint
    return self.randrange(a, b+1)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/random.py", line 200, in randrange
    raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,0, 0)
Roys-MacBook-Pro-1840:4 roy$

=== opt.ini ===

# If you change the options you must regenerate & export all stl files

[DEFAULT]
# Name (error may occur if illegal chars used. check documentation for the drive's file system and OS.):
name = xytest
# number of bumps that ride the mazes; 2 to 4 (more accepted but not recommended)
nubs = 2
# Number mazes/levels (int; part count=levels+1; must be at least 1)
levels = 5
# Tolerance (so they fit; e.g. 0.2; float)
tolerance = .3
# Maze on inside (yes/no)
maze_inside = no
# inside vs. outside maze transition shell (int; 0 for none; 1 to [levels] for transition)
# if greater or equal to levels, defaults to no transition.
# transitions to maze_inside status on the inside
transition_shell = 0
# Maze unit size (mm; float)
spacing = 6
# Units tall on inner most (int)
units_tall = 4
# Units wide on inner most (as if maze is on the outside; int)
units_wide = 10
# Wall thickness, excluding maze thickness (mm; float)
wall_thickness = 0.8
jmerc77 commented 5 years ago

hmmm. seems like randint(0,1) may act different on your mac. on windows with python 3.7, I get numbers numbers 0 and 1.

and python 3.4

jmerc77 commented 5 years ago

please verify the error for latest update. many fixes have been made.

jmerc77 commented 4 years ago

ran in to this a couple times on windows too in the past. but may be fixed now. added a if based catch to try to fix the issue. i believe the problem was to do with only having 1 possible value to choose from. the if fixes this.

jmerc77 commented 4 years ago

It seems to be fixed now. did lots of runs during updates and this error has not come up anymore. fixed other issues with the general design too.