1. A non-transitory computer-readable recording medium storing a voxelization program that causes a computer to execute a process, the process comprising: voxelizing a three-dimensional shape to generate a first voxel structure corresponding to the three-dimensional shape; specifying, in a case where lines perpendicular to respective faces of a cube or a cuboid containing the generated first voxel structure are extended from the respective faces toward inside the cube or the cuboid until the lines hit the first voxel structure, a region outside an outer periphery of the first voxel structure according to whether at least lines extended from three faces orthogonal to each other intersect; setting the specified outside region as a second voxel structure; and performing inversion to invert a region of the voxel structures and a region not set as a voxel in the cube or the cuboid.