External data comprising boundary data on an object is acquired by an external data acquiring means using a computer, and the external data is inputted to the computer by an external data input means. The external data is divided by a cell dividing means into rectangular parallelepiped cells having boundary planes intersecting perpendicularly. The divided cells are sorted by a cell sorting means into boundary cells including boundary data and non-boundary cells not including boundary data. Different space numbers are set to respective spaces partitioned by sorting the cells by a space sorting means with the boundary data, and the space numbers of adjacent cells not partitioned with the boundary data are reset to an identical space number by a space number compression means.