nsd = number of space dimensions; either 2 or 3