Two-dimensional drawing automatic marking method, device and electronic equipment
By inputting the three-dimensional digital-analog model to the pre-trained drawing labeling model, generating the labeling information of the two-dimensional drawings and determining the position of the figures in the drawing frame, the problem of low manual labeling of two-dimensional drawings in mechanical design is solved, and automated labeling is realized, reducing time costs and improving coverage.
Patent Information
- Application Number
- CN202111253741.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the field of mechanical design, the annotation and information filling of two-dimensional drawings mainly rely on manual operations of designers, resulting in high time costs and low processing efficiency.
By obtaining the three-dimensional digital and modulus to be marked for the part and inputting it into the pre-trained drawing labeling model, the drawing labeling information of the two-dimensional figure corresponding to the three-dimensional digital and modulus is generated, including the labeling dimension information and the frame text information. Then, determine the relative position of the two-dimensional figure in the drawing frame to ensure that the drawings are moderately white and meet the preset requirements.
It realizes that the two-dimensional drawings are automatically marked and information filled out without manual filling by designers, which reduces the time cost of designers, improves design efficiency, and ensures the full coverage of drawings.
Smart Images

Figure CN113901615B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of mechanical design, and in particular to a two-dimensional drawing automatic marking method, device and electronic equipment. Background Art
[0002] In the field of mechanical design, the design plan needs to be output as a two-dimensional drawing for subsequent processing. The two-dimensional drawing needs to be dimensioned, and various text information (details column, title column, tolerance, etc.) needs to be filled in the drawing frame.
[0003] At present, for the two-dimensional drawings, the annotation and information filling of these drawings are all completed manually by designers, which takes a lot of time, resulting in a waste of designers' time cost and energy and low processing efficiency. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and electronic equipment for automatic annotation of two-dimensional drawings, which reduces the time cost of designers, improves the processing efficiency during design, and ensures the comprehensive coverage of automatic annotation of two-dimensional drawings.
[0005] In a first aspect, the present invention provides a method for automatic annotation of two-dimensional drawings, the method comprising: obtaining a three-dimensional digital model of a part to be annotated; inputting the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain drawing annotation information of a two-dimensional graphic corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes annotation dimension information and drawing frame text information for the two-dimensional graphic in the drawing; determining the relative position of the two-dimensional graphic in the drawing frame, and ensuring that the drawing has an appropriate amount of blank space to meet preset requirements, and completing the annotation.
[0006] In an optional embodiment, the training step of the pre-trained drawing annotation model includes: constructing a training data set based on the three-dimensional digital model of the part to be annotated and its corresponding drawing annotation information; based on the training data set, training the pre-constructed drawing annotation model until the model converges to obtain a trained drawing annotation model.
[0007] In an optional embodiment, the step of constructing a training data set includes: converting a three-dimensional digital model of a part into processable data of a drawing annotation model as input of the drawing annotation model; the processable data of the drawing annotation model includes point cloud data; based on the category of the part, selecting drawing annotation information corresponding to the part as a label of the drawing annotation model; the label has a corresponding relationship with the category of the part; and constructing a training data set based on the input and label of the drawing annotation model.
[0008] In an optional embodiment, the method also includes: creating a data structure for representing the three-dimensional digital model and drawing annotation information to be annotated, wherein the data structure includes the view name, view normal, view distribution distance and annotation object; the annotation object includes edges, faces and holes for annotation.
[0009] In an optional embodiment, the method further includes: a step of determining a relative position of the two-dimensional graphic in the frame, including: determining the relative position of the two-dimensional graphic in the frame based on a coordinate difference between a center coordinate of the two-dimensional graphic and a center coordinate of the frame.
[0010] In an optional embodiment, the drawing has moderate blank space to meet the preset requirements: the difference between the spacing between the three views of the two-dimensional graphic and the spacing between the three views and the drawing frame does not exceed 5% of the width and height of the frame; at the same time, the area ratio of the three views of the two-dimensional graphic to the overall area of the drawing frame is set to between 50% and 95%.
[0011] In a second aspect, the present invention provides an automatic annotation device for two-dimensional drawings, including an acquisition module for acquiring a three-dimensional digital model of a part to be annotated; an input module for inputting the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain drawing annotation information of a two-dimensional graphic corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes annotation dimension information and drawing frame text information for the two-dimensional graphic in the drawing; a drawing setting module for determining the relative position of the two-dimensional graphic in the drawing frame, and ensuring that the drawing has an appropriate amount of blank space to meet preset requirements, and completing the annotation.
[0012] In a third aspect, the present invention provides an electronic device including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the automatic annotation method for two-dimensional drawings of any one of the aforementioned embodiments.
[0013] In a fourth aspect, the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the two-dimensional drawing automatic marking method of any one of the aforementioned implementation modes.
[0014] The present invention provides a method, device and electronic device for automatic annotation of two-dimensional drawings. The method first obtains the three-dimensional digital model of the part to be annotated, and then inputs the three-dimensional digital model to be annotated into a pre-trained drawing annotation model, outputs the drawing annotation information of the two-dimensional graphics corresponding to the three-dimensional digital model to be annotated, and determines the relative position of the two-dimensional graphics in the drawing frame, and ensures that the drawing blank is appropriate, meets the preset requirements, and completes the annotation; wherein the drawing annotation information includes the annotation size information and drawing frame text information for the two-dimensional graphics in the drawing. The above method outputs the drawing annotation information of the corresponding two-dimensional graphics by passing the input three-dimensional digital model of the part through a pre-trained drawing annotation model, which can eliminate the need for manual filling by the designer, reduces the designer's time cost, and improves the processing efficiency during design; and, because the pre-trained drawing annotation model includes the drawing annotation information of the two-dimensional graphics corresponding to the part, it can cover as many corresponding relationships between the three-dimensional digital model and the two-dimensional graphics annotation as possible, thereby ensuring comprehensive coverage of the drawing annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of a process flow of a two-dimensional drawing automatic annotation method provided by an embodiment of the present invention;
[0017] Figure 2 A schematic diagram of a json file containing annotation information provided by an embodiment of the present invention;
[0018] Figure 3 A schematic diagram of the structure of a pre-selected drawing annotation model provided by an embodiment of the present invention;
[0019] Figure 4 A schematic diagram of the overall process of model training and automatic labeling provided by an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of the structure of a two-dimensional drawing automatic marking device provided by an embodiment of the present invention;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0023] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0025] In the description of the present invention, it should be noted that the terms "center", "left", "right", "vertical", "horizontal", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0026] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] Considering that the filling of various text information (details column, title bar, tolerance, etc.) in the dimensioning and drawing frame in the two-dimensional drawings is completed manually by the designer, it takes a lot of time. In the method disclosed for the technical problem at present, although there is also an automation scheme for drawing information, this type of scheme is only to realize the automatic filling of the part drawing title bar by obtaining the part name information from the assembly drawing form (patent CN111353284A), or to determine the frame size according to the two-dimensional graphic size (patent CN111739119A). However, the above scheme still requires manual intervention by the designer to complete the marking of the entire drawing scheme, so it still needs to spend a lot of time, and the processing efficiency for the entire drawing is still low. Based on this, the embodiment of the present invention provides a two-dimensional drawing automatic marking method, device and electronic equipment, which reduces the time cost of designers, improves the processing efficiency during design, and ensures the comprehensive coverage of the automatic marking of two-dimensional drawings.
[0028] For ease of understanding, a method for automatic drawing annotation provided by an embodiment of the present invention is first described in detail.
[0029] See also Figure 1 The flowchart of a two-dimensional drawing automatic annotation method shown in FIG. 1 mainly includes the following steps S102 to S106:
[0030] Step S102, obtaining the three-dimensional digital model of the part to be annotated.
[0031] The three-dimensional digital model of the part to be annotated can be obtained by obtaining user input, and the digital model needs to be automatically annotated.
[0032] Step S104, input the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain drawing annotation information of the two-dimensional graphics corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes the annotation size information and frame text information for the two-dimensional graphics in the drawing.
[0033] Among them, the pre-trained drawing annotation model can include point cloud models such as classic models PointNet, convolutional neural networks, etc., and can also include non-point cloud models such as meshNet models. The selected drawing annotation model is trained through a pre-established training data set to obtain a trained drawing annotation model. The annotation dimension information may include dimension text, width and height, etc., and the frame text information may include detail columns, title columns, dimension tolerances, etc. In addition, it may also include annotations of views, shapes, offsets, text fonts, colors, etc.
[0034] Step S106, determine the relative position of the two-dimensional graphic in the drawing frame, ensure that the blank space of the drawing is appropriate, meet the preset requirements, and complete the annotation.
[0035] The relative position of the two-dimensional graphic in the frame is determined, and the target moving position of the two-dimensional graphic in the frame can be determined based on the coordinate difference between the center coordinates of the two-dimensional graphic and the center coordinates of the frame. After the target moving position is determined, the two-dimensional graphic is moved to the target moving position.
[0036] The method for automatic annotation of two-dimensional drawings provided by an embodiment of the present invention outputs annotation information of the corresponding two-dimensional graphics by passing the input three-dimensional digital model of the part through a pre-trained drawing annotation model, which eliminates the need for designers to fill in the annotation information manually, thereby reducing the time cost of designers and improving processing efficiency during design; and, since the pre-trained drawing annotation model includes the drawing annotation information of the two-dimensional graphics corresponding to the part, it can cover as many corresponding relationships between the three-dimensional digital model and the two-dimensional graphic annotation as possible, thereby ensuring comprehensive coverage of the drawing annotation.
[0037] In one implementation, the pre-trained drawing annotation model can be trained through the following training steps 2.1-2.2:
[0038] Step 2.1), construct a training data set based on the three-dimensional digital model of the part to be annotated and its corresponding drawing annotation information.
[0039] Step 2.2), based on the training data set, train the pre-built drawing annotation model until the model converges to obtain a trained drawing annotation model.
[0040] In actual application, a data structure can be created to represent the 3D digital model and drawing annotation information to be annotated, where the data structure includes the view name, view normal, view distribution distance and annotation object; the annotation object includes the edges, faces and holes used for annotation. Optionally, the annotation information 2D drawing annotation data structure can also include the annotation offset, text font, color, size, width and height, etc. The data structure of the 3D digital model and drawing annotation information to be annotated can be represented by a json data structure. For example, the annotation size information can be stored in a json file. Figure 2 shown.
[0041] The training data set constructed above is constructed based on the pre-established correspondence between the drawing annotation information and the three-dimensional digital model of the part. When the training data set is constructed by the annotation dimension information stored in the json file and the three-dimensional digital model of the part, the following steps 2.1.1 to 2.1.3 can be specifically included:
[0042] Step 2.1.1), convert the 3D digital model of the part into data that can be processed by the drawing annotation model as the input of the drawing annotation model. When the model is a point cloud model, the data that can be processed by the drawing annotation model can be point cloud data, and the converted point cloud data is an N*3 matrix (N is the number of points). When the model is a non-point cloud model, the data that can be processed by the drawing annotation model is correspondingly non-point cloud data.
[0043] Step 2.1.2), based on the category of the part, select the drawing annotation information corresponding to the part as the label of the drawing annotation model. The label has a corresponding relationship with the category of the part. For ease of understanding, the corresponding relationship can be: for example, for a part belonging to category A, the annotation information can include the title bar content, front view shape, color, and size (this is only an example and is not specifically limited).
[0044] Considering that there are many types of parts, the 2D drawing annotation content of parts of the same category is roughly the same, and the 2D drawing annotation content of parts of different categories may be different. Therefore, the training data set is determined based on the correspondence between the 3D digital model and the 2D drawing annotation information based on the part category. When the part category is M, the 2D drawing annotation data can be converted into a 1*M dimensional vector as the label of the data set. For example, when the category is 128, the label is a 1*128 dimensional vector.
[0045] Step 2.1.3), construct a training dataset based on the input and labels of the drawing annotation model.
[0046] Furthermore, after obtaining the pre-trained drawing annotation model, the three-dimensional digital model of the part input by the user can be predicted and the most appropriate annotation solution can be output.
[0047] In one embodiment, the method further includes: creating a blank drawing for storing two-dimensional graphics. When creating the blank drawing, it can be created through the ezdxf library. The blank drawing for storing two-dimensional graphics includes a drawing frame.
[0048] In addition, the two-dimensional graphics and the frame can be adaptively integrated. In practical applications, the adaptive position integration can include displaying the two-dimensional graphics in a suitable area of the frame, and the area occupied by its three views should be between 50% and 95% of the overall area of the frame. In specific implementation, the position of the frame where the two-dimensional graphics are located can be determined based on the preset vertex coordinates of the blank drawing; wherein the preset vertices include the lower left and upper right vertices of the frame.
[0049] The width and height of the frame can be obtained by subtracting the coordinates of the upper left vertex and the lower right vertex. For example, the width and height of the frame and the position of the frame can be determined by traversing the starting point and the end point of the line on the drawing, obtaining the coordinates of the lower left and upper right vertices of the frame based on size comparison.
[0050] Furthermore, in order to ensure that the two-dimensional graphics can be displayed in the appropriate area of the frame, in the specific implementation, the center coordinates of the two-dimensional graphics and the center coordinates of the frame can be determined first, and then the relative position of the two-dimensional graphics in the frame can be determined based on the coordinate difference between the center coordinates of the two-dimensional graphics and the center coordinates of the frame.
[0051] In order to ensure the adaptive position integration of the frame and the two-dimensional graphics, so that the display of the frame and the two-dimensional graphics is more in line with the situation of moderate white space, it is possible to further judge whether the placement of the three views of the two-dimensional graphics in the frame is within a reasonable range based on the existing frame. When judging, first, the difference between the spacing between the three views of the two-dimensional graphics and the spacing between the three views and the frame can be set not to exceed 5% of the width and height of the frame. At the same time, the area ratio of the three views of the two-dimensional graphics to the overall area of the frame is set to between 50% and 95%. For example, it can be judged based on the width and height of the frame whether the area occupied by the three views of the two-dimensional graphics is between 50% and 95% of the overall area of the frame. If it is satisfied, it means that the three views of the two-dimensional graphics can be well contained in the frame. The frame can be directly selected for projection. In this way, it can be ensured that the projection of the frame can be completed automatically, which is flexible and simple.
[0052] In addition, if the placement of the three views of the two-dimensional figure in the frame does not meet the above-mentioned blank space requirements, they can be adjusted by changing the ratio of the two according to the actual situation, or by replacing new paper (that is, the frame) to ensure that the blank space in the frame is appropriate. This is only an example and is not specifically limited.
[0053] Furthermore, after the predicted annotation information is output through the pre-trained drawing annotation model, the automatic annotation and information filling of the drawing can be completed according to the obtained new part annotation scheme, actual geometric dimensions, text and other attributes, and the two-dimensional drawing can be output after completion.
[0054] The above overall solution including model training and automatic labeling can also be found in Figure 4 The process diagram shown in the figure first establishes a data structure representing the annotation scheme information (dimension annotation, tolerance, text, title bar, etc.) in the two-dimensional drawing, and then establishes a data set that binds the three-dimensional digital model of the part and the two-dimensional drawing annotation and information filling scheme, where the input is the three-dimensional digital model of the part, and the label is the data structure of the two-dimensional drawing annotation scheme. Then, through (deep learning, machine learning, etc.), the corresponding relationship between the three-dimensional digital model of the part and its corresponding two-dimensional drawing annotation and information filling scheme is learned, and the drawing frame and two-dimensional graphics are further adaptively integrated, so that the drawing can be drawn more reasonably through the two-way adjustment of the drawing scale and the drawing frame size, so as to output the final two-dimensional drawing. The whole set of solutions covers any stage of drawing annotation, and can directly obtain the annotated drawings without manual intervention, which improves the processing efficiency of automatic drawing annotation.
[0055] In view of the above-mentioned two-dimensional drawing automatic marking method, an embodiment of the present invention provides a two-dimensional drawing automatic marking device, see Figure 5 As shown, the device includes the following parts:
[0056] An acquisition module 502 is used to acquire a three-dimensional digital model of a part to be annotated;
[0057] The input module 504 is used to input the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain the drawing annotation information of the two-dimensional figure corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes the annotation size information and the drawing frame text information for the two-dimensional figure in the drawing;
[0058] The drawing setting module 506 determines the relative position of the two-dimensional graphic in the drawing frame, ensures that the drawing has an appropriate amount of blank space, meets the preset requirements, and completes the annotation.
[0059] The two-dimensional drawing automatic annotation device provided by the embodiment of the present invention outputs the annotation information of the corresponding two-dimensional graphics by passing the input three-dimensional digital model of the part through a pre-trained drawing annotation model, which eliminates the need for designers to fill in the information manually, reduces the time cost of designers, and improves the processing efficiency during design; and, because the pre-trained drawing annotation model includes the drawing annotation information of the two-dimensional graphics corresponding to the part, it can cover as many corresponding relationships between the three-dimensional digital model and the two-dimensional graphic annotation as possible, thereby ensuring comprehensive coverage of the drawing annotation.
[0060] In one embodiment, the above device further includes a model training module, which is used to:
[0061] A training data set is constructed based on the three-dimensional digital model of the part to be annotated and its corresponding drawing annotation information; based on the training data set, a pre-constructed drawing annotation model is trained until the model converges to obtain a trained drawing annotation model.
[0062] In one embodiment, the model training module is further used to:
[0063] The three-dimensional digital model of the part is converted into processable data of the drawing annotation model as the input of the drawing annotation model; the processable data of the drawing annotation model includes point cloud data; based on the category of the part, the drawing annotation information corresponding to the part is selected as the label of the drawing annotation model; the label has a corresponding relationship with the category of the part; and a training data set is constructed based on the input and label of the drawing annotation model.
[0064] In one embodiment, the above device further includes: a creation module, configured to:
[0065] A data structure is created to represent the annotation information of the 3D digital model and drawing to be annotated, wherein the data structure includes the view name, view normal, view distribution distance and annotation object; the annotation object includes the edges, faces and holes used for annotation.
[0066] In one implementation, the drawing setting module 506 is further used to:
[0067] The relative position of the two-dimensional graphic in the drawing frame is determined based on the coordinate difference between the center coordinates of the two-dimensional graphic and the center coordinates of the drawing frame.
[0068] In one embodiment, the drawing has moderate white space, meeting the preset requirements that: the difference between the spacing between the three views of the two-dimensional graphic and the spacing between the three views and the drawing frame does not exceed 5% of the width and height of the drawing frame; at the same time, the area ratio of the three views of the two-dimensional graphic to the overall area of the drawing frame is set to between 50% and 95%.
[0069] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0070] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned implementation methods.
[0071] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected via the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.
[0072] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0073] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0074] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0075] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.
[0076] The computer program product of the two-dimensional drawing automatic annotation method, device and electronic device provided in the embodiments of the present invention includes a computer-readable storage medium storing non-volatile program code executable by a processor, and a computer program is stored on the computer-readable storage medium. The computer program is executed by the processor to execute the method described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0077] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned embodiment, and will not be repeated here.
[0078] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be referred to the method embodiment, which will not be repeated here.
[0079] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A two-dimensional drawing automatic marking method, characterized in that: The method comprises: Obtain the three-dimensional digital model of the part to be annotated; Inputting the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain drawing annotation information of a two-dimensional figure corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes annotation size information and drawing frame text information for the two-dimensional figure in the drawing; Determine the relative position of the 2D graphics in the drawing frame, ensure that the blank space on the drawing is appropriate, meet the preset requirements, and complete the annotation; The training step of the pre-trained drawing annotation model includes: constructing a training data set based on the three-dimensional digital model of the part to be annotated and its corresponding drawing annotation information; training the pre-constructed drawing annotation model based on the training data set until the model converges to obtain a trained drawing annotation model; The step of constructing a training data set includes: converting the three-dimensional digital model of the part into processable data of a drawing annotation model as input of the drawing annotation model; the processable data of the drawing annotation model includes point cloud data; based on the category of the part, selecting the drawing annotation information corresponding to the part as a label of the drawing annotation model; the label has a corresponding relationship with the category of the part; and constructing the training data set based on the input of the drawing annotation model and the label.
2. The method for automatic marking of two-dimensional drawings according to claim 1, characterized in that: The method further comprises: A data structure is created for representing the three-dimensional digital model to be annotated and the drawing annotation information, wherein the data structure includes a view name, a view normal, a view distribution distance and an annotation object; the annotation object includes edges, faces and holes for annotation.
3. The method for automatic marking of two-dimensional drawings according to claim 1, characterized in that: The step of determining the relative position of the two-dimensional graphic in the frame includes: The relative position of the two-dimensional graphic in the picture frame is determined based on the coordinate difference between the center coordinates of the two-dimensional graphic and the center coordinates of the picture frame.
4. The method for automatic marking of two-dimensional drawings according to claim 1, characterized in that: The drawing has moderate white space, meeting the preset requirements that: the difference between the spacing between the three views of the two-dimensional graphic and the spacing between the three views and the drawing frame does not exceed 5% of the width and height of the drawing frame; at the same time, the area ratio of the three views of the two-dimensional graphic to the overall area of the drawing frame is set to between 50% and 95%.
5. A two-dimensional drawing automatic marking device, characterized in that: Used to implement the method described in claim 1; the device comprises: An acquisition module is used to acquire the three-dimensional digital model of the part to be annotated; An input module, used for inputting the three-dimensional digital model to be annotated into a pre-trained drawing annotation model to obtain drawing annotation information of a two-dimensional figure corresponding to the three-dimensional digital model to be annotated; wherein the drawing annotation information includes annotation size information and drawing frame text information for the two-dimensional figure in the drawing; The drawing setting module determines the relative position of the two-dimensional graphics in the drawing frame, ensures that the drawing has appropriate white space, meets the preset requirements, and completes the annotation.
6. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the two-dimensional drawing automatic marking method according to any one of claims 1 to 4.
7. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the two-dimensional drawing automatic marking method described in any one of claims 1 to 4.
Citation Information
Patent Citations
Automatic three-dimensional model component category tagging method
CN106157375A
Method and device for automatically generating two-dimensional part view based on three-dimensional model
CN110750840A