A CAD-based approach for measuring volumetric error in layered manufacturing