Implementing CurveSegment constructor