{'fraction_non_alphanumeric': 0.023908045977011495, 'fraction_numerical': 0.006781609195402299, 'mean_word_length': 4.713066316480631, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Research on Automatic Dimensioning of the Engineering Drawing Based on CBR

In this paper, we describe a novel automatic dimensioning method. The method redefines the characteristics of graphics output primitive and determines the position and type of dimension in new drawings by comparing them with similar engineering drawings which with dimension. Firstly, redefining graphics output primitive so that each graphics output primitive has its own unique attributes, creating dimension templates and each template consists of three parts: the dimension object, the dimension type, and the dimension placement point. Secondly, finding the case that is most similar with the topological structure, geometric structure, and expression function of the new drawing from the case library. At the end, by making a match with the case select from case library to determine the dimension object, dimension type, dimension value, and dimension placement point in the new drawing. Our early experiments show that the presented theory has a good usability.


Introduction
With the continuous development of science and technology, big data and intelligent learning technologies play an increasingly important role in various academic fields. The automatic dimensioning technology also has different solutions under the influence of related technologies. Case-based reasoning (CBR) [1] is the process of solving new problems based on the solutions of similar past problems, it belongs to artificial intelligence. Case-based reasoning has been formalized for purposes of computer reasoning as a four-step process: retrieve、reuse、revise and retain. CBR technology has been applied in the field of machinery, such as the intelligent design of mechanical products [2]. Yu Yan and Liu Guo ping [3] proposed composite-knowledge reasoning for automatic dimensioning. In this paper we introduce the expression of knowledge in the case library, the design of similarity matching algorithms, and the entire process of automating dimensioning.

Dimension knowledge representation
Each case in the case library can be viewed as consisting of graphs and dimension, and each dimension can be regarded as consisting of dimension object, dimension type, dimension placement points and dimension value [4,5] as shown in figure 1. There are main eight types of dimension, which are linear dimension, aligned dimension, diameter dimension, radius dimension, cylindrical diameter dimension, angular dimension, arc dimension, and ordinate dimension. According to the composition method of dimension as shown in figure1, we treat every dimension as a dimension template, as long   When we add dimensions to a new drawing, we need to determine each dimension object and the dimension placement points, then we can get the dimension type through dimension object and get dimension value through dimension placement points, some dimension types need to be determined by comparison with a matching case, such as cylinder diameter. We define the placement point of the dimension as a feature point and redefine the graphics output primitive to give more attributes to the feature point, and then derive the dimension type based on the feature point attribute.

Definition of feature points
We define the dimension placement points in dimension template as feature points, then we use a 64bit binary number to represent each feature point's characteristics. The 64-bit binary number is divided into 5 parts: For the first part (the 1 st to 8 th bits), the value of each bit in the binary indicates whether there is a point has straight line connection with itself in each azimuth of the point. If there is a point in the i-th direction has straight line connection with the point 0, the i-th bit value in the binary is 1, else the i-th bit value in the binary is 0, as shown in figure 3.  For the third part (the 25 th to 32 th bits), if the feature point is a circle center, the value of each bit in the binary indicates whether there is a center point of a circle in each azimuth of the feature point. As shown in figure5, if there is a center in the i-th direction, the i-th bit value in the binary is 1, else the ith bit value in the binary is 0, as shown in figure 5.
For the fourth part (the 33 th to 40 th bits), the value of each bit in the binary indicates the type of dimension, and the types of dimension as shown in figure2. For the last part (the 41th to 64 th bits), this part bits value is reserved for new attributes defined in future.

Case Reasoning
The knowledge expression of case library is divided into two parts, one is graphic expression and the other is dimension knowledge expression. For these two expression libraries, each case in one library corresponds to one case in another library. And the process of reasoning is mainly similar reasoning.

Graphic similarity
Graphic similarity refers to the degree of similarity between graphs in topological structure, geometric shape and expressive function. Therefore, we divide the graph similarity into three parts: the similarity of topological structure, the similarity of geometric shape and the similarity of size constraint. Similarity results are classified into deterministic similarity and fuzzy similarity. If two graphs similar in all aspects, we say these two graphs are deterministic similar, otherwise we call them fuzzy similarity. It is the best result for that a case drawing and the new drawing are deterministic similar. If every case drawing is not deterministic similar with the new drawing, we need to calculate a similarity. The specific calculation of similarity is based on reference documentation [5,6].

Feature point similarity
Definition similar feature point: (1) There is a feature point A of a feature in a drawing, we calculate the attribute value num1 of the feature point A according to the definition of 2.1, and there a feature point B of a feature in another drawing, we also calculate the attribute value num2 of the feature point B according to the definition of 2.1. If num1 equals num2, we say that A and B are a pair of similar feature points.
(2) There is a feature point A of a feature in a drawing, according to (1), if we can find two or more feature points in another drawing which are similar with A, we call these points a B set , . According to 2.2, we can get a feature point's feature array, then we compare the feature array of Bi and the feature array of point A, if the feature array of and the feature array of feature point A are the same, and A are a pair of similar points .

Feature similarity and reasoning
In a two-dimensional graph, a point usually has only two attributes x coordinate and y coordinate; the attributes of the line are only the starting point and the ending point; the attributes of the arc are the center of the circle, the starting point of the arc, and the ending point of the arc; the attributes of the circle are the center of the circle and the radius of the circle. According to the definition of 2.1 and 2.2, we add some attributes to every point. Then, in addition to the attributes of the x and y coordinates, each point or a center of circle has a 64-bit binary number and an array of features. As shown in figure  2, all feature templates are composed of one or several of points, lines, arcs, or circles. And lines, arcs, and circles are composed of one or several of points and centers. If there are two features that are similar, first their types are similar, and secondly, the points that make up these features are similar one-to-one. When a feature in the new drawing is found which is similar with a feature in the case, then the dimension can be added to the feature of the new drawing according the case' dimension information. The similar relationship is shown in figure 6.

Results
In order to demonstrate the feasibility of the proposed approach, we implement several experiments and give the automatic dimensioning results of a multipath axes. As shown in Figure.7.

Conclusion
This paper proposes a method of automatic dimensioning based on case-based reasoning, which uses the existing engineering drawings' dimension information to realize automatic dimensioning of new drawings. In this method, we redefine the attributes of feature points, and we divided each kind dimension into four main parts: dimension object, dimension placement points, dimension type and dimension value. Through these operations we give each point more information so that we can use our algorithm to search a similar set of feature points, and according to feature points and the way that a dimension is composed, we can add dimension to a new drawing automatically and correctly.