#!/usr/bin/env python #--*-python-*- if __name__ == '__main__': import optparse import sys import os from chroma.camera import view, EventViewer from chroma.stl import mesh_from_stl from chroma.tools import enable_debug_on_crash import chroma.loader from chroma.log import logger, logging logger.setLevel(logging.INFO) parser = optparse.OptionParser('%prog') parser.add_option('--debug', dest='debug', action='store_true', default=False, help='Start python debugger on exception') parser.add_option('-r', '--resolution', dest='resolution', help='specify window resolution', default='1024,576') parser.add_option('-i', dest='io_file', default=None) options, args = parser.parse_args() if len(args) < 1: sys.exit(parser.format_help()) if options.debug: enable_debug_on_crash() size = [int(s) for s in options.resolution.split(',')] geometry = chroma.loader.load_geometry_from_string(args[0]) if options.io_file is None: view(geometry, size) else: viewer = EventViewer(geometry, options.io_file, size=size) viewer.start()