Model generation method and apparatus
By acquiring the target building structure and layers from two-dimensional drawings, a three-dimensional model is automatically generated, solving the problems of tedious and inefficient traditional model making and achieving efficient three-dimensional model generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2026-03-31
AI Technical Summary
In traditional architectural design, the process of converting two-dimensional drawings into three-dimensional models is cumbersome and inefficient.
By acquiring the target building structure and layers from two-dimensional drawings, determining the reference model based on the target primitives, and generating a three-dimensional model based on the reference model and the target primitives, automatic model conversion is achieved.
It simplifies the mold-making process and improves the efficiency and accuracy of mold making.
Smart Images

Figure CN113987649B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer-aided architectural design technology, and in particular to a model generation method and apparatus. Background Technology
[0002] In architectural design, it is usually necessary to recreate a three-dimensional model based on two-dimensional drawings.
[0003] In traditional technology, designers use computer-aided design (CAD) to obtain CAD drawings, and then manually convert these CAD drawings into a 3D model in building information modeling (BIM) to achieve the conversion from two-dimensional to three-dimensional.
[0004] However, the manual mold-making process is cumbersome and inefficient. Summary of the Invention
[0005] Therefore, it is necessary to provide a model generation method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems.
[0006] A model generation method, comprising:
[0007] Obtain the target building structure from the 2D drawing to be processed;
[0008] Obtain the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure;
[0009] A reference model is determined based on the target primitives, and a three-dimensional model of the target building structure is generated based on the reference model and the target primitives.
[0010] In one embodiment, determining the reference model based on the target primitives includes:
[0011] The initial reference model is determined based on the type of the target building structure that matches the target primitives;
[0012] The initial reference model is resized based on the target primitives to obtain the reference model.
[0013] In one embodiment, an initial reference model is determined based on the type of the target building structure, including:
[0014] If the target building structure is a door structure, then the initial reference model is determined to be the initial door model;
[0015] If the target building structure is a window structure, then the initial reference model is determined to be the initial window model.
[0016] In one embodiment, the initial reference model is resized based on the target primitives to obtain a reference model, including:
[0017] If the target building structure is a door structure, and the target primitive includes arc elements, then the radius of the arc elements is obtained as the model length.
[0018] Read the dimension annotations of the target primitives to obtain the model height and model thickness;
[0019] The initial gate model is adjusted based on its length, height, and thickness to obtain an adjusted initial gate model, which serves as a reference model.
[0020] In one embodiment, generating a 3D model of the target building structure based on a reference model and target primitives includes:
[0021] A reference model is generated using the center side of the arc element as the fixed side of the door, thus obtaining the three-dimensional model of the door.
[0022] In one embodiment, the initial reference model is resized based on the target primitives to obtain a reference model, including:
[0023] If the target building structure is a door structure, and the target primitive includes line elements but not arc elements, then the length of the target door line element is obtained as the model length; where the target door line element is a line element in the target primitive whose two ends intersect the wall edge line perpendicularly.
[0024] Read the dimension annotations of the target primitives to obtain the model height and model thickness;
[0025] The initial gate model is adjusted based on its length, height, and thickness to obtain an adjusted initial gate model, which serves as a reference model.
[0026] In one embodiment, generating a 3D model of the target building structure based on a reference model and target primitives includes:
[0027] A reference model is generated at the target line element of the door to obtain the three-dimensional model of the door.
[0028] In one embodiment, the initial reference model is resized based on the target primitives to obtain a reference model, including:
[0029] When the target building structure is a window structure, obtain the maximum distance between two parallel line elements in the target primitive as the model length;
[0030] The maximum distance between the window target line elements is obtained and used as the model thickness; where the window target line elements are perpendicular to the line elements with the maximum distance obtained.
[0031] Read the data from the first preset position in the dimension annotation of the target element to obtain the model height;
[0032] The initial window model is adjusted based on the model length, model height, and model thickness to obtain the adjusted initial window model, which serves as the reference model.
[0033] In one embodiment, generating a 3D model of the target building structure based on a reference model and target primitives includes:
[0034] Read the data from the second preset position in the dimension annotation of the target element to obtain the set height; where the set height is the distance between the bottom edge of the reference model and the ground;
[0035] Generate a reference model with a set height at the window target line element to obtain the 3D model of the window.
[0036] A model generation apparatus, comprising:
[0037] Structure acquisition is used to acquire the target building structure in the two-dimensional drawing to be processed.
[0038] The layer acquisition module is used to acquire the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure.
[0039] The model generation module determines a reference model based on the target primitives, and generates a 3D model of the target building structure based on the reference model and the target primitives.
[0040] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0041] Obtain the target building structure from the 2D drawing to be processed;
[0042] Obtain the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure;
[0043] A reference model is determined based on the target primitives, and a three-dimensional model of the target building structure is generated based on the reference model and the target primitives.
[0044] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0045] Obtain the target building structure from the 2D drawing to be processed;
[0046] Obtain the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure;
[0047] A reference model is determined based on the target primitives, and a three-dimensional model of the target building structure is generated based on the reference model and the target primitives.
[0048] The aforementioned model generation method, apparatus, computer equipment, and storage medium acquire the target building structure from the two-dimensional drawing to be processed, acquire the target layer corresponding to the target building structure, determine the reference model based on the target primitives, and generate a three-dimensional model of the target building structure based on the reference model and the target primitives. This achieves automatic model conversion from two-dimensional drawing to three-dimensional model, simplifies the model conversion process, and improves model conversion efficiency. Attached Figure Description
[0049] Figure 1 This is an internal structural diagram of a computer device in one embodiment;
[0050] Figure 2 This is a flowchart illustrating a model generation method in one embodiment;
[0051] Figure 3 This is a flowchart illustrating the process of obtaining the reference model in one embodiment;
[0052] Figure 4 This is a flowchart illustrating the process of obtaining a reference model for a single-leaf door structure in one embodiment.
[0053] Figure 5 This is a schematic diagram of the structure of an arc-shaped gate element in one embodiment;
[0054] Figure 6 This is a schematic diagram of the structure of a linear gate element in one embodiment;
[0055] Figure 7 This is a schematic diagram of a three-dimensional model of a single-leaf door structure in one embodiment;
[0056] Figure 8 This is a flowchart illustrating the process of obtaining a reference model for a double-leaf door structure in one embodiment.
[0057] Figure 9 This is a schematic diagram of a three-dimensional model of a double-leaf door structure in one embodiment;
[0058] Figure 10 This is a flowchart illustrating the process of obtaining the reference model corresponding to the window structure in one embodiment;
[0059] Figure 11 This is a schematic diagram of the structure of a window element in one embodiment;
[0060] Figure 12 This is a flowchart illustrating the process of obtaining the reference model corresponding to the window structure in one embodiment;
[0061] Figure 13This is a schematic diagram of a three-dimensional model of a window structure in one embodiment;
[0062] Figure 14 This is a structural block diagram of a model generation device in one embodiment. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0064] The model generation method provided in this application can be applied to, for example... Figure 1 The computer device shown includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a model generation method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0065] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0066] In one embodiment, such as Figure 2 As shown, a model generation method is provided, which can be applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0067] S210. Obtain the target building structure from the two-dimensional drawing to be processed.
[0068] Optionally, the two-dimensional drawing to be processed can be a two-dimensional CAD drawing, on which multiple architectural structures are drawn, such as door structures, window structures, column structures, wall structures, beam structures, slab structures, etc. The two-dimensional CAD drawing can be a top view of the entire building.
[0069] Prior to S210, the computer device performs structural analysis on the content drawn on the two-dimensional drawing to be processed, obtaining the layer to which each architectural element belongs. Each layer includes elements of the same architectural structure. For example, if the computer device analyzes the two-dimensional CAD drawing to be processed based on ODA (Open Design Alliance), it obtains layers that include the same architectural structure in the two-dimensional CAD drawing. For example, a door layer includes all door elements in the two-dimensional CAD drawing, and a window layer includes all window elements in the two-dimensional CAD drawing.
[0070] Optionally, the configuration interface of the computer device displays multiple structural selection options, such as door structure selection, window structure selection, column structure selection, wall structure selection, beam structure selection, etc. The computer device receives the user's structural selection operation on the configuration interface for multiple structural selection options to obtain the target building structure in the two-dimensional drawing to be processed selected by the user. For example, if the structural selection operation is to select the door structure option, the target building structure is the door structure.
[0071] S220. Obtain the target layer corresponding to the target building structure.
[0072] The target layer includes multiple target elements that match the target building structure.
[0073] Optionally, each structure selection option corresponds to a layer, and each layer includes elements of the same type of building structure. In response to the structure selection operation, the computer device acquires the target layer corresponding to the target building structure. For example, if the structure selection operation selects the door structure option, the target building structure is the door structure, and the computer device acquires the door layer corresponding to the door structure, which includes multiple door elements matching the door structure.
[0074] Optionally, the target layer may include only the elements that match the target building structure, or it may include both the elements that match the target building structure and the elements that match the remaining building structures in the two-dimensional drawing to be processed, and display the two types of elements separately.
[0075] S230. Determine the reference model based on the target primitives, and generate a three-dimensional model of the target building structure based on the reference model and the target primitives.
[0076] Specifically, the type of the reference model is determined based on the type of the target primitive, and the size of the reference model is determined based on the size of the target primitive, so as to obtain a reference model that matches both the type and size of the target primitive. The generation position of the reference model is determined based on the target primitive, and the reference model is generated at that generation position to obtain a three-dimensional model of the corresponding target building structure.
[0077] In this embodiment, the computer device obtains the target building structure in the two-dimensional drawing to be processed, obtains the target layer corresponding to the target building structure, determines the reference model based on the target primitives, and generates a three-dimensional model of the target building structure based on the reference model and the target primitives. This realizes automatic conversion from two-dimensional drawing to three-dimensional model, simplifies the conversion process, and improves conversion efficiency.
[0078] In one embodiment, to improve the accuracy of the generated 3D model relative to the target building structure in the 2D drawing to be processed, such as... Figure 3 As shown, the process of determining the reference model based on the target primitives in S230 above includes:
[0079] S310. Determine the initial reference model based on the type of the target building structure that matches the target primitive.
[0080] The initial reference model is the three-dimensional model of the building structure corresponding to the target building. Specifically, the type of the initial reference model is the same as the type of the target building structure.
[0081] Optionally, if the target building structure is a door structure, the computer device determines the initial reference model as the initial door model; if the target building structure is a window structure, the computer device determines the initial reference model as the initial window model.
[0082] S320. Adjust the size of the initial reference model according to the target primitives to obtain the reference model.
[0083] Specifically, the computer device determines the size of the target graphic element based on the two-dimensional drawing to be processed, and then adjusts the size of the initial reference model according to the size of the target graphic element to obtain a reference model that matches the type and size of the target graphic element.
[0084] In this embodiment, the computer device determines an initial reference model based on the type of the target building structure that matches the target primitives, and adjusts the size of the initial reference model according to the target primitives, thereby obtaining a reference model that matches both the type and size of the target primitives. The target primitives in the two-dimensional drawing to be processed correspond to the target building structure. The reference model obtained based on the type and size of the target primitives can accurately reproduce the target building structure in the two-dimensional drawing to be processed. Then, a three-dimensional model of the corresponding target building structure is obtained from the reference model, thereby improving the accuracy of the generated three-dimensional model in reproducing the target building structure in the two-dimensional drawing to be processed.
[0085] In one embodiment, the process of adjusting the dimensions differs depending on the type of target building structure, such as... Figure 4 As shown, the above S320 includes:
[0086] S410. If the target building structure is a door structure, and the target primitive includes arc elements, then obtain the radius of the arc elements as the model length.
[0087] Optionally, the two-dimensional drawing to be processed may include multiple types of building structures, and the graphic elements representing the same type of building structure may also include multiple types. For door structures, the type of door graphic element can be classified according to the basic graphic elements included in the door graphic element. Among them, the basic graphic element is the smallest unit that constitutes the graphic element, such as point elements, line elements, arc elements, etc.
[0088] Optionally, the gate primitive can be divided into categories based on whether it includes arc elements, such as... Figure 5 The arc-shaped gate primitive shown and Figure 6 The image shows a linear door element. When the target building structure is a door structure, the corresponding target element is the door element. If the target element includes arc elements, the computer can determine that the target element is a door. Figure 5 The circular arc-shaped door primitive shown (representing a single-leaf door structure) is used to obtain the radius of the arc element as the model length.
[0089] S420: Read the dimension annotations of the target primitives to obtain the model height and model thickness.
[0090] It should be noted that the 3D model is a solid model. Taking the 3D model of a door as an example, the 3D model of a door has three dimensional parameters: length L, height H, and thickness W. The model length determined by the computer equipment based on the above arc-shaped door primitive is the length L of the final 3D model of the door. The height H and thickness W of the 3D model of the door also need to be further determined.
[0091] Optionally, the computer device can read the dimension annotations on the target elements in the two-dimensional drawing to obtain the model height and model thickness, i.e., the height H and thickness W of the three-dimensional model of the door. Further, the computer device can obtain the aforementioned model height and model thickness from the dimension annotations on the target elements according to a preset reading rule. The preset reading rule reads the numeric characters in the dimension annotations and uses the numbers at specified positions as the corresponding model height and model thickness. For example, the preset reading rule reads the numeric characters in the dimension annotations and specifies that the first two digits of the numeric characters are the model thickness (in cm) and the last two digits are the model length (in dm). The computer device then processes the model according to this reading rule. Figure 5 By reading the dimension annotations of the arc-shaped door element shown, we can obtain that the model thickness of the corresponding arc-shaped door element is 10cm and the model height is 200cm.
[0092] Optionally, if the computer device does not read the dimension annotation of the target graphic element, the preset thickness dimension is used as the model thickness, and the preset height dimension is used as the model height.
[0093] S430. Adjust the initial door model according to the model length, model height and model thickness to obtain the adjusted initial door model, which serves as the reference model.
[0094] Specifically, when the target primitive is an arc-shaped door primitive, the initial door model is the initial arc-shaped door model. Here, the model length corresponds to the length of the initial arc-shaped door model, the model height corresponds to the height of the initial arc-shaped door model, and the model width corresponds to the height of the initial arc-shaped door model. After determining the model length, model height, and model thickness, the computer device adjusts the length of the initial arc-shaped door model to the model length, the height of the initial arc-shaped door model to the model height, and the thickness of the initial arc-shaped door model to the model thickness, thus obtaining the adjusted initial arc-shaped door model. This adjusted initial arc-shaped door model is then used as the reference model corresponding to the arc-shaped door primitive.
[0095] Accordingly, when the target primitive is an arc-shaped door primitive, the above-mentioned step S230, which generates a three-dimensional model of the target building structure based on the reference model and the target primitive, includes:
[0096] A reference model is generated using the center side of the arc element as the fixed side of the door, thus obtaining the three-dimensional model of the door.
[0097] Specifically, after obtaining the reference model corresponding to the arc-shaped door element, the computer device generates a reference model of a specific type and size with the center side of the arc element in the target element as the fixed side of the door, thus obtaining the three-dimensional model corresponding to the single-leaf door structure. Figure 7(Mid-shaded area). Optionally, the computer device can directly generate the above-mentioned 3D model based on the family file of a single-leaf 3D door structure, with the center side of the arc element in the target primitive as the fixed side of the door.
[0098] In this embodiment, when the target building structure is a door structure, if the target primitive includes arc elements, the radius of the arc elements is obtained as the model length, and the dimension annotations of the target primitive are read to obtain the model height and model thickness. The initial arc-shaped door model is then adjusted based on the model length, model height, and model thickness to obtain the adjusted initial arc-shaped door model, which serves as a reference model. A reference model is then generated using the center side of the arc element as the fixed side of the door, thus obtaining the 3D model of the single-leaf door structure. This achieves automatic model conversion from 2D drawings to 3D models for single-leaf door structures, simplifying the conversion process, improving conversion efficiency, and enhancing the accuracy of single-leaf door structure model conversion.
[0099] In one embodiment, when the target primitive is Figure 5 In the case of a linear door element (representing a double-leaf door structure), such as Figure 8 As shown, the above S320 includes:
[0100] S810. If the target building structure is a door structure, and the target primitive includes line elements but not arc elements, then obtain the length of the target door line element as the model length.
[0101] Among them, the door target line element is a line element in the target graphic element whose two ends intersect the wall edge line perpendicularly.
[0102] Specifically, when the target building structure is a door structure, the corresponding target graphic element is the door graphic element. If the target graphic element is identified to include line elements and exclude arc elements, the computer equipment can determine that the target graphic element is the door element. Figure 5 For a straight-line door primitive in the model, the length of the line element (ab line) that intersects the wall edge line at both ends is obtained as the model length.
[0103] S820: Read the dimension annotations of the target primitives to obtain the model height and model thickness.
[0104] S830. Adjust the initial door model according to the model length, model height and model thickness to obtain the adjusted initial door model, which serves as the reference model.
[0105] Similarly, to generate a 3D model of the door, in addition to determining the model length, the model height and model thickness also need to be confirmed. For details, please refer to S420-S430 in the above embodiments, which will not be repeated here. It should be noted that when the target primitive is a linear door primitive, the initial door model is the initial linear door model. Here, the model length corresponds to the length of the initial linear door model, the model height corresponds to the height of the initial linear door model, and the model width corresponds to the height of the initial linear door model. After determining the model length, model height, and model thickness, the computer device adjusts the length of the initial linear door model to the model length, the height of the initial linear door model to the model height, and the thickness of the initial linear door model to the model thickness, thus obtaining the adjusted initial linear door model. This adjusted initial linear door model is then used as the reference model corresponding to the linear door primitive.
[0106] Accordingly, when the target primitive is a linear door primitive, the above-mentioned step S230, which generates a 3D model of the target building structure based on the reference model and the target primitive, includes:
[0107] A reference model is generated at the target line element of the door to obtain the three-dimensional model of the door.
[0108] Specifically, after obtaining the reference model corresponding to the linear door element, the computer device generates a reference model of a specific type and size at the door target line element, thus obtaining the three-dimensional model corresponding to the double-leaf door structure. Figure 9 (Mid-shaded area). Alternatively, the computer device can directly generate the above-mentioned 3D model at the door target line element based on the family file of the double-leaf 3D door structure.
[0109] In this embodiment, when the target building structure is a door structure, if the target primitive includes line elements but not arc elements, the length of the line element (i.e., the door target line element) whose two ends intersect the wall edge line perpendicularly is obtained as the model length. The dimension annotations of the target primitive are read to obtain the model height and thickness. The initial straight-line door model is then adjusted based on the model length, height, and thickness to obtain the adjusted initial straight-line door model, which serves as a reference model. A reference model is then generated at the door target line element, thus obtaining the 3D model of the double-leaf door structure. This achieves automatic model conversion from 2D drawings to 3D models for double-leaf door structures, simplifying the conversion process, improving conversion efficiency, and enhancing the accuracy of double-leaf door structure model conversion.
[0110] In one embodiment, when the target building structure is a window structure, such as Figure 10 As shown, the above S320 includes:
[0111] S1010. When the target building structure is a window structure, obtain the maximum distance between two parallel line elements in the target primitive as the model length.
[0112] Specifically, when the target building structure is a window structure, the corresponding target primitive is a window primitive composed of multiple line elements. The computer device identifies and obtains the maximum distance between two parallel line elements in this target primitive, which is used as the model length. For example, as... Figure 11 The window primitive shown consists of 6 line elements from a to f. The computer device directly obtains the maximum distance between two parallel line elements from a to f as the model length, that is, the distance between line elements e and f is used as the model length.
[0113] S1020: Obtain the maximum distance between window target line elements, which is used as the model thickness.
[0114] Among them, the window target line element is perpendicular to the line element that achieves the maximum distance.
[0115] Similarly, to generate a 3D model of a window, in addition to determining the model length, the model height and thickness also need to be confirmed. Specifically, the computer device obtains the distance between line elements perpendicular to the line element with the maximum distance (i.e., the window target line element) in the window primitives, as the model thickness. See further... Figure 11 The line elements with the maximum distance are line elements e and f. Line elements a to d are all perpendicular to line elements e and f, that is, line elements a to d are the target line elements of the window. The computer device obtains the maximum distance between two line elements a to d as the model thickness, that is, the distance between line elements a and d is used as the model length.
[0116] S1030: Read the data from the first preset position in the dimension annotation of the target element to obtain the model height.
[0117] Optionally, the computer device can read data from a first preset position in the dimension annotation on the target primitive. The first preset position may be the first two numeric characters after the non-numeric characters in the dimension annotation to obtain the model height.
[0118] Optionally, if the computer device does not read the dimension annotation of the target element, the preset first height dimension is used as the model height.
[0119] S1040. Adjust the initial window model according to the model length, model height and model thickness to obtain the adjusted initial window model, which serves as the reference model.
[0120] Specifically, the model length corresponds to the length of the initial window model, the model height corresponds to the height of the initial window model, and the model width corresponds to the height of the initial window model. After determining the model length, model height, and model thickness, the computer device adjusts the length of the initial window model to the model length, the height of the initial window model to the model height, and the thickness of the initial window model to the model thickness, thus obtaining the adjusted initial window model, which is then used as the reference model.
[0121] Accordingly, when the target primitive is a window primitive, such as Figure 12 As shown, the process of generating a 3D model of the target building structure based on the reference model and target primitives in S230 above includes:
[0122] S1210. Read the data from the second preset position in the dimension annotation of the target element to obtain the set height.
[0123] The height is set to the distance between the bottom edge of the reference model and the ground (e.g., ...). Figure 13 (S in the middle).
[0124] Optionally, the computer device can read data from a second preset position in the dimension annotation on the target element. This second preset position can be a position adjacent to the first preset position, such as numeric characters in the dimension annotation excluding the first two numeric characters after the non-numeric characters, in order to obtain the set height.
[0125] Optionally, if the computer device does not read the dimension annotation of the target element, the preset second height dimension is used as the set height.
[0126] S1220. Generate a reference model with a set height at the window target line element to obtain the three-dimensional model of the window.
[0127] Specifically, after obtaining the reference model corresponding to the window primitive, the computer device generates a reference model with a set height and determined type and size at the window target line element, thus obtaining the three-dimensional model corresponding to the window structure. Figure 13 (Mid-shaded area). Alternatively, the computer device can directly generate the above-mentioned 3D model at the window target line element based on the family file of the 3D window structure.
[0128] In this embodiment, when the target building structure is a window structure, the maximum distance between two parallel line elements in the target primitive is obtained as the model length, and the maximum distance between the window target line elements is obtained as the model thickness. Data from the first preset position in the dimension annotation of the target primitive is read to obtain the model height. Then, the initial window model is adjusted based on the model length, model height, and model thickness to obtain the adjusted initial window model, which serves as a reference model. Next, data from the second preset position in the dimension annotation of the target primitive is read to obtain the set height, so that a reference model of the set height is generated at the window target line elements, thus obtaining the 3D model of the window. This achieves automatic conversion of window structures from 2D drawings to 3D models, simplifying the conversion process, improving conversion efficiency, and enhancing the accuracy of window structure conversion.
[0129] It should be understood that, although Figure 2-12 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated in this document, there is no strict order in which these steps are executed; they can be performed in other orders. Furthermore, Figure 2-12 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0130] In one embodiment, such as Figure 14 As shown, a model generation device is provided, including: a structure acquisition module 1401, a layer acquisition module 1402, and a model generation module 1403, wherein:
[0131] The structure acquisition module 1401 is used to acquire the target building structure in the two-dimensional drawing to be processed;
[0132] The layer acquisition module 1402 is used to acquire the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure;
[0133] The model generation module 1403 determines the reference model based on the target primitives, and generates a three-dimensional model of the target building structure based on the reference model and the target primitives.
[0134] In one embodiment, the model generation module 1403 is specifically used for:
[0135] The initial reference model is determined based on the type of the target building structure that matches the target primitives; the initial reference model is then sized according to the target primitives to obtain the final reference model.
[0136] In one embodiment, the model generation module 1403 is specifically used for:
[0137] If the target building structure is a door structure, then the initial reference model is determined to be the initial door model; if the target building structure is a window structure, then the initial reference model is determined to be the initial window model.
[0138] In one embodiment, the model generation module 1403 is specifically used for:
[0139] If the target building structure is a door structure, and the target primitive includes arc elements, then obtain the radius of the arc elements as the model length; read the dimension annotations of the target primitive to obtain the model height and model thickness; adjust the initial door model according to the model length, model height, and model thickness to obtain the adjusted initial door model, which serves as the reference model.
[0140] In one embodiment, the model generation module 1403 is specifically used for:
[0141] A reference model is generated using the center side of the arc element as the fixed side of the door, thus obtaining the three-dimensional model of the door.
[0142] In one embodiment, the model generation module 1403 is specifically used for:
[0143] If the target building structure is a door structure, and the target primitive includes line elements but not arc elements, then the length of the target door line element is obtained as the model length; where the target door line element is a line element in the target primitive whose two ends intersect the wall edge line perpendicularly; the dimension annotation of the target primitive is read to obtain the model height and model thickness; the initial door model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial door model, which is used as the reference model.
[0144] In one embodiment, the model generation module 1403 is specifically used for:
[0145] A reference model is generated at the target line element of the door to obtain the three-dimensional model of the door.
[0146] In one embodiment, the model generation module 1403 is specifically used for:
[0147] When the target building structure is a window structure, the maximum distance between two parallel line elements in the target primitive is obtained as the model length; the maximum distance between the window target line elements is obtained as the model thickness; wherein, the window target line elements are perpendicular to the line elements with the maximum distance obtained; the data of the first preset position in the dimension annotation of the target primitive is read to obtain the model height; the initial window model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial window model as the reference model.
[0148] In one embodiment, the model generation module 1403 is specifically used for:
[0149] Read the data from the second preset position in the dimension annotation of the target element to obtain the set height; where the set height is the distance between the bottom edge of the reference model and the ground; generate a reference model with the set height at the window target line element to obtain the three-dimensional model of the window.
[0150] Specific limitations regarding the model generation device can be found in the limitations of the model generation method described above, and will not be repeated here. Each module in the aforementioned model generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0151] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0152] Obtain the target building structure from the 2D drawing to be processed; obtain the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure; determine the reference model based on the target primitives, and generate a 3D model of the target building structure based on the reference model and the target primitives.
[0153] In one embodiment, the processor further performs the following steps when executing the computer program:
[0154] The initial reference model is determined based on the type of the target building structure that matches the target primitives; the initial reference model is then sized according to the target primitives to obtain the final reference model.
[0155] In one embodiment, the processor further performs the following steps when executing the computer program:
[0156] If the target building structure is a door structure, then the initial reference model is determined to be the initial door model; if the target building structure is a window structure, then the initial reference model is determined to be the initial window model.
[0157] In one embodiment, the processor further performs the following steps when executing the computer program:
[0158] If the target building structure is a door structure, and the target primitive includes arc elements, then obtain the radius of the arc elements as the model length; read the dimension annotations of the target primitive to obtain the model height and model thickness; adjust the initial door model according to the model length, model height, and model thickness to obtain the adjusted initial door model, which serves as the reference model.
[0159] In one embodiment, the processor further performs the following steps when executing the computer program:
[0160] A reference model is generated using the center side of the arc element as the fixed side of the door, thus obtaining the three-dimensional model of the door.
[0161] In one embodiment, the processor further performs the following steps when executing the computer program:
[0162] If the target building structure is a door structure, and the target primitive includes line elements but not arc elements, then the length of the target door line element is obtained as the model length; where the target door line element is a line element in the target primitive whose two ends intersect the wall edge line perpendicularly; the dimension annotation of the target primitive is read to obtain the model height and model thickness; the initial door model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial door model, which is used as the reference model.
[0163] In one embodiment, the processor further performs the following steps when executing the computer program:
[0164] A reference model is generated at the target line element of the door to obtain the three-dimensional model of the door.
[0165] In one embodiment, the processor further performs the following steps when executing the computer program:
[0166] When the target building structure is a window structure, the maximum distance between two parallel line elements in the target primitive is obtained as the model length; the maximum distance between the window target line elements is obtained as the model thickness; wherein, the window target line elements are perpendicular to the line elements with the maximum distance obtained; the data of the first preset position in the dimension annotation of the target primitive is read to obtain the model height; the initial window model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial window model as the reference model.
[0167] In one embodiment, the processor further performs the following steps when executing the computer program:
[0168] Read the data from the second preset position in the dimension annotation of the target element to obtain the set height; where the set height is the distance between the bottom edge of the reference model and the ground; generate a reference model with the set height at the window target line element to obtain the three-dimensional model of the window.
[0169] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0170] Obtain the target building structure from the 2D drawing to be processed; obtain the target layer corresponding to the target building structure; the target layer includes multiple target primitives that match the target building structure; determine the reference model based on the target primitives, and generate a 3D model of the target building structure based on the reference model and the target primitives.
[0171] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0172] The initial reference model is determined based on the type of the target building structure that matches the target primitives; the initial reference model is then sized according to the target primitives to obtain the final reference model.
[0173] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0174] If the target building structure is a door structure, then the initial reference model is determined to be the initial door model; if the target building structure is a window structure, then the initial reference model is determined to be the initial window model.
[0175] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0176] If the target building structure is a door structure, and the target primitive includes arc elements, then obtain the radius of the arc elements as the model length; read the dimension annotations of the target primitive to obtain the model height and model thickness; adjust the initial door model according to the model length, model height, and model thickness to obtain the adjusted initial door model, which serves as the reference model.
[0177] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0178] A reference model is generated using the center side of the arc element as the fixed side of the door, thus obtaining the three-dimensional model of the door.
[0179] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0180] If the target building structure is a door structure, and the target primitive includes line elements but not arc elements, then the length of the target door line element is obtained as the model length; where the target door line element is a line element in the target primitive whose two ends intersect the wall edge line perpendicularly; the dimension annotation of the target primitive is read to obtain the model height and model thickness; the initial door model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial door model, which is used as the reference model.
[0181] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0182] A reference model is generated at the target line element of the door to obtain the three-dimensional model of the door.
[0183] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0184] When the target building structure is a window structure, the maximum distance between two parallel line elements in the target primitive is obtained as the model length; the maximum distance between the window target line elements is obtained as the model thickness; wherein, the window target line elements are perpendicular to the line elements with the maximum distance obtained; the data of the first preset position in the dimension annotation of the target primitive is read to obtain the model height; the initial window model is adjusted according to the model length, model height and model thickness to obtain the adjusted initial window model as the reference model.
[0185] In one embodiment, when the computer program is executed by the processor, it further performs the following steps:
[0186] Read the data from the second preset position in the dimension annotation of the target element to obtain the set height; where the set height is the distance between the bottom edge of the reference model and the ground; generate a reference model with the set height at the window target line element to obtain the three-dimensional model of the window.
[0187] 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 methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0188] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0189] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A model generation method characterized by comprising: The method comprises: performing structural analysis processing on the content drawn on the two-dimensional drawing paper to be processed, and identifying and separating a plurality of layers; each building structure corresponds to a layer, and each layer includes a plurality of graphemes of the same building structure; obtaining a target building structure in the two-dimensional drawing paper to be processed; obtaining a target layer corresponding to the target building structure from the plurality of layers; the target layer includes a plurality of target graphemes matched with the target building structure; the type of each target grapheme is divided according to a basic graph element in the target grapheme; the basic graph element includes a point element, a line element, and a circular arc element; determining an initial reference model according to the type of the target building structure, adjusting the size of the initial reference model according to the type and size of the target grapheme to determine a reference model, determining the generation position of the reference model based on the target grapheme, and generating a reference model at the generation position to obtain a three-dimensional model of the target building structure; wherein, in the case that the target building structure is a door structure, if the target grapheme includes a circular arc element, a three-dimensional model of a single-leaf door is generated with the center side of the circular arc element as the fixed side of the door; if the target grapheme includes a line element but does not include a circular arc element, a three-dimensional model of a double-leaf door structure is generated at a door target line element in the target grapheme, both ends of which are perpendicular to the wall line.
2. The method of claim 1, wherein, The method comprises: if the target building structure is a door structure, determining that the initial reference model is an initial door model; if the target building structure is a window structure, determining that the initial reference model is an initial window model.
3. The method of claim 2, wherein, The method comprises: adjusting the size of the initial reference model according to the type and size of the target grapheme to obtain the reference model.
4. The method according to any one of claims 1 to 3, characterized in that, The method comprises: if the target grapheme includes a circular arc element, obtaining the radius of the circular arc element as the model length; reading the size label of the target grapheme to obtain the model height and the model thickness; adjusting the initial door model according to the model length, the model height, and the model thickness to obtain the adjusted initial door model as the reference model.
5. The method according to any one of claims 1 to 3, characterized in that, The method comprises: if the target grapheme includes a line element but does not include a circular arc element, obtaining the length of the door target line element as the model length; wherein the door target line element is a line element in the target grapheme, both ends of which are perpendicular to the wall line; reading the size label of the target grapheme to obtain the model height and the model thickness; adjusting the initial door model according to the model length, the model height, and the model thickness to obtain the adjusted initial door model as the reference model.
6. The method according to any one of claims 1 to 3, characterized in that, The size adjustment of the initial reference model according to the type and size of the target graph element comprises: In the case that the target building structure is a window structure, the maximum distance between two parallel line elements in the target graph element is obtained as a model length; The maximum distance between window target line elements is obtained as a model thickness; wherein the window target line element is perpendicular to the line element from which the maximum distance is obtained; Data of a first preset position in the size annotation of the target graph element is read to obtain a model height; The initial window model is adjusted according to the model length, the model height and the model thickness to obtain an adjusted initial window model as the reference model.
7. The method of claim 6, wherein, The generation position of the reference model is determined based on the target graph element, and the reference model is generated at the generation position to obtain a three-dimensional model of the target building structure, which comprises: Data of a second preset position in the size annotation of the target graph element is read to obtain a setting height; wherein the setting height is the distance between the bottom edge of the reference model and the ground; The reference model of the setting height is generated at the window target line element to obtain a three-dimensional model of the window.
8. A model generation apparatus characterized by comprising: The device comprises: A structure acquisition module is configured to perform structural analysis processing on the content drawn on a to-be-processed two-dimensional drawing, identify and separate a plurality of layers; each building structure corresponds to a layer, and each layer comprises a plurality of graph elements of the same building structure; and a target building structure in the to-be-processed two-dimensional drawing is acquired. A layer acquisition module is configured to acquire a target layer corresponding to the target building structure; the target layer in the plurality of layers comprises a plurality of target graph elements matched with the target building structure; the type of each target graph element is divided according to a basic graph element in the target graph element; and the basic graph element comprises a point element, a line element and a circular arc element. A model generation module is configured to determine an initial reference model according to the type of the target building structure, perform size adjustment on the initial reference model according to the type and size of the target graph element to determine a reference model, determine a generation position of the reference model based on the target graph element, and generate the reference model at the generation position to obtain a three-dimensional model of the target building structure. In the case that the target building structure is a door structure, if the target graph element comprises a circular arc element, a three-dimensional model of a single-leaf door is generated with the center side of the circular arc element as a door fixed side; If the target graph element comprises a line element but does not comprise a circular arc element, a three-dimensional model of a double-leaf door structure is generated at a door target line element in the target graph element, both ends of which are perpendicular to the wall line.
9. The apparatus of claim 8, wherein, The model generation module is configured to: In the case that the target building structure is a window structure, the maximum distance between two parallel line elements in the target graph element is obtained as a model length; The maximum distance between window target line elements is obtained as a model thickness; wherein the window target line element is perpendicular to the line element from which the maximum distance is obtained; Data of a first preset position in the size annotation of the target graph element is read to obtain a model height; The initial window model is adjusted according to the model length, the model height and the model thickness, and the adjusted initial window model is obtained as the reference model.
10. The apparatus of claim 9, wherein, The model generation module is configured to: read data of a second preset position in a size mark of the target graphic element to obtain a setting height; wherein the setting height is a distance between a bottom edge of the reference model and the ground; generate the reference model with the setting height at the window target line element to obtain a three-dimensional model of a window.
Citation Information
Patent Citations
BIM model generation method and device, equipment and storage medium
CN111523167A
Model verification method, electronic equipment and related product
CN113010944A