
    Og                       d dl mZ d dlmZmZmZmZmZ d dlZd dl	Z	d dl
Z
d dlmZ d dlmZmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlm Z  erd dl!m"Z" g d	Z#e	jH                   G d
 de	jJ                               Z&e	jH                   G d de	jJ                               Z' G d dejP                        Z) G d dejP                        Z* G d d      Z+	 d#	 	 	 	 	 	 	 d$dZ,d%dZ-	 	 	 	 d&dZ. G d de)      Z/ G d de)      Z0 G d de*      Z1 G d de*      Z2 G d d e*      Z3 G d! d"e*      Z4de1e2e3e4gZ5y)'    )annotations)UnionIterableSequenceOptionalTYPE_CHECKINGN)const)Tags
group_tags)Vec2Vec3UVecOCSbulge_to_arcConstructionEllipseConstructionArcBSplineNonUniformScalingErroropen_uniform_knot_vectorglobal_bspline_interpolationarc_angle_span_degangle_to_paramparam_to_angle)OCSTransform)AbstractTagWriter)BoundaryPathsPolylinePathEdgePathLineEdgeArcEdgeEllipseEdge
SplineEdgeEdgeTypeBoundaryPathTypeAbstractEdgeAbstractBoundaryPathc                      e Zd ZdZdZy)r$         N)__name__
__module____qualname__POLYLINEEDGE     b/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/ezdxf/entities/boundary_paths.pyr$   r$   /   s    HDr0   r$   c                      e Zd ZdZdZdZdZy)r#   r(   r)         N)r*   r+   r,   LINEARCELLIPSESPLINEr/   r0   r1   r#   r#   5   s    D
CGFr0   r#   c                      e Zd ZU ded<   ded<   ded<   ej
                  dd       Zeej
                  dd              Zej
                  dd	       Z	ej
                  dd
       Z
ej
                  dd       Zy)r&   r$   typeintpath_type_flags	list[str]source_boundary_objectsc                     y Nr/   selfs    r1   clearzAbstractBoundaryPath.clearB   s     r0   c                     y r@   r/   )clstagss     r1   	load_tagszAbstractBoundaryPath.load_tagsE   s    <?r0   c                     y r@   r/   )rB   	tagwriterdxftypes      r1   
export_dxfzAbstractBoundaryPath.export_dxfI   s    NQr0   c                     y r@   r/   rB   ocs	elevations      r1   	transformzAbstractBoundaryPath.transformL       FIr0   c                     y r@   r/   rA   s    r1   is_validzAbstractBoundaryPath.is_validO        #r0   NreturnNone)rF   r
   rV   r&   rI   r   rJ   strrV   rW   rN   r   rO   floatrV   rW   rV   bool)r*   r+   r,   __annotations__abcabstractmethodrC   classmethodrG   rK   rP   rS   r/   r0   r1   r&   r&   =   s    
&&   ?  ?Q QI I# #r0   r&   c                     e Zd ZU ded<   eej                  dd              Zeej                  dd              Zej                  dd       Z	ej                  dd       Z
ej                  dd       Zedd       Zedd	       Zy
)r%   r#   r:   c                     y r@   r/   rA   s    r1   start_pointzAbstractEdge.start_pointV   s    #&r0   c                     y r@   r/   rA   s    r1   	end_pointzAbstractEdge.end_pointZ   s    !$r0   c                     y r@   r/   )rB   rI   s     r1   rK   zAbstractEdge.export_dxf^   s    @Cr0   c                     y r@   r/   rM   s      r1   rP   zAbstractEdge.transforma   rQ   r0   c                     y r@   r/   rA   s    r1   rS   zAbstractEdge.is_validd   rT   r0   c                    | j                   S r@   )rd   rA   s    r1   real_start_pointzAbstractEdge.real_start_pointg   s    r0   c                    | j                   S r@   )rf   rA   s    r1   real_end_pointzAbstractEdge.real_end_pointk   s    ~~r0   NrV   r   rI   r   rV   rW   rZ   r\   )r*   r+   r,   r^   propertyr_   r`   rd   rf   rK   rP   rS   rk   rm   r/   r0   r1   r%   r%   S   s    
N&  &$  $C CI I# #     r0   r%   c                  0   e Zd ZdddZd Zd Zd ZddZedd       Z	e
dd       Zd d	Zd!d
Zd!dZd!dZej"                  f	 	 	 d"dZd#dZ	 	 d$	 	 	 	 	 	 	 d%dZd&d'dZd(dZd)d*dZd+d dZd,d-dZd dZd.d/dZd0d1dZd2d/dZd2d/dZd3d4dZddZ y)5r   Nc                    |xs g | _         y r@   paths)rB   rt   s     r1   __init__zBoundaryPaths.__init__q   s    16"
r0   c                ,    t        | j                        S r@   )lenrt   rA   s    r1   __len__zBoundaryPaths.__len__t   s    4::r0   c                     | j                   |   S r@   rs   )rB   items     r1   __getitem__zBoundaryPaths.__getitem__w   s    zz$r0   c                ,    t        | j                        S r@   )iterrt   rA   s    r1   __iter__zBoundaryPaths.__iter__z       DJJr0   c                :    t        d | j                  D              S )Nc              3  <   K   | ]  }|j                           y wr@   rS   .0ps     r1   	<genexpr>z)BoundaryPaths.is_valid.<locals>.<genexpr>~        4A1::<4   )allrt   rA   s    r1   rS   zBoundaryPaths.is_valid}       4444r0   c                (   g }|d   j                   dk(  sJ t        |d      }|D ]c  }|d   j                  }t        |dz        }|rt        j                  |      nt        j                  |      }||_        |j                  |       e  | |      S )Nr   \   	splitcoder)   )	coder   valuer]   r   rG   r   r<   append)rE   rF   rt   grouped_path_tags	path_tagsr<   is_polyline_pathpaths           r1   rG   zBoundaryPaths.load_tags   s    Aw||r!!!&tr:* 		I'l00O#Oa$78 $ &&y1''	2 
 $3D LL		 5zr0   c                :    t        d | j                  D              S )Nc              3  V   K   | ]!  }|j                   t        j                  k(   # y wr@   )r:   r$   r.   r   s     r1   r   z/BoundaryPaths.has_edge_paths.<locals>.<genexpr>   s      Gq166-222Gs   '))anyrt   rA   s    r1   has_edge_pathszBoundaryPaths.has_edge_paths   s    GDJJGGGr0   c                    g | _         y)zRemove all boundary paths.Nrs   rA   s    r1   rC   zBoundaryPaths.clear   	    
r0   c              #  r   K   | j                   D ]$  }|j                  t        j                  z  s!| & yw)z+Iterable of external paths, could be empty.N)rt   r<   r	   BOUNDARY_PATH_EXTERNALrB   bs     r1   external_pathszBoundaryPaths.external_paths   s2      	A  5#?#??	   -77c              #  r   K   | j                   D ]$  }|j                  t        j                  z  s!| & yw)z,Iterable of outermost paths, could be empty.N)rt   r<   r	   BOUNDARY_PATH_OUTERMOSTr   s     r1   outermost_pathszBoundaryPaths.outermost_paths   s2      	A  5#@#@@	r   c              #     K   t         j                  t         j                  z   }| j                  D ]!  }t	        |j
                  |z        du s| # yw)z*Iterable of default paths, could be empty.FN)r	   r   r   rt   r]   r<   )rB   not_defaultr   s      r1   default_pathszBoundaryPaths.default_paths   sL     33e6R6RR 	AA%%34=	s   AAAc                    ddt        fdt        | j                        D              }d|t        j                  k(  rdn|t        j
                  k(  rdfd|D        S )am  Iterable of paths to process for rendering, filters unused
        boundary paths according to the given hatch style:

        - NESTED: use all boundary paths
        - OUTERMOST: use EXTERNAL and OUTERMOST boundary paths
        - IGNORE: ignore all paths except EXTERNAL boundary paths

        Yields paths in order of EXTERNAL, OUTERMOST and DEFAULT.

        c                T    | t         j                  z  ry| t         j                  z  ryy)Nr   r(   r)   )r	   r   r   flagss    r1   path_type_enumz5BoundaryPaths.rendering_paths.<locals>.path_type_enum   s'    u333666r0   c              3  N   K   | ]  \  }} |j                         ||f  y wr@   )r<   )r   ir   r   s      r1   r   z0BoundaryPaths.rendering_paths.<locals>.<genexpr>   s,      
:>!Q^A--.15
s   "%r(   r3   r)   c              3  6   K   | ]  \  }}}|k  s|  y wr@   r/   )r   	path_type_r   ignores       r1   r   z0BoundaryPaths.rendering_paths.<locals>.<genexpr>   s     EoiA)f2DEs   )rV   r;   )sorted	enumeratert   r	   HATCH_STYLE_NESTEDHATCH_STYLE_OUTERMOST)rB   hatch_stylert   r   r   s      @@r1   rendering_pathszBoundaryPaths.rendering_paths   sb    	  
BKDJJBW
 
 %222FE777FEEEr0   c                    t        |t              st        dt        |             | j                  j                  |       y)zCAppend a new boundary path.

        .. versionadded:: 1.4
        zinvalid path type: N)
isinstancer&   	TypeErrorr:   rt   r   )rB   r   s     r1   r   zBoundaryPaths.append   s8    
 $ 451$t*>??

$r0   c                V    t         j                  |||      }| j                  |       |S )aA  Create and add a new :class:`PolylinePath` object.

        Args:
            path_vertices: iterable of polyline vertices as (x, y) or
                (x, y, bulge)-tuples.
            is_closed: 1 for a closed polyline else 0
            flags: default(0), external(1), derived(4), textbox(8) or outermost(16)

        )r   from_verticesr   )rB   path_vertices	is_closedr   new_paths        r1   add_polyline_pathzBoundaryPaths.add_polyline_path   s)      --mYNHr0   c                J    t               }||_        | j                  |       |S )zCreate and add a new :class:`EdgePath` object.

        Args:
            flags: default(0), external(1), derived(4), textbox(8) or outermost(16)

        )r   r<   r   )rB   r   r   s      r1   add_edge_pathzBoundaryPaths.add_edge_path   s$     :#( Hr0   c                    |j                  dt        | j                               | j                  D ]  }|j                  ||        y )N[   )
write_tag2rw   rt   rK   )rB   rI   rJ   r   s       r1   rK   zBoundaryPaths.export_dxf   s;    RTZZ1JJ 	0DOOIw/	0r0   c                    |j                   s"| j                  d       | j                          | j                  D ]  }|j	                  ||        y)zoTransform HATCH boundary paths.

        These paths are 2d elements, placed in the OCS of the HATCH.

        Tjust_with_bulgerO   N)scale_uniformpolyline_to_edge_pathsarc_edges_to_ellipse_edgesrt   rP   )rB   rN   rO   r   s       r1   rP   zBoundaryPaths.transform   sM       '''=++-JJ 	5DNN3)N4	5r0   c                    dddfd}t        | j                        D ]>  \  }}t        |t              s|r|j	                         s* ||      | j                  |<   @ y)zConvert polyline paths including bulge values to line- and arc edges.

        Args:
            just_with_bulge: convert only polyline paths including bulge
                values if ``True``

        c              3    K   d }d}| D ]f  \  }}}t        ||      }||}|}|dk7  rt               }t        |||      \  |_        }}	|_        |j                  t        j                  ||j                        z   }
|
j                  |d      |_        t        j                  |      dz  |_        t        j                  |	      dz  |_        t        j                  |j                  |j                        r't        j                  |j                  d      rd|_        | nHt               }|j                  |j                  f|_        |j                  |j                  f|_        | |}|}i y w)N        g&.>)abs_tol     v@r   )r   r    r   centerradiusr   
from_angleiscloseccwmathdegreesstart_angle	end_angler   xystartend)points
prev_point
prev_bulger   r   bulgepointarcr   r   	chk_pointlines               r1   _edgesz4BoundaryPaths.polyline_to_edge_paths.<locals>._edges  sK    &*J #J% !#1eQ
%!&J!&J$!)C %Z
C
#!
 #

T__[#**-U UI'//
D/ICG&*ll;&?%&GCO$(LL$;e$CCM||COOS]]CI ).I#:D",,,
!=DJ %1DHJ"
"
C!#s   E2E4c                    t               }t        | j                        }| j                  r|j	                  |d          t         |            |_        |S Nr   )r   listverticesr   r   edges)polyline_path	edge_pathr   r   s      r1   to_edge_pathz:BoundaryPaths.polyline_to_edge_paths.<locals>.to_edge_path4  sJ     
I!-"8"89H&&,"6(#34IOr0   N)rV   z"Iterable[Union[LineEdge, ArcEdge]])rV   r   )r   rt   r   r   	has_bulge)rB   r   r   
path_indexr   r   s        @r1   r   z$BoundaryPaths.polyline_to_edge_paths  sY    $	#L	 !*$** 5 	<J$-"4>>+;)5d);

:&		<r0   c                    g }| j                   D ]=  }|j                  t        j                  k(  rt	        |||      }|j                  |       ? || _         y)ae  Convert all edge paths to simple polyline paths without bulges.

        Args:
            distance: maximum distance from the center of the curve to the
                center of the line segment between two approximation points to
                determine if a segment should be subdivided.
            segments: minimum segment count per curve

        N)rt   r:   r$   r.   flatten_to_polyline_pathr   )rB   distancesegments	convertedr   s        r1   edge_to_polyline_pathsz$BoundaryPaths.edge_to_polyline_pathsB  sT     	JJ 	#Dyy,111/hIT"	# 
r0   c                    dd}| j                   D ]N  }t        |t              s|j                  }t	        |      D ]!  \  }}t        |t
              s ||      ||<   # P y)z'Convert all arc edges to ellipse edges.c                    t               }| j                  |_        d|_        | j                  df|_        | j
                  |_        | j                  |_        | j                  |_        |S )N      ?r   )r!   r   ratior   
major_axisr   r   r   )r   ellipses     r1   
to_ellipsez<BoundaryPaths.arc_edges_to_ellipse_edges.<locals>.to_ellipseV  sT    !mG ZZGNGM"%**c!2G"%//G #G''GKNr0   N)r   r    rV   r!   )rt   r   r   r   r   r    )rB   r   r   r   
edge_indexedges         r1   r   z(BoundaryPaths.arc_edges_to_ellipse_edgesS  sa    	 JJ 	=D$)

(1%(8 =$J!$0,6t,<j)=	=r0   c                    dfd}t        | j                        D ]Q  \  }}t        |t              s|j                  }t        |      D ]!  \  }}t        |t
              s ||      ||<   # S y)z
        Convert all ellipse edges to spline edges (approximation).

        Args:
            num: count of control points for a **full** ellipse, partial
                ellipses have proportional fewer control points but at least 3.

        c                :   t        | j                  | j                  | j                  | j                  | j
                        }t        t        t              |j                  z  t        j                  z        d      }t        j                  ||      }t               }|j                  |_        | j                   s|j#                         }t%        j&                  |j(                        |_        |j+                         |_        |j/                         |_        |S )Nr   r   r   start_param	end_paramr3   )r   r   r   r   r  r  maxr;   r[   
param_spanr   taur   ellipse_approximationr"   degreer   reverser   r   control_pointsknotsknot_valuesweights)er   counttoolsplinenums        r1   to_spline_edgezCBoundaryPaths.ellipse_edges_to_spline_edges.<locals>.to_spline_edgeq  s     *xx<<ggMM++G E#J););;dhhFGKE00%@D\F KKFM55||~$(IId.A.A$BF!!%F!\\^FNMr0   N)r  r!   rV   r"   )r   rt   r   r   r   r!   )rB   r  r  r   r   r   r   r  s    `      r1   ellipse_edges_to_spline_edgesz+BoundaryPaths.ellipse_edges_to_spline_edgesg  sp    	, !*$** 5 	AJ$)

(1%(8 A$J!$4,:4,@j)A	Ar0   c                    dfd}| j                   D ]f  }t        |t              sg }|j                  D ];  }t        |t              r|j                   ||             +|j                  |       = ||_        h y)zConvert all spline edges to line edges (approximation).

        Args:
            factor: count of approximation segments = count of control
                points x factor

        c              3    K   | j                   }t        | j                        r>t        | j                  | j                  dz   | j
                  t        |      r|nd       }nUt        | j                        r+t        j                  | j                  | j                        }nt        j                  d      t        t        |j                        d      dz
  z  }t        |j                  |            }t        |d d |dd        D ]5  \  }}t               }|j                  |_        |j                  |_        | 7 y w)Nr(   )r  orderr  r  z2SplineEdge() without control points or fit points.r3   )r  rw   r  r   r  r  
fit_pointsfrom_fit_pointsr	   DXFStructureErrorr  r   approximatezipr   vec2r   r   )	spline_edger  bsplinesegment_countr   v1v2r  factors	           r1   to_line_edgesz?BoundaryPaths.spline_edges_to_line_edges.<locals>.to_line_edges  s    !))G;--.!#.#=#=%,,q0%11'*7|G	 [++,!11**K,>,> --H  !W%;%;!<a@1DNMG//>?HhsmXab\: BzWW
77
	s   D?EN)r"  r"   )rt   r   r   r   r"   extendr   )rB   r'  r(  r   	new_edgesr  s    `    r1   spline_edges_to_line_edgesz(BoundaryPaths.spline_edges_to_line_edges  ss    	2 JJ 	'D$)	 JJ /D!$
3!((t)<=!((.	/
 '
	'r0   c                    fd}| j                   D ]f  }t        |t              sg }|j                  D ];  }t        |t              r|j                   ||             +|j                  |       = ||_        h y)zConvert all ellipse edges to line edges (approximation).

        Args:
            num: count of control points for a **full** ellipse, partial
                ellipses have proportional fewer control points but at least 3.

        c              3  :  K   t        | j                  | j                  | j                  | j                  | j
                        }t        t        t              |j                  z  t        j                  z        d      }|j                  |dz         }| j                  st        t        |            }t        |j!                  |            }t#        |d d |dd        D ]5  \  }}t%               }|j&                  |_        |j&                  |_        | 7 y w)Nr  r3   r(   r  )r   r   r   r   r  r  r  r;   r[   r  r   r	  paramsr   reversedr   r   r   r   r!  r   r   )	r  r   r$  r.  r   r%  r&  r   r  s	           r1   r(  z@BoundaryPaths.ellipse_edges_to_line_edges.<locals>.to_line_edges  s     ){{??jj ,,..G  E#J1C1C$Cdhh$N OQRSM^^MA$56F 88!$v,/G,,V45HhsmXab\: BzWW
77
	s   DDN)rt   r   r   r   r!   r)  r   )rB   r  r(  r   r*  r  s    `    r1   ellipse_edges_to_line_edgesz)BoundaryPaths.ellipse_edges_to_line_edges  ss    	, JJ 	'D$)	 JJ /D!$4!((t)<=!((.	/
 '
	'r0   c                j    | j                  d       | j                          | j                  |       y)a"  Convert all bulge, arc and ellipse edges to spline edges
        (approximation).

        Args:
            num: count of control points for a **full** circle/ellipse, partial
                circles/ellipses have proportional fewer control points but at
                least 3.

        Tr   N)r   r   r  )rB   r  s     r1   all_to_spline_edgesz!BoundaryPaths.all_to_spline_edges  s/     	##D#9'')**3/r0   c                    | j                  d       | j                          | j                  |       | j                  |       y)a  Convert all bulge, arc and ellipse edges to spline edges and
        approximate this splines by line edges.

        Args:
            num: count of control points for a **full** circle/ellipse, partial
                circles/ellipses have proportional fewer control points but at
                least 3.
            spline_factor: count of spline approximation segments = count of
                control points x spline_factor

        Tr   N)r   r   r0  r+  )rB   r  spline_factors      r1   all_to_line_edgeszBoundaryPaths.all_to_line_edges  s=     	##D#9'')((-''6r0   c                2   | j                   D ]  }t        |t              r|j                         c S t        |t              rA|j
                  D ]1  }|j                  t        j                  t        j                  hv s0  y vt        t        |             y)zgReturns ``True`` if any boundary path has bulge values or arc edges
        or ellipse edges.

        TF)rt   r   r   r   r   r   r:   r#   r6   r7   r   )rB   r   r  s      r1   has_critical_elementsz#BoundaryPaths.has_critical_elements  s    
 JJ 	,D$-~~''D(+ JJ $DyyX\\83C3C$DD#$  T
++	, r0   r@   )rt   z$Optional[list[AbstractBoundaryPath]]r\   )rF   r
   rV   r   rU   )rV   Iterable[AbstractBoundaryPath])r   r;   rV   r8  )r   r&   rV   rW   Tr(   r   zIterable[tuple[float, ...]]r   r]   r   r;   rV   r   )r(   )r   r;   rV   r   rX   )r   rZ   T   )r   r[   r   r;   )    )r  r;   rV   rW   )   )r'  r;   rV   rW   )@   )r@  r?  )r  r;   r4  r;   rV   rW   )!r*   r+   r,   ru   rx   r{   r~   rS   ra   rG   rp   r   rC   r   r   r   r	   r   r   r   r   r   rK   rP   r   r   r   r  r+  r0  r2  r5  r7  r/   r0   r1   r   r   p   s    =  5    H H "'!9!9FF	'F>  	2  	
 
&
0
5;<z"=(%AN*'X''R07"r0   r   r   c                    dd l }|j                  j                  | t               d      }d |j	                  ||      D        }t
        j                  || j                        S )Nr   )rN   rO   c              3  L   K   | ]  }|j                   |j                  f  y wr@   )r   r   )r   vs     r1   r   z+flatten_to_polyline_path.<locals>.<genexpr>  s     Kqacc
Ks   "$r   )
ezdxf.pathr   from_hatch_boundary_pathr   
flatteningr   r   r<   )r   r   r   ezdxfez_pathr   s         r1   r   r     sa      jj11$CEQ1OGKG$6$6x$JKH%%"" &  r0   c                    g }t        |       rm| d   j                  dv rM| j                         }|j                  dk(  r|j                  |j                         n|j                          |S 	 g S t        |       rmg S )Nr  )a   J  rK  )rw   r   popr   r   r  )r   source_boundary_object_tagslast_tags      r1    pop_source_boundary_objects_tagsrO  !  sv    "$
i.R=* }}H}}#+228>>B ,33522I i. Ir0   c                l    | j                  dt        |             |D ]  }| j                  d|        y )NrJ  rK  )r   rw   )rI   handleshandles      r1   export_source_boundary_objectsrS  2  s7     S\* *S&)*r0   c                      e Zd Zej                  ZddZddZe	 	 d	 	 	 	 	 	 	 dd       Z	edd       Z
	 d	 	 	 	 	 ddZddZddZddZdd	Zy
)r   c                X    t         j                  | _        d| _        g | _        g | _        y )NF)r	   BOUNDARY_PATH_POLYLINEr<   r   r   r>   rA   s    r1   ru   zPolylinePath.__init__=  s*    $)$@$@ ;= 35$r0   c                     yNTr/   rA   s    r1   rS   zPolylinePath.is_validG      r0   c                n    t               }|j                  ||       |t        j                  z  |_        |S )aG  Create a new :class:`PolylinePath` object from vertices.

        Args:
            path_vertices: iterable of polyline vertices as (x, y) or
                (x, y, bulge)-tuples.
            is_closed: 1 for a closed polyline else 0
            flags: default(0), external(1), derived(4), textbox(8) or outermost(16)

        )r   set_verticesr	   rV  r<   )rE   r   r   r   r   s        r1   r   zPolylinePath.from_verticesJ  s3       >mY7#(5+G+G#G r0   c                v   t               }t        |      |_        |D ]  }|\  }}|dk(  r%|j                  j	                  |d   |d   df       2|dk(  r=|j                  j                         \  }}}|j                  j	                  |||f       t|dk(  rz|dk(  r||_        |dk(  r||_        |d	k(  s |S )
N
   r   r(   r   *   H   I   r   ]   )r   rO  r>   r   r   rL  r   r<   )	rE   rF   r   tagr   r   r   r   r   s	            r1   rG   zPolylinePath.load_tags_  s    ~'G'M$ 	CKD%rz$$eAha#%>?"mm//11e$$aE]3!&',$!	" r0   c                    g }|D ]V  }t        |      dk(  r|\  }}d}n*t        |      dk(  r|\  }}}nt        j                  d      |j                  |||f       X || _        || _        y)zpSet new `vertices` as new polyline path, a vertex has to be a
        (x, y) or a (x, y, bulge)-tuple.

        r)   r   r3   z7Invalid vertex format, expected (x, y) or (x, y, bulge)N)rw   r	   DXFValueErrorr   r   r   )rB   r   r   new_verticesvertexr   r   r   s           r1   r[  zPolylinePath.set_verticesv  s      
	/F6{a1V!$1e))M  Au.
	/ %"r0   c                .    g | _         d| _        g | _        y)zrRemoves all vertices and all handles to associated DXF objects
        (:attr:`source_boundary_objects`).
        FN)r   r   r>   rA   s    r1   rC   zPolylinePath.clear  s     ')$r0   c                :    t        d | j                  D              S )Nc              3  (   K   | ]
  \  }}}|  y wr@   r/   )r   r   r   r   s       r1   r   z)PolylinePath.has_bulge.<locals>.<genexpr>  s     :[Q55:s   )r   r   rA   s    r1   r   zPolylinePath.has_bulge  s    :DMM:::r0   c                p   | j                         }|j                  } |dt        | j                               |dk(  r/ |dt        |              |dt        | j                               nB|dk(  r/ |dt        | j                                |dt        |             nt        d|        |dt        | j                               | j                  D ]A  \  }}}|j                  dt        |      t        |      f       |s0 |d	t        |             C |dk(  rt        || j                         y y )
Nr   HATCHr_  r`  MPOLYGONzunsupported DXF type ra  r]  r^  )r   r   r;   r<   r   
ValueErrorrw   r   write_vertexr[   rS  r>   )rB   rI   rJ   r   	write_tagr   r   r   s           r1   rK   zPolylinePath.export_dxf  s   NN$	((	"c$../0gb#i.)b#dnn-.
"b#dnn-.b#i.)4WI>??"c$--()== 	,KAq%""2a%(';<"eEl+	,
 g*9d6R6RS r0   c                z     j                     fd} j                  rt         |              _        yy)zTransform polyline path.c               3     K   j                   D ]L  \  } }}|rrt        d      j                  t        | |            }|j                  |j
                  |f N y w)Nz<Polyline path with arcs does not support non-uniform scaling)r   r   transform_vertexr   r   r   )r   r   r   rC  rO   has_non_uniform_scalingrN   rB   s       r1   
_transformz*PolylinePath.transform.<locals>._transform  si     #}} 	&1e 40"  ((aI)>?cc133o%	&s   AA N)r   r   r   )rB   rN   rO   rt  rs  s   ``` @r1   rP   zPolylinePath.transform  s3    &)&7&7"7
	& == .DM r0   NrU   r\   r9  r:  )rF   r
   rV   r   r;  )r   zIterable[Sequence[float]]r   r]   rV   rW   rX   rZ   )r*   r+   r,   r$   r-   r:   ru   rS   ra   r   rG   r[  rC   r   rK   rP   r/   r0   r1   r   r   :  s    $$D5  	2  	
 
 (  . FJ#1#>B#	#,*;T,/r0   c                  "   e Zd Zej                  ZddZd ZddZe	dd       Z
ddZddZ	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z	 	 d	 	 	 	 	 	 	 ddZddZddZddZy	)r   c                J    t         j                  | _        g | _        g | _        y r@   )r	   BOUNDARY_PATH_DEFAULTr<   r   r>   rA   s    r1   ru   zEdgePath.__init__  s    $::)+
')$r0   c                ,    t        | j                        S r@   )r}   r   rA   s    r1   r~   zEdgePath.__iter__  r   r0   c                :    t        d | j                  D              S )Nc              3  <   K   | ]  }|j                           y wr@   r   )r   r  s     r1   r   z$EdgePath.is_valid.<locals>.<genexpr>  r   r   )r   r   rA   s    r1   rS   zEdgePath.is_valid  r   r0   c                    |        }t        |      |_        t        |d      D ]c  }t        |      dk(  r|d   j                  }d|cxk  rdk  s-n 0|j
                  j                  t        |   j                  |dd               e |S )Nr_  r   r      r(   )	rO  r>   r   rw   r   r   r   EDGE_CLASSESrG   )rE   rF   r   	edge_tags	edge_types        r1   rG   zEdgePath.load_tags  s    E	,LT,R	)#DB7 	YI9~"!!**I9 q &&|I'>'H'HSTSU'WX	Y r0   c                L    | j                   D ]  }|j                  ||        y)zTransform edge boundary paths.r   N)r   rP   )rB   rN   rO   r  s       r1   rP   zEdgePath.transform  s%    JJ 	5DNN3)N4	5r0   c                    t               }t        |      |_        t        |      |_        | j                  j                  |       |S )zAdd a :class:`LineEdge` from `start` to `end`.

        Args:
            start: start point of line, (x, y)-tuple
            end: end point of line, (x, y)-tuple

        )r   r   r   r   r   r   )rB   r   r   r   s       r1   add_linezEdgePath.add_line  s8     z%[
9

$r0   c                    t               }t        |      |_        ||_        ||_        ||_        t        |      |_        | j                  j                  |       |S )ac  Add an :class:`ArcEdge`.

        **Adding Clockwise Oriented Arcs:**

        Clockwise oriented :class:`ArcEdge` objects are sometimes necessary to
        build closed loops, but the :class:`ArcEdge` objects are always
        represented in counter-clockwise orientation.
        To add a clockwise oriented :class:`ArcEdge` you have to swap the
        start- and end angle and set the `ccw` flag to ``False``,
        e.g. to add a clockwise oriented :class:`ArcEdge` from 180 to 90 degree,
        add the :class:`ArcEdge` in counter-clockwise orientation with swapped
        angles::

            edge_path.add_arc(center, radius, start_angle=90, end_angle=180, ccw=False)

        Args:
            center: center point of arc, (x, y)-tuple
            radius: radius of circle
            start_angle: start angle of arc in degrees (`end_angle` for a
                clockwise oriented arc)
            end_angle: end angle of arc in degrees (`start_angle` for a
                clockwise oriented arc)
            ccw: ``True`` for counter-clockwise ``False`` for
                clockwise orientation

        )
r    r   r   r   r   r   r]   r   r   r   )rB   r   r   r   r   r   r   s          r1   add_arczEdgePath.add_arc  sP    D i&\

%! s)

#
r0   c                   |dkD  rt        j                  d      t               }t        |      |_        t        |      |_        ||_        ||_        ||_        t        |      |_
        | j                  j                  |       |S )a  Add an :class:`EllipseEdge`.

        **Adding Clockwise Oriented Ellipses:**

        Clockwise oriented :class:`EllipseEdge` objects are sometimes necessary
        to build closed loops, but the :class:`EllipseEdge` objects are always
        represented in counter-clockwise orientation.
        To add a clockwise oriented :class:`EllipseEdge` you have to swap the
        start- and end angle and set the `ccw` flag to ``False``,
        e.g. to add a clockwise oriented :class:`EllipseEdge` from 180 to 90
        degree, add the :class:`EllipseEdge` in counter-clockwise orientation
        with swapped angles::

            edge_path.add_ellipse(center, major_axis, ratio, start_angle=90, end_angle=180, ccw=False)

        Args:
            center: center point of ellipse, (x, y)-tuple
            major_axis: vector of major axis as (x, y)-tuple
            ratio: ratio of minor axis to major axis as float
            start_angle: start angle of ellipse in degrees (`end_angle` for a
                clockwise oriented ellipse)
            end_angle: end angle of ellipse in degrees (`start_angle` for a
                clockwise oriented ellipse)
            ccw: ``True`` for counter-clockwise ``False`` for
                clockwise orientation

        r   z!argument 'ratio' has to be <= 1.0)r	   rd  r!   r   r   r   r   r   r   r]   r   r   r   )rB   r   r   r   r   r   r   r   s           r1   add_ellipsezEdgePath.add_ellipse  sz    J 3;%%&IJJ-f!*- *% 3i

'"r0   Nc	                8   t               }	|t        j                  |      |	_        |t        j                  |      |	_        |t        |      |	_        n0t        t        t        |	j                        |dz               |	_        |t        |      |	_        ||	_	        t        t        t        |	j                                    |	_        t        |      |	_        |t        |      |	_        |t        |      |	_        | j                   j#                  |	       |	S )a  Add a :class:`SplineEdge`.

        Args:
            fit_points: points through which the spline must go, at least 3 fit
                points are required. list of (x, y)-tuples
            control_points: affects the shape of the spline, mandatory and
                AutoCAD crashes on invalid data. list of (x, y)-tuples
            knot_values: (knot vector) mandatory and AutoCAD crashes on invalid
                data. list of floats; `ezdxf` provides two tool functions to
                calculate valid knot values: :func:`ezdxf.math.uniform_knot_vector`,
                :func:`ezdxf.math.open_uniform_knot_vector` (default if ``None``)
            weights: weight of control point, not mandatory, list of floats.
            degree: degree of spline (int)
            periodic: 1 for periodic spline, 0 for none periodic spline
            start_tangent: start_tangent as 2d vector, optional
            end_tangent: end_tangent as 2d vector, optional

        .. warning::

            Unlike for the spline entity AutoCAD does not calculate the
            necessary `knot_values` for the spline edge itself. On the contrary,
            if the `knot_values` in the spline edge are missing or invalid
            AutoCAD **crashes**.

        r(   )r"   r   r   r  r  r  r   rw   r  r  r;   r]   rationalperiodicstart_tangentend_tangentr   r   )
rB   r  r  r  r  r  r  r  r  r  s
             r1   
add_splinezEdgePath.add_splineQ  s    H ! $		* 5F%$(IIn$=F!"!%k!2F!%(V-B-B)CVaZP"F !']FNd3v~~#678h-$#'#6F "!%k!2F

&!r0   c                v    t        |||      }| j                  ||j                  |j                               S )N)r  r  method)r  r  r  )r   r  r  r  )rB   r  r  r  r#  s        r1   add_spline_control_framez!EdgePath.add_spline_control_frame  sB     /!&
 !"11  
 	
r0   c                    g | _         y)zDelete all edges.N)r   rA   s    r1   rC   zEdgePath.clear  r   r0   c                   |j                  dt        | j                               |j                  dt        | j                               | j                  D ]  }|j                  |        t        || j                         y )Nr   ra  )r   r;   r<   rw   r   rK   rS  r>   )rB   rI   rJ   r  s       r1   rK   zEdgePath.export_dxf  sd    RT%9%9!:;RTZZ1JJ 	'DOOI&	'&y$2N2NOr0   c                   t        | j                        dk  ryt        | j                        }|j                  d      }|j	                  |       |g}|j
                  }|D ]l  }|j                  }|j                  |      |kD  r)t               }||_	        ||_
        |j	                  |       ||ur|j	                  |       |j
                  }n || _        y)zInsert line-edges between the existing edges if the gap between these edges
        are bigger than `len_tol`.

        .. versionadded:: 1.4

        r)   Nr   )rw   r   r   rL  r   rm   rk   r   r   r   r   )	rB   len_tolcurrent_edges
first_edger*  rf   r  rd   	line_edges	            r1   
close_gapszEdgePath.close_gaps  s     tzz?QTZZ("&&q)
Z()3	--	! 		,D//K!!+.8$J	"+	 +	  +:%  &++I		, 
r0   rU   r\   )rF   r
   rV   r   rZ   )r   r   r   r   rV   r   )r   r   r   T)r   r   r   r[   r   r[   r   r[   r   r]   rV   r    )r   r   r   r   r   T)r   r   r   r   r   r[   r   r[   r   r[   r   r]   rV   r!   )NNNNr3   r   NN)r  Optional[Iterable[UVec]]r  r  r  Optional[Iterable[float]]r  r  r  r;   r  r;   r  Optional[UVec]r  r  rV   r"   )r3   r   )r  zIterable[tuple[float, float]]r  r;   r  rY   rV   r"   rX   )r  r[   rV   rW   )r*   r+   r,   r$   r.   r:   ru   r~   rS   ra   rG   rP   r  r  r  r  r  rC   rK   r  r/   r0   r1   r   r     s     D*
 5 	 	5
"   ,, , 	,
 , , 
,b &  33 3 	3
 3 3 3 
3n 043715-1(,&*9,9 19 /	9
 +9 9 9 &9 $9 
9|  	
1
 
 	

 

Pr0   r   c                  |    e Zd Zd Zej
                  Zd Zd	dZe	d
d       Z
e	d
d       Zedd       ZddZddZy)r   c                H    t        dd      | _        t        dd      | _        y r   r   r   r   rA   s    r1   ru   zLineEdge.__init__  s    !QZ
1:r0   c                     yrX  r/   rA   s    r1   rS   zLineEdge.is_valid  rY  r0   c                    | j                   S r@   )r   rA   s    r1   rd   zLineEdge.start_point  s    zzr0   c                    | j                   S r@   )r   rA   s    r1   rf   zLineEdge.end_point  s    xxr0   c                     |        }|D ]3  }|\  }}|dk(  rt        |      |_        |dk(  s$t        |      |_        5 |S )Nr]     r  rE   rF   r  rb  r   r   s         r1   rG   zLineEdge.load_tags  sL    u 	'CKD%rz!%[
;	' r0   c                <   |j                  dd       | j                  ^}}}|j                  dt        |             |j                  dt        |             | j                  ^}}}|j                  dt        |             |j                  dt        |             y )Nr_  r(   r]     r     )r   r   r[   r   )rB   rI   r   r   r   s        r1   rK   zLineEdge.export_dxf  s    R#::1qRq*Rq*881qRq*Rq*r0   c                    |j                  | j                  |      | _        |j                  | j                  |      | _        y r@   )transform_2d_vertexr   r   rM   s      r1   rP   zLineEdge.transform  s2    ,,TZZC
**488Y?r0   Nr\   rn   )rF   r
   rV   r   ro   rZ   )r*   r+   r,   	EDGE_TYPEr#   r5   r:   ru   rS   rp   rd   rf   ra   rG   rK   rP   r/   r0   r1   r   r     sa    I==D      	+@r0   r   c                      e Zd Zej                  Zd ZddZddZe	dd       Z
e	dd       Ze	dd       Ze	dd       Zedd       ZddZdd	Zdd
Zy)r    c                ^    t        dd      | _        d| _        d| _        d| _        d| _        y )Nr   r   r   T)r   r   r   r   r   r   rA   s    r1   ru   zArcEdge.__init__  s,    3n "% %r0   c                     yrX  r/   rA   s    r1   rS   zArcEdge.is_valid  rY  r0   c                6    | j                         j                  S r@   )construction_toolrd   rA   s    r1   rd   zArcEdge.start_point   s    %%'333r0   c                J    | j                   r| j                  S | j                  S r@   r   rd   rf   rA   s    r1   rk   zArcEdge.real_start_point      88###~~r0   c                6    | j                         j                  S r@   )r  rf   rA   s    r1   rf   zArcEdge.end_point
  s    %%'111r0   c                J    | j                   r| j                  S | j                  S r@   r   rf   rd   rA   s    r1   rm   zArcEdge.real_end_point      88>>!r0   c                &    |        }d}d}|D ]P  }|\  }}|dk(  rt        |      |_        |dk(  r||_        +|dk(  r|}3|dk(  r|};|dk(  sAt        |      |_        R |j                  r||_        ||_        |S d|z
  |_        d|z
  |_        |S )Nr   r]  (   2   3   r`  r   )r   r   r   r]   r   r   r   rE   rF   r  r   r   rb  r   r   s           r1   rG   zArcEdge.load_tags  s    u 	'CKD%rz"5k#;	'( 88$D DN   %s{D"U]DNr0   c                   |j                  dd       | j                  ^}}}| j                  r| j                  }| j                  }nd| j                  z
  }d| j                  z
  }|j                  dt        |             |j                  dt        |             |j                  d| j                         |j                  d|       |j                  d|       |j                  d	t        | j                               y )
Nr_  r)   r   r]  r  r  r  r  r`  )r   r   r   r   r   r[   r   r;   rB   rI   r   r   r   r   r   s          r1   rK   zArcEdge.export_dxf5  s    R#;;1q88$$E..C DNN*E$***CRq*Rq*R-R'R%RTXX/r0   c                   |j                  | j                  |      | _        |j                  t        | j                  dd            | _        t        j                  t        | j                  | j                        d      sA|j                  | j                        | _        |j                  | j                        | _	        y |j                  | j                        | _        | j                  dz   | _	        y )Nr   r   )r  r   transform_lengthr   r   r   r   r   r   r   transform_deg_anglerM   s      r1   rP   zArcEdge.transformG  s    --dkk9E**4Q+BC||t//@%
  #66t7G7GHD 44T^^DDN  #66t7G7GHD!--5DNr0   c                p    t        | j                  | j                  | j                  | j                        S )z5Returns ConstructionArc() for the OCS representation.)r   r   r   r   )r   r   r   r   r   rA   s    r1   r  zArcEdge.construction_tool\  s-    ;;;;((nn	
 	
r0   NrU   r\   rn   )rF   r
   rV   r    ro   rZ   )rV   r   )r*   r+   r,   r#   r6   r:   r  ru   rS   rp   rd   rk   rf   rm   ra   rG   rK   rP   r  r/   r0   r1   r    r      s    <<DI 4 4  
 2 2    
  @0$6*
r0   r    c                     e Zd Zd Zej
                  ZddZddZe	dd       Z
e	dd       Ze	dd       Ze	dd       Ze	dd       Zej                  dd       Ze	dd	       Zej                  dd
       Zedd       ZddZddZddZy)r!   c                |    t        d      | _        t        d      | _        d| _        d| _        d| _        d| _        y )N)r   r   r  r   r   r   T)r   r   r   r   r   r   r   rA   s    r1   ru   zEllipseEdge.__init__j  s7    :&z*
"% %r0   c                     yrX  r/   rA   s    r1   rS   zEllipseEdge.is_validu  rY  r0   c                J    | j                         j                  j                  S r@   )r  rd   r!  rA   s    r1   rd   zEllipseEdge.start_pointx  s    %%'33888r0   c                J    | j                         j                  j                  S r@   )r  rf   r!  rA   s    r1   rf   zEllipseEdge.end_point|  s    %%'11666r0   c                J    | j                   r| j                  S | j                  S r@   r  rA   s    r1   rk   zEllipseEdge.real_start_point  r  r0   c                J    | j                   r| j                  S | j                  S r@   r  rA   s    r1   rm   zEllipseEdge.real_end_point  r  r0   c                h    t        | j                  t        j                  | j                              S r@   )r   r   r   radiansr   rA   s    r1   r  zEllipseEdge.start_param  s"    djj$,,t7G7G*HIIr0   c                `    t        j                  t        | j                  |            | _        y r@   )r   r   r   r   r   rB   params     r1   r  zEllipseEdge.start_param  s    <<tzz5(IJr0   c                h    t        | j                  t        j                  | j                              S r@   )r   r   r   r  r   rA   s    r1   r  zEllipseEdge.end_param  s     djj$,,t~~*FGGr0   c                `    t        j                  t        | j                  |            | _        y r@   )r   r   r   r   r   r  s     r1   r  zEllipseEdge.end_param  s    nTZZ&GHr0   c                R    |        }d}d}|D ]f  }|\  }}|dk(  rt        |      |_        |dk(  rt        |      |_        4|dk(  r||_        A|dk(  r|}I|dk(  r|}Q|dk(  sWt	        |      |_        h |j
                  r||_        ||_        |S d|z
  |_        d|z
  |_        |S )	Nr   r]  r  r  r  r  r`  r   )r   r   r   r   r]   r   r   r   r  s           r1   rG   zEllipseEdge.load_tags  s    u 	'CKD%rz"5k"&u+"
;	' 88$D DN   %s{D"U]DNr0   c                   |j                  dd       | j                  ^}}}|j                  dt        |             |j                  dt        |             | j                  ^}}}|j                  dt        |             |j                  dt        |             |j                  d| j                         | j
                  r| j                  }| j                  }nd| j                  z
  }d| j                  z
  }|j                  d	|       |j                  d
|       |j                  dt        | j
                               y )Nr_  r3   r]  r  r  r  r  r   r  r  r`  )	r   r   r[   r   r   r   r   r   r;   r  s          r1   rK   zEllipseEdge.export_dxf  s   R#;;1qRq*Rq*??1qRq*Rq*R,88$$E..C DNN*E$***CR'R%RTXX/r0   c           	         t        t        | j                        t        | j                        t        ddd      | j                  | j
                  | j                        S )z9Returns ConstructionEllipse() for the OCS representation.r   r(   )r   r   	extrusionr   r  r  )r   r   r   r   r   r  r  rA   s    r1   r  zEllipseEdge.construction_tool  sK    "$DOO,1am** ((nn	
 		
r0   c                   | j                         }|j                  j                  } ||j                  j	                  |            |_         ||j
                        |_        |j                  |_        |j                  |j                         |j                  j                  } ||j                        j                  | _         ||j
                        j                  | _        |j                  | _        |j                  | _        |j                  | _        | j                   dz  | _        | j"                  dz  | _        t%        j&                  | j"                  d      rd| _        y y )Nzr   r   )r  old_ocsto_wcsr   replacer   old_extrusionr  rP   mnew_ocsfrom_wcsr!  r   r  r  r   r   r   r   )rB   rN   rO   r  
ocs_to_wcs
wcs_to_ocss         r1   rP   zEllipseEdge.transform  s   ""$ [[''
ahh...;<!!,,/'' 	
CEE [[))
 *//$Q\\277WW
 ==  ++e3%/<<*"DN +r0   NrU   r\   rn   )rV   r[   )r  r[   rV   rW   )rF   r
   rV   r!   ro   )rV   r   rZ   )r*   r+   r,   r  r#   r7   r:   ru   rS   rp   rd   rf   rk   rm   r  setterr  ra   rG   rK   r  rP   r/   r0   r1   r!   r!   f  s    ID	 9 9 7 7  
    
 J J K K H H I I ! !F0,
##r0   r!   c                      e Zd Zd Zej
                  Zd
dZddZe	dd       Z
e	dd       Zedd       ZddZddZddZy	)r"   c                    d| _         d| _        d| _        g | _        g | _        g | _        g | _        d | _        d | _        y )Nr3   r   )	r  r  r  r  r  r  r  r  r  rA   s    r1   ru   zSplineEdge.__init__  sE    (**,&($&-1+/r0   c                    t        | j                        rI| j                  dz   }t        | j                        }||kD  ry||z   }t        | j                        |k7  ryyt        | j                        dk  ryy)Nr(   Fr)   T)rw   r  r  r  r  )rB   r  r  required_knot_counts       r1   rS   zSplineEdge.is_valid  sv    t""#KK!OE++,Eu}"'%-4##$(;;  !A%r0   c                     | j                   d   S r   r  rA   s    r1   rd   zSplineEdge.start_point&  s    ""1%%r0   c                     | j                   d   S )Nr  r  rA   s    r1   rf   zSplineEdge.end_point*  s    ""2&&r0   c                    |        }|D ]  }|\  }}|dk(  r||_         |dk(  r||_        "|dk(  r||_        /|dk(  r|j                  j	                  |       P|dk(  r|j
                  j	                  |       q|dk(  r%|j                  j	                  t        |             |dk(  r%|j                  j	                  t        |             |dk(  rt        |      |_	        |d	k(  st        |      |_
         |S )
N^   r`  J   r  r^  r]  r        )r  r  r  r  r   r  r  r   r  r  r  r  s         r1   rG   zSplineEdge.load_tags.  s    u 	/CKD%rz# % %  ''.##E*##**4;7&&tE{3%)%["#'; '	/( r0   c                p    d fd}t         j                        rHt         j                        t         j                        k(  rd _        nt	        j
                  d      d _        |j                  } |dd        |dt         j                                |dt         j                                |d	t         j                                |d
t         j                                |dt         j                               t         j                        r$ j                  D ]  } |dt        |              nt	        j
                  d      t        j                   j                        } j                  rit        | j                        D ]O  \  }} |dt        |j                                |dt        |j                                 |dt        |             Q n.|D ])  \  }}	 |dt        |              |dt        |	             + t         j"                        dkD  r] ||        |dt         j"                                j"                  D ])  ^}}	}
 |dt        |              |dt        |	             + n&|j$                  t        j&                  k\  r	 |dd        j(                  3 j(                  ^}}	}
 |dt        |              |dt        |	              j*                  4 j*                  ^}}	}
 |dt        |              |dt        |	             y y )Nc                    t        |       dkD  r:j                  | d   | d   z
  _        j                  | d   | d   z
  _        y y y )Nr(   r   r  )rw   r  r  )r   rB   s    r1   set_required_tangentsz4SplineEdge.export_dxf.<locals>.set_required_tangentsH  sZ    6{Q%%-)/VAY)>D&##+'-bzF2J'>D$ , r0   r(   zASplineEdge: count of control points and count of weights mismatchr   r_  r4   r  r`  r  _   `   r  z(SplineEdge: missing required knot valuesr]  r  r^  rJ  r  r  r     r     )r   z
list[Vec2])rw   r  r  r  r	   rd  r   r;   r  r  r  r[   r   r   r   r   r   r  
dxfversionDXF2010r  r  )rB   rI   r  ro  r   cpr   weightr   r   r   s   `          r1   rK   zSplineEdge.export_dxfG  s   	? t||4<< C(;(;$<< !)) 
 DM((	"a"c$++&'"c$--()"c$--()"c$**+,"c$--./ t )) ,"eEl+, %%&PQQ YYt**+==!$R!6 -v"eEGGn-"eEGGn-"eFm,-
  (1"eAh'"eAh'(
 t!#!"%b#doo./ OO (1q"eAh'"eAh'( !!U]]2b!)))HAq1b%(#b%(#'''HAq1b%(#b%(# (r0   c                   t        fd| j                  D              | _        t        fd| j                  D              | _        | j                  Et	        | j                        j                        }j                  |      j                  | _        | j                  Ft	        | j                        j                        }j                  |      j                  | _        y y )Nc              3  B   K   | ]  }j                  |        y wr@   r  r   rC  rO   rN   s     r1   r   z'SplineEdge.transform.<locals>.<genexpr>  s#      #
67C##Ay1#
   c              3  B   K   | ]  }j                  |        y wr@   r  r  s     r1   r   z'SplineEdge.transform.<locals>.<genexpr>  s#      
67C##Ay1
r  r  )	r   r  r  r  r   r  transform_directionr!  r  )rB   rN   rO   ts    `` r1   rP   zSplineEdge.transform  s    " #
;?;N;N#
 
  
;???
 
 )T''(0090=A!$!8!8!;!@!@D'T%%&...;A"66q9>>D (r0   c                v    t        | j                  | j                  | j                  dz   | j                        S )z-Returns BSpline() for the OCS representation.r(   )r  r  r  r  )r   r  r  r  r  rA   s    r1   r  zSplineEdge.construction_tool  s3    ..""++/LL	
 	
r0   NrU   r\   rn   )rF   r
   rV   r"   ro   rZ   )rV   r   )r*   r+   r,   r  r#   r8   r:   ru   rS   rp   rd   rf   ra   rG   rK   rP   r  r/   r0   r1   r"   r"   	  sg    I??D
0 & & ' '  0B$H?
r0   r"   r<  )r   r&   r   r[   r   r;   rV   r   )r   r
   rV   r=   )rI   r   rQ  zSequence[str])6
__future__r   typingr   r   r   r   r   r_   enumr   ezdxf.lldxfr	   ezdxf.lldxf.tagsr
   r   
ezdxf.mathr   r   r   r   r   r   r   r   r   r   r   r   r   r   ezdxf.math.transformtoolsr   ezdxf.lldxf.tagwriterr   __all__uniqueIntEnumr$   r#   ABCr&   r%   r   r   rO  rS  r   r   r   r    r!   r"   r}  r/   r0   r1   <module>r     sl   # E E 
    -     37 t||  
 t||  $377 $,377 :` `H BD
*/;>"* *+8*D/' D/N~# ~B+@| +@\s
l s
l`#, `#FW
 W
t hjAr0   