Pull points to closest curve

yes, since the this is part of a much bigger file and I only showed the relevent parts to this problem,
like point 3 here: