March generator: enhance error handling

This commit is contained in:
Théophile Bastian 2018-02-09 00:58:09 +01:00
parent 1dece061a3
commit 65cb03487d

View file

@ -7,6 +7,7 @@
"""
from functools import reduce
import sys
class Vert:
@ -203,9 +204,13 @@ def do_main(base_cases):
if index[code] is None:
index[code] = tr_case
has_unbound = False
for (val, tri) in enumerate(index):
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> "
"edges_of_intersection[256] = {"))