Add degree limitation. Separate 2D/3D NTree.