A method of virtually designing a post and core restoration for attachment in a damaged tooth of a patient, where the tooth includes a bore for receiving the post of the post and core, the method includes obtaining a first 3D scan includes at least a part of the damaged tooth; providing a digital 3D shape adapted to fit the bore of the damaged tooth; virtually matching the first 3D scan of the tooth and the digital 3D shape, where the matching includes matching a surface region in the first 3D scan of the tooth with a corresponding surface region of the digital 3D shape, such that at least part digital 3D shape is represented relative to the first 3D scan of the tooth; and virtually designing the post and core restoration based on the representation of the digital 3D shape relative to the first 3D scan of the tooth.