works now also with meshes that have a thickness