NanoShaper: a general and robust ray-casting based tool for processing surfaces at the nanoscale