AbstractHalfEdge e = getEdge(polyline, i);
if(e.hasAttributes(AbstractHalfEdge.IMMUTABLE))
continue main;
edgeIndex.add(e);
}
<BUG>for(Vertex v:toInsert)
{
int segId = bgLink.get(k++);
AbstractHalfEdge toSplit = edgeIndex.get(segId);</BUG>
double od = v.sqrDistance3D(toSplit.origin());

AbstractHalfEdge e = getEdge(polyline, i);
if(e.hasAttributes(AbstractHalfEdge.IMMUTABLE))
continue main;
edgeIndex.add(e);
}
for(int k = 0; k < toInsert.size(); k++)
{
Vertex v = toInsert.get(k);
int segId = bgLink.get(k);
AbstractHalfEdge toSplit = edgeIndex.get(segId);
double od = v.sqrDistance3D(toSplit.origin());
