FEPoint fep2 = fepointlist.getPoint(idx_p2);
if (fep1.squaredDistanceFrom(fep2) < SPRING_THRESHOLD_SQUARED) {
// is it headed outwards from point 1?
LocalPathAndIndex loc1 = findLocalPathAndIndex(fep1);
FEPath path1 = loc1.getPath();
int index1 = loc1.getIndex();
FEPoint fep1_plus = path1.safelyGetPoint(index1 + 1);
FEPoint fep1_minus = path1.safelyGetPoint(index1 - 1);
if (isClockwise(fep1, fep2, fep1_plus, fep1_minus)) {
// is it headed outwards from point 2?
LocalPathAndIndex loc2 = findLocalPathAndIndex(fep2);
FEPath path2 = loc2.getPath();
int index2 = loc2.getIndex();
FEPoint fep2_plus = path2.safelyGetPoint(index2 + 1);
FEPoint fep2_minus = path2.safelyGetPoint(index2 - 1);
if (isClockwise(fep2, fep1, fep2_plus, fep2_minus)) {
add(fep1, fep2);
}
}
}