A two-dimensional drawing paper generation method, device, storage medium and electronic equipment

By slicing and annotating the three-dimensional graphics, efficient two-dimensional drawings are generated, solving the problem of low efficiency in generating two-dimensional drawings.

CN116630468BActive Publication Date: 2026-11-27CHINA ENFI ENG CORP +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310501274.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2026-11-27
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

The problem of low efficiency in generating 2D drawings in existing technologies.

Method used

By slicing a pre-constructed 3D graphic, initial 2D images corresponding to each viewpoint are obtained, and based on a predetermined drawing frame model, matching and parameter annotation are performed to generate a 2D drawing of the target type.

Benefits of technology

It improves the efficiency of generating 2D drawings and shortens the drawing output time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630468B_ABST
    Figure CN116630468B_ABST
Patent Text Reader

Abstract

The application discloses a two-dimensional drawing generation method and device, a storage medium and electronic equipment. The method comprises the following steps: performing cutting processing on a pre-constructed three-dimensional figure to obtain an initial two-dimensional image corresponding to each view angle; performing frame drawing model matching on each initial two-dimensional image based on a predetermined frame drawing model to obtain at least one two-dimensional drawing image containing a plurality of initial two-dimensional images; performing parameter labeling on each object in each two-dimensional drawing image according to an image labeling category and an object category corresponding to each object to obtain a two-dimensional labeled image corresponding to each two-dimensional drawing image; selecting a drawing generation format corresponding to each two-dimensional labeled image based on each two-dimensional labeled image to generate a target type of two-dimensional drawing corresponding to each two-dimensional labeled image. The two-dimensional drawing generation method can improve the efficiency of generating a two-dimensional drawing from a three-dimensional figure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of three-dimensional design technology, and in particular to a method, apparatus, storage medium, and electronic device for generating two-dimensional drawings. Background Technology

[0002] 3D design is an emerging design method that builds upon 2D and 3D design, making design objectives more three-dimensional and visual. 3D drawing is a crucial part of BIM design. Compared to traditional 2D drawings, 3D design effectively solves problems such as interdisciplinary clashes and inconsistent drawing models. Traditional methods for generating 2D drawings from 3D designs typically use native image slicing tools, which is inefficient. Summary of the Invention

[0003] In view of this, the present invention provides a method, apparatus, storage medium, and electronic device for generating two-dimensional drawings, the main purpose of which is to solve the problem of low efficiency in current two-dimensional drawing generation methods.

[0004] To address the above problems, this application provides a method for generating two-dimensional drawings, including:

[0005] The pre-constructed 3D graphics are sliced ​​to obtain the initial 2D images corresponding to each viewpoint;

[0006] Based on each predetermined drawing frame model, the initial two-dimensional image is matched with the drawing frame model to obtain at least one two-dimensional drawing image containing several initial two-dimensional images.

[0007] Each object in each of the two-dimensional drawing images is labeled with parameters according to the image labeling category and object category corresponding to each object, to obtain a two-dimensional labeled image corresponding to each of the two-dimensional drawing images;

[0008] Based on each of the two-dimensional annotated images, a drawing generation format corresponding to each of the two-dimensional annotated images is selected, and a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images is generated.

[0009] Optionally, before performing image slicing on the pre-constructed 3D solid image, the method further includes: performing anomaly parameter processing on the pre-created initial 3D solid image to obtain the 3D solid image, specifically including:

[0010] Obtain parameter data corresponding to each object in the initial three-dimensional graphic, wherein the parameter data includes at least one or more of the following: equipment name information, equipment tag number information, and equipment centerline information;

[0011] Based on the parameter data, each object is filtered using preset filtering rules to obtain each abnormal object;

[0012] Add each of the aforementioned abnormal objects to the respective preset abnormal lists;

[0013] Based on the exception type corresponding to each of the exception lists, the exception parameter data of each exception object contained in each exception list are processed one by one to obtain the three-dimensional graphic.

[0014] Optionally, the step of filtering each object based on the parameter data and using preset filtering rules to obtain each abnormal object specifically includes:

[0015] Determine whether the device tag number information and device name information of each object meet the preset conditions. If the preset conditions are not met, obtain the abnormal object with missing information.

[0016] Obtain each first object that meets the preset conditions;

[0017] Determine whether the device tag number information of each of the first objects is duplicated, and obtain the abnormal objects with duplicate device tag numbers;

[0018] The number of device centerlines for each of the objects is obtained, and abnormal objects with missing centerlines are identified.

[0019] Optionally, the step of slicing the pre-constructed three-dimensional graphic to obtain initial two-dimensional images corresponding to each viewpoint specifically includes:

[0020] Obtain the view range corresponding to each perspective of the three-dimensional graphic;

[0021] Calculate the union of the views to obtain the clipping box range used to generate the initial two-dimensional images;

[0022] The three-dimensional solid graphic is sliced ​​based on a predetermined view matrix, rotation matrix, clipping plane, rotation direction, and clipping box range to obtain the initial two-dimensional images.

[0023] Optionally, the step of performing drawing matching on each of the initial two-dimensional images to obtain at least one two-dimensional drawing image containing each target initial two-dimensional image specifically includes:

[0024] Based on several preset drawing frames, determine the target drawing frame corresponding to each two-dimensional drawing image to be generated;

[0025] Determine the initial two-dimensional images of each target corresponding to the target two-dimensional drawing image;

[0026] Each of the initial target images is adjusted according to a preset ratio to obtain scaled images corresponding to the two-dimensional target drawing images;

[0027] Based on the scaled images and the target drawing frame, the target two-dimensional drawing image is constructed to obtain the two-dimensional drawing images.

[0028] Optionally, the step of annotating each object in each of the two-dimensional drawing images with parameters according to the image annotation category and object category corresponding to each object to obtain a two-dimensional annotated image corresponding to each of the two-dimensional drawing images specifically includes:

[0029] Based on each of the scaled images, create an image to be labeled that is associated with each of the scaled images;

[0030] Each object in each of the images to be labeled is labeled with parameters according to the image labeling category and object category corresponding to each object, to obtain an external labeled image corresponding to each of the images to be labeled.

[0031] Based on each of the externally labeled images, the parameters of each of the two-dimensional drawing images are refreshed to obtain a two-dimensional labeled image corresponding to each of the two-dimensional drawing images.

[0032] Optionally, the step of annotating each object in each of the images to be annotated with parameters according to the image annotation category and object category corresponding to each object, to obtain an external annotation image corresponding to each of the images to be annotated, specifically includes:

[0033] For each object in each of the images to be labeled, the devices are grouped based on the device number, the first device centerline spacing, the second device centerline spacing, and the device category to obtain multiple device groups;

[0034] Based on each of the images to be labeled, an image labeling category corresponding to each of the images to be labeled is determined. The image labeling category includes: a planar image labeling category and a sectional / elevation image labeling category.

[0035] The horizontal and vertical axis numbers of the images to be labeled in the planar image labeling category are sequentially labeled to obtain each first axis grid; the vertical axis numbers of the images to be labeled in the sectional elevation image labeling category are sequentially labeled to obtain each second axis grid.

[0036] Based on each of the first grid lines and each of the second grid lines, the equipment in each equipment group is labeled to obtain an external labeled image corresponding to each of the images to be labeled.

[0037] To address the aforementioned problems, this application provides a two-dimensional drawing generation device, comprising:

[0038] The acquisition module is used to slice pre-constructed 3D graphics to obtain initial 2D images corresponding to each viewpoint.

[0039] Drawing matching module: used to match the drawing model of each initial two-dimensional image with the drawing model of each predetermined drawing frame, so as to obtain at least one two-dimensional drawing image containing several initial two-dimensional images;

[0040] Annotation module: used to annotate each object in each of the two-dimensional drawing images with parameters according to the image annotation category and object category corresponding to each object, so as to obtain a two-dimensional annotated image corresponding to each of the two-dimensional drawing images;

[0041] Drawing generation module: used to generate two-dimensional drawings of the target type corresponding to each of the two-dimensional annotated images by selecting the drawing generation format corresponding to each of the two-dimensional annotated images.

[0042] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the two-dimensional drawing generation method described above.

[0043] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the aforementioned two-dimensional drawing generation method.

[0044] This application obtains initial 2D images corresponding to various viewpoints by slicing a pre-constructed 3D graphic; it then performs frame drawing model matching on each of the initial 2D images based on predetermined drawing model frames to obtain at least one 2D drawing image containing several initial 2D images; it further annotates each object in each 2D drawing image with parameters according to the image annotation category and object category corresponding to each object, obtaining 2D annotation images corresponding to each 2D drawing image; and finally, based on each 2D annotation image and selecting a drawing generation format corresponding to each 2D annotation image, it generates a 2D drawing of the target type corresponding to each 2D annotation image. The 2D drawing generation method in this application improves the efficiency of 2D drawing generation.

[0045] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0046] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0047] Figure 1 A flowchart illustrating a two-dimensional drawing generation method provided in an embodiment of this application is shown;

[0048] Figure 2 A flowchart illustrating a two-dimensional drawing generation method according to another embodiment of this application is shown;

[0049] Figure 3 This illustration shows a structural block diagram of a two-dimensional drawing generation device according to another embodiment of this application. Detailed Implementation

[0050] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0051] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0052] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0053] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0054] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0055] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0056] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0057] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0058] This application provides a method for generating two-dimensional drawings, such as... Figure 1 As shown, it includes:

[0059] Step S101: Perform image slicing on the pre-constructed three-dimensional graphics to obtain the initial two-dimensional images corresponding to each viewpoint;

[0060] In this step, the view range corresponding to each perspective of the 3D solid graphic is obtained; the union of each view range is calculated to obtain the clipping frame range for generating each initial 2D image; the 3D solid graphic is sliced ​​based on a predetermined view matrix, rotation matrix, clipping plane, rotation direction, and the clipping frame range to obtain each initial 2D image. This application utilizes preset drawing software to create a planar detail index to generate a top view; a sectional detail index generates a front view, rear view, left view, and right view. The preset drawing software can be MicroStation software, which is a 2D and 3D CAD design software. By obtaining the view range corresponding to each perspective of the 3D solid graphic, calculating the maximum and minimum values ​​of the union of each view range, and using these as the clipping frame range, a rotation matrix and direction are defined, and then the views are generated, achieving one-click automatic generation of the top view, front view, rear view, left view, and right view.

[0061] Step S102: Based on each predetermined drawing frame drawing model, perform drawing frame drawing model matching for each of the initial two-dimensional images to obtain at least one two-dimensional drawing image containing several initial two-dimensional images;

[0062] In this step, based on several preset drawing frames, the target drawing frame corresponding to each two-dimensional drawing image to be generated is determined; the target initial two-dimensional images corresponding to the target two-dimensional drawing images are determined; each target initial image is adjusted according to a preset ratio to obtain a scaled image corresponding to the target two-dimensional drawing image; based on each scaled image and the target drawing frame, the target two-dimensional drawing image is constructed to obtain each two-dimensional drawing image. Specifically, this application pre-creates a drawing frame library, allowing users to select drawing frame models from the library in specific applications. Alternatively, a custom drawing frame model can be created. Specifically, a new model of type "drawing" is created, the size and specifications of the drawing are set, and the reference depth and reference origin are set according to the corresponding drawing frame to obtain a custom drawing frame model. This application addresses the problem of newly created drawings lacking frames by designing a new drawing function, pre-setting various existing standard frames, allowing users to freely choose frames according to their needs.

[0063] Step S103: For each object in each of the two-dimensional drawing images, perform parameter annotation according to the image annotation category and object category corresponding to each object to obtain a two-dimensional annotation image corresponding to each of the two-dimensional drawing images;

[0064] In this step, based on each scaled image, an image to be labeled is created and associated with each scaled image; each object in each image to be labeled is parameter-labeled according to the image labeling category and object category corresponding to each object, resulting in an external labeled image corresponding to each image to be labeled; based on each external labeled image, the parameters of each two-dimensional drawing image are refreshed to obtain a two-dimensional labeled image corresponding to each two-dimensional drawing image. The labeling tools for each image to be labeled are divided into grid labeling, configuration icon labeling, pipe labeling, electrical labeling, and instrument labeling.

[0065] Step S104: Based on each of the two-dimensional annotated images, select the drawing generation format corresponding to each of the two-dimensional annotated images, and generate a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images.

[0066] In the specific implementation process, this application can customize the target format of the 2D drawings for printing according to actual needs. The target format can be any one of PDF, DGN, or DWG. The automatic drawing export function of this application automatically exports and merges the drawings into a single file. It filters the drawings to be printed, references each drawing to a new file, merges the necessary drawing models, deletes unnecessary models, arranges them in a certain order and spacing, and saves them. To address the cumbersome operations of exporting drawings in various formats, export functions for three commonly used drawing formats—PDF, DGN, and DWG—are designed. Automatic or semi-automatic drawing export is achieved, and all drawings can be integrated into a single file for easy subsequent retrieval.

[0067] This application obtains initial 2D images corresponding to various viewpoints by slicing a pre-constructed 3D graphic; it then performs frame drawing model matching on each of the initial 2D images based on predetermined frame drawing models to obtain at least one 2D drawing image containing several initial 2D images; it further annotates each object in each 2D drawing image with parameters according to the image annotation category and object category corresponding to each object, obtaining 2D annotation images corresponding to each 2D drawing image; and finally, based on each 2D annotation image and selecting a drawing generation format corresponding to each 2D annotation image, it generates a 2D drawing of the target type corresponding to each 2D annotation image. The 2D drawing generation method in this application improves the efficiency of 2D drawing generation.

[0068] Another embodiment of this application provides a different method for generating two-dimensional drawings, such as... Figure 2 As shown, it includes:

[0069] Step S201: Perform abnormal parameter processing on the pre-created initial 3D solid graphic to obtain the 3D solid graphic;

[0070] In this step, abnormal parameters are processed on the pre-designed initial 3D model to obtain the 3D graphic. Specifically, parameter data corresponding to each object in the initial 3D graphic is obtained. The parameter data includes at least: equipment name information, equipment tag number information, and equipment centerline information. Based on the parameter data, the objects are filtered using preset filtering rules to obtain abnormal objects. Specifically, if the equipment tag number of each object is not empty, the length of the equipment tag number is not less than a specified number of digits, and the Chinese name of the equipment is not empty, then it is added to the complete information equipment list. The system determines whether the device tag number and device name information of each object meet preset conditions. If the preset conditions are not met, it filters out abnormal objects with missing information. The preset conditions can be any one of the following: the device tag number is empty, the device tag number length is less than a predetermined number of digits, or the Chinese name of the device is empty. If so, the device object is determined to be an abnormal object with missing information. The system then obtains each first object that meets the preset conditions. The first objects are each device in the complete information device list. It determines whether the device tag number information of each first object is duplicated, and filters out abnormal objects with duplicate device tag numbers. It obtains the number of device centerlines for each object and filters out abnormal objects with missing centerlines. Each abnormal object is added to a preset abnormal list. Based on the abnormal type corresponding to each abnormal list, the abnormal parameter data of each abnormal object in each abnormal list are processed one by one to obtain the three-dimensional graphic. Through the device attribute inspection function, the system filters and locates devices with complete information, devices with missing device centerlines, devices with missing device information, and devices with duplicate device tag numbers. By pre-checking the parameter values ​​in the initial 3D graphic, abnormal device objects with three types of issues—missing device information, duplicate device tag numbers, and missing center lines—were identified, listed, precisely located, and highlighted. The missing parameter information for each device was then supplemented, laying the foundation for subsequent image slicing processing of the 3D graphic.

[0071] Step S202: Perform image slicing on the three-dimensional graphic to obtain initial two-dimensional images corresponding to each viewpoint;

[0072] In this step, the view range corresponding to each perspective of the 3D solid graphic is obtained; the union of each view range is calculated to obtain the clipping frame range for cropping and generating each initial 2D image; the 3D solid graphic is sliced ​​based on a predetermined view matrix, rotation matrix, clipping plane, rotation direction, and the clipping frame range to obtain each initial 2D image. The initial 2D image can be one or more of the top view, left view, right view, front view, and rear view of the 3D solid graphic. This application achieves the effect of generating five views with one click by writing five methods: creating a top view, creating a front view, creating a rear view, creating a left view, and creating a right view. All five methods first obtain the maximum and minimum values ​​of the union of all view ranges in the current file, which are used as the clipping frame range. Then, the view matrix, rotation matrix, clipping plane, and flip direction are defined. Finally, the view name is defined and the corresponding view is generated. Throughout the process, their rotation matrix, clipping plane, and flip direction are different, and the view name can use a default name or a custom name.

[0073] Step S203: Based on several preset drawing frames, determine the target drawing frame corresponding to each two-dimensional drawing image to be generated;

[0074] In this step, the drawing frame is selected from a pre-built drawing frame library. The target drawing frame corresponding to each 2D drawing image to be generated is chosen. For example, if there are five initial 2D images, including the left, right, front, rear, and top views of a 3D solid, and the goal is to print the left, right, front, and rear views on one sheet, and the top view on a separate sheet, the drawing frame is selected from the pre-built library. This ensures that the left, right, front, and rear views share a common target drawing frame, while the top view corresponds to a separate target drawing frame. To facilitate the generation of 2D drawings, this application pre-builds widely used drawing frame models for direct selection during the 2D drawing image creation process. Users can also customize and create drawing frame models for direct use in subsequent 2D drawing image creation. Users can freely choose drawing frames according to their needs, offering flexibility and convenience, thus improving the efficiency of 2D drawing generation.

[0075] Step S204: Determine the initial two-dimensional images of each target corresponding to the target two-dimensional drawing image;

[0076] In the specific implementation of this step, two-dimensional drawing images corresponding to each of the initial two-dimensional images can be constructed separately according to actual needs, or multiple initial two-dimensional images can be used to construct a single two-dimensional drawing image. For example, when there are five initial two-dimensional images, including the left view, right view, front view, rear view, and top view of a three-dimensional solid figure, the top view is determined to correspond to one target two-dimensional drawing image; the left and right views are determined to correspond to one target two-dimensional drawing image; and the front and rear views are determined to correspond to one target two-dimensional drawing image, ultimately resulting in three two-dimensional drawing images. As another example, when there are three initial two-dimensional images, including the left view, front view, and rear view of a three-dimensional solid figure, two-dimensional drawing images are constructed for each of the three initial two-dimensional images. The first two-dimensional drawing image is determined to be the initial two-dimensional drawing image corresponding to the left view, the second two-dimensional drawing image is determined to be the initial two-dimensional drawing image corresponding to the front view, and the third two-dimensional drawing image is determined to be the initial two-dimensional drawing image corresponding to the rear view, ultimately resulting in three two-dimensional drawing images. For example, when there are five initial two-dimensional images, including the left view, right view, front view, rear view, and top view of a three-dimensional solid figure, and when it is finally necessary to print all the views on a two-dimensional drawing sheet, the final two-dimensional drawing image is one. The target drawing frame corresponding to the five initial two-dimensional images is determined to obtain a final two-dimensional drawing image.

[0077] Step S205: Adjust each of the initial two-dimensional images of the target according to a preset ratio to obtain each scaled image corresponding to the target two-dimensional drawing image;

[0078] In the specific implementation process of this step, the size of the device object in the initial two-dimensional image is the same as the actual size of the device object. It is necessary to scale and adjust the current initial two-dimensional image according to a preset ratio to obtain each scaled image.

[0079] Step S206: Based on each of the scaled images and the target drawing frame, construct the target two-dimensional drawing image to obtain each of the two-dimensional drawing images;

[0080] In this step, each scaled image is placed into a predetermined area in the target drawing, and the area and size of each scaled image are adjusted to construct the target two-dimensional drawing image. Simultaneously, based on each scaled image, a configuration file corresponding to each scaled image is generated. The configuration file includes data information such as view name, display scale, offset distance, and rotation matrix. This application achieves the saving and application of the image slicing configuration file function to save the user's image slicing settings, generating a file in a predetermined format. This predetermined format can be an XML file, and it can be reused repeatedly. Furthermore, the configuration file can be applied to other 3D projects with similar project configurations. This application implements the function of saving the image slicing configuration file. When applying the image slicing configuration file, it is necessary to obtain various data of the clipping frame, dynamic view setting data, and view identifiers in the view geometry information, etc., all of which are saved in the configuration file. When a new project applies the configuration file, it is necessary to extract various data, create clipping frames and views, and set the dynamic views and view identifiers one by one.

[0081] Step S207: Based on each of the scaled images, create an image to be labeled associated with each of the scaled images;

[0082] In this step, an image to be labeled is constructed based on each of the scaled images and associated with each scaled image. Labeling is performed on the image to be labeled, and labeling tools include grid annotation, configuration icon annotation, pipe annotation, electrical annotation, and instrument annotation, etc. The image to be labeled is an external drawing file generated by exporting each of the scaled images, and the labeling is performed within the external drawing file.

[0083] Step S208: Perform parameter annotation on each object in each of the images to be annotated, according to the image annotation category and object category corresponding to each object, to obtain the external annotation image corresponding to each of the images to be annotated;

[0084] In this step, for each object in the image to be labeled, the devices are grouped based on their corresponding device number, first device centerline spacing, second device centerline spacing, and device category to obtain multiple device groups. Specifically, the first device centerline spacing can be the horizontal device centerline spacing, and the second device centerline spacing can be the vertical device centerline spacing. The device categories include: equipment, pipes, cable trays, cables, instruments, etc. Device objects of the same category are grouped according to the first device centerline spacing and the second device centerline spacing. Device objects of the same category whose first device centerline spacing is less than a first preset threshold and whose second device centerline spacing is less than a second preset threshold are grouped together to obtain several device groups. The first and second preset thresholds can be set according to actual needs. Based on each of the images to be labeled, an image labeling category corresponding to each image to be labeled is determined. The image labeling category includes: a planar image labeling category and a sectional elevation image labeling category. The axis numbers of the horizontal and vertical axes of the images to be labeled in the planar image labeling category are sequentially labeled to obtain each first axis grid. The axis numbers of the vertical axes of the images to be labeled in the sectional elevation image labeling category are sequentially labeled to obtain each second axis grid. Based on each first axis grid and each second axis grid, the equipment in each equipment group is labeled to obtain the labeled image corresponding to each image to be labeled.

[0085] Step S209: Based on each of the external annotation images, refresh the parameters of each of the two-dimensional drawing images to obtain a two-dimensional annotation image corresponding to each of the two-dimensional drawing images;

[0086] In this step, the parameters of each of the two-dimensional drawing images are refreshed based on the external annotation images. The parameters annotated in the external annotation images are mapped to the corresponding positions in each of the two-dimensional drawing images, resulting in a two-dimensional annotation image corresponding to each of the two-dimensional drawing images. This application implements a function to save drawing information, allowing information to be filled into the corresponding positions on the drawing and saved. The user inputs information into a list, and the program fills the list content into the file attributes. After the file attributes are updated, they are automatically refreshed onto the text nodes in the drawing frame.

[0087] Step S210: Based on each of the two-dimensional annotated images, select the drawing generation format corresponding to each of the two-dimensional annotated images, and generate a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images.

[0088] In this step, the drawing generation formats include PDF, DGN, DWG, etc. When generating two-dimensional drawings, any target type can be selected from the aforementioned generation formats. This application achieves automatic export of drawings and compositing them into a single file. The drawings to be printed are selected, and each drawing is referenced to a new file. The two-dimensional drawings are arranged in a certain order and spacing and then saved.

[0089] This application obtains a three-dimensional solid image by performing abnormal parameter processing on an initial three-dimensional solid model and a pre-created initial three-dimensional solid graphic; it then performs image slicing on the three-dimensional solid graphic to obtain initial two-dimensional images corresponding to each viewpoint; based on several preset drawing frames, it determines the target drawing frame corresponding to each two-dimensional drawing image to be generated; it determines each target initial two-dimensional image corresponding to the target two-dimensional drawing image; it adjusts each of the target initial two-dimensional images according to a preset ratio to obtain each scaled image corresponding to the target two-dimensional drawing image; and based on each scaled image and the target drawing frame, it constructs the target two-dimensional drawing. The method involves generating two-dimensional images, creating scaled images, and creating annotated images associated with each scaled image. For each object in the annotated image, parameters are labeled according to the image annotation category and object category corresponding to each object, resulting in an external annotation image corresponding to each annotated image. Based on the external annotation images, the parameters of each two-dimensional drawing image are refreshed to obtain a two-dimensional annotation image corresponding to each two-dimensional drawing image. Finally, based on the two-dimensional annotation images and selecting a drawing generation format corresponding to each two-dimensional annotation image, a two-dimensional drawing of the target type corresponding to each two-dimensional annotation image is generated. This two-dimensional image generation method can shorten the drawing time for generating two-dimensional drawings based on three-dimensional graphics and improve the efficiency of two-dimensional drawing output.

[0090] Another embodiment of this application provides a two-dimensional drawing generation device, such as... Figure 3 As shown, it includes:

[0091] Module 1: Used to slice pre-constructed 3D graphics to obtain initial 2D images corresponding to each viewpoint;

[0092] Drawing matching module 2: used to perform drawing model matching for each of the initial two-dimensional images based on each predetermined drawing frame drawing model, so as to obtain at least one two-dimensional drawing image containing several initial two-dimensional images;

[0093] Annotation module 3: used to annotate each object in each of the two-dimensional drawing images with parameters according to the image annotation category and object category corresponding to each object, so as to obtain a two-dimensional annotated image corresponding to each of the two-dimensional drawing images;

[0094] Drawing generation module 4: is used to generate two-dimensional drawings of the target type corresponding to each of the two-dimensional annotated images by selecting the drawing generation format corresponding to each of the two-dimensional annotated images.

[0095] In the specific implementation process, the two-dimensional drawing generation device further includes: an abnormal parameter processing module, which is specifically used to: obtain parameter data corresponding to each object in the initial three-dimensional drawing, wherein the parameter data includes at least one or more of the following: equipment name information, equipment tag number information, and equipment centerline information; filter each object based on the parameter data and using preset filtering rules to obtain each abnormal object; add each abnormal object to each preset abnormal list; and process the abnormal parameter data of each abnormal object contained in each abnormal list according to the abnormal type corresponding to each abnormal list to obtain the three-dimensional solid drawing.

[0096] In the specific implementation process, the abnormal parameter processing module is also used to: determine whether the device tag number information and device name information of each object meet the preset conditions, and when the preset conditions are not met, obtain the abnormal object with missing information; obtain each first object that meets the preset conditions; determine whether the device tag number information of each first object is repeated, and obtain the abnormal object with repeated device tag numbers; obtain the number of device center lines of each object, and obtain the abnormal object with missing center lines.

[0097] In the specific implementation process, the obtaining module 1 is specifically used to: obtain the view range corresponding to each perspective of the three-dimensional solid graphic; calculate the union of each view range to obtain the clipping frame range for cutting to generate each initial two-dimensional image; and perform image cutting processing on the three-dimensional solid graphic based on the predetermined view matrix, rotation matrix, clipping plane, rotation direction and the clipping frame range to obtain each initial two-dimensional image.

[0098] In the specific implementation process, the drawing matching module 2 is specifically used for: determining the target drawing frame corresponding to each two-dimensional drawing image to be generated based on several preset drawing frames; determining each target initial two-dimensional image corresponding to the target two-dimensional drawing image; adjusting each target initial image according to a preset ratio to obtain each scaled image corresponding to the target two-dimensional drawing image; and constructing the target two-dimensional drawing image based on each scaled image and the target drawing frame to obtain each two-dimensional drawing image.

[0099] In the specific implementation process, the annotation module 3 is specifically used to: create an image to be annotated associated with each of the scaled images; perform parameter annotation on each object in each of the images to be annotated, according to the image annotation category and object category corresponding to each object, to obtain an external annotation image corresponding to each of the images to be annotated; and refresh the parameters of each of the two-dimensional drawing images based on each of the external annotation images to obtain a two-dimensional annotation image corresponding to each of the two-dimensional drawing images.

[0100] In the specific implementation process, the annotation module 3 is further used to: group the objects in each of the images to be annotated according to the corresponding device number, the first device centerline spacing, the second device centerline spacing, and the device category to obtain multiple device groups; determine the image annotation category corresponding to each of the images to be annotated, the image annotation category including: planar image annotation category and sectional elevation image annotation category; sequentially annotate the axis numbers of the horizontal and vertical axes of the images to be annotated in the planar image annotation category to obtain each first axis grid; sequentially annotate the axis numbers of the vertical axes of the images to be annotated in the sectional elevation image annotation category to obtain each second axis grid; and annotate the devices in each device group based on each first axis grid and each second axis grid to obtain the external annotation image corresponding to each of the images to be annotated.

[0101] This application obtains initial 2D images corresponding to various viewpoints by slicing a pre-constructed 3D graphic; it then performs frame drawing model matching on each of the initial 2D images based on predetermined frame drawing models to obtain at least one 2D drawing image containing several initial 2D images; it further annotates each object in each 2D drawing image with parameters according to the image annotation category and object category corresponding to each object, obtaining 2D annotation images corresponding to each 2D drawing image; and finally, based on each 2D annotation image and selecting a drawing generation format corresponding to each 2D annotation image, it generates a 2D drawing of the target type corresponding to each 2D annotation image. The 2D drawing generation method in this application improves the efficiency of 2D drawing generation.

[0102] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps:

[0103] Step 1: Perform image slicing on the pre-constructed 3D graphics to obtain the initial 2D images corresponding to each viewpoint;

[0104] Step 2: Based on each predetermined drawing frame drawing model, perform drawing frame drawing model matching for each of the initial two-dimensional images to obtain at least one two-dimensional drawing image containing several initial two-dimensional images;

[0105] Step 3: For each object in each of the two-dimensional drawing images, perform parameter annotation according to the image annotation category and object category corresponding to each object to obtain a two-dimensional annotation image corresponding to each of the two-dimensional drawing images;

[0106] Step 4: Based on each of the two-dimensional annotated images, select the drawing generation format corresponding to each of the two-dimensional annotated images, and generate a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images.

[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0109] The specific implementation process of the above method steps can be found in the embodiments of the above arbitrary two-dimensional drawing generation method, which will not be repeated here.

[0110] This application obtains initial 2D images corresponding to various viewpoints by slicing a pre-constructed 3D graphic; it then performs frame drawing model matching on each of the initial 2D images based on predetermined frame drawing models to obtain at least one 2D drawing image containing several initial 2D images; it further annotates each object in each 2D drawing image with parameters according to the image annotation category and object category corresponding to each object, obtaining 2D annotation images corresponding to each 2D drawing image; and finally, based on each 2D annotation image and selecting a drawing generation format corresponding to each 2D annotation image, it generates a 2D drawing of the target type corresponding to each 2D annotation image. The 2D drawing generation method in this application improves the efficiency of 2D drawing generation.

[0111] Another embodiment of this application provides an electronic device, which can be a server. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the program is executed by the processor, it implements the functions or steps of a two-dimensional drawing generation method on the server side.

[0112] In one embodiment, an electronic device is provided, which can be a client. The electronic device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When the program of the electronic device is executed by the processor, it implements the functions or steps of a two-dimensional drawing generation method on the client side.

[0113] Another embodiment of this application provides an electronic device, including at least a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program in the memory, performs the following method steps:

[0114] Step 1: Perform image slicing on the pre-constructed 3D graphics to obtain the initial 2D images corresponding to each viewpoint;

[0115] Step 2: Based on each predetermined drawing frame drawing model, perform drawing frame drawing model matching for each of the initial two-dimensional images to obtain at least one two-dimensional drawing image containing several initial two-dimensional images;

[0116] Step 3: For each object in each of the two-dimensional drawing images, perform parameter annotation according to the image annotation category and object category corresponding to each object to obtain a two-dimensional annotation image corresponding to each of the two-dimensional drawing images;

[0117] Step 4: Based on each of the two-dimensional annotated images, select the drawing generation format corresponding to each of the two-dimensional annotated images, and generate a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images.

[0118] The specific implementation process of the above method steps can be found in the embodiment of the above two-dimensional drawing generation method, which will not be repeated here.

[0119] This application obtains initial 2D images corresponding to various viewpoints by slicing a pre-constructed 3D graphic; it then performs frame drawing model matching on each of the initial 2D images based on predetermined frame drawing models to obtain at least one 2D drawing image containing several initial 2D images; it further annotates each object in each 2D drawing image with parameters according to the image annotation category and object category corresponding to each object, obtaining 2D annotation images corresponding to each 2D drawing image; and finally, based on each 2D annotation image and selecting a drawing generation format corresponding to each 2D annotation image, it generates a 2D drawing of the target type corresponding to each 2D annotation image. The 2D drawing generation method in this application improves the efficiency of 2D drawing generation.

[0120] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. A method for generating two-dimensional drawings, characterized in that, include: The pre-constructed 3D graphics are sliced ​​to obtain the initial 2D images corresponding to each viewpoint; Based on each predetermined drawing frame model, the initial two-dimensional image is matched with the drawing frame model to obtain at least one two-dimensional drawing image containing several initial two-dimensional images. Each object in each of the two-dimensional drawing images is labeled with parameters according to the image labeling category and object category corresponding to each object, to obtain a two-dimensional labeled image corresponding to each of the two-dimensional drawing images; Based on each of the two-dimensional annotated images, a drawing generation format corresponding to each of the two-dimensional annotated images is selected, and a two-dimensional drawing of the target type corresponding to each of the two-dimensional annotated images is generated; The step of slicing a pre-constructed three-dimensional graphic to obtain initial two-dimensional images corresponding to each viewpoint specifically includes: Obtain the view range corresponding to each perspective of the three-dimensional graphic; Calculate the union of the views to obtain the clipping box range used to generate the initial two-dimensional images; The three-dimensional solid graphic is sliced ​​based on a predetermined view matrix, rotation matrix, clipping plane, rotation direction, and clipping box range to obtain the initial two-dimensional images.

2. The method as described in claim 1, characterized in that, Before slicing the pre-constructed 3D solid image, the method further includes: processing abnormal parameters of the pre-created initial 3D solid image to obtain the 3D solid image, specifically including: Obtain parameter data corresponding to each object in the initial three-dimensional solid figure. The parameter data includes at least one or more of the following: equipment name information, equipment tag number information, and equipment centerline information. Based on the parameter data, each object is filtered using preset filtering rules to obtain each abnormal object; Add each of the aforementioned abnormal objects to the respective preset abnormal lists; Based on the exception type corresponding to each of the exception lists, the exception parameter data of each exception object contained in each exception list are processed one by one to obtain the three-dimensional graphic.

3. The method as described in claim 2, characterized in that, The step of filtering each object based on the parameter data and using preset filtering rules to obtain each abnormal object specifically includes: Determine whether the device tag number information and device name information of each object meet the preset conditions. If the preset conditions are not met, obtain the abnormal object with missing information. Obtain each first object that meets the preset conditions; Determine whether the device tag number information of each of the first objects is duplicated, and obtain the abnormal objects with duplicate device tag numbers; The number of device centerlines for each of the objects is obtained, and abnormal objects with missing centerlines are identified.

4. The method as described in claim 1, characterized in that, The step of matching the initial two-dimensional images with the drawing model of each predetermined drawing frame to obtain at least one two-dimensional drawing image containing several initial two-dimensional images specifically includes: Based on several preset drawing frame models, the target drawing frame corresponding to each two-dimensional drawing image to be generated is determined. Determine the initial two-dimensional images of each target corresponding to the target two-dimensional drawing image; Each of the initial two-dimensional images of the target is adjusted according to a preset ratio to obtain each scaled image corresponding to the target two-dimensional drawing image; Based on the scaled images and the target drawing frame, the target two-dimensional drawing image is constructed to obtain the two-dimensional drawing images.

5. The method as described in claim 4, characterized in that, The step of annotating each object in each of the two-dimensional drawing images with parameters according to the image annotation category and object category corresponding to each object to obtain a two-dimensional annotated image corresponding to each of the two-dimensional drawing images specifically includes: Based on each of the scaled images, create an image to be labeled that is associated with each of the scaled images; Each object in each of the images to be labeled is labeled with parameters according to the image labeling category and object category corresponding to each object, to obtain an external labeled image corresponding to each of the images to be labeled. Based on each of the externally labeled images, the parameters of each of the two-dimensional drawing images are refreshed to obtain a two-dimensional labeled image corresponding to each of the two-dimensional drawing images.

6. The method as described in claim 5, characterized in that, The step of annotating each object in each of the images to be annotated with parameters according to the image annotation category and object category corresponding to each object, to obtain an external annotation image corresponding to each of the images to be annotated, specifically includes: For each object in each of the images to be labeled, the devices are grouped based on the device number, the first device centerline spacing, the second device centerline spacing, and the device category to obtain multiple device groups; Based on each of the images to be labeled, an image labeling category corresponding to each of the images to be labeled is determined. The image labeling category includes: a planar image labeling category and a sectional / elevation image labeling category. The horizontal and vertical axis numbers of the images to be labeled in the planar image labeling category are sequentially labeled to obtain each first axis grid; the vertical axis numbers of the images to be labeled in the sectional elevation image labeling category are sequentially labeled to obtain each second axis grid. Based on each of the first grid lines and each of the second grid lines, the equipment in each equipment group is labeled to obtain an external labeled image corresponding to each of the images to be labeled.

7. A two-dimensional drawing generation apparatus, used to implement the two-dimensional drawing generation method as described in any one of claims 1 to 6, characterized in that, include: The acquisition module is used to slice pre-constructed 3D graphics to obtain initial 2D images corresponding to each viewpoint. Drawing matching module: used to match the drawing model of each initial two-dimensional image with the drawing model of each predetermined drawing frame, so as to obtain at least one two-dimensional drawing image containing several initial two-dimensional images; Annotation module: used to annotate each object in each of the two-dimensional drawing images with parameters according to the image annotation category and object category corresponding to each object, so as to obtain a two-dimensional annotated image corresponding to each of the two-dimensional drawing images; Drawing generation module: used to generate two-dimensional drawings of the target type corresponding to each of the two-dimensional annotated images by selecting the drawing generation format corresponding to each of the two-dimensional annotated images.

8. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the two-dimensional drawing generation method according to any one of claims 1-6.

9. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the two-dimensional drawing generation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Drawing data conformity checking method based on diagram topology structure

    CN102222132A

  • Method and system for automatically generating two-dimensional engineering drawing based on three-dimensional model

    CN115344905A

  • Method and device for inserting view in drawing, equipment and storage medium

    CN115391864A

  • Automatic labeling method and system for pipeline three-dimensional building information model

    CN115510525A