
    BPcG                         d dl Z d dlZ G d dej                  Zedk    r e                                             dS dS )    Nc                       e Zd Zd Zd ZdS )
Spirographc                 b   |                     dt          dd           |                     dt          dd           |                     dt          d	d
           |                     ddd           |                     dt          dd           |                     dt          dd           d S )Nz
--primaryrg      Y@zThe radius of the outer gear)typedefaulthelpz--secondaryrg      N@zThe radius of the inner gearz--penrg      I@z+The distance of the pen from the inner gearz--gearplacementinsidez6Selects whether the gear is inside or outside the ring)r   r   z
--rotationg        z,The number of degrees to rotate the image byz	--quality   z$The quality of the calculated output)add_argumentfloatint)selfparss     ,/usr/share/inkscape/extensions/spirograph.pyadd_argumentszSpirograph.add_arguments   s   ue:X 	 	
 	
 	
 	/	 	 	
 	
 	
 	>	 	 	
 	
 	
 	I 	 	
 	
 	

 	?	 	 	
 	
 	
 	7	 	 	
 	
 	
 	
 	
    c                 P	   | j                             t          | j        j                  dz             | j        _        | j                             t          | j        j                  dz             | j        _        | j                             t          | j        j                  dz             | j        _        | j        j        dk    rd S | j        j        dk    rd S | j        j        	                    d          
                                                    d          r| j        j        | j        j        z   }d}n| j        j        | j        j        z
  }d}|| j        j        z  }|dk    rd S dt          j        z  || j        j        z  z  }t          j         | j        j        z  dz  }t          j                    }t          j        d	d
d          |_        d}d}t'          |          D ]}	|	|z  }
| j         j        j        }|t          j        |
|z             z  | j        j        t          j        ||
z  |z             z  |z  z   |d         z   }|t          j        |
|z             z  | j        j        t          j        ||
z  |z             z  z
  |d         z   }| t          j        |
|z             z  || j        j        z  t          j        ||
z  |z             z  |z  z
  |z  dz  }|t          j        |
|z             z  || j        j        z  t          j        ||
z  |z             z  z
  |z  dz  }|	dk    rW|d                    t          |          t          |          t          ||z             t          ||z                       z  }|d                    t          ||z
            t          ||z
            t          |          t          |                    z  }t          j        |	|z  | j        j                  dk    r|	| j        j        z  dk    r|dz  } nF|	|dz
  k    rI|d                    t          ||z             t          ||z                       z  }||_        | j                                                             |           d S )Npxr    outside         z#000000nonez1.0)strokefillstroke_width i     zM {},{} C {},{} z{},{} {},{}Zz	 C {},{} )svgunittouustroptionsprimaryr
secondaryrpenrqualitygearplacementstriplower
startswithmathpirotationinkexPathElementStylestylerange	namedviewcentercossinformatfmodpathget_current_layerappend)r   aflipratioscaler0   newpath_stringmaxPointCountithetaview_centerxydxdys                   r   effectzSpirograph.effect<   s    $ 1 1#dl6K2L2Lt2S T T"&("3"3C8O4P4PSW4W"X"X H--c$,2C.D.Dt.KLL<"a''F<1$$F<%++C006688CCINN 	%(??ADD%(??ADDL++A::FDGut|';;<G8dl33c9!!KyvERRR	}%% 7	T 7	TAIE(,3KDHUX-...,#dhuu}x/G&H&HH4OPa.!  DHUX-...,#dhuu}x/G&H&HHIa.!  B%("2333l'(huu}x7889     !1222dl//$(55=8;S2T2TTU 	
   Avv188FFCFFCBKKQV     }33BKKQVc!ffc!ff    
 Ia%i)=>>!CCDL00A553&KEMA---#{'9'9#a"f++s1r6{{'S'SS""$$++C00000r   N)__name__
__module____qualname__r   rM    r   r   r   r      s8         
  
  
DX1 X1 X1 X1 X1r   r   __main__)r.   r1   EffectExtensionr   rN   runrQ   r   r   <module>rU      s   *  {1 {1 {1 {1 {1& {1 {1 {1| zJLL r   