How to remove a vertex from ofPolyline?

How can i remove a vertex at some index?

someting like …
removeVertexAtIndex(int index);

I haven’t test this, but how about
myPolyline.getVertices().remove( myPolyline.getVertices().begin() + index);

Thanks :slight_smile: this is a solution i found :slight_smile: not sure if it is good or not yet but works :slight_smile: (for cases index -1, only one element, over max index)

void my_ofPolylineRemoveVertexAtIndex(ofPolyline &p, int index)
{
    int polyLine_length = p.getVertices().size();
    
    if(index>=0)
    {
        if(index<polyLine_length)
        {
            if(polyLine_length > 1)
            {
                p.getVertices().erase(p.getVertices().begin() + index);
                p.flagHasChanged();
            }
            else
            {
                p.clear();
            }
        }
    }
   
}