
    Mi                     H    S SK rSSKJr  SSKJr  SS jrS	S jrS\0rS\0r	g)
    N   )util)
PointCloudc                 `   [         R                  " U R                  5       5      R                  5       nUSUR	                  S5       R                  5       n[        UR                  5       5      nUS:  a  [        S5      eUc  SU;   a  SnUb  UR                  US5      n[        R                  " UR                  5       [        R                  S9nUR                  SU45      nSnUSS2SS24   n	US	:X  as  [        R                  " USS2SS24   [        R                  S9n[        R                  " U[        R                  " [        U5      S
4[        R                  S9S-  4S
S9nO2US:  a,  [        R                  " USS2SS24   [        R                  S9nUR!                  XS.5        U$ )aQ  
Load an XYZ file into a PointCloud.

Parameters
------------
file_obj : an open file-like object
  Source data, ASCII XYZ
delimiter : None or string
  Characters used to separate the columns of the file
  If not passed will use whitespace or commas

Returns
----------
kwargs : dict
  Data which can be passed to PointCloud constructor
N
   znot enough columns in xyz file!, )dtype         )axis      )verticescolors)r   decode_textreadstripfindlensplit
ValueErrorreplacenparrayfloat64reshapeuint8concatenateonesupdate)
file_obj	delimiterkwargsrawfirstcolumnsr   datar   r   s
             n/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/trimesh/exchange/xyz.pyload_xyzr-      si   $ 

8==?
+
1
1
3C #((4.!'')E%++- G{:;;SE\	kk)S) HHSYY[

3E =="g'D FArrE{H!|$q!"u+RXX6RWWc$i^288<sBC!
 
A$q!A#v,bhh7
MMx:;M    c                    [        U [        5      (       d  [        S5      eU R                  nU(       a?  [	        U S5      (       a.  U R
                  b!  [        R                  " X0R
                  45      nUc  Sn[        R                  " X2S9nU$ )a   
Export a PointCloud object to an XYZ format string.

Parameters
-------------
cloud : trimesh.PointCloud
  Geometry in space
write_colors : bool
  Write colors or not
delimiter : None or str
  What to separate columns with

Returns
--------------
export : str
  Pointcloud in XYZ format
zobject must be PointCloudr   r
   )	col_delim)

isinstancer   r   r   hasattrr   r   hstackr   array_to_string)cloudwrite_colorsr&   r+   exports        r,   
export_xyzr8   B   sw    $ eZ((455 >>Dx00U\\5Myy$-. 	!!$<FMr.   xyz)N)TN)
numpyr    r   pointsr   r-   r8   _xyz_loaders_xyz_exporters r.   r,   <module>r@      s0      8v!H x $r.   