Splits edges of polygons by a number of divisions.
Splitting edges of a polygon is pre-cursor to subdividing a polygon. So doing this will move you closer to implementing subdivision surfaces using VEX, if you choose to do it.
There are many ways to implement this. You can perform everything using a single detail wrangle, but that would be so slow and would not scale well.
You want to break down each step so that you can parallelize anything that can be parallelized.
That's the only way you can have a shot at beating C++ operators, apart from using faster algorithms.
Splitting a polygon in VEX is challenging but not because you have to recreate the polygons with new points, but rather you have to first create new points, track them in successive steps, and interpolate all point, vertex and primitive attributes, as well as preserve all group memberships.
Vertex attributes are particularly tricky because removing a primitive removes its vertices as well, so you have to match the new vertices to the old ones properly, where the original vertices (corner vertices) will have a single vertex to match, while the new edge vertices will have 2 corner vertices to interpolate between.
https://www.dropbox.com/s/dxxqy8uzn546jit/EdgeDivide_SOP_Animatrix.otl?dl=1