edge3d.py revision 5b2208f64b606f78f10d1136d933135a9d70a11a
'''
Copyright (C) 2007 Terry Brown, terry_n_brown@yahoo.com
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
'angle of illumination, clockwise, 45 = upper right'),
('-d', '--stddev', 'float', 'stddev', 5.0,
'stdDeviation for Gaussian Blur'),
('-H', '--blurheight', 'float', 'blurheight', 2.0,
'height for Gaussian Blur'),
('-W', '--blurwidth', 'float', 'blurwidth', 2.0,
'width for Gaussian Blur'),
('-s', '--shades', 'int', 'shades', 2,
'shades, 2 = black and white, 3 = black, grey, white, etc.'),
'black and white, create only the fully black and white wedges'),
('-p', '--thick', 'float', 'thick', 10.,
'stroke-width for path pieces'),
]
for o in opts:
angles start and end"""
def f(x):
"""Maybe add 360 to x"""
if x < 0: return x + 360.
return x
# rotate all inputs by start, => start = 0
return a < e
# size of a wedge for shade i, wedges come in pairs
continue
"""Check each internode to see if it's in one of the wedges
for the current shade. shade is a floating point 0-1 white-black"""
# size of a wedge for shade i, wedges come in pairs
p = simplepath.parsePath(d)
g = None
continue
last = []
result = []
if cmd == 'Z':
last = []
continue
if last:
if result:
if not g:
a = 'fill:none;stroke:#%02x%02x%02x;stroke-opacity:1;stroke-width:10;%s' % ((col,)*3 + (self.filtId,))
if defs:
# make a clipped group, clip with clone of original, clipped group
# include original and group of paths
# make a blur filter reference by the style of each path
('x', '-0.5'), ('y', '-0.5')]:
else:
# can't find defs, just group paths
return g
e = Edge3d()
e.affect()