Sections

Introduction

By Vertex

Splitting by vertex results in 2 new polylines, where the first vertex of the second polyline is a clone of the last vertex of the first polyline.

(I) Select Relevant Nodes

(II) Clone Target Vertex & Set Clone Pointers

(III) Swap Next Vertex Pointer to Clone

(IV) Detach Previous Polyline Pointers

(V) Detach & Redirect Next Polyline Segment w.r.t. Clone Vertex & Previous Polyline

(VI) Instantiate New Polylines with Heads of Each Polyline

Many

Splitting by many polylines stacks onto many split by polyline operations, which splits on the head tail vertices, which is a special case of just splitting on many vertices.

For splitting by many vertices, we just take the split by vertex base case, and perform the following iteration:

For each vertex:

  1. Split track by vertex.

  2. Save first track.

  3. Last vertex?

    1. If not last vertex, input second track for splitting on next vertex & repeat on next node.

    2. If last vertex, save second track & return all saved tracks.