I've modified the code slightly to include some function files of methods that I...
ERROR: CurveSegment: point outside curve segment