
    Mi`                        S SK r S SKrSSKJr  SSKJr  SSKJr  SSKJ	r	J
r
  SSKJr  \R                  " 5       S	:X  Ga  \ R                  R                  S
S5      R!                  S5       V s/ s H  n \" U 5      S :  d  M  U PM     sn rS H  r\ R(                  R+                  \S5      r\ R(                  R-                  \5      (       d  MA  \ R.                  " \5       H6  rS\;   d  M  \R3                  \ R(                  R+                  \\5      5        M8     M     SR+                  \" \5      5      r\R6                  " S\5        O\R                  " 5       S:X  a  \ R                  R                  S
S5      R!                  S5       V s/ s H  n \" U 5      S :  d  M  U PM     sn r\R9                  / SQ5        SR+                  \" \5      5      r\R6                  " S\5        O\ R                  R                  S
S5      r\R:                  " S\S9r\SLrSSSS.r     S$S\
S\	S\ S\ S\ S\ 4S  jjr! S%S!\"S"\"S\ 4S# jjr#gs  sn f s  sn f )&    N   )util)log)
get_string)BooleanOperationTypeIterable   )
MeshScriptWindowsPATH ;)zC:\Program FileszC:\Program Files (x86)zBlender FoundationBlenderzsearching for blender in: %sDarwin:)z(/Applications/blender.app/Contents/MacOSz(/Applications/Blender.app/Contents/MacOSz0/Applications/Blender/blender.app/Contents/MacOSblender)pathUNION
DIFFERENCE	INTERSECT)union
differenceintersectionmeshes	operation	use_exactuse_selfdebugcheck_volumec                    [         (       d  [        S5      eU(       a"  [        S U  5       5      (       d  [        S5      eUR                  5       R	                  5       nU[
        ;  a$  [        SU S[
        R                  5        S35      eU(       a  SnOSn[        S5      nUR                  S	[
        U   5      R                  S
U5      R                  SU 5      n	[        X	US9 n
U
R                  [        S-   5      nSSS5        [        R                  " W5      nU H
  nSUl        M     [        R                  " U5      $ ! , (       d  f       NJ= f)aj  
Run a boolean operation with multiple meshes using Blender.

Parameters
-----------
meshes
  List of mesh objects to be operated on
operation
  Type of boolean operation ("difference", "union", "intersect").
use_exact
  Use the "exact" mode as opposed to the "fast" mode.
use_self
  Whether to consider self-intersections.
debug
  Provide additional output for troubleshooting.
check_volume
  Raise an error if not all meshes are watertight
  positive volumes. Advanced users may want to ignore
  this check as it is expensive.

Returns
----------
result
  The result of the boolean operation on the provided meshes.
No blender available!c              3   8   #    U  H  oR                   v   M     g 7f)N)	is_volume).0ms     t/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/trimesh/interfaces/blender.py	<genexpr>boolean.<locals>.<genexpr>T   s     <VVs   zNot all meshes are volumes!`z` is not a valid boolean: `EXACTFASTz!templates/blender_boolean.py.tmplz
$OPERATIONz$SOLVER_OPTIONSz	$USE_SELF)r   scriptr    --background --python $SCRIPTN)exists
ValueErroralllowerstrip_blender_boolkeysr   replacer
   run_blender_executabler   make_sequenceface_normalsconcatenate)r   r   r   r   r   r   keysolver_optionstemplater,   blendresultr%   s                r&   booleanr@   1   s8   B 6011C<V<<<677 //

!
!
#C
-	{5m6H6H6J5K1M
 	
   =>H
 	}S'9:	"N	3	
	, 
 
6	>%.1QQR 
? 'F  F## 
?	>s   'E
Eangle_limitisland_marginc                 Z   [         (       d  [        S5      e[        S5      nUR                  SUS 5      R                  SUS 5      n[	        U /USUS9 nUR                  [        S-   5      nS	S	S	5        [        R                  " W5       H
  nS	Ul	        M     U$ ! , (       d  f       N4= f)
z(
Run an unwrap operation using blender.
r!   z$templates/blender_unwrap.py.templatez$ANGLE_LIMITz.6fz$ISLAND_MARGINobj)r   r,   exchanger   r-   N)
r.   r/   r   r5   r
   r6   r7   r   r8   r9   )	meshrA   rB   r   r=   r,   r>   r?   r%   s	            r&   unwraprG   x   s     6011 @AHnS0ACKK]3/F 
D6&5	NRW.1QQR 
O ' ( M 
O	Ns   B
B*)r   TFFT)g     P@g        F)$osplatformr   r   	constantsr   	resourcesr   typedr   r   genericr
   systemenvirongetsplitlen_search_pathpfr   joinr.   listdirpappendsetr   extendwhichr7   r3   boolr@   floatrG   )is   0r&   <module>r_      s;   	    " 2 ??	!  "zz~~fb9??DSD!AQR
ADSL>WW\\"2377>>"ZZ^> ''R(;< $ ? 88C-.LII,l;__("!zz~~fb9??DSD!AQR
ADSL	
 88C-.LII,l;::>>&"-Ljj> 	D	(
  '3D$D$#D$ D$ 	D$
 D$ D$P PU49HLW T Ts   ,I I	II