
    j?
                     "   d dl Z d dlZd dlZd dlmZ ddlmZ ej                  j                  ej                  j                  ej                  j                  e                  Zi ZdedefdZdedefdZdedefd	Zdedefd
ZdedefdZy)    N)BytesIO   )Dictnamereturnc                     ddl m} ddlm}  |t        j
                  j                  t        d|             } |t        j                  |j                  |       j                  d            |      S )z
    Load a schema and evaluate the referenced files.

    Parameters
    ------------
    name : str
      Filename of schema.

    Returns
    ----------
    schema
      Loaded and resolved schema.
    r   )FilePathResolver)resolveschemautf-8)resolver)	resolversr	   schemasr
   ospathjoin_pwdjsonloadsgetdecode)r   r	   r
   r   s       G/DATA/.local/lib/python3.12/site-packages/trimesh/resources/__init__.py
get_schemar      sQ     -!  T8T BCH4::hll4077@AHUU    c                     t        |       }| j                  d      rt        j                  |      }n|j	                  d      }t        j                  |      S )a  
    Get a resource from the `trimesh/resources` folder as a decoded string.

    Parameters
    -------------
    name : str
      File path relative to `trimesh/resources/{name}`

    Returns
    -------------
    resource
      File data decoded from JSON.
    z.gzipr   )	get_bytesendswithgzip
decompressr   r   r   )r   raws     r   get_jsonr!   %   sC     D/C}}Wooc"jj!::c?r   c                 6    t        |       j                  d      S )z
    Get a resource from the `trimesh/resources` folder as a decoded string.

    Parameters
    -------------
    name
      File path relative to `trimesh/resources`

    Returns
    -------------
    resource
      File data as a string.
    r   )r   r   r   s    r   
get_stringr$   ;   s     T?!!'**r   c                    t         j                  | d      }||S t        t        j                  j
                  t        g| j                  d       d      5 }|j                         }ddd       t         | <   |S # 1 sw Y   xY w)z
    Get a resource from the `trimesh/resources` folder as binary data.

    Parameters
    -------------
    name
      File path relative to `trimesh/resources`

    Returns
    -------------
    resource
      File data as raw bytes.
    N/rb)	_cacher   openr   r   r   r   splitread)r   cachedfresources       r   r   r   L   sp     ZZd#F
 
bggll42$**S/2D	9Q668 
: F4LO	 
:	9s   A<<Bc                 *    t        t        |             S )a  
    Get a resource from the `trimesh/resources` folder as a binary stream.

    Parameters
    -------------
    name : str
      File path relative to `trimesh/resources`

    Returns
    -------------
    resource
      File data as a binary stream.
    )r   r   r#   s    r   
get_streamr0   h   s     9T?##r   )r   r   r   ior   typedr   r   
expanduserabspathdirname__file__r   r(   strr   r!   r$   bytesr   r0    r   r   <module>r:      s      	   
ww"''//"''//(*CDE	VS VT V.3 4 ,+S +S +"C E 8$S $W $r   