From: Ian Jackson Date: Sat, 7 Apr 2018 22:54:55 +0000 (+0100) Subject: curveopt: wip, observe a bug X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=ece586e7d6e8f68236020935fdb7439c54dfa382;p=moebius3.git curveopt: wip, observe a bug This algorithm encourages a segment with a curve either side of it to be shorter than its neighbours. In this test case there is another bug: the cp[1] (F) and cp[2] (G) vectors are wrong, exaggerating the effect of the bug. To fix the wrong encouragement bug, I think we will have to split the penalty for curvature from the penalty for density variation. Signed-off-by: Ian Jackson --- diff --git a/curveopt.py b/curveopt.py index 5ebe166..12d9625 100644 --- a/curveopt.py +++ b/curveopt.py @@ -29,8 +29,8 @@ class OptimisedCurve(): for end in (False,True): ei = nt if end else 0 fi = nt-1 if end else 1 - cp0i = 0 if end else 3 - cp1i = 1 if end else 2 + cp0i = 3 if end else 0 + cp1i = 2 if end else 1 e = np.array(cp[cp0i]) ef_dirn = unit_v(cp[cp1i] - cp[cp0i]) ef_len = np.linalg.norm(np.array(fc_input[fi]) - np.array(fc_input[ei]))