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 <ijackson@chiark.greenend.org.uk>
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]))