
    jJ                         d dl Z d dlZddlmZ ddlmZmZmZmZ ddl	m
Z
 	 	 	 	 ddedee   d	ee   d
ee   dedefdZ	 d dlZeedZy# e$ rZ ee      ZeedZY dZ[ydZ[ww xY w)    N   )ExceptionWrapper)BinaryIODictNumberOptional   )load_glbfile_obj
tol_lineartol_angulartol_relativemerge_primitivesreturnc                 n   t        j                         5 }t        j                  j	                  |d      }t        |d      5 }	|	j                  | j                                ddd       t        j                  j	                  |d      }
t        |      |||d}t        j                  ||
fi |j                         D ci c]  \  }}|	|| c}} t        |
d      5 }	t        d|	|d|cddd       cddd       S # 1 sw Y   xY wc c}}w # 1 sw Y   nxY w	 ddd       y# 1 sw Y   yxY w)	a6  
    Use `cascadio` a packaged version of OpenCASCADE
    to load a STEP file using GLB as an intermediate.

    Parameters
    -----------
    file_obj
      STEP file to load.
    **kwargs
      Passed to `cascadio.step_to_glb`

    Returns
    ----------
    kwargs
      Keyword arguments for a Scene.
    z	data.stepwbNzconverted.glb)r   r   r   r   rb)r   r    )tempfileTemporaryDirectoryospathjoinopenwritereadboolcascadiostep_to_glbitemsr
   )r   	file_typer   r   r   r   kwargsFstepfilefglbfilecascadio_kwargskvs                 E/DATA/.local/lib/python3.12/site-packages/trimesh/exchange/cascade.py	load_stepr+      s   6 
	$	$	&!77<<;/(D!QGGHMMO$ " '',,q/2
 !%%5 6$&(	
 		
 !0 5 5 7I 711=q!t 7I	
 '4 ATQ9ITVT ! 1 
'	& "!$ J !  1 
'	&	&sN   -D+ D"AD+ 
DDD+"D0	D+D	D+D	D++D4)stpstep)NNFT)r   r   
exceptionsr   typedr   r   r   r   gltfr
   r   r+   r   _cascade_loadersBaseExceptionEwrapperr       r*   <module>r6      s    	  ) 4 4  $($(#(!5U5U  5U &!	5U
 4.5U 5U 
5Up9()< 9q!G&89s    	A
 
A&A!!A&