The path is a contour from ofxOpenCv, I heavily simplified first to match the laser capabilities.
In the code that you are showing, you are adding vertex to a single polyline (line2?); and I don't see a line2.begin() nor line2.close() while ofBeginShape/ofEndShape are global functions to directly render vertex to the screen. Also ofPolyline is intended to store only one shape, not multiple ones.
As outlines is a vector of polylines, why not map directly the points values of the contour and send that as different polylines to ofxIlda?