File: //usr/share/inkscape/extensions/dimension.pyo
�
��Yc @ s� d Z d d l Z y d d l m Z m Z e Z Wn
e Z n Xd d l Z d d l Z d d l
Td e j f d � � YZ e
d k r� e � Z e j � n d S( s
dimension.py
An Inkscape effect for adding CAD style dimensions to selected objects
in a drawing.
It uses the selection's bounding box, so if the bounding box has empty
space in the x- or y-direction (such as with some stars) the results
will look strange. Strokes might also overlap the edge of the
bounding box.
The dimension arrows aren't measured: use the "Visualize Path/Measure
Path" effect to add measurements.
This code contains snippets from existing effects in the Inkscape
extensions library, and marker data from markers.svg.
Copyright (C) 2007 Peter Lewerin, peter.lewerin@tele2.se
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
i����N( t Popent PIPE( t *t Dimensionc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c
C s� t j j | � | j j d d d d d d d d d d
d d �| j j d
d d d d d d d d d
d d �| j j d d d d d d d d d d d d �d S( Ns -xs --xoffsett actiont storet typet floatt destt xoffsett defaultg Y@t helps( x offset of the vertical dimension arrows -ys --yoffsett yoffsets* y offset of the horizontal dimension arrows -ts --typet stringt geometrics Bounding box type( t inkext Effectt __init__t OptionParsert
add_option( t self( ( s+ /usr/share/inkscape/extensions/dimension.pyR 1 s c C sA | j d � } | d k rH t j j | j j � t j d d � � } n t j j | t j d d � � } | j d | � | j d d � | j d d � | j d
d � | j d d � | j t j d
d � | � t j j d � } | j d d � | r| j d d � n | j d d � | j d d � | j
| � d S( Ns /svg:svg//svg:defst defst svgt markert idt orientt autot refXs 0.0t refYt styles overflow:visiblet stockidt inkscapet patht ds7 M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z t transforms( scale(0.8) rotate(180) translate(12.5,0)s scale(0.8) translate(12.5,0)sE fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none( t xpathSinglet NoneR t etreet
SubElementt documentt getroott addNSt sett Elementt append( R t namet rotateR R t arrow( ( s+ /usr/share/inkscape/extensions/dimension.pyt addMarker@ s"