Detect top surfaces and take them into account when defining support layers