shared.py 1.0 KB

1234567891011121314151617181920212223242526272829
  1. # This file is part of libigl, a simple c++ geometry processing library.
  2. #
  3. # Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
  4. #
  5. # This Source Code Form is subject to the terms of the Mozilla Public License
  6. # v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. # obtain one at http://mozilla.org/MPL/2.0/.
  8. import pyigl as igl
  9. import sys
  10. import os
  11. TUTORIAL_SHARED_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../tutorial/data/")
  12. def check_dependencies(deps):
  13. available = [hasattr(igl, m) for m in deps]
  14. all_available = True
  15. for i, d in enumerate(available):
  16. if not d:
  17. all_available = False
  18. print("The libigl python bindings were compiled without %s support. Please recompile with the CMAKE flag LIBIGL_WITH_%s." %(deps[i], deps[i].upper()))
  19. if not all_available:
  20. sys.exit(-1)
  21. def print_usage(key_dict):
  22. print("Usage:")
  23. for k in key_dict.keys():
  24. print("%s : %s" %(k, key_dict[k]))