A method, system, device and storage medium for inserting a picture frame

By automatically acquiring and processing the bounding rectangle in the two-dimensional drawing, determining the optimal frame and inserting it into the drawing, it solves the problem of low efficiency and accuracy of inserting frames in the traditional method, and achieves efficient labor cost saving and precise fixed-point insertion.

CN111739119BActive Publication Date: 2024-08-30GUANGZHOU MINO AUTOMOTIVE EQUIP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010411782.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-15
Publication Date
2024-08-30
Estimated Expiration
2040-05-15

AI Technical Summary

Technical Problem

The traditional method of inserting picture frames has low accuracy and efficiency, and consumes a lot of labor costs. The picture frames are selected based on experience and the positions are manually adjusted, resulting in repeated operations and a huge workload.

Method used

By obtaining the first bounding rectangle of the graphics object in the two-dimensional drawing, determining the minimum bounding rectangle and the second bounding rectangle, determining the optimal frame based on these rectangles, and using the processor to insert it into the two-dimensional drawing, reducing manual selection and Adjustment.

Benefits of technology

It improves the accuracy and efficiency of frame insertion, saves a lot of labor costs, and realizes automated frame selection and fixed-point insertion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111739119B
    Figure CN111739119B
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for inserting a drawing frame. The method comprises the following steps: obtaining the first boundary rectangle of each graphic object in a two-dimensional drawing; determining the minimum boundary rectangle according to a number of the first boundary rectangles; determining the second boundary rectangle according to the minimum boundary rectangle and the blank space of the drawing; determining the optimal drawing frame according to the second boundary rectangle; inserting the optimal drawing frame into the two-dimensional drawing according to the first insertion point and the second insertion point. The present invention determines the second boundary rectangle through the graphic objects in the two-dimensional drawing, and determines the optimal drawing frame suitable for inserting into the two-dimensional drawing according to the boundary rectangle, without manually selecting the appropriate drawing frame based on experience, saving a lot of labor costs, and can insert the selected optimal drawing frame into the two-dimensional drawing at a fixed point, improving the accuracy and efficiency of the drawing frame insertion. The present invention can be widely used in the field of computer drawing technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics technology, and in particular to a method, system, device and storage medium for inserting a drawing frame. Background Art

[0002] The drawing frame is a wireframe that limits the drawing area in a two-dimensional drawing. The drawing frame will be applied after the graphic objects are drawn in the two-dimensional drawing.

[0003] The drawing frame is mainly determined by the format and ratio. The format can be divided into A0, A1, A2, A3 and A4, etc., and the ratio can be divided into 1:1, 1:2, 1:4, 1:5 and 1:10, etc. The drawing frame of each format can be divided into different drawing frames according to different ratios, so there are many types of drawing frames.

[0004] The traditional method of inserting a drawing frame into a 2D drawing is that engineers rely on their experience to select a drawing frame of appropriate size and scale from the drawing frame library for each 2D drawing, and manually adjust the position of the drawing frame in the 2D drawing so that the drawing frame inserted into the 2D drawing can contain all the graphic objects in the 2D drawing.

[0005] This traditional method of inserting a frame into a two-dimensional drawing is to select a frame for the two-dimensional drawing based on experience. Therefore, the frame selected each time may not be the most appropriate, and once the selected frame is not the most appropriate, it is necessary to reselect the frame for the two-dimensional drawing. The repeated operation of selecting the frame consumes a lot of labor costs (time and energy). In addition, after selecting a suitable frame for the two-dimensional drawing, it is necessary to manually adjust the position of the inserted frame in the two-dimensional drawing so that the inserted frame can completely contain all the graphic objects in the two-dimensional drawing. A simple piece of tooling equipment includes two-dimensional drawings: equipment assembly drawings, about 6 unit assembly drawings, and about 40 parts drawings. If a frame is manually inserted for each two-dimensional drawing, it can be seen that the workload is huge. Therefore, this method of selecting frames based on experience and manually adjusting the position of the frames reduces the accuracy and efficiency of inserting frames and consumes a lot of labor costs. Summary of the invention

[0006] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent. The purpose of the present invention is to provide a method, system, device and storage medium for inserting a frame.

[0007] The technical solution adopted in one aspect of the present invention is:

[0008] A method for inserting a drawing frame comprises the following steps:

[0009] Get the first bounding rectangle of each graphic element in the two-dimensional drawing;

[0010] Determine a minimum bounding rectangle based on a plurality of said first bounding rectangles;

[0011] Determine the second bounding rectangle based on the minimum bounding rectangle and the blank space in the drawing;

[0012] Determine the optimal frame according to the second boundary rectangle;

[0013] An optimal drawing frame is inserted into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal drawing frame and the second insertion point is selected in the second boundary rectangle.

[0014] The technical solution adopted in another aspect of the present invention is:

[0015] A system for inserting a picture frame, comprising:

[0016] A first bounding rectangle acquisition module, used to acquire a first bounding rectangle of each graphic object in the two-dimensional drawing;

[0017] A minimum bounding rectangle acquisition module, used to determine a minimum bounding rectangle based on a plurality of the first bounding rectangles;

[0018] A second bounding rectangle module, used to determine a second bounding rectangle according to the minimum bounding rectangle and the blank space of the drawing;

[0019] An optimal frame acquisition module, used to determine an optimal frame according to the second boundary rectangle;

[0020] The optimal drawing frame insertion module is used to insert the optimal drawing frame into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal drawing frame and the second insertion point is selected in the second boundary rectangle.

[0021] The technical solution adopted in another aspect of the present invention is:

[0022] A device for inserting a picture frame, comprising:

[0023] at least one processor;

[0024] at least one memory for storing at least one program;

[0025] When the at least one program is executed by the at least one processor, the at least one processor is enabled to implement the method of inserting a drawing frame.

[0026] The technical solution adopted in another aspect of the present invention is:

[0027] A storage medium stores instructions executable by a processor, wherein the instructions executable by the processor are used to implement a method for inserting a picture frame when executed by the processor.

[0028] The beneficial effects of the present invention are as follows: the present invention determines a second boundary rectangle through graphic objects in a two-dimensional drawing, and determines an optimal frame suitable for inserting into the two-dimensional drawing based on the boundary rectangle, without the need to manually screen out a suitable frame based on experience, thus saving a large amount of labor costs, and the selected optimal frame can be inserted into the two-dimensional drawing at a fixed point, thus improving the accuracy and efficiency of frame insertion. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the embodiments of the present invention or the drawings of related technical solutions in the prior art are introduced below. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 A schematic flow chart of a specific embodiment of a method for inserting a picture frame according to the present invention;

[0031] Figure 2 is a schematic diagram of a first boundary rectangle of the present invention;

[0032] Figure 3 It is a schematic diagram of the minimum bounding rectangle of the present invention;

[0033] Figure 4 A schematic diagram of the blank space and the second boundary of the present invention;

[0034] Figure 5 It is a schematic diagram of the optimal frame of the present invention;

[0035] Figure 6 A schematic diagram of a two-dimensional drawing with an optimal drawing frame inserted in the present invention;

[0036] Figure 7 A schematic structural diagram of a specific embodiment of a system for inserting a drawing frame according to the present invention;

[0037] Figure 8 The present invention is a structural schematic diagram of a specific embodiment of a device for inserting a picture frame. DETAILED DESCRIPTION

[0038] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0039] A method and system for inserting a picture frame according to an embodiment of the present invention will be described in detail below with reference to the accompanying drawings. First, a method for inserting a picture frame according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0040] Reference Figure 1 , an embodiment of the present invention provides a method for inserting a frame, comprising the following steps:

[0041] S101, obtaining a first boundary rectangle of each graphic object in the two-dimensional drawing;

[0042] Specifically, a two-dimensional drawing contains several graphic objects, such as Figure 2 As shown, Figure 2 The arc and circle in the figure are both graphic objects, and each of the graphic objects has a boundary rectangle, namely a first boundary rectangle, which can cover the graphic object. The first boundary rectangle can be obtained by reading the boundary rectangle of the graphic object.

[0043] S102, determining a minimum bounding rectangle according to a plurality of the first bounding rectangles;

[0044] Specifically, each of the graphic objects has a first bounding rectangle, which covers the corresponding graphic object. The minimum bounding rectangle is the bounding rectangle of all graphic objects in the two-dimensional drawing, and can cover all graphic objects. Figure 2 and Figure 3 As shown, the first bounding rectangle includes the coordinates of the lower left corner and the upper right corner, and the minimum bounding rectangle can be determined according to the coordinates of the lower left corner and the upper right corner of the first bounding rectangle.

[0045] S103, determining a second bounding rectangle according to the minimum bounding rectangle and the blank space in the drawing;

[0046] Specifically, Figure 4As shown, all graphic objects are contained within the minimum bounding rectangle, and the drawing area with a certain distance around the minimum bounding rectangle is the drawing blank, which is used for later annotation of technical requirements, etc., and is also for the overall aesthetics of the two-dimensional drawing. The size of the drawing blank can be determined by setting the numerical value of the certain distance. The inner side of the drawing blank is the minimum bounding rectangle, and the outer side of the drawing blank is the second bounding rectangle.

[0047] S104: Determine an optimal frame according to the second boundary rectangle.

[0048] Specifically, the drawing frame refers to a wireframe used to define a drawing area in a two-dimensional drawing. The second boundary rectangle contains a number of graphic objects, and the second boundary rectangle is the drawing area. Therefore, the second boundary rectangle must be included in the optimal drawing frame, and the optimal drawing frame can be determined by comparing the area of ​​the second boundary rectangle with the area of ​​the drawing frame.

[0049] S105 . Inserting an optimal drawing frame into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal drawing frame and the second insertion point is selected in the second boundary rectangle.

[0050] Specifically, after the optimal frame is determined, it needs to be inserted into the appropriate position in the two-dimensional drawing. The first insertion point is selected on the optimal frame, and the second insertion point is selected on the second boundary rectangle. When the first insertion point and the second insertion point coincide, the optimal frame can be inserted into the two-dimensional drawing.

[0051] Compared with the traditional method of selecting a frame based on experience and manually inserting the frame into a two-dimensional drawing, the present invention determines the drawing area, i.e., the second boundary rectangle, through a graphic object, and determines the optimal frame suitable for inserting into the two-dimensional drawing based on the second boundary rectangle. There is no need to manually screen out a suitable frame based on experience, thus saving a lot of labor costs. Moreover, the selected optimal frame can be inserted into the two-dimensional drawing at a fixed point, thus improving the accuracy and efficiency of frame insertion.

[0052] As an optional implementation, step S102 includes the following steps S1021-S1023:

[0053] S1021, obtaining the lower left corner coordinates and the upper right corner coordinates of each of the first boundary rectangles to obtain a coordinate set;

[0054] S1022, obtaining the minimum coordinate and the maximum coordinate according to the coordinate set;

[0055] S1023. Obtain a minimum bounding rectangle according to the minimum coordinates and the maximum coordinates.

[0056] Specifically, each of the graphic objects corresponds to a first bounding rectangle, the first bounding rectangle includes the lower left corner coordinates and the upper right corner coordinates, the lower left corner coordinates and the upper right corner coordinates of the first bounding rectangle of each of the graphic objects are extracted, thereby obtaining a coordinate set including multiple coordinate points, and comparing the horizontal coordinate value x and the vertical coordinate value y of each coordinate point in the coordinate set to obtain the maximum horizontal coordinate value x max and the maximum ordinate value y max , and the minimum horizontal coordinate x min and the minimum ordinate value y min , according to the maximum horizontal coordinate value x max and the maximum ordinate value y max Get the maximum coordinate M(x max ,y max ), according to the minimum horizontal coordinate x min and the minimum ordinate value y min Get the minimum coordinate N(x min ,y min ), the maximum coordinate M(x max ,y max ) and the minimum coordinate N(x min ,y min ) can determine a bounding rectangle, namely the minimum bounding rectangle, such as Figure 3 shown.

[0057] As an optional implementation, step S104 includes the following steps S1041-S1043:

[0058] S1041, obtaining the area of ​​the second boundary rectangle;

[0059] S1042, determining an optimal frame model according to the area of ​​the second boundary rectangle;

[0060] S1043, determining an optimal frame according to the optimal frame model.

[0061] Specifically, the types of drawing frames are various due to the different formats and ratios. For example, the formats include A0, A1, A2, A3 and A4, and the drawing frames of each format include multiple ratios such as 1:1, 1:2, 1:4, 1:5 and 1:10. The data of each type of drawing frame is stored in the drawing frame database, and the data of the drawing frame includes the drawing frame area and the first insertion point. Then, each type of drawing frame is stored in the shared file. Each type of drawing frame is stored in the shared file in the form of a drawing. Each type of drawing frame will save a drawing frame path, and the drawing frame path is used to find the storage location of the drawing frame in the shared file.

[0062] Compare the area of ​​the second bounding rectangle with the area of ​​each frame model in the frame database. For example, if a frame with an A4 format and a ratio of 1:1 has a blank area of ​​180*230 excluding the title bar to accommodate the area of ​​the second bounding rectangle, then the frame model (with an A4 format and a ratio of 1:1) is used as an alternative frame. Because there is more than one frame that meets the conditions, multiple alternative frames that meet the conditions will be determined, and the frame with the smallest area is selected from the multiple alternative frames as the optimal frame. Obtain the model (format and ratio) of the optimal frame, and search for the corresponding model frame in the shared file.

[0063] As an optional implementation, step S105 includes the following steps S1051-S1053:

[0064] S1051, obtaining a first insertion point in the optimal frame;

[0065] S1052, obtaining a storage path of the optimal frame;

[0066] S1053, obtaining a second insertion point in the second boundary rectangle;

[0067] S1054: inserting the optimal frame into the two-dimensional drawing according to the storage path, the first insertion point, and the second insertion point of the optimal frame.

[0068] In this embodiment, a point is obtained on the optimal frame as the first insertion point, such as Figure 5 As shown, a point is obtained on the second boundary rectangle as the second insertion point. Each frame stored in the shared disk includes a storage path. The optimal frame can be obtained according to the storage path of the optimal frame. The optimal frame is inserted into the two-dimensional drawing according to the storage path of the optimal frame and the first insertion point. In the process of inserting the optimal frame into the two-dimensional drawing, the coordinates of the first insertion point and the coordinates of the second insertion point coincide, thereby achieving the purpose of inserting the optimal frame into the two-dimensional drawing. Finally, the two-dimensional drawing with the optimal frame inserted is shown as follows. Figure 6 In this embodiment, the center point of the optimal frame can be selected as the first insertion point, and the center point of the second boundary rectangle can be selected as the second insertion point, so as to ensure that the center point of the optimal frame coincides with the center point of the second boundary rectangle, and the optimal frame can cover the second boundary rectangle. Of course, the first insertion point and the second insertion point can be selected according to actual conditions, and finally the optimal frame can be inserted into a suitable position in the two-dimensional drawing.

[0069] As an optional implementation, the method further includes inserting a frame into the two-dimensional drawing according to preset frame information, wherein the preset frame information includes a format, a scale and an insertion point ( S106 ).

[0070] Specifically, when you want to insert a frame of any model, you can obtain the preset frame information, search for the frame that meets the format and scale conditions in the shared file according to the format and scale, and insert the frame that meets the format and scale conditions into the two-dimensional drawing according to the insertion point, where the insertion point is the point selected on the second boundary rectangle.

[0071] As an optional implementation, step S101 specifically includes:

[0072] The GetBoundingBox function may be used to obtain the first bounding rectangle.

[0073] Specifically, the GetBoundingBox function is used to obtain the bounding rectangle of the graphic object. Therefore, the GetBoundingBox function can be used to obtain the first bounding rectangle of the graphic object (what is actually obtained are the lower left corner coordinates and the upper right corner coordinates of the first bounding rectangle).

[0074] Next, a system for inserting a picture frame according to an embodiment of the present invention is described with reference to the accompanying drawings.

[0075] Figure 7 The present invention is a schematic diagram of a system structure for inserting a frame according to an embodiment of the present invention.

[0076] The system specifically comprises:

[0077] A first bounding rectangle obtaining module 301 is used to obtain a first bounding rectangle of each graphic object in the two-dimensional drawing;

[0078] A minimum bounding rectangle obtaining module 302, configured to determine a minimum bounding rectangle based on a plurality of the first bounding rectangles;

[0079] A second bounding rectangle acquisition module 303 is used to determine a second bounding rectangle according to the minimum bounding rectangle and the blank space of the drawing;

[0080] An optimal frame acquisition module 304 is used to determine an optimal frame according to the second boundary rectangle;

[0081] The optimal frame inserting module 305 is used to insert the optimal frame into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal frame and the second insertion point is selected in the second boundary rectangle.

[0082] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0083] Reference Figure 8, an embodiment of the present invention provides a device for inserting a frame, comprising:

[0084] at least one processor 401;

[0085] At least one memory 402, used to store at least one program;

[0086] When the at least one program is executed by the at least one processor 401 , the at least one processor 401 implements the method for inserting a frame.

[0087] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0088] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0089] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features described may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0090] 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.

[0091] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0092] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0093] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0094] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0095] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0096] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for inserting a frame, characterized in that: The following steps are involved: Get the first bounding rectangle of each graphic object in the two-dimensional drawing; Determine a minimum bounding rectangle based on a plurality of said first bounding rectangles; Determine the second bounding rectangle based on the minimum bounding rectangle and the blank space in the drawing; Get the area of ​​the second bounding rectangle; Determining the optimal frame model according to the area of ​​the second boundary rectangle; Determine the optimal frame according to the optimal frame model; Inserting an optimal drawing frame into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal drawing frame and the second insertion point is selected in the second boundary rectangle; The step of determining the optimal frame model according to the area of ​​the second boundary rectangle comprises the following steps: comparing the area of ​​the second bounding rectangle with the area of ​​each model of the frame in the frame database; Selecting a frame whose blank area can accommodate the area of ​​the second boundary rectangle as an alternative frame; A model of a frame with the smallest area is selected from multiple candidate frames as the optimal frame model.

2. A method for inserting a frame according to claim 1, characterized in that: The step of determining a minimum bounding rectangle based on the plurality of first bounding rectangles comprises the following steps: Obtaining the coordinates of the lower left corner and the upper right corner of each of the first bounding rectangles to obtain a coordinate set; Get the minimum coordinate and the maximum coordinate according to the coordinate set; Get the minimum bounding rectangle based on the minimum and maximum coordinates.

3. A method for inserting a frame according to claim 1, characterized in that: The step of inserting the optimal drawing frame into the two-dimensional drawing according to the first insertion point and the second insertion point comprises the following steps: Get the first insertion point in the optimal frame; Get the storage path of the optimal frame; Get a second insertion point in the second bounding rectangle; The optimal drawing frame is inserted into the two-dimensional drawing according to the storage path, the first insertion point and the second insertion point of the optimal drawing frame.

4. A method for inserting a picture frame according to claim 1, characterized in that: The following steps are also included: A drawing frame is inserted into a two-dimensional drawing according to preset drawing frame information, wherein the preset drawing frame information includes a format, a scale and an insertion point.

5. A method for inserting a picture frame according to claim 1, characterized in that: The step of obtaining the first bounding rectangle of each graphic object in the two-dimensional drawing specifically includes: Use the GetBoundingBox function to obtain the first bounding rectangle.

6. A system for inserting a picture frame, characterized in that: include: A first bounding rectangle acquisition module, used to acquire a first bounding rectangle of each graphic object in the two-dimensional drawing; A minimum bounding rectangle acquisition module, used to determine a minimum bounding rectangle based on a plurality of the first bounding rectangles; A second bounding rectangle acquisition module, used to determine the second bounding rectangle according to the minimum bounding rectangle and the blank space of the drawing; An optimal frame acquisition module, used to acquire the area of ​​the second boundary rectangle, determine the optimal frame model according to the area of ​​the second boundary rectangle, and determine the optimal frame according to the optimal frame model; An optimal drawing frame inserting module, used for inserting an optimal drawing frame into the two-dimensional drawing according to a first insertion point and a second insertion point, wherein the first insertion point is selected in the optimal drawing frame and the second insertion point is selected in the second boundary rectangle; Wherein, the optimal frame acquisition module is also used for: The area of ​​the second boundary rectangle is compared with the area of ​​each frame model in the frame database; a frame whose blank area can accommodate the area of ​​the second boundary rectangle is selected as an alternative frame; and the model of the frame with the smallest area is selected from multiple alternative frames as the optimal frame model.

7. A device for inserting a picture frame, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method for inserting a frame according to any one of claims 1 to 5.

8. A storage medium storing instructions executable by a processor, characterized in that: The processor-executable instructions are used to implement a method for inserting a frame according to any one of claims 1 to 5 when executed by the processor.

Citation Information

Patent Citations

  • Quick inserting pattern frame system and method

    CN101055601A

  • Processing method of combo box and processing device of combo box

    CN108804406A