Preheat oven to 180°C. Grease a 2-litre capacity ovenproof dish or cast iron skillet with butter, or grease and line the base and sides of a 22cm springform tin with baking paper. Whisk together cream, egg yolks and rosemary. Season.
Thinly slice potatoes, pumpkin and squash using a mandoline or the slicing attachment on a food processor (alternatively, cut into paper thin slices with a knife). Put in a bowl and add cream mixture. Use your hands to separate vegetable slices and stir through cream mixture until vegetables are coated.
Spread ⅓ of the vegetables in prepared dish with your hand. Sprinkle with ⅓ cup of the gruyere. Spread another ⅓ of the vegetables on top and sprinkle with another ⅓ cup of gruyere. Top with remaining vegetables. Sprinkle with the remaining gruyere, parmesan and nutmeg. If using a tin, place on an oven tray.
Cover dish or tin with foil and bake for 30 minutes. Uncover and bake for 25-30 minutes or until golden and vegetables are tender when pierced with a knife.
Cool for 15 minutes, then remove from tin and cut into wedges. If using an ovenproof dish or skillet, serve directly from the dish or pan.