A modeling device comprising: a data obtainer configured to obtain, from a measurement device for performing three-dimensional measurement of a three-dimensional object , multiple pieces of measurement data each indicative of a set of coordinates in three dimensions and individually corresponding to multiple measurement points belonging to the three-dimensional object ; a surface extractor configured to generate mathematical formulae representing flat surfaces constituting the three-dimensional object by use of the multiple pieces of measurement data; and a modeler configured to generate a shape model representing the three-dimensional object from the mathematical formulae, characterized in that the surface extractor being configured to: determine, by use of mathematical formulae which are of the mathematical formulae and represent a first surface and second surfaces 32 surrounding the first surface, of the surfaces of the three-dimensional object , boundaries surrounding the first surface; extract, from measurement points which are of the multiple measurement points and belong to the first surface, measurement points relating to a region which is inside the first surface and has a predetermined width from the boundaries, thereby eliminating measurement points that may be deviated from a supposed plane and redetermine the mathematical formula representing the first surface by use of the extracted measurement points. a data obtainer configured to obtain, from a measurement device for performing three-dimensional measurement of a three-dimensional object , multiple pieces of measurement data each indicative of a set of coordinates in three dimensions and individually corresponding to multiple measurement points belonging to the three-dimensional object ; a surface extractor configured to generate mathematical formulae representing flat surfaces constituting the three-dimensional object by use of the multiple pieces of measurement data; and a modeler configured to generate a shape model representing the three-dimensional object from the mathematical formulae, characterized in that the surface extractor being configured to: determine, by use of mathematical formulae which are of the mathematical formulae and represent a first surface and second surfaces 32 surrounding the first surface, of the surfaces of the three-dimensional object , boundaries surrounding the first surface; extract, from measurement points which are of the multiple measurement points and belong to the first surface, measurement points relating to a region which is inside the first surface and has a predetermined width from the boundaries, thereby eliminating measurement points that may be deviated from a supposed plane and redetermine the mathematical formula representing the first surface by use of the extracted measurement points. determine, by use of mathematical formulae which are of the mathematical formulae and represent a first surface and second surfaces 32 surrounding the first surface, of the surfaces of the three-dimensional object , boundaries surrounding the first surface; extract, from measurement points which are of the multiple measurement points and belong to the first surface, measurement points relating to a region which is inside the first surface and has a predetermined width from the boundaries, thereby eliminating measurement points that may be deviated from a supposed plane and redetermine the mathematical formula representing the first surface by use of the extracted measurement points. <EOS>