CN-121637599-B - Method, system and storage medium for positioning label area of electronic drawing
Abstract
The embodiment of the invention provides a method, a system and a storage medium for positioning a drawing area of an electronic drawing, and relates to the technical field of engineering drawing data processing. The method comprises the steps of obtaining all line segments contained in an electronic drawing, determining a first target line segment and a second target line segment in all line segments, and determining a drawing area in the electronic drawing based on linear characteristics of the first target line segment and the second target line segment, wherein the drawing area is used for drawing information related to the electronic drawing, and the linear characteristics comprise vertical and/or parallel relations among the line segments. The method and the device can intelligently and adaptively accurately identify and position the icon areas in various electronic drawings, and improve the efficiency and accuracy of drawing information automatic extraction and management.
Inventors
- LIU JUNJIE
- LUO XIAOPING
- LIU YUAN
Assignees
- 一智科技(成都)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260204
Claims (10)
- 1. A method of locating a region of a drawing of an electronic drawing, the method being performed on a computer device comprising at least one processor and a storage device in communication with the at least one processor, the storage device having stored therein computer instructions which when executed by the at least one processor perform the operations of: Acquiring all line segments contained in the electronic drawing; determining a first target line segment and a second target line segment in all the line segments; determining a first vertical line segment group based on the vertical relation between the first target line segment and other line segments in all the line segments, and recording the coordinates of each line segment in the first vertical line segment group; determining a first parallel line segment group based on the parallel relation between the first target line segment and other line segments in all the line segments, and recording the coordinates of each line segment in the first parallel line segment group; Respectively comparing a first number of line segments contained in the first vertical line segment group and a second number of line segments contained in the first parallel line segment group with a first threshold value to obtain a first comparison result; determining a start line and a first edge line in response to the first number and the second number being greater than or equal to the first threshold value, and And determining a drawing area in the electronic drawing based on the starting line and the first side line, wherein the drawing area is used for signing drawing information related to the electronic drawing.
- 2. The method of claim 1, wherein the determining the tab area in the electronic drawing based on the start line and the first edge line comprises: determining a line segment intersecting the initial line in the first vertical line segment group to obtain a second vertical line segment group; Comparing the third number of the line segments contained in the second vertical line segment group with a second threshold value to obtain a second comparison result; And determining a target starting line and a first target side line based on the second comparison result, and determining the icon area based on the target starting line and the first target side line.
- 3. The method of claim 2, wherein the determining a target starting line and a first target edge based on the second comparison result comprises: Determining the start line as the target start line and the first edge line as the first target edge line in response to the third number being greater than or equal to the second threshold value, and In response to the third number being less than the second threshold, Selecting a line segment meeting a preset condition from the first parallel line segment group, and determining the line segment as the target starting line; determining a line segment intersecting the target starting line in the first vertical line segment group to obtain a third vertical line segment group, and And determining a line segment closest to the first edge in the third vertical line segment group as the first target edge.
- 4. The method of claim 3, wherein the determining the tab area based on the target start line and the first target edge line comprises: Determining a line segment intersecting the first target edge in the first parallel line segment group to obtain a target parallel line segment group; Determining the orientation of the icon area in the electronic drawing based on the target parallel line segment group and the target vertical line segment group, wherein the target vertical line segment group is one of the third vertical line segment group and the second vertical line segment group; Determining a second target edge and a third target edge based on the orientation; The tab area is determined based on the second target edge, the third target edge, the target starting line, and the first target edge.
- 5. The method of claim 4, wherein determining the orientation of the tab area in the electronic drawing based on the set of target parallel line segments and the set of target perpendicular line segments comprises: determining that the icon area is located in a first position of the electronic drawing in response to the fourth number of line segments contained in the target parallel line segment group being greater than the fifth number of line segments contained in the target perpendicular line segment group; and in response to the fourth number being less than or equal to the fifth number, determining that the tab area is located in a second orientation of the electronic drawing.
- 6. The method of claim 5, wherein the first orientation comprises a right side of the electronic drawing and the second orientation comprises a lower side of the electronic drawing, and wherein determining the second target edge and the third target edge based on the orientation comprises: Determining a line segment with the largest y value in the target parallel line segment group as the second target side line and determining a line segment with the largest x value except the first target side line in the target vertical line segment group as the third target side line in response to the icon area being positioned on the right side of the electronic drawing; and in response to the icon area being positioned below the electronic drawing, determining a line segment with the smallest y value except the target initial line in the target parallel line segment group as the second target side line, and determining a line segment with the smallest x value in the target vertical line segment group as the third target side line.
- 7. A label area positioning system for an electronic drawing, comprising: The acquisition module is configured to acquire all line segments contained in the electronic drawing; a line segment determination module configured to determine a first target line segment and a second target line segment of the all line segments, and The icon determination module is configured to: determining a first vertical line segment group based on the vertical relation between the first target line segment and other line segments in all the line segments, and recording the coordinates of each line segment in the first vertical line segment group; determining a first parallel line segment group based on the parallel relation between the first target line segment and other line segments in all the line segments, and recording the coordinates of each line segment in the first parallel line segment group; Respectively comparing a first number of line segments contained in the first vertical line segment group and a second number of line segments contained in the first parallel line segment group with a first threshold value to obtain a first comparison result; determining a start line and a first edge line in response to the first number and the second number being greater than or equal to the first threshold value, and And determining a drawing area in the electronic drawing based on the starting line and the first side line, wherein the drawing area is used for drawing information related to the electronic drawing.
- 8. The system of claim 7, wherein the determining the tab area in the electronic drawing based on the start line and the first edge line comprises: determining a line segment intersecting the initial line in the first vertical line segment group to obtain a second vertical line segment group; Comparing the third number of the line segments contained in the second vertical line segment group with a second threshold value to obtain a second comparison result; And determining a target starting line and a first target side line based on the second comparison result, and determining the icon area based on the target starting line and the first target side line.
- 9. The system of claim 8, wherein the determining a target starting line and a first target edge based on the second comparison result comprises: Determining the start line as the target start line and the first edge line as the first target edge line in response to the third number being greater than or equal to the second threshold value, and In response to the third number being less than the second threshold, Selecting a line segment meeting a preset condition from the first parallel line segment group, and determining the line segment as the target starting line; determining a line segment intersecting the target starting line in the first vertical line segment group to obtain a third vertical line segment group, and And determining a line segment closest to the first edge in the third vertical line segment group as the first target edge.
- 10. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the tab area locating method of an electronic drawing according to any one of claims 1 to 6.
Description
Method, system and storage medium for positioning label area of electronic drawing Technical Field The present disclosure relates to the field of engineering drawing data processing technologies, and in particular, to a method, a system, and a storage medium for locating a label area of an electronic drawing. Background In the field of engineering design, computer-aided design (Computer-AIDED DESIGN, CAD) electronic drawings (for example, drawings drawn by software such as AutoCAD and Tianzheng CAD, which are abbreviated as drawings) are core carriers for information transmission. For standard drawing management, a specific 'drawing label area' is arranged inside a drawing frame of a drawing when the drawing is drawn. The tab area is typically located at a corner (e.g., right side or lower side) of the frame, and is used for centrally filling in data information of the drawing, such as a drawing name, a project name, a drawing number, a version number, a drawing unit, a specialty, and the like. Such data information is critical to archiving, retrieving, version management, and collaborative work of drawings. However, in practical application, automatic identification of the icon area faces significant technical challenges, and there are problems of unfixed position of the icon area, direction change of the drawing, lack of automatic identification means, and the like. Therefore, it is necessary to provide a method, a system and a storage medium for locating a drawing area of an electronic drawing, which can intelligently and adaptively and accurately identify and locate the drawing area in various electronic drawings, and improve the efficiency and accuracy of drawing information automatic extraction and management. Disclosure of Invention The invention comprises a method for positioning the icon area of the electronic drawing. The method is performed on a computer device comprising at least one processor and a storage device in communication with the at least one processor, the storage device having stored therein computer instructions that when executed by the at least one processor perform the operations of obtaining all line segments contained in the electronic drawing, determining a first target line segment and a second target line segment of the all line segments, determining a tab area in the electronic drawing based on linear characteristics of the first target line segment and the second target line segment, the tab area for signing drawing information related to the electronic drawing, the linear characteristics including a perpendicular and/or parallel relationship between the line segments. The invention comprises a picture label area positioning system of an electronic drawing. The system comprises an acquisition module, a line segment determining module and a drawing determining module, wherein the acquisition module is configured to acquire all line segments contained in the electronic drawing, the line segment determining module is configured to determine a first target line segment and a second target line segment in all the line segments, the drawing determining module is configured to determine a drawing area in the electronic drawing based on linear characteristics of the first target line segment and the second target line segment, the drawing area is used for drawing information related to the electronic drawing, and the linear characteristics comprise vertical and/or parallel relations among the line segments. The invention includes a computer readable storage medium storing computer instructions that when read by a computer, the computer performs a method for locating a tab area of an electronic drawing according to any embodiment of the present disclosure. The method has the advantages that all line segments in the electronic drawing are obtained efficiently, on the basis, the first target line segment and the second target line segment of the drawing frame are determined accurately by analyzing the linear characteristics (such as vertical and/or parallel relation) of the line segments, and then the label region is positioned quickly in a geometric logic mode. The method overcomes the defects of strong dependence on the drawing format and low positioning precision of the traditional method, realizes the automation and high-precision positioning of the drawing area, and remarkably improves the efficiency and accuracy of drawing information identification. Drawings The present specification will be further elucidated by way of example embodiments, which will be described in detail by means of the accompanying drawings. The embodiments are not limiting, in which like numerals represent like structures, wherein: FIG. 1 is an exemplary block diagram of a tab area positioning system for an electronic drawing, according to some embodiments of the present description; FIG. 2 is an exemplary flow chart of a method for locating a tab area of an electronic drawing, according to some embodimen