Commit 6e5fe7ed authored by Thomas Holder's avatar Thomas Holder

extensions 2to3: rename xxx_todo_changeme

parent a0f105a3
Pipeline #50811025 failed with stages
in 8 minutes and 7 seconds
......@@ -55,9 +55,9 @@ def rootWrapper(a,b,c,d):
return 1.0*(-d/c),
return ()
def bezierparameterize(xxx_todo_changeme):
def bezierparameterize(arg):
#parametric bezier
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
x0=bx0
y0=by0
cx=3*(bx1-x0)
......@@ -70,10 +70,10 @@ def bezierparameterize(xxx_todo_changeme):
return ax,ay,bx,by,cx,cy,x0,y0
#ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
def linebezierintersect(xxx_todo_changeme1, xxx_todo_changeme2):
def linebezierintersect(arg_a, arg_b):
#parametric line
((lx1,ly1),(lx2,ly2)) = xxx_todo_changeme1
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme2
((lx1,ly1),(lx2,ly2)) = arg_a
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg_b
dd=lx1
cc=lx2-lx1
bb=ly1
......@@ -102,23 +102,23 @@ def linebezierintersect(xxx_todo_changeme1, xxx_todo_changeme2):
retval.append(bezierpointatt(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)),i))
return retval
def bezierpointatt(xxx_todo_changeme3,t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme3
def bezierpointatt(arg, t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
x=ax*(t**3)+bx*(t**2)+cx*t+x0
y=ay*(t**3)+by*(t**2)+cy*t+y0
return x,y
def bezierslopeatt(xxx_todo_changeme4,t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme4
def bezierslopeatt(arg, t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
dx=3*ax*(t**2)+2*bx*t+cx
dy=3*ay*(t**2)+2*by*t+cy
return dx,dy
def beziertatslope(xxx_todo_changeme5, xxx_todo_changeme6):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme5
(dy,dx) = xxx_todo_changeme6
def beziertatslope(arg, d):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
(dy,dx) = d
ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
#quadratic coefficents of slope formula
if dx:
......@@ -147,8 +147,8 @@ def tpoint(_x1_y1, _x2_y2, t):
(x1, y1) = _x1_y1
(x2, y2) = _x2_y2
return x1+t*(x2-x1),y1+t*(y2-y1)
def beziersplitatt(xxx_todo_changeme9,t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme9
def beziersplitatt(arg, t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
m1=tpoint((bx0,by0),(bx1,by1),t)
m2=tpoint((bx1,by1),(bx2,by2),t)
m3=tpoint((bx2,by2),(bx3,by3),t)
......@@ -226,15 +226,15 @@ def Simpson(f, a, b, n_limit, tolerance):
#print multiplier, endsum, interval, asum, bsum, est1, est0
return est1
def bezierlengthSimpson(xxx_todo_changeme12, tolerance = 0.001):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme12
def bezierlengthSimpson(arg, tolerance = 0.001):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
global balfax,balfbx,balfcx,balfay,balfby,balfcy
ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
balfax,balfbx,balfcx,balfay,balfby,balfcy = 3*ax,2*bx,cx,3*ay,2*by,cy
return Simpson(balf, 0.0, 1.0, 4096, tolerance)
def beziertatlength(xxx_todo_changeme13, l = 0.5, tolerance = 0.001):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme13
def beziertatlength(arg, l = 0.5, tolerance = 0.001):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
global balfax,balfbx,balfcx,balfay,balfby,balfcy
ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
balfax,balfbx,balfcx,balfay,balfby,balfcy = 3*ax,2*bx,cx,3*ay,2*by,cy
......
......@@ -2,8 +2,8 @@
from bezmisc import *
from ffgeom import *
def maxdist(xxx_todo_changeme):
((p0x,p0y),(p1x,p1y),(p2x,p2y),(p3x,p3y)) = xxx_todo_changeme
def maxdist(arg):
((p0x,p0y),(p1x,p1y),(p2x,p2y),(p3x,p3y)) = arg
p0 = Point(p0x,p0y)
p1 = Point(p1x,p1y)
p2 = Point(p2x,p2y)
......
......@@ -103,8 +103,8 @@ def get_cartesian_pt( t, p):#get the cartesian coordinates from a trilinear set
c2 = p[0][2]*t[2]/denom
return ( c1*p[2][1][0]+c2*p[2][0][0], c1*p[2][1][1]+c2*p[2][0][1] )
def get_cartesian_tri(xxx_todo_changeme6, params):#get the cartesian points from a trilinear vertex matrix
((t11,t12,t13),(t21,t22,t23),(t31,t32,t33)) = xxx_todo_changeme6
def get_cartesian_tri(arg, params):#get the cartesian points from a trilinear vertex matrix
((t11,t12,t13),(t21,t22,t23),(t31,t32,t33)) = arg
p1=get_cartesian_pt( (t11,t12,t13), params )
p2=get_cartesian_pt( (t21,t22,t23), params )
p3=get_cartesian_pt( (t31,t32,t33), params )
......
......@@ -107,8 +107,8 @@ except:
exit()
def bezierslopeatt(xxx_todo_changeme20,t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = xxx_todo_changeme20
def bezierslopeatt(arg, t):
((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)) = arg
ax,ay,bx,by,cx,cy,x0,y0=bezmisc.bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)))
dx=3*ax*(t**2)+2*bx*t+cx
dy=3*ay*(t**2)+2*by*t+cy
......
......@@ -30,8 +30,8 @@ class Motion(inkex.Effect):
dest="magnitude", default=100.0,
help="magnitude of the motion vector")
def makeface(self,last, xxx_todo_changeme):
(cmd, params) = xxx_todo_changeme
def makeface(self, last, arg):
(cmd, params) = arg
a = []
a.append(['M',last[:]])
a.append([cmd, params[:]])
......
......@@ -100,9 +100,9 @@ symbols = {
#=====================================================================
#create a 2d list corresponding to the 1's and 0s of the DataMatrix
def encode(text, xxx_todo_changeme ):
def encode(text, n_row_col):
#retreive the parameters of this size of DataMatrix
(nrow, ncol) = xxx_todo_changeme
(nrow, ncol) = n_row_col
data_nrow, data_ncol, reg_row, reg_col, nd, nc, inter = get_parameters( nrow, ncol )
if not ((nrow == 144) and (ncol == 144)): #we have a regular datamatrix
......@@ -516,9 +516,9 @@ def utah(array, nrow, ncol, row, col, char):
#"place_bits" fills an nrow x ncol array with the bits from the
# codewords in data.
def place_bits(data, xxx_todo_changeme1):
def place_bits(data, n_row_col):
# First, fill the array[] with invalid entries */
(nrow, ncol) = xxx_todo_changeme1
(nrow, ncol) = n_row_col
INVALID = 2
array = [[INVALID] * ncol for i in xrange(nrow)] #initialise and fill with -1's (invalid value)
# Starting in the correct location for character #1, bit 8,...
......
  • I know it's just cosmetical, but this looks much better. Thank you for doing this, Thomas.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment