#Copyright (C) 2010 Jean-Luc JOULIN "JeanJouX" jean-luc.joulin@laposte.net
#This extension allow you to draw a isometric grid with inkscape
#There is some options including subdivision, subsubdivions and custom line width
#All elements are grouped with similar elements
#These grid are used for isometric view in mechanical drawing or piping schematic
#!!! Y Divisions can't be smaller than half the X Divions
#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.
import inkex
from math import *
help="Major X Divisions")
help="Major X Divisions")
help="Major X divison Spacing")
help="Subdivisions per Major X division")
help="Subsubdivisions per Minor X division")
help="Major X Division Line thickness")
help="Minor X Division Line thickness")
help="Subminor X Division Line thickness")
help="Border Line thickness")
#Can't generate a grid too flat
#If the Y dimension is smallest than half the X dimension, fix it.
#Find the pixel dimensions of the overall grid
#Embed grid in group
#Put in in the centre of the current view
'transform':t }
#Group for major x gridlines
#Group for major y gridlines
#Group for major z gridlines
#Group for minor x gridlines
#Group for subminor x gridlines
#Group for minor y gridlines
#Group for subminor y gridlines
#Group for minor z gridlines
#Group for subminor z gridlines
#X DIVISION
#Shortcuts for divisions
#Initializing variable
cpt_div=0
com_div=0
com_div=0
com_div=1
if com_subsubdiv==1:
if com_subdiv==1:
if com_div==1:
com_div=0
#Y DIVISONS
#Shortcuts for divisions
nb_ligne=(self.options.x_divs+self.options.y_divs)*self.options.subdivs*self.options.subsubdivs #Global number of lines
#Initializing variable
cpt_div=0
com_div=0
com_div=0
com_div=1
txb=0
if com_subsubdiv==1:
if com_subdiv==1:
if com_div==1:
com_div=0
txb=0
if com_subsubdiv==1:
if com_subdiv==1:
if com_div==1:
com_div=0
txb=0
if tyb<=0:
tyb=0
if com_subsubdiv==1:
if com_subdiv==1:
if com_div==1:
com_div=0
else:
if com_subsubdiv==1:
if com_subdiv==1:
if com_div==1:
com_div=0
if __name__ == '__main__':
e = Grid_Polar()
e.affect()
#End of file