A library for constructing a balanced linear octree representation of a 3D object described in Constructive Solid Geometry notation