
    Og.i                    `   d Z ddlmZ ddlmZmZmZmZ ddlm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZmZmZmZmZ erddlmZ dd	lmZ d
ZdZdez  Zdez  ZdZ G d de       Z! G d d      Z" e"       Z# G d d      Z$ G d de$      Z% G d de$      Z& G d de&      Z' G d de$      Z(ddZ)y) a  Dimension lines as composite entities build up by DXF primitives.

This add-on exist just for an easy transition from `dxfwrite` to `ezdxf`.

Classes
-------

- LinearDimension
- AngularDimension
- ArcDimension
- RadiusDimension
- DimStyle

This code was written long before I had any understanding of the DIMENSION
entity and therefore, the classes have completely different implementations and
styling features than the dimensions based on the DIMENSION entity .

.. warning::

    Try to not use these classes beside porting `dxfwrite` code to `ezdxf`
    and even for that case the usage of the regular DIMENSION entity is to
    prefer because this module will not get much maintenance and may be removed
    in the future.

    )annotations)AnyTYPE_CHECKINGIterableOptional)radiansdegreespi)abstractmethod)TextEntityAlignment)Vec3Vec2distancelerpConstructionRayUVec)Drawing)GenericLayoutType皙?.     f@g      i@      ?c                  <     e Zd ZdZg dZd fdZddZddZ xZS )	DimStylezBDimStyle parameter struct, a dumb object just to store values
    ))tickDIMTICK_ARCH)
tickfactorr   )tick2xF)scaleg      Y@)roundvalr   )	roundhalfF)	textcolor   )height      ?)prefix )suffixr'   )stylezOpenSansCondensed-Light)layer
DIMENSIONS)dimlinecolorr#   )
dimlineext333333?)	textabove皙?)
dimextlineT)dimextlinecolor   )dimextlinegapr.   c                l    t         |   t        j                         || d<   | j	                  |       y )Nname)super__init__r   default_valuesupdate)selfr6   kwargs	__class__s      Z/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/ezdxf/addons/dimlines.pyr8   zDimStyle.__init__\   s+    001VF    c                    | |   S N )r;   attrs     r>   __getattr__zDimStyle.__getattr__b   s    Dzr?   c                    || |<   y rA   rB   )r;   rC   values      r>   __setattr__zDimStyle.__setattr__e   s    T
r?   )r6   str)rC   rH   returnr   )rC   rH   rF   r   rI   None)	__name__
__module____qualname____doc__r9   r8   rD   rG   __classcell__r=   s   @r>   r   r   /   s    'NRr?   r   c                  :    e Zd ZdZddZddZddZed	d       Zy)
	DimStylesz
    DimStyle container

    c           
         i | _         t        d      | _        | j                  dt        t        d      ddddd	       | j                  d
t        dddddd	       | j                  dt        dddddd	       y )NDefault	angle.deg   °r   DIMTICK_RADIUST        F)r   r(   r    r   r   r-   r1   z
angle.gradgonz	angle.radrad   )_stylesr   defaultnew	ANGLE_DEGrH   
ANGLE_GRAD	ANGLE_RADr;   s    r>   r8   zDimStyles.__init__o   s    ,.	*t9! 	 		
 	! 	 		
 	! 	 		
r?   c                N    | j                   j                  || j                        S )z0
        Get DimStyle() object by name.
        )r\   getr]   )r;   r6   s     r>   rd   zDimStyles.get   s     ||dll33r?   c                <    t        |fi |}|| j                  |<   |S )z'
        Create a new dimstyle
        )r   r\   )r;   r6   r<   r)   s       r>   r^   zDimStyles.new   s&     (("Tr?   c                F   t         j                  j                  dd}ddd}ddd}| j                  j	                  d      }|j                  dd|       |j                  d	d
|       | j                  j	                  d      }|j                  dd|       |j                  dd|       | j                  j	                  d      }|j                  dd|       |j                  g d|       | j                  j	                  d      }|j                  g d|       y)zy
        Insert necessary definitions into drawing:

            ticks: DIMTICK_ARCH, DIMTICK_DOT, DIMTICK_ARROW
        BYBLOCKcolorr*      r#   r   )rX   r%   )rX   g      ࿩startend
dxfattribs)皙ɿro   )r0   r0   DIMTICK_DOTr   r   g?)centerradiusrn   DIMTICK_ARROW)rq   r.   r   r.   g)rn   rW   )rq   ru   )g      ?rX   rv   N)	dimstylesr]   r2   blocksr^   add_line
add_circle	add_solid)drawingdimcolorcolor4color7blocks        r>   setupzDimStyles.setup   s   & &&66
 y1y1"">2[khO\{vN""=1Z[XNsvF""?3Z\hO;O""#34< 	 	
r?   NrI   rJ   )r6   rH   rI   r   )r|   z	'Drawing')	rK   rL   rM   rN   r8   rd   r^   staticmethodr   rB   r?   r>   rR   rR   i   s+    
!
F4 (
 (
r?   rR   c                  :    e Zd ZdZddZddZd	dZed
d       Zy)_DimensionBasez3
    Abstract base class for dimension lines.

    c                T    t         j                  |      | _        || _        || _        y rA   )rw   rd   dimstyler*   r    )r;   r   r*   r    s       r>   r8   z_DimensionBase.__init__   s     !h/
 r?   c                    |dk(  r.| j                   | j                   S | j                  j                   S |dk(  r.| j                  | j                  S | j                  j                  S | j                  |   S )zw
        Get dimension line properties by `property_name` with the possibility to override several properties.
        r*   r    )r*   r   r    )r;   property_names     r>   propz_DimensionBase.prop   su     G#!%!74::PT]]=P=PPj( ==,  ]]++ ==//r?   c                    dt        | j                  d            z   dz   }||z  }t        |v r&|j                  d       |j                  t               | j                  d      |z   | j                  d      z   S )z,
        Format the dimension text.
        z%.r    f0r&   r(   )rH   r   DIMENSIONS_FLOATINGPOINTrstrip)r;   dimvalue
dimtextfmtdimtexts       r>   format_dimtextz_DimensionBase.format_dimtext   sn     C		* 566<
x'#w.NN3NN34yy"W,tyy/BBBr?   c                     y rA   rB   r;   layouts     r>   renderz_DimensionBase.render   s    r?   N)r   rH   r*   rH   r    int)r   rH   rI   r   )r   floatrI   rH   )r   'GenericLayoutType')	rK   rL   rM   rN   r8   r   r   r   r   rB   r?   r>   r   r      s+    
!
0C  r?   r   c                       e Zd ZdZ	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 d fdZddZddZddZddZddZ	e
dd       Ze
dd	       Zdd
Zedd       ZddZedd       ZddZddZddZddZd dZddZ xZS )!LinearDimensionz
    Simple straight dimension line with two or more measure points, build with basic DXF entities. This is NOT a dxf
    dimension entity. And This is a 2D element, so all z-values will be ignored!

    c                    t         |   |||       || _        t        |      | _        dg| j
                  z  | _        t        |      | _        d| _	        y)a  
        LinearDimension Constructor.

        Args:
            pos: location as (x, y) tuple of dimension line, line goes through this point
            measure_points: list of points as (x, y) tuples to dimension (two or more)
            angle: angle (in degree) of dimension line
            dimstyle: dimstyle name, 'Default' - style is the default value
            layer: dimension line layer, override the default value of dimstyle
            roundval: count of decimal places

        r'   N)
r7   r8   anglelistmeasure_pointssection_counttext_overrider   
dimlineposr   )r;   posr   r   r   r*   r    r=   s          r>   r8   zLinearDimension.__init__  sQ    * 	5(3
">2 TD$6$66s)r?   c                "    || j                   |<   y)zg
        Set and override the text of the dimension text for the given dimension line section.
        N)r   )r;   sectiontexts      r>   set_textzLinearDimension.set_text  s     '+7#r?   c                z   | j                   D cg c]  }t        |       c}| _         t        | j                  t	        | j
                              }| j                   D cg c]  }| j                  ||       c}| _        | j                  | j                        | _	        | j                          yc c}w c c}w )z`
        Calc setup values and determines the point order of the dimension line points.
        )r   N)r   r   r   r   r   r   _get_point_on_dimlinedimline_points_indices_of_sorted_pointspoint_order_build_vectors)r;   point
dimlinerays      r>   _setupzLinearDimension._setup$  s     9=8K8KLutE{L$T__GDJJ<OP
 ,,
 &&uj9
  99$:M:MN M
s   B3!B8c                :    | j                   | j                  |      S )zL
        Get point on the dimension line, index runs left to right.
        )r   r   )r;   indexs     r>   _get_dimline_pointz"LinearDimension._get_dimline_point1  s      ""4#3#3E#:;;r?   c                L    | j                  |      | j                  |dz         fS )zU
        Get start and end point on the dimension line of dimension section.
           r   )r;   r   s     r>   _get_section_pointsz#LinearDimension._get_section_points7  s0     &&w/1H1HaK2
 
 	
r?   c                F    | j                  d      | j                  d      fS )zE
        Get the first and the last point of dimension line.
        r   r   rb   s    r>   _get_dimline_boundsz#LinearDimension._get_dimline_bounds?  s%     &&q)4+B+B2+FFFr?   c                2    t        | j                        dz
  S )zcount of dimline sectionsr   lenr   rb   s    r>   r   zLinearDimension.section_countE  s     4&&'!++r?   c                ,    t        | j                        S )zcount of dimline pointsr   rb   s    r>   point_countzLinearDimension.point_countJ  s     4&&''r?   c                    | j                          | j                  |       | j                  d      r| j                  |       | j	                  |       | j                  |       y3build dimension line object with basic dxf entitiesr1   N)r   _draw_dimliner   _draw_extension_lines
_draw_text_draw_ticksr   s     r>   r   zLinearDimension.renderO  sM    6"99\"&&v. r?   c                    t        |       D cg c]	  \  }}||f }}}|j                          |D cg c]  \  }}|	 c}}S c c}}w c c}}w )z7get indices of points, for points sorted by x, y values)	enumeratesort)pointsidxr   indexed_pointss       r>   r   z)LinearDimension._indices_of_sorted_pointsX  sO     :C69JK:35#,KK&45
s55 L5s
   AAc                    | j                         \  }}t        |      t        |      z
  j                         | _        | j                  j	                         | _        y)z9build unit vectors, parallel and normal to dimension lineN)r   r   	normalizeparallel_vector
orthogonalnormal_vector)r;   point1point2s      r>   r   zLinearDimension._build_vectors_  sI    113 $VtF| ;FFH!11<<>r?   c                B    |j                  |j                  |             S )z=get the measure target point projection on the dimension line)	intersectr   )r   dimrays     r>   r   z%LinearDimension._get_point_on_dimlinee  s       1 1% 899r?   c                   | j                         \  }}| j                  d      }|dkD  r$|| j                  |z  z
  }|| j                  |z  z   }| j                  d      | j                  d      d}|j                  |||       y)zbuild dimension line entityr-   r   r,   r*   rh   rk   N)r   r   r   ry   )r;   r   start_point	end_pointr-   attribss         r>   r   zLinearDimension._draw_dimlinej  s    !%!9!9!;YYY|,
>%)=)=
)JKK!T%9%9J%FGI YY~.YYw'
 	 	 	
r?   c                V   | j                  d      }| j                  d      | j                  d      d}t        | j                  | j                        D ]R  \  }}t	        ||      t        |t              kD  s$||z
  j                         }|||z  z
  }|j                  |||       T y)"build the extension lines entitiesr4   r,   r*   rh   rk   N)	r   zipr   r   r   maxDIMENSIONS_MIN_DISTANCEr   ry   )r;   r   r4   r   dimline_pointtarget_pointdirection_vectors          r>   r   z%LinearDimension._draw_extension_lines}  s    		/2YY~.YYw'

 ,/!4!4,
 	'M< |4s68  %1=$@#K#K#M +/?-/OP'$&   	r?   c                |   | j                  d      | j                  d      | j                  d      | j                  | j                  d      d}t        | j                        D ]V  }| j	                  |      }| j                  |      }|j                  ||      j                  |t        j                         X y)	z%build the dimension value text entityr$   r"   r*   r)   )r$   ri   r*   rotationr)   r   rn   alignN)
r   r   ranger   _get_dimvalue_text_get_text_insert_pointadd_textset_placementr   MIDDLE_CENTER)r;   r   r   r   dimvalue_textinsert_points         r>   r   zLinearDimension._draw_text  s     ii)YY{+YYw'

YYw'
 T//0 	G 33G<M66w?LOO""   m$7$E$E  	r?   c                    | j                   |   }t        |      r|S | j                  |      \  }}t        ||      | j	                  d      z  }| j                  |      S )z?get the dimension value as text, distance from point1 to point2r   )r   r   r   r   r   r   )r;   r   overrider   r   r   s         r>   r   z"LinearDimension._get_dimvalue_text  s]    %%g.x=O11':FF+dii.@@""8,,r?   c                    | j                  |      \  }}| j                  d      dz  | j                  d      z   }t        ||      | j                  |z  z   S )z)get the dimension value text insert pointr$          @r/   )r   r   r   r   )r;   r   r   r   dists        r>   r   z&LinearDimension._get_text_insert_point  sT    11':yy"S(499[+AAFF#t'9'9D'@AAr?   c                     j                  d       j                  d       j                  d      ddd fd} j                  d      rLt        d j                  dz
        D ]  } ||d        t        d j                        D ]  } ||d	        y
t         j                        D ]  } ||d        y
)z@insert the dimension line ticks, (markers on the dimension line)r   r*   xscaleyscaler*   Fc                    j                   |rdndz   d<   j                  j                  |       j                  d             y)z*build the insert-entity for the tick blockr   rX   r   r   insertr6   rn   N)r   add_blockrefr   r   )r   rotater   r   r;   s     r>   add_tickz-LinearDimension._draw_ticks.<locals>.add_tick  sJ    "&**S"IGJ..u5YYv&"   r?   r   r   r   TN)F)r   r   r   boolrI   rJ   )r   r   r   )r;   r   r   r   r   s   ``  @r>   r   zLinearDimension._draw_ticks  s     ii-ii-YYw'
	 	 99Xq$"2"2Q"67 '&'q$"2"23 &%& t//0 '&'r?   )rX   rT   NN)r   r   r   Iterable[UVec]r   r   r   rH   r*   Optional[str]r    Optional[int])r   r   r   rH   rI   rJ   r   )r   r   rI   r   )r   r   rI   tuple[Vec3, Vec3])rI   r  )rI   r   r   r   rI   rJ   )r   r  rI   z	list[int])r   r   r   r   rI   r   )r   r   rI   rH   )r   r   rI   r   )rK   rL   rM   rN   r8   r   r   r   r   r   propertyr   r   r   r   r   r   r   r   r   r   r   r   r   rO   rP   s   @r>   r   r      s     !#"& ' 	
    8+<
G , , ( (! 6 6? : :
&,&-B'r?   r   c                       e Zd ZdZeZeZeZ		 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ
ddZddZddZddZddZddZdd	Zdd
ZddZddZ xZS )AngularDimensionz
    Draw an angle dimensioning line at dimline pos from start to end, dimension text is the angle build of the three
    points start-center-end.

    c                    t         |   |||       t        |      | _        t        |      | _        t        |      | _        t        |      | _        y)a2  
        AngularDimension constructor.

        Args:
            pos: location as (x, y) tuple of dimension line, line goes through this point
            center: center point as (x, y) tuple of angle
            start: line from center to start is the first side of the angle
            end: line from center to end is the second side of the angle
            dimstyle: dimstyle name, 'Default' - style is the default value
            layer: dimension line layer, override the default value of dimstyle
            roundval: count of decimal places

        N)r7   r8   r   r   rr   rl   rm   )	r;   r   rr   rl   rm   r   r*   r    r=   s	           r>   r8   zAngularDimension.__init__  sB    . 	5(3s)6l%[
9r?   c                   t        | j                  | j                        | _        t        | j                  | j                        | _        | j                  | j                  z
  j                         | _        | j                  | j                  z
  j                         | _	        | j                  j                  | _        | j                  j                  | _        y)zsetup calculation valuesN)r   rr   r   
pos_radiusrl   rs   r   start_vectorrm   
end_vectorr   start_angle	end_anglerb   s    r>   r   zAngularDimension._setup  s    "4;;@t{{DJJ7!ZZ$++5@@B88dkk1<<>,,22..r?   c                    | j                          | j                  |       | j                  d      r| j                  |       | j	                  |       | j                  |       yr   )r   _draw_dimension_liner   r   _draw_dimension_textr   r   s     r>   r   zAngularDimension.render  sQ     	!!&)99\"&&v.!!&) r?   c           
         |j                  | j                  | j                  t        | j                        t        | j
                        | j                  d      | j                  d      d       y)z0draw the dimension line from start- to endangle.r*   r,   r*   ri   )rs   rr   r  r  rn   N)add_arcr  rr   r	   r  r  r   r   s     r>   r  z%AngularDimension._draw_dimension_line  sX    ??;; 0 01dnn-7+>2 	 		
r?   c           	         | j                   | j                  fD ]U  }|j                  | j                  |      | j	                  |      | j                  d      | j                  d      d       W y)r   r*   r2   r  rk   N)r  r  ry   _get_extline_start_get_extline_endr   )r;   r   vectors      r>   r   z&AngularDimension._draw_extension_lines  sk    (($//: 	FOO--f5))&1!YYw/!YY'89  	r?   c                D    | j                   || j                  d      z  z   S Nr4   )rr   r   r;   r  s     r>   r  z#AngularDimension._get_extline_start%  s    {{ftyy'AABBr?   c                :    | j                   || j                  z  z   S rA   rr   r  r  s     r>   r  z!AngularDimension._get_extline_end(      {{ft677r?   c                   | j                  d      t        | j                  | j                  z   dz  t        dz  z
        | j                  d      | j                  d      | j                  d      d}|j                  | j                         |      j                  | j                         t        j                  	       y )
Nr$      r   r*   r)   r"   r$   r   r*   r)   ri   r   r   )r   r	   r  r  r
   r   _get_dimtextr   r   r   r   )r;   r   r   s      r>   r  z%AngularDimension._draw_dimension_text+  s    ii)!!DNN2a7"s(B YYw'YYw'YY{+
 	""$ 	 	
 -'')%33  
r?   c                    | j                   | j                  z   dz  j                         }| j                  | j	                  d      z   | j	                  d      dz  z   }| j
                  ||z  z   S )Nr   r/   r$   )r  r  r   r  r   rr   )r;   	midvectorlengths      r>   r   z'AngularDimension._get_text_insert_point=  sg    ''$//9S@KKM	OOdii44tyy7JS7PP 	 {{i&011r?   c                   | j                  d      | j                  d      | j                  d      d}| j                  df| j                  | j                  d      ffD ]s  \  }}| j                  || j                  z  z   }|j
                  t        dz  z   }t        ||rt        ndz         |d<   |j                  || j                  d	      |
       u y )Nr   r*   r   Fr   r   rX   r   r   r   )	r   r  r  rr   r  r   r
   r	   r   )r;   r   r   r  mirrorr   r   s          r>   r   zAngularDimension._draw_ticksD  s    ii-ii-YYw'
 &__dii12
 	NFF  ;;&4??*BCL||b3h.H")(Fb*L"MGJ#YYv&"   	r?   c                z    | j                   | j                  z
  | j                  d      z  }| j                  |      S Nr   )r  r  r   r   )r;   r   s     r>   r#  zAngularDimension._get_dimtextW  s7     $"2"22dii6HH""5))r?   )rU   NN)r   r   rr   r   rl   r   rm   r   r   rH   r*   r  r    r  r   r  r  r   rI   r   rI   r   rI   rH   )rK   rL   rM   rN   r_   DEGr`   GRADra   RADr8   r   r   r  r   r  r  r  r   r   r#  rO   rP   s   @r>   r  r    s     CD
C $#"&  	
     :/!

C8
$2&*r?   r  c                  p     e Zd ZdZ	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZd	 fdZd
dZd
dZddZ xZ	S )ArcDimensionz
    Arc is defined by start- and endpoint on arc and the center point, or by three points lying on the arc if acr3points
    is True. Measured length goes from start- to endpoint. The dimension line goes through the dimlinepos.

    c	           	     >    t         	|   |||||||       || _        y)a  
        Args:
            pos: location as (x, y) tuple of dimension line, line goes through this point
            center: center point of arc
            start: start point of arc
            end: end point of arc
            arc3points: if **True** arc is defined by three points on the arc (center, start, end)
            dimstyle: dimstyle name, 'Default' - style is the default value
            layer: dimension line layer, override the default value of dimstyle
            roundval: count of decimal places

        N)r7   r8   
arc3points)
r;   r   rr   rl   rm   r4  r   r*   r    r=   s
            r>   r8   zArcDimension.__init__f  s%    . 	feS(E8L$r?   c                    t         |           | j                  r1t        | j                  | j
                  | j                        | _        y y rA   )r7   r   r4  center_of_3points_arcrr   rl   rm   )r;   r=   s    r>   r   zArcDimension._setup  s8    ??/TZZDK r?   c                ^    | j                   || j                  | j                  d      z   z  z   S r  )rr   rs   r   r  s     r>   r  zArcDimension._get_extline_start  s-    {{dkkDIIo$>>?
 	
r?   c                :    | j                   || j                  z  z   S rA   r  r  s     r>   r  zArcDimension._get_extline_end  r  r?   c                    | j                   | j                  z
  | j                  z  | j                  d      z  }| j	                  |      S r*  )r  r  rs   r   r   )r;   
arc_lengths     r>   r#  zArcDimension._get_dimtext  sI    ^^d...kkii ! 	
 "":..r?   )FrT   NN)r   r   rr   r   rl   r   rm   r   r4  r   r   rH   r*   r  r    r  r   r+  r-  )
rK   rL   rM   rN   r8   r   r  r  r#  rO   rP   s   @r>   r2  r2  _  s}     !!#"&%% % 	%
 % % % %  %4

8/r?   r2  c                  |     e Zd ZdZ	 	 	 	 d
	 	 	 	 	 	 	 	 	 	 	 d fdZddZddZddZddZddZ	ddZ
dd	Z xZS )RadialDimensionz
    Draw a radius dimension line from `target` in direction of `center` with length drawing units. RadiusDimension has
    a special tick!!
    c                    t         |   |||       t        |      | _        t        |      | _        t        |      | _        y)at  
        Args:
            center: center point of radius
            target: target point of radius
            length: length of radius arrow (drawing length)
            dimstyle: dimstyle name, 'Default' - style is the default value
            layer: dimension line layer, override the default value of dimstyle
            roundval: count of decimal places

        N)r7   r8   r   rr   targetr   r&  )r;   rr   r>  r&  r   r*   r    r=   s          r>   r8   zRadialDimension.__init__  s7    & 	5(36l6lFmr?   c                    | j                   | j                  z
  j                         | _        t	        | j                  | j                         | _        y rA   )r>  rr   r   target_vectorr   rs   rb   s    r>   r   zRadialDimension._setup  s9    KK$++%
)+ 	 t{{DKK8r?   c                    | j                          | j                  |       | j                  |       | j                  |       y)r   N)r   r  r  r   r   s     r>   r   zRadialDimension.render  s5    !!&)!!&) r?   c                    | j                   | j                  | j                  | j                  z
  z  z   }|j	                  || j
                  | j                  d      | j                  d      d       y )Nr,   r*   rh   rk   )rr   r@  rs   r&  ry   r>  r   )r;   r   r   s      r>   r  z$RadialDimension._draw_dimension_line  se    kk$++";<
 	>27+ 	 	
r?   c           
     L   |j                  | j                         | j                  d      | j                  j                  | j                  d      | j                  d      | j                  d      d      j                  | j                         t        j                         y )Nr$   r*   r)   r"   r"  r   r   )	r   r#  r   r@  	angle_degr   _get_insert_pointr   MIDDLE_RIGHTr   s     r>   r  z$RadialDimension._draw_dimension_text  s    ""$))H- ..887+7+;/ 	 		
 -""$,?,L,L  
r?   c                r    | j                   | j                  | j                  | j                  d      z   z  z
  S )Nr/   )r>  r@  r&  r   rb   s    r>   rE  z!RadialDimension._get_insert_point  s3    {{$++		+0F"FG
 	
r?   c                \    | j                  | j                  | j                  d      z        S r*  )r   rs   r   rb   s    r>   r#  zRadialDimension._get_dimtext  s%    ""4;;71C#CDDr?   c           
         |j                  | j                  d| j                  j                  dz   | j	                  d      | j	                  d      | j	                  d      d       y )NrW      r   r*   )r   r   r   r*   r   )r   r>  r@  rD  r   r   s     r>   r   zRadialDimension._draw_ticks  s\    ;;! ..883>))L1))L17+	 	 		
r?   )r   rT   NN)rr   r   r>  r   r&  r   r   rH   r*   r  r    r  r   r  r,  r-  )rK   rL   rM   rN   r8   r   r   r  r  rE  r#  r   rO   rP   s   @r>   r<  r<    sy     !#"&$$ $ 	$
 $ $  $09!



E

r?   r<  c                    t        | |      }t        | |      }t        | |      }t        | |      }|j                  |      }|j                  |      }|j                  |      S )z
    Calc center point of 3 point arc. ConstructionCircle is defined by 3 points
    on the circle: point1, point2 and point3.
    )r   r   r   r   )	r   r   point3ray1ray2	midpoint1	midpoint2center_ray1center_ray2s	            r>   r6  r6    sa    
 66*D66*DVV$IVV$I//),K//),K  --r?   N)r   r   r   r   rL  r   rI   r   )*rN   
__future__r   typingr   r   r   r   mathr   r	   r
   abcr   ezdxf.enumsr   
ezdxf.mathr   r   r   r   r   r   ezdxf.documentr   ezdxf.eztypesr   r   r   r_   r`   ra   dictr   rR   rw   r   r   r  r2  r<  r6  rB   r?   r>   <module>r\     s   2 # 9 9 % %  + H H&/  BJ	RZ
	7t 7t`
 `
F K	) )XS'n S'lK*~ K*\6/# 6/rX
n X
v.r?   