In additive manufacturing (AM) processes, the layer-by-layer fabrication leads to a staircase error resulting in dimensional inaccuracies in the part surface. Using thinner slices reduces the staircase error and improves part accuracy but also increases the number of layers and the build time for manufacturing the part. Another approach called adaptive slicing uses slices of varying thicknesses based on the part geometry to build the part. A new algorithm to compute adaptive slice thicknesses using octree data structure is presented in this study. This method, termed as modified boundary octree data structure (MBODS) algorithm, is used to convert the stereolithography (STL) file of an object to an octree data structure based on the part's geometry, the machine parameters, and a user defined tolerance value. A subsequent algorithm computes the variable slice thicknesses using the MBODS representation of the part and virtually manufactures the part using these calculated slice thicknesses. Points sampled from the virtually manufactured part are inspected to evaluate the volumetric, profile, and cylindricity part errors. The MBODS based slicing algorithm is validated by comparing it with the uniform slicing approach using various slice thicknesses for different parts. The developed MBODS algorithm is observed to be more effective in improving the part quality while using lesser number of slices.