
    h.                       S SK Jr  S SKJrJrJr  S SKJr  S SKJr  S SK	J
r
JrJrJrJrJr  S SKJr  S SKJrJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  \(       a  S SKJ r   S SK!J"r"  S SK#J$r$  S SK%J&r&  S/r'\" S\
" S\RP                  \S9\
" S\RP                  \\RR                  \S9\
" SSS9\
" SS\RT                  \S9\
" SS \RT                  \S9\
" S\RV                  \RX                  " S S5      \S9\
" S \RZ                  \RX                  " S S5      \S9\
" S!S S9\
" S"S\R\                  \S9\
" S#S \RT                  \S9\
" S$S%S&9\
" S'S \R^                  \S9S(.5      r0\" \05      r1\ " S) S\5      5       r2g*)+    )annotations)TYPE_CHECKINGIterableOptional)const)	validator)DXFAttrDXFAttributesDefSubclassXTypeRETURN_DEFAULTgroup_code_mapping)Tags)NULLVECZ_AXIS   )AbstractBoundaryPath)
base_class)acdb_entity)register_entity)
DXFPolygon)RGB)Drawing)	DXFEntity)AbstractTagWriterHatch	AcDbHatch
   )xtypedefault   )r   r    r   fixer   SOLID)r    F   )r    r   r"   G   K      L   4   )   M   /   T)optionalb   )	elevation	extrusionpattern_name
solid_fillassociativehatch_stylepattern_typepattern_anglepattern_scalepattern_double
pixel_sizen_seed_pointsc                     ^  \ rS rSrSrSr\" \\\	5      r
\R                  r\rSU 4S jjrSS jrSS jrSSU 4S jjjrS r S     SS	 jjr    SS
 jrSS jrSrU =r$ )r      zDXF HATCH entityHATCHc                  > [         TU ]  U5        UR                  [        R                  [
        R                  5        U R                  R                  U/ SQ5        U R                  R                  XR                  5       5        U R                  R                  USS/5        U R                  (       a9  U R                  R                  U/ SQ5        U R                  R                  U5        U R                  R                  US/5        U R                  U5        U R                  (       a;  UR                  [        R                   :  a  U R                  R                  U5        ggg)z(Export entity specific data as DXF tags.)r0   r1   r2   r3   r4   r5   r6   )r7   r8   r9   r:   N)superexport_entity
write_tag2r   SUBCLASS_MARKER
acdb_hatchnamedxfexport_dxf_attribspaths
export_dxfdxftypepatternexport_seedsgradient
dxfversionDXF2000)self	tagwriter	__class__s     F/var/www/html/env/lib/python3.13/site-packages/ezdxf/entities/hatch.pyrA   Hatch.export_entity   s    i(U22JOOD##		
 	

i8##I~/NO<<HH''O LL##I.##I~>)$==Y11EMMAMM$$Y/ B=    c                     UR                  S5      nUR                  1 SkUS9nXU[	        U5      -   S-   2	 U VVs/ s H  u  pEUS:X  d  M  UPM     snnU l        U$ ! [        R                   a    Us $ f = fs  snnf )Nr/   >   r      r/   )startr   r   )	tag_indexr   DXFValueErrorcollect_consecutive_tagslenseeds)rP   tagsstart_index	seed_datacodevalues         rS   
load_seedsHatch.load_seeds   s    	..,K 11 2 
	
 {S^;a??@ 09GyDBJeyG
 "" 	K	 Hs   A A:A:A76A7c                    UR                  S[        U R                  5      5        U R                   H  nUR                  SUS S 5        M     g )Nr/   r   r#   )rB   r\   r]   write_vertex)rP   rQ   seeds      rS   rL   Hatch.export_seeds   s>    RTZZ1JJD""2tBQx0 rU   c                f   > U R                   (       d  g[        TU ]	  5         U R                  5         g)z<Remove all dependencies from actual document. (internal API)N)is_aliver@   remove_dependenciesremove_association)rP   otherrR   s     rS   rk   Hatch.remove_dependencies   s$    }}#%!rU   c                    U R                   R                  (       a,  SU R                   l        U R                   H
  n/ Ul        M     gg)z Remove associated path elements.r   N)rF   r4   rH   source_boundary_objects)rP   paths     rS   rl   Hatch.remove_association   s6    88#$DHH 

/1, #  rU   c                    SU l         SU l        SU R                  l        XR                  l        X R                  l        SU R                  l        [        R                  U R                  l	        Ub  X0l
        gg)aG  Set the solid fill mode and removes all gradient and pattern fill related
data.

Args:
    color: :ref:`ACI`, (0 = BYBLOCK; 256 = BYLAYER)
    style: hatch style (0 = normal; 1 = outer; 2 = ignore)
    rgb: true color value as (r, g, b)-tuple - has higher priority
        than `color`. True color support requires DXF R2000.

Nr   r$   )rM   rK   rF   r3   colorr5   r2   r   HATCH_TYPE_PREDEFINEDr6   rgb)rP   rt   stylerv   s       rS   set_solid_fillHatch.set_solid_fill   s`      $ ' % ; ;?H rU   c                   U R                   (       d  [        R                  " S5      eU R                  nU R                  R
                  nU R                  R                  nUb  Ub  Uc  [        R                  " S5      eU H  nUR                   (       a  UR                  (       a  [        R                  " S5      eX6R                  La  [        R                  " S5      eXFR                  R
                  :w  a  [        R                  " S5      eUR                  R                  UR                  R                  5        UR                  U5        M     [        UR                  5      (       a  SOSU R                  l        g)	a  Set association from hatch boundary `path` to DXF geometry `entities`.

A HATCH entity can be associative to a base geometry, this association
is **not** maintained nor verified by `ezdxf`, so if you modify the base
geometry the geometry of the boundary path is not updated and no
verification is done to check if the associated geometry matches
the boundary path, this opens many possibilities to create
invalid DXF files: USE WITH CARE!

zHATCH entity is destroyedNz/virtual entity can not have associated entitiesz2associated entity is destroyed or a virtual entityz.associated entity is from a different documentz,associated entity is from a different layoutr   r   )rj   r   DXFStructureErrordocrF   ownerhandle
is_virtualrp   appendappend_reactor_handler\   r4   )rP   rq   entitiesr|   r}   r~   entitys          rS   	associateHatch.associate
  s,    }}))*EFFhh;%-6>))A  F??f&7&7--H  **$--D  

(((--B  ((//

0A0AB((0   %((D(D$E$Eq1rU   c                    [        U5      n[        U5      S:  a  [        R                  " S5      e[        U5      U l        [        U R                  5      U R
                  l        g)zSet seed points, `points` is an iterable of (x, y)-tuples.
I don't know why there can be more than one seed point.
All points in :ref:`OCS` (:attr:`Hatch.dxf.elevation` is the Z value)

r   zSArgument points should be an iterable of 2D points and requires at least one point.N)listr\   r   rZ   r]   rF   r;   )rP   pointss     rS   set_seed_pointsHatch.set_seed_points6  sQ     fv;?%%'  &\
!$TZZrU   )rM   rK   rv   r]   )rQ   r   returnNone)r^   r   r   r   )rQ   r   )N)rm   zOptional[Drawing]r   r   )   r   N)rt   intrw   r   rv   zOptional[RGB])rq   r   r   zIterable[DXFEntity])r   zIterable[tuple[float, float]]r   r   )__name__
__module____qualname____firstlineno____doc__DXFTYPEr
   r   r   rD   
DXFATTRIBSr   rO   MIN_DXF_VERSION_FOR_EXPORTacdb_hatch_group_codeLOAD_GROUP_CODESrA   rc   rL   rk   rl   rx   r   r   __static_attributes____classcell__)rR   s   @rS   r   r      s    Gz;
CJ!&,04 1
" "2 DH%(3@4*M(*M4G*MX1 1rU   N)3
__future__r   typingr   r   r   ezdxf.lldxfr   r   ezdxf.lldxf.attributesr	   r
   r   r   r   r   ezdxf.lldxf.tagsr   
ezdxf.mathr   r   boundary_pathsr   	dxfentityr   dxfgfxr   factoryr   polygonr   ezdxf.colorsr   ezdxf.documentr   ezdxf.entitiesr   ezdxf.lldxf.tagwriterr   __all__point3dis_not_null_vectoris_integer_boolHATCH_STYLE_NESTEDis_in_integer_rangeru   is_not_zerois_greater_or_equal_zerorD   r   r    rU   rS   <module>r      s   # 4 4  !  " & 0 !  $  &(7 ) 
 Ru}}gF--22 
  73 // 	
 // 	
 ,,33Aq9 	
  //33Aq9 	
 !Q/ ++ 	
 "// 	
 b40 88 	
c@C
H +:6  Y1J Y1 Y1rU   