cubicsuperpath.py revision 4fc9681334bf42f3b8a3f374e4803f35bf2724e8
"""
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
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
"""
import simplepath
from math import *
class SuperSubpath(list):
for m in mlist[1:]:
return prod
pt[0]=x
pt[1]=y
A=p1[:]
return([[A,A,A],[B,B,B]])
k=[-(B[1]-A[1]),B[0]-A[0]]
d=k[0]*k[0]+k[1]*k[1]
k[0]/=sqrt(d)
k[1]/=sqrt(d)
d*=-1
O=[(B[0]+A[0])/2+d*k[0],(B[1]+A[1])/2+d*k[1]]
start*=-1
end*=-1
#v=dTeta*2/pi*0.552
#if not sweepflag:
# v*=-1
p=[]
p[ 0][0]=p[ 0][1][:]
p[-1][2]=p[-1][1][:]
for pts in p:
return(p)
def CubicSuperPath(simplepath):
csp = []
subpath = -1
subpathstart = []
last = []
lastctrl = []
for s in simplepath:
if cmd == 'M':
subpath += 1
subpathstart = params[:]
elif cmd == 'L':
elif cmd == 'C':
elif cmd == 'Q':
elif cmd == 'A':
elif cmd == 'Z':
last = subpathstart[:]
lastctrl = subpathstart[:]
return csp
def unCubicSuperPath(csp):
a = []
if subpath:
try:
a.append(['Z',[]])
except:
pass
return a
def parsePath(d):
def formatPath(p):