
    Mi                         S r SSKr SSKJrJrJr  SSKJrJrJrJr       SSSS	\\\S4   S
\\   4S jjrg! \ a(  rSSK	J
r
  \
R                  " \5      r\r\r\r SrCNQSrCff = f)zP
raster.py
------------

Turn 2D vector paths into raster images using `pillow`
    N)Image
ImageChops	ImageDraw   )
exceptions)	ArrayLikeFloatingOptionalUnionpathztrimesh.path.Path2Dpitchoriginc                 P   Ucd  UbD  [         R                  " U[         R                  S9nU R                  US-   -  R	                  5       nOU R                  R	                  5       S-  nUc  U R
                  S   US-  -
  n[         R                  " U[         R                  S9n[         R                  " U[         R                  S9nUcP  [         R                  " [         R                  " U R
                  U45      SS9n[         R                  " Xa-  5      S-   n[         R                  " U[         R                  S9n[        UR                  5       5      nU R                   Vs/ s H5  owU-
  U-  R                  5       R                  [         R                  5      PM7     nnU R                   n	U R"                  n
[$        R&                  " SUS9n[(        R*                  " U5      nUbJ  [-        U5      nU H0  nUR/                  UR1                  5       R                  5       S	US
9  M2     U(       d  U$ U	 Hj  nUR3                  X   R1                  5       R                  5       S	S9  X    H1  nUR3                  X   R1                  5       R                  5       SS9  M3     Ml     U$ s  snf )a  
Rasterize a Path2D object into a boolean image ("mode 1").

Parameters
------------
path : Path2D
  Original geometry
pitch : float or (2,) float
  Length(s) in model space of pixel edges
origin : (2,) float
  Origin position in model space
resolution : (2,) int
  Resolution in pixel space
fill :  bool
  If True will return closed regions as filled
width : int
  If not None will draw outline this wide in pixels

Returns
------------
raster : PIL.Image
  Rasterized version of input as `mode 1` image
)dtyper   i   r   g       @)axis1)modesize   )fillwidth)r   )nparrayint64extentsmaxbounds
asanyarrayfloat64ptpvstackceiltupletolistdiscreteroundastyperootenclosure_directedr   newr   Drawintlineflattenpolygon)r   r   r   
resolutionr   r   spanir%   roots	enclosureresultdrawcoordsr(   childs                   m/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/trimesh/path/raster.py	rasterizer:      s&   @ }!*BHH=J\\Z!^499;ELL$$&-E~Q53;/ MM%rzz2E]]64F vvbiif 56Q?WWT\*Q.
z:Jz((*+J JNWAf*%,,.55bhh?HW IIE''I YYCj1F>>&!D E
FIIfnn&--/auIE  M
 X^++-446Q?_ELL00299;!LD %	  M= Xs   #<J#)NNNTN)__doc__numpyr   PILr   r   r   BaseExceptionE r   ExceptionWrapper_handletypedr   r	   r
   r   r:        r9   <module>rF      s    
00 9 8
 /3"&	
V
V9d*+V YV   ))!,GEIJs   
: A( A##A(