
    Mi                     :    S SK r S SKrSSKJrJr  SSKJr  SS jrg)    N   )logtol)__version__c                 ^   SSK Jn  SSKJn  [        R
                  R                  U5      n[        R
                  R                  U5      n[        R
                  R                  U5      u  pU
S:w  a  [        S5      e[        R
                  R                  U5      (       d  [        R                  " U5        O/[        R
                  R                  U5      (       d  [        S5      e U R                  5       nU R$                  ['        U Vs/ s H  oR$                  PM     sn5      -  nUR)                  S
SS9nSn[+        U5       GHb  u  nnU SU 3nU S3n[        R
                  R-                  UU5      nU" UU5        U R.                  Ul        XR0                  -  Ul        SU 3nU nUR2                   VVs/ s H%  nU Vs/ s H  nSR5                  U5      PM     snPM'     nnnUR7                  USUS9nUR7                  US5      nUR7                  USSSS9  UR7                  USUR8                  S S9  UR7                  USUS   S   US   S   US   S   US   S   US   S   US   S   S9  UR7                  US5      nUR7                  USSSS9  UR7                  US5      nUR7                  USUUS S US S US 3S!9  UR7                  US"SS9nUb&  UR7                  US#US   S S US   S S US   S S$3S%9  UR7                  US&5      nUR7                  USSSS9  UR7                  US5      nUR7                  USUUS S US S US 3S!9  UbK  U S'3n UR7                  US(U S)S*9n!UR7                  U!SSSS9  UR7                  U!S+US,9  UR7                  U!S-US,9  UnGMe     UR;                  U5      n"U S.3n#U"R=                  [        R
                  R-                  UU#5      SS/9  UR)                  S05      nUR7                  US15      n$UU$l        UR7                  US25      n%S3U%l        UR7                  US4S5S69n&U S.3U&l        UR7                  US75      n'S8[@         3UR7                  U'S15      l        S9UR7                  U'S:5      l        UR7                  US;5      n(UU(l        UR;                  U5      n"[B        RD                  (       aQ  SS<K#J$n)  URK                  U)" S=5      S>9n*U*RM                  U"5      (       d   [        RN                  " U*RP                  5        U"R=                  [        R
                  R-                  US?5      5        [R        R&                  " U5      $ ! [         a&    [        R                   " SSS	9  U R"                  /n GNf = fs  snf s  snf s  snnf )@as  
Convert a Trimesh object into a URDF package for physics
simulation. This breaks the mesh into convex pieces and
writes them to the same directory as the .urdf file.

Parameters
---------
mesh : trimesh.Trimesh
  Input geometry
directory : str
  The directory path for the URDF package

Returns
---------
mesh : Trimesh
  Multi-body mesh containing convex decomposition
r   N   )export_mesh zURDF path must be a directory!z-problem with convex decomposition, using hullT)exc_inforobotroot)name_convex_piece_z.objlink_z{:.2E}linkinertialoriginz0 0 0)xyzrpymassz.2E)valueinertiar   )ixxixyixziyyiyzizzvisualgeometrymeshz.4E )filenamescalematerialcolorz 1)rgba	collision_jointjointfixed)r   typeparent)r   childz.urdf)pretty_printmodelr   versionz1.0sdfz1.4)r1   authorztrimesh zblank@blank.blankemaildescription)
get_streamzschema/urdf.xsd)filezmodel.config)*
lxml.etreeetreeexportr	   ospathabspathbasenamesplitext
ValueErrorexistsmkdirisdirconvex_decompositionBaseExceptionr   errorconvex_hullvolumesumElement	enumeratejoincenter_massdensitymoment_inertiaformat
SubElementr   ElementTreewritetextr   r   strict	resourcesr6   	XMLSchemavalidatedebug	error_lognp)+r!   	directoryr$   r&   kwargsetr	   fullpathr   _extconvex_piecesmeffective_densityr   prev_link_nameipiece
piece_namepiece_filenamepiece_filepath	link_name	geom_namexyIr   r   r   r    r%   r(   
joint_namer*   treeurdf_filenamer0   r1   r2   r3   r5   r6   schemas+                                              o/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/trimesh/exchange/urdf.pyexport_urdfru   	   s   &  $ wwy)H77H%DWWd#FA
by9:: 77>>(##
WW]]8$$9::+113 c]*K]88]*K&LL ::gF:+D Nm,5v^A3/
&<t,h?E>* !,,)LL8J<(	%&	6;6J6JK6J!,!Qhooa !,6JK }}T6	}: ==z2
hg7C
hC0@B
!Q!Q!Q!Q!Q!Q 	 		
 tX.
fhGA==4
3Kqs1U3K8	 	 	
 =="==MM'58C.%(3qqRUVX(Y  
 MM$4	
iwGD==J7
3Kqs1U3K8	 	 	
 %%;f-JMM$jwMOEMM%wGMDMM%M?MM%yM9"G -L >>$DfENMJJrww||Hm44JH ::gDMM$'EEJmmD),GGL
--eU-
3Cu~CH]]4*F+3K=)ABMM&&!&*=BMM&'"'--m4KK>>$D
zz* :.?#@At$$IIf&&'JJrww||Hn5666-  c  +		ADQ))*+
 +L( -Ks0   (U, V
>
V)V$#V),,VV$V))g      ?N)	r;   numpyr[   	constantsr   r   r1   r   ru        rt   <module>rz      s    	    !Z!ry   