March generator: enhance error handling
This commit is contained in:
parent
1dece061a3
commit
65cb03487d
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
class Vert:
|
class Vert:
|
||||||
|
@ -203,9 +204,13 @@ def do_main(base_cases):
|
||||||
if index[code] is None:
|
if index[code] is None:
|
||||||
index[code] = tr_case
|
index[code] = tr_case
|
||||||
|
|
||||||
|
has_unbound = False
|
||||||
for (val, tri) in enumerate(index):
|
for (val, tri) in enumerate(index):
|
||||||
if tri is None:
|
if tri is None:
|
||||||
print(">> UNBOUND {}".format(val))
|
print(">> UNBOUND {}".format(val), file=sys.stderr)
|
||||||
|
has_unbound = True
|
||||||
|
if has_unbound:
|
||||||
|
raise RuntimeError("Some cases were not generated.")
|
||||||
|
|
||||||
print(("static const std::vector<MarchingCubes::CubeTri> "
|
print(("static const std::vector<MarchingCubes::CubeTri> "
|
||||||
"edges_of_intersection[256] = {"))
|
"edges_of_intersection[256] = {"))
|
||||||
|
|
Loading…
Reference in a new issue