In the KD_TREE::Add_Points function, the tmp_counter variable is used to count the number of points actually inserted into the tree. However, when downsample_switch evaluates to false (i.e., downsample_on is set to false or the DOWNSAMPLE_SWITCH macro is disabled), the counter is not incremented in the else branch.
This causes the function to always return 0, even though points are successfully added to the kd-tree.
In the KD_TREE::Add_Points function, the tmp_counter variable is used to count the number of points actually inserted into the tree. However, when downsample_switch evaluates to false (i.e., downsample_on is set to false or the DOWNSAMPLE_SWITCH macro is disabled), the counter is not incremented in the else branch.
This causes the function to always return 0, even though points are successfully added to the kd-tree.