File: //usr/share/inkscape/extensions/perspective.pyc
�
��Yc @ s d Z d d l Z d d l 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 Z d d l
Z
d d l Ty d d l Td d l TWn+ e
j � e
j e d � � e � n Xd e
j f d � � YZ e d k re � Z e j � n d S( s&
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
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.
Perspective approach & math by Dmitry Platonov, shadowjack@mail.ru, 2006
i����N( t Popent PIPE( t *s� Failed to import the numpy or numpy.linalg modules. These modules are required by this extension. Please install them and try again. On a Debian-like system this can be done with the command, sudo apt-get install python-numpy.t Projectc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C s t j j | � d S( N( t inkext Effectt __init__( t self( ( s- /usr/share/inkscape/extensions/perspective.pyR 0 s c C s= t | j j � d k r5 t j t d � � t � n | j d � } | j | j j d } | j | j j d } | j t j
d d � � r� t j t d | j t j
d d � � � � t � n | j t j
d d
� k s� | j t j
d d
� k r�| j t j
d d
� k r�t j
| d d
d
g d
d d
g g � } t j | j d � � } t | � d k s~t | d � d k r�t j t d � � t � n t j | | � t d# d t �} xP t d � D]B } | d | d d | | d <| d | d d | | d <q�Wi d d 6d d 6d d 6d d 6} | j d } | j j d }
x� | j � D]� } t r�t d | |
| f d t d t d t �} | j � }
| t | j j � � | | <| j j � } q\t j d | |
| f � d \ } } | t | j � � | | <| j! � | j! � q\Wt"