Three-dimensional halfspace constructive solid geometry tree construction from implicit boundary representations