This is a classic recursive task. Recursion is a rather “odd” way to do business where something calls itself until something else happens and the loop is terminated.
For instance in loop: 0 you subdivide and you get a List of boxes (2d or 3d). Then you sample the ones that yield a ccx event with a Curve and/or a Mesh and/or a Brep (general case) into a tree at branch loop.
Then in loop 1 you gather items from tree branch (loop -1) and for each you subdivide and you sample the new ones (ccx etc etc) into a tree at branch loop. This means that the amount of items can escalate quite fast (but depends on the “filter” used for passing items to the next loop).
A tree like that is in fact the history of the actions that occured (until the recursion termination) … so by selecting a given branch you can inspect what happened per loop.
You can do that via Anemone (or via code - my game). I fact I have stuff like that but is carried over solely via code and works in 3d against any Brep/Mesh.
The result is kinda like “approximating” an image via “pixels” with more and more finer resolution.