Measure the niche or wall at several points and use the smallest value. We build to the millimetre.
Placement
Infill strips close the gap to the walls on both sides.
Ceiling strip3 cm
Automatic: the cabinet body is at most 275 cm high; anything above goes into the ceiling strip.
Top
A wardrobe runs up to the ceiling with a ceiling strip. A low piece (TV unit, drawer unit, sideboard) is closed with a top panel instead: at most 140 cm high, on the floor or floating.
Sloped ceiling
For an attic or under the stairs: the cabinet follows the slope. Measure the height at the wall and how far the slope reaches into the room.