# Path: trimesh/constants.py
# class NumericalToleranceMesh(object):
# class NumericalResolutionMesh(object):
# class NumericalTolerancePath(object):
# class NumericalResolutionPath(object):
# class MeshError(Exception):
# class TransformError(Exception):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
# def _log_time(method):
#     def timed(*args, **kwargs):


import numpy as np
import networkx as nx
import itertools
from collections import deque
from tempfile import NamedTemporaryFile
from distutils.spawn import find_executable
from subprocess import check_call
from xml.etree import cElementTree
from ..constants import res, log
    Using this over openCASCADE as it is signifigantly more stable (though not OSS.)

    STEPtools Inc. provides the binary under this license:
    http://www.steptools.com/demos/license_author.html

    To install the required binary ('export_product_asm') into PATH:
        wget http://www.steptools.com/demos/stpidx_author_linux_x86_64_16.0.zip
        unzip stpidx_author_linux_x86_64_16.0.zip
        sudo cp stpidx_author_linux_x86_64/bin/export_product_asm /usr/bin/

    Arguments
    ----------
    file_obj:  file like object containing step file
    file_type: unused

    Returns
    ----------
    meshes: list of Trimesh objects (with correct metadata set from STEP file)
    '''

    with NamedTemporaryFile() as out_file:
        with NamedTemporaryFile(suffix='.STEP') as in_file:
            if hasattr(file_obj, 'read'):
                in_file.write(file_obj.read())
                in_file.flush()
                in_file.seek(0)
                file_name = in_file.name
            else:
                file_name = file_obj
            check_call([_STEP_FACETER, file_name,

# Path: trimesh/constants.py
# class NumericalToleranceMesh(object):
# class NumericalResolutionMesh(object):
# class NumericalTolerancePath(object):
# class NumericalResolutionPath(object):
# class MeshError(Exception):
# class TransformError(Exception):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
#     def __init__(self, **kwargs):
# def _log_time(method):
#     def timed(*args, **kwargs):


# Path: trimesh/io/step.py
import numpy as np
import networkx as nx
import itertools
from collections import deque
from tempfile import NamedTemporaryFile
from distutils.spawn import find_executable
from subprocess import check_call
from xml.etree import cElementTree
from ..constants import res, log

    Using this over openCASCADE as it is signifigantly more stable (though not OSS.)

    STEPtools Inc. provides the binary under this license:
    http://www.steptools.com/demos/license_author.html

    To install the required binary ('export_product_asm') into PATH:
        wget http://www.steptools.com/demos/stpidx_author_linux_x86_64_16.0.zip
        unzip stpidx_author_linux_x86_64_16.0.zip
        sudo cp stpidx_author_linux_x86_64/bin/export_product_asm /usr/bin/

    Arguments
    ----------
    file_obj:  file like object containing step file
    file_type: unused

    Returns
    ----------
    meshes: list of Trimesh objects (with correct metadata set from STEP file)
    '''

    with NamedTemporaryFile() as out_file:
        with NamedTemporaryFile(suffix='.STEP') as in_file:
            if hasattr(file_obj, 'read'):
                in_file.write(file_obj.read())
                in_file.flush()
                in_file.seek(0)
                file_name = in_file.name
            else:
                file_name = file_obj
            check_call([_STEP_FACETER, file_name,

                        '-tol', str(res.mesh),