## [PyX-checkins] SF.net SVN: pyx: [2629] trunk/pyx/pyx/deformer.py

 [PyX-checkins] SF.net SVN: pyx: [2629] trunk/pyx/pyx/deformer.py From: - 2006-04-27 17:32:17 ```Revision: 2629 Author: m-schindler Date: 2006-04-27 10:32:11 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/pyx/?rev=2629&view=rev Log Message: ----------- improve the sorting of controldists a bit Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2006-04-27 16:17:48 UTC (rev 2628) +++ trunk/pyx/pyx/deformer.py 2006-04-27 17:32:11 UTC (rev 2629) @@ -177,22 +177,25 @@ # 0 = 1.5 b |b| curvB + a * T - E # because of the absolute values we get several possibilities for the signs # in the equation. We test all signs, also the invalid ones! - solutions = [] if allownegative: - for sign_a, sign_b in [(+1, +1), (-1, +1), (+1, -1), (-1, -1)]: - coeffs_a = (sign_b*3.375*curvA*curvA*curvB, 0.0, -sign_b*sign_a*4.5*curvA*curvB*D, T**3, sign_b*1.5*curvB*D*D - T*T*E) - candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if sign_a*root >= 0] - for a in candidates_a: - b = (D - 1.5*curvA*a*abs(a)) / T - if (sign_b*b >= 0): - solutions.append((a, b)) + signs = [(+1, +1), (-1, +1), (+1, -1), (-1, -1)] else: - coeffs_a = (3.375*curvA*curvA*curvB, 0.0, -4.5*curvA*curvB*D, T**3, 1.5*curvB*D*D - T*T*E) - candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if root >= 0] + signs = [(+1, +1)] + + solutions = [] + for sign_a, sign_b in signs: + coeffs_a = (sign_b*3.375*curvA*curvA*curvB, 0.0, -sign_b*sign_a*4.5*curvA*curvB*D, T**3, sign_b*1.5*curvB*D*D - T*T*E) + candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if sign_a*root >= 0] for a in candidates_a: b = (D - 1.5*curvA*a*abs(a)) / T - if (b >= 0): + if (sign_b*b >= 0): solutions.append((a, b)) + #coeffs_b = (sign_a*3.375*curvA*curvB*curvB, 0.0, -sign_a*sign_b*4.5*curvA*curvB*E, T**3, sign_a*1.5*curvA*E*E - T*T*D) + #candidates_b = [root for root in mathutils.realpolyroots(*coeffs_b) if sign_b*root >= 0] + #for b in candidates_b: + # a = (E - 1.5*curvB*b*abs(b)) / T + # if (sign_a*a >= 0): + # solutions.append((a, b)) # sort the solutions: the more reasonable values at the beginning @@ -201,11 +204,51 @@ # inside the two sets: sort by magnitude sx = (x[0] > 0 and x[1] > 0) sy = (y[0] > 0 and y[1] > 0) - if sx == sy: - return cmp(x[0]**2 + x[1]**2, y[0]**2 + y[1]**2) + + # experimental stuff: + # what criterion should be used for sorting ? + # + #errx = abs(1.5*curvA*x[0]*abs(x[0]) + x[1]*T - D) + abs(1.5*curvB*x[1]*abs(x[1]) + x[0]*T - E) + #erry = abs(1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) + abs(1.5*curvB*y[1]*abs(y[1]) + y[0]*T - E) + # # For each equation, a value like + # # abs(1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) / abs(curvA*(D - y[1]*T)) + # # indicates how good the solution is. In order to avoid the division, + # # we here multiply with all four denominators: + # errx = max(abs( (1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) * (curvB*(E - y[0]*T))*(curvA*(D - x[1]*T))*(curvB*(E - x[0]*T)) ), + # abs( (1.5*curvB*y[1]*abs(y[1]) + y[0]*T - E) * (curvA*(D - y[1]*T))*(curvA*(D - x[1]*T))*(curvB*(E - x[0]*T)) )) + # errx = max(abs( (1.5*curvA*x[0]*abs(x[0]) + x[1]*T - D) * (curvA*(D - y[1]*T))*(curvB*(E - y[0]*T))*(curvB*(E - x[0]*T)) ), + # abs( (1.5*curvB*x[1]*abs(x[1]) + x[0]*T - E) * (curvA*(D - y[1]*T))*(curvB*(E - y[0]*T))*(curvA*(D - x[1]*T)) )) + #errx = (abs(curvA*x[0]) - 1.0)**2 + (abs(curvB*x[1]) - 1.0)**2 + #erry = (abs(curvA*y[0]) - 1.0)**2 + (abs(curvB*y[1]) - 1.0)**2 + + errx = x[0]**2 + x[1]**2 + erry = y[0]**2 + y[1]**2 + + if sx == 1 and sy == 1: + # try to use longer solutions if there are any crossings in the control-arms + # the following combination yielded fewest sorting errors in test_bezier.py + t, s = intersection(A, B, tangA, tangB) + t, s = abs(t), abs(s) + if (t > 0 and t < x[0] and s > 0 and s < x[1]): + if (t > 0 and t < y[0] and s > 0 and s < y[1]): + # use the shorter one + return cmp(errx, erry) + else: + # use the longer one + return -1 + else: + if (t > 0 and t < y[0] and s > 0 and s < y[1]): + # use the longer one + return 1 + else: + # use the shorter one + return cmp(errx, erry) + #return cmp(x[0]**2 + x[1]**2, y[0]**2 + y[1]**2) else: return cmp(sy, sx) + + solutions.sort(mycmp) # XXX should the solutions's list also be unique'fied? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```

 [PyX-checkins] SF.net SVN: pyx: [2620] trunk/pyx/pyx/deformer.py From: - 2006-04-27 07:59:51 ```Revision: 2620 Author: m-schindler Date: 2006-04-27 00:59:47 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/pyx/?rev=2620&view=rev Log Message: ----------- improve the fallback of deformer.smoothed Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2006-04-27 07:45:19 UTC (rev 2619) +++ trunk/pyx/pyx/deformer.py 2006-04-27 07:59:47 UTC (rev 2620) @@ -515,9 +515,12 @@ c2 = s2 * abs(c2) # get the length of the control "arms" - a, d = controldists_from_endgeometry_pt(p1, p2, t1, t2, c1, c2, epsilon=epsilon)[0] + controldists = controldists_from_endgeometry_pt(p1, p2, t1, t2, c1, c2, epsilon=epsilon) - if a >= 0 and d >= 0: + if controldists and (controldists[0][0] >= 0 and controldists[0][1] >= 0): + # use the first entry in the controldists + # this should be the "smallest" pair + a, d = controldists[0] # avoid curves with invalid parameterization a = max(a, epsilon) d = max(d, epsilon) @@ -533,10 +536,11 @@ d = min(d, abs(s)) else: + # use a fallback t, s = intersection(p1, p2, t1, t2) if t is not None and s is not None: - a = abs(t) - d = abs(s) + a = 0.65 * abs(t) + d = 0.65 * abs(s) else: # if there is no useful result: # take an arbitrary smoothing curve that does not obey This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [PyX-checkins] SF.net SVN: pyx: [2626] trunk/pyx/pyx/deformer.py From: - 2006-04-27 14:53:18 ```Revision: 2626 Author: m-schindler Date: 2006-04-27 07:53:11 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/pyx/?rev=2626&view=rev Log Message: ----------- allow only positive results from controldists_from_endgeometry -- and fix some things in parallel Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2006-04-27 14:48:57 UTC (rev 2625) +++ trunk/pyx/pyx/deformer.py 2006-04-27 14:53:11 UTC (rev 2626) @@ -71,7 +71,7 @@ return (d1, g1, f1, e, f2, g2, d2) # >>> -def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, epsilon): # <<< +def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, epsilon, allownegative=0): # <<< """For a curve with given tangents and curvatures at the endpoints this gives the distances between the controlpoints @@ -85,9 +85,10 @@ The outcome is sorted so that the first entry is expected to be the most reasonable one """ + debug = 0 - # these two thresholds are dimensionless, not lengths: - fallback_threshold = 1.0e-3 + # this threshold is dimensionless, not a length: + fallback_threshold = 1.0e-6 # some shortcuts T = tangA[0] * tangB[1] - tangA[1] * tangB[0] @@ -99,23 +100,29 @@ # Terefore, we need a fallback. # When the curvature is nearly zero or when T is nearly zero # we know the exact answer to the problem. + # The fallback is done only for results that are positive! # extreme case: all parameters are nearly zero a = b = 0.3 * AB if max([abs(1.5*a*a*curvA), abs(1.5*b*b*curvB), abs(a*T), abs(b*T), abs(D), abs(E)]) < epsilon: + if debug: print "extreme case 1" return [(a, b)] # extreme case: curvA geometrically too big if fallback_threshold * abs(curvA*AB) > 1: + if debug: print "extreme case 2a" a = math.sqrt(abs(D / (1.5 * curvA))) * mathutils.sign(D*curvA) b = (D - 1.5*curvA*a*abs(a)) / T - return [(a, b)] + if a >= 0 and b >= 0: + return [(a, b)] # extreme case: curvB geometrically too big if fallback_threshold * abs(curvB*AB) > 1: + if debug: print "extreme case 2b" b = math.sqrt(abs(E / (1.5 * curvB))) * mathutils.sign(E*curvB) a = (E - 1.5*curvB*b*abs(b)) / T - return [(a, b)] + if a >= 0 and b >= 0: + return [(a, b)] # extreme case: curvA much smaller than T try: @@ -124,7 +131,8 @@ except ZeroDivisionError: pass else: - if abs(1.5*a*a*curvA) < fallback_threshold * abs(b*T): + if abs(1.5*a*a*curvA) < fallback_threshold * abs(b*T) and a >= 0 and b >= 0: + if debug: print "extreme case 3a" return [(a, b)] # extreme case: curvB much smaller than T @@ -134,7 +142,8 @@ except ZeroDivisionError: pass else: - if abs(1.5*b*b*curvB) < fallback_threshold * abs(a*T): + if abs(1.5*b*b*curvB) < fallback_threshold * abs(a*T) and a >= 0 and b >= 0: + if debug: print "extreme case 3b" return [(a, b)] # extreme case: T much smaller than both curvatures @@ -153,7 +162,9 @@ pass else: if (abs(b*T) < fallback_threshold * abs(1.5*a*a*curvA) and - abs(a*T) < fallback_threshold * abs(1.5*b*b*curvB) ): + abs(a*T) < fallback_threshold * abs(1.5*b*b*curvB) and + a >= 0 and b >= 0): + if debug: print "extreme case 4" return [(a, b)] # Now the general case: @@ -167,20 +178,21 @@ # because of the absolute values we get several possibilities for the signs # in the equation. We test all signs, also the invalid ones! solutions = [] - for sign_a in [+1, -1]: - for sign_b in [+1, -1]: + if allownegative: + for sign_a, sign_b in [(+1, +1), (-1, +1), (+1, -1), (-1, -1)]: coeffs_a = (sign_b*3.375*curvA*curvA*curvB, 0.0, -sign_b*sign_a*4.5*curvA*curvB*D, T**3, sign_b*1.5*curvB*D*D - T*T*E) candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if sign_a*root >= 0] for a in candidates_a: b = (D - 1.5*curvA*a*abs(a)) / T if (sign_b*b >= 0): solutions.append((a, b)) -# coeffs_b = (sign_a*3.375*curvA*curvB*curvB, 0.0, -sign_a*sign_b*4.5*curvA*curvB*E, T**3, sign_a*1.5*curvA*E*E - T*T*D) -# candidates_b = [root for root in mathutils.realpolyroots(*coeffs_b) if sign_b*root >= 0] -# for b in candidates_b: -# a = (E - 1.5*curvB*b*abs(b)) / T -# if (sign_a*a >= 0): -# solutions.append((a, b)) + else: + coeffs_a = (3.375*curvA*curvA*curvB, 0.0, -4.5*curvA*curvB*D, T**3, 1.5*curvB*D*D - T*T*E) + candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if root >= 0] + for a in candidates_a: + b = (D - 1.5*curvA*a*abs(a)) / T + if (b >= 0): + solutions.append((a, b)) # sort the solutions: the more reasonable values at the beginning @@ -199,10 +211,10 @@ # XXX should the solutions's list also be unique'fied? # XXX we will stop here, if solutions is empty - if not solutions: - # TODO: remove this Exception. - # this exception is only for getting aware of possible fallback situations - raise ValueError, "no curve found. Try adjusting the fallback-parameters." + #if not solutions: + # # TODO: remove this Exception. + # # this exception is only for getting aware of possible fallback situations + # raise ValueError, "no curve found. Try adjusting the fallback-parameters." return solutions # >>> @@ -587,13 +599,9 @@ """ # TODO: - # * more testing of controldists_from_endgeometry_pt # * do testing for curv=0, T=0, D=0, E=0 cases # * do testing for several random curves # -- does the recursive deformnicecurve converge? - # - # TODO for the test cases: - # * improve the intersection of nearly degenerate paths def __init__(self, distance, relerr=0.05, sharpoutercorners=0, dointersection=1, @@ -934,22 +942,25 @@ curvD = orig_curvD / (1.0 - dist*orig_curvD) # first try to approximate the normcurve with a single item - # TODO: is it good enough to get the first entry here? - # TODO: we rely on getting a result! - a, d = controldists_from_endgeometry_pt(A, D, tangA, tangD, curvA, curvD, epsilon=epsilon)[0] - if a >= 0 and d >= 0: - if a < epsilon and d < epsilon: - result = normpath.normsubpath([normpath.normline_pt(A[0], A[1], D[0], D[1])], epsilon=epsilon) - else: - # we avoid curves with invalid parameterization - a = max(a, epsilon) - d = max(d, epsilon) - result = normpath.normsubpath([normpath.normcurve_pt( - A[0], A[1], - A[0] + a * tangA[0], A[1] + a * tangA[1], - D[0] - d * tangD[0], D[1] - d * tangD[1], - D[0], D[1])], epsilon=epsilon) + controldistpairs = controldists_from_endgeometry_pt(A, D, tangA, tangD, curvA, curvD, epsilon=epsilon) + if controldistpairs: + # TODO: is it good enough to get the first entry here? + # from testing: this fails if there are loops in the original curve + a, d = controldistpairs[0] + if a >= 0 and d >= 0: + if a < epsilon and d < epsilon: + result = normpath.normsubpath([normpath.normline_pt(A[0], A[1], D[0], D[1])], epsilon=epsilon) + else: + # we avoid curves with invalid parameterization + a = max(a, epsilon) + d = max(d, epsilon) + result = normpath.normsubpath([normpath.normcurve_pt( + A[0], A[1], + A[0] + a * tangA[0], A[1] + a * tangA[1], + D[0] - d * tangD[0], D[1] - d * tangD[1], + D[0], D[1])], epsilon=epsilon) + # then try with two items, recursive call if ((not result.normsubpathitems) or (self.checkdistanceparams and result.normsubpathitems @@ -1271,7 +1282,7 @@ #done[otherparam(end)] = 1 # eventually close the path - if (parampairs[0][0] is parampairs[-1][-1] or + if add_nsp and (parampairs[0][0] is parampairs[-1][-1] or (parampairs[0][0] in selfintparams and otherparam(parampairs[0][0]) is parampairs[-1][-1])): add_nsp.normsubpathitems[-1] = add_nsp.normsubpathitems[-1].modifiedend_pt(*add_nsp.atbegin_pt()) add_nsp.close() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [PyX-checkins] SF.net SVN: pyx: [2629] trunk/pyx/pyx/deformer.py From: - 2006-04-27 17:32:17 ```Revision: 2629 Author: m-schindler Date: 2006-04-27 10:32:11 -0700 (Thu, 27 Apr 2006) ViewCVS: http://svn.sourceforge.net/pyx/?rev=2629&view=rev Log Message: ----------- improve the sorting of controldists a bit Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2006-04-27 16:17:48 UTC (rev 2628) +++ trunk/pyx/pyx/deformer.py 2006-04-27 17:32:11 UTC (rev 2629) @@ -177,22 +177,25 @@ # 0 = 1.5 b |b| curvB + a * T - E # because of the absolute values we get several possibilities for the signs # in the equation. We test all signs, also the invalid ones! - solutions = [] if allownegative: - for sign_a, sign_b in [(+1, +1), (-1, +1), (+1, -1), (-1, -1)]: - coeffs_a = (sign_b*3.375*curvA*curvA*curvB, 0.0, -sign_b*sign_a*4.5*curvA*curvB*D, T**3, sign_b*1.5*curvB*D*D - T*T*E) - candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if sign_a*root >= 0] - for a in candidates_a: - b = (D - 1.5*curvA*a*abs(a)) / T - if (sign_b*b >= 0): - solutions.append((a, b)) + signs = [(+1, +1), (-1, +1), (+1, -1), (-1, -1)] else: - coeffs_a = (3.375*curvA*curvA*curvB, 0.0, -4.5*curvA*curvB*D, T**3, 1.5*curvB*D*D - T*T*E) - candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if root >= 0] + signs = [(+1, +1)] + + solutions = [] + for sign_a, sign_b in signs: + coeffs_a = (sign_b*3.375*curvA*curvA*curvB, 0.0, -sign_b*sign_a*4.5*curvA*curvB*D, T**3, sign_b*1.5*curvB*D*D - T*T*E) + candidates_a = [root for root in mathutils.realpolyroots(*coeffs_a) if sign_a*root >= 0] for a in candidates_a: b = (D - 1.5*curvA*a*abs(a)) / T - if (b >= 0): + if (sign_b*b >= 0): solutions.append((a, b)) + #coeffs_b = (sign_a*3.375*curvA*curvB*curvB, 0.0, -sign_a*sign_b*4.5*curvA*curvB*E, T**3, sign_a*1.5*curvA*E*E - T*T*D) + #candidates_b = [root for root in mathutils.realpolyroots(*coeffs_b) if sign_b*root >= 0] + #for b in candidates_b: + # a = (E - 1.5*curvB*b*abs(b)) / T + # if (sign_a*a >= 0): + # solutions.append((a, b)) # sort the solutions: the more reasonable values at the beginning @@ -201,11 +204,51 @@ # inside the two sets: sort by magnitude sx = (x[0] > 0 and x[1] > 0) sy = (y[0] > 0 and y[1] > 0) - if sx == sy: - return cmp(x[0]**2 + x[1]**2, y[0]**2 + y[1]**2) + + # experimental stuff: + # what criterion should be used for sorting ? + # + #errx = abs(1.5*curvA*x[0]*abs(x[0]) + x[1]*T - D) + abs(1.5*curvB*x[1]*abs(x[1]) + x[0]*T - E) + #erry = abs(1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) + abs(1.5*curvB*y[1]*abs(y[1]) + y[0]*T - E) + # # For each equation, a value like + # # abs(1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) / abs(curvA*(D - y[1]*T)) + # # indicates how good the solution is. In order to avoid the division, + # # we here multiply with all four denominators: + # errx = max(abs( (1.5*curvA*y[0]*abs(y[0]) + y[1]*T - D) * (curvB*(E - y[0]*T))*(curvA*(D - x[1]*T))*(curvB*(E - x[0]*T)) ), + # abs( (1.5*curvB*y[1]*abs(y[1]) + y[0]*T - E) * (curvA*(D - y[1]*T))*(curvA*(D - x[1]*T))*(curvB*(E - x[0]*T)) )) + # errx = max(abs( (1.5*curvA*x[0]*abs(x[0]) + x[1]*T - D) * (curvA*(D - y[1]*T))*(curvB*(E - y[0]*T))*(curvB*(E - x[0]*T)) ), + # abs( (1.5*curvB*x[1]*abs(x[1]) + x[0]*T - E) * (curvA*(D - y[1]*T))*(curvB*(E - y[0]*T))*(curvA*(D - x[1]*T)) )) + #errx = (abs(curvA*x[0]) - 1.0)**2 + (abs(curvB*x[1]) - 1.0)**2 + #erry = (abs(curvA*y[0]) - 1.0)**2 + (abs(curvB*y[1]) - 1.0)**2 + + errx = x[0]**2 + x[1]**2 + erry = y[0]**2 + y[1]**2 + + if sx == 1 and sy == 1: + # try to use longer solutions if there are any crossings in the control-arms + # the following combination yielded fewest sorting errors in test_bezier.py + t, s = intersection(A, B, tangA, tangB) + t, s = abs(t), abs(s) + if (t > 0 and t < x[0] and s > 0 and s < x[1]): + if (t > 0 and t < y[0] and s > 0 and s < y[1]): + # use the shorter one + return cmp(errx, erry) + else: + # use the longer one + return -1 + else: + if (t > 0 and t < y[0] and s > 0 and s < y[1]): + # use the longer one + return 1 + else: + # use the shorter one + return cmp(errx, erry) + #return cmp(x[0]**2 + x[1]**2, y[0]**2 + y[1]**2) else: return cmp(sy, sx) + + solutions.sort(mycmp) # XXX should the solutions's list also be unique'fied? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [PyX-checkins] SF.net SVN: pyx: [2819] trunk/pyx/pyx/deformer.py From: - 2006-06-08 18:07:24 ```Revision: 2819 Author: wobsta Date: 2006-06-08 11:07:04 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/pyx/?rev=2819&view=rev Log Message: ----------- remove a spurious epsilon parameter Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2006-06-08 18:02:18 UTC (rev 2818) +++ trunk/pyx/pyx/deformer.py 2006-06-08 18:07:04 UTC (rev 2819) @@ -79,7 +79,7 @@ return (d1, g1, f1, e, f2, g2, d2) # >>> -def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, epsilon, allownegative=0): # <<< +def controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, allownegative=0): # <<< """For a curve with given tangents and curvatures at the endpoints this gives the distances between the controlpoints @@ -291,7 +291,7 @@ # >>> def normcurve_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB): # <<< - a, b = controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB, epsilon=epsilon)[0] + a, b = controldists_from_endgeometry_pt(A, B, tangA, tangB, curvA, curvB)[0] return normpath.normcurve_pt(A[0], A[1], A[0] + a * tangA[0], A[1] + a * tangA[1], B[0] - b * tangB[0], B[1] - b * tangB[1], B[0], B[1]) @@ -598,7 +598,7 @@ c2 = s2 * abs(c2) # get the length of the control "arms" - controldists = controldists_from_endgeometry_pt(p1, p2, t1, t2, c1, c2, epsilon=epsilon) + controldists = controldists_from_endgeometry_pt(p1, p2, t1, t2, c1, c2) if controldists and (controldists[0][0] >= 0 and controldists[0][1] >= 0): # use the first entry in the controldists @@ -990,7 +990,7 @@ # or even split it for recursive calls if (math.hypot(A[0] - D[0], A[1] - D[1]) < epsilon and math.hypot(tangA[0] - tangD[0], tangA[1] - tangD[1]) < T_threshold): - return normpath.normsubpath([normpath.normline_pt(A[0], A[1], D[0], D[1])], epsilon=epsilon) + return normpath.normsubpath([normpath.normline_pt(A[0], A[1], D[0], D[1])]) result = normpath.normsubpath(epsilon=epsilon) # is there enough space on the normals before they intersect? @@ -1013,7 +1013,7 @@ curvD = orig_curvD / (1.0 - dist*orig_curvD) # first try to approximate the normcurve with a single item - controldistpairs = controldists_from_endgeometry_pt(A, D, tangA, tangD, curvA, curvD, epsilon=epsilon) + controldistpairs = controldists_from_endgeometry_pt(A, D, tangA, tangD, curvA, curvD) if controldistpairs: # TODO: is it good enough to get the first entry here? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [PyX-checkins] SF.net SVN: pyx: [2965] trunk/pyx/pyx/deformer.py From: - 2008-03-09 11:55:17 ```Revision: 2965 http://pyx.svn.sourceforge.net/pyx/?rev=2965&view=rev Author: m-schindler Date: 2008-03-09 04:55:19 -0700 (Sun, 09 Mar 2008) Log Message: ----------- corrected a radians/degree error in deformer.cycloid Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2008-02-25 09:45:19 UTC (rev 2964) +++ trunk/pyx/pyx/deformer.py 2008-03-09 11:55:19 UTC (rev 2965) @@ -378,7 +378,7 @@ skipfirst = abs(unit.topt(self.skipfirst)) skiplast = abs(unit.topt(self.skiplast)) radius = abs(unit.topt(self.radius)) - turnangle = degrees(self.turnangle) + turnangle = radians(self.turnangle) sign = mathutils.sign(self.sign) cosTurn = math.cos(turnangle) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```
 [PyX-checkins] SF.net SVN: pyx: [2998] trunk/pyx/pyx/deformer.py From: - 2008-06-04 09:03:18 ```Revision: 2998 http://pyx.svn.sourceforge.net/pyx/?rev=2998&view=rev Author: m-schindler Date: 2008-06-04 02:03:25 -0700 (Wed, 04 Jun 2008) Log Message: ----------- fixed a bug in deformer.parallel, reported by Andreas Matthias Modified Paths: -------------- trunk/pyx/pyx/deformer.py Modified: trunk/pyx/pyx/deformer.py =================================================================== --- trunk/pyx/pyx/deformer.py 2008-05-19 08:29:56 UTC (rev 2997) +++ trunk/pyx/pyx/deformer.py 2008-06-04 09:03:25 UTC (rev 2998) @@ -728,7 +728,7 @@ # avoid too small dists: we would run into instabilities if abs(dist) < abs(epsilon): - return orig_nsp + return normpath.normpath([orig_nsp]) result = normpath.normpath() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```