Exemplo n.º 1
0
# -*- coding: utf-8 -*-
""" stems
"""
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__author__ = """Chris Holden"""
__email__ = '*****@*****.**'

__package__ = 'stems'

__docs__ = 'https://ceholden.github.io/{pkg}/'.format(pkg=__package__)
__docs_version__ = '%s/%s' % (__docs__, __version__)
__repo_url__ = 'https://github.com/ceholden/{pkg}'.format(pkg=__package__)
__repo_issues__ = '/'.join([__repo_url__, 'issues'])

# See: http://docs.python-guide.org/en/latest/writing/logging/
import logging  # noqa
from logging import NullHandler as _NullHandler
logging.getLogger(__name__).addHandler(_NullHandler())
Exemplo n.º 2
0
from .awesomedict import AwesomeDict

import logging as _logging
try:  # Python 2.7+
    from logging import NullHandler as _NullHandler
except ImportError:

    class _NullHandler(_logging.Handler):
        def emit(self, record):
            pass


_logger = _logging.getLogger(__name__)
_logger.addHandler(_NullHandler())
Exemplo n.º 3
0
                                   seg_frac    = .05,
                                   seg_angle   = .25,
                                   aspect_frac = .1,
                                   radius_frac = 1e-2,
                                   radius_min  = 1e-2,
                                   radius_max  = 50,
                                   tangent     = .0175)
res_path = _NumericalResolutionPath(seg_frac     = .04,
                                    seg_angle    = .18,
                                    max_sections = 10,
                                    min_sections = 5,
                                    export       = '.5f')

### logging
log = _getLogger('trimesh')
log.addHandler(_NullHandler())
def _log_time(method):
    def timed(*args, **kwargs):
        tic    = time_function()
        result = method(*args, **kwargs)
        log.debug('%s executed in %.4f seconds.',
                   method.__name__,
                   time_function()-tic)
        return result
    timed.__name__ = method.__name__
    timed.__doc__  = method.__doc__
    return timed

### exceptions
class MeshError(Exception):
    pass
Exemplo n.º 4
0
    res.export: format string to use when exporting floating point vertices
    """
    def __init__(self, **kwargs):
        self.seg_frac = .05
        self.seg_angle = .08
        self.max_sections = 10
        self.min_sections = 5
        self.export = '.5f'


tol_path = NumericalTolerancePath()
res_path = NumericalResolutionPath()

# logging
log = _getLogger('trimesh')
log.addHandler(_NullHandler())


def _log_time(method):
    def timed(*args, **kwargs):
        tic = time_function()
        result = method(*args, **kwargs)
        log.debug('%s executed in %.4f seconds.', method.__name__,
                  time_function() - tic)
        return result

    timed.__name__ = method.__name__
    timed.__doc__ = method.__doc__
    return timed