fractalize.py revision 659d437ab1fa196d010c1e92b009b608b8e8b086
'''
Copyright (C) 2005 Carsten Goetze c.goetze@tu-bs.de
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
'''
""" Calculate the vector from (x1,y1) to (x2,y2) """
""" Calculate the point half-way between the two points """
""" Calculate normalized vector perpendicular to the vector (x3,y3) """
""" Scale perpendicular vector by random factor """
""" add scaled perpendicular vector to the half-way point to get the final
displaced subdivision point """
return [x, y]
help="Number of subdivisons")
help="Smoothness of the subdivision")
p = simplepath.parsePath(d)
a = []
first = 1
if cmd != 'Z':
if first == 1:
first = 2
else :
if s > 0 :
""" recursively subdivide the segment left of the subdivision point """
""" recursively subdivide the segment right of the subdivision point """
e = PathFractalize()
e.affect()