CAD-based wall model generation method, apparatus and device, and storage medium

Through the CAD-based wall model generation method, the CAD file is parsed and the wall side and top surface models are generated, which solves the problem of incorrect processing of complex top surface structures in the existing technology and achieves higher model generation accuracy and ease of use. sex.

CN118734416AActive Publication Date: 2024-10-01TUS DIGITAL DISPLAY TECH (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411223581.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-10-01
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

When the existing technology converts two-dimensional CAD drawings into three-dimensional wall models, especially when dealing with complex top structures, errors are prone to occur, resulting in inaccuracies in model generation.

Method used

Using a CAD-based wall model generation method, by parsing the CAD file, the graphic element group is obtained and converted into a bottom and top vertex array, combined with the external height value to generate a total vertex array, and an index is added to generate the wall side and top triangle arrays , and then build the side and top surface models of the wall to improve the accuracy of the model.

Benefits of technology

It reduces the error rate of model generation and improves the accuracy of wall model generation. It is suitable for accurate processing of complex structures and is suitable for use by non-professional designers and amateurs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734416A_ABST
    Figure CN118734416A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of three-dimensional modeling, in particular to a wall model generation method and device based on CAD, equipment and a storage medium. The method comprises the following steps: analyzing a target CAD file to obtain a graphic element group; converting each graphic element in the graphic element group to obtain a bottom surface vertex array; acquiring a height value, and determining a total vertex array according to the height value and the bottom vertex array; adding an index to the total vertex array to generate a wall surface triangular array of the wall side surface model, and performing triangulation on the wall surface triangular array to generate a top surface triangular array of the wall top surface; according to the bottom face vertex array, the total vertex array, the wall face triangle array and the top face triangle array, a top face model and a side face model of the wall body are generated, so that the wall body model is divided into the wall side face and the wall top face to be generated respectively, the wall top face structure is processed more accurately, and the model generation accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of three-dimensional modeling, and in particular to a CAD-based wall model generation method, device, equipment and storage medium. Background Art

[0002] For the current architectural design industry and interior design industry, having an accurate wall model that can express the three-dimensional structure of a floor or interior space can provide great convenience for designers.

[0003] There are many scene editing platforms on the market with similar functions to assist designers in scene design. However, these platforms either import models modified by professional modeling software in advance, or the imported CAD needs to be drawn according to fixed rules, which is not convenient for instant updates and has a high threshold for users. The following is a detailed explanation: Traditional 2D CAD drawing design: The field of architectural design has long relied on 2D CAD drawings, which describe the floor plan, structure, and functional areas of a building in detail, but can only display architectural information on a two-dimensional plane.

[0004] Typical CAD drawing formats include DWG and DXF, which are widely used in architectural design, construction drawings and engineering drawings. Although two-dimensional CAD drawings can provide detailed architectural information, their flat perspective limits designers and construction personnel's three-dimensional understanding of architectural space.

[0005] Development of 3D modeling: With the advancement of computer technology, 3D modeling technology has been more and more widely used in architectural design. 3D modeling can provide more intuitive and realistic architectural visual effects, helping designers to perform space analysis, collision detection and virtual reality display.

[0006] Common 3D modeling software includes Autodesk Revit, SketchUp, 3ds Max, etc. These software require professional modelers to build detailed 3D architectural models to display the spatial layout and structural details of the building.

[0007] Conversion of CAD drawings to 3D models: In order to convert 2D CAD drawings into 3D models, some auxiliary tools and software have appeared on the market. These tools can generate preliminary 3D building models based on the information in CAD drawings, reducing the workload of manual modeling.

[0008] However, the common method of generating wall models from architectural drawings usually generates the entire wall as a whole, which is prone to errors when encountering complex top surface structures and is not conducive to the accuracy of wall model generation.

[0009] Based on this, how to improve the accuracy of wall model generation is a technical problem that needs to be solved urgently. Summary of the invention

[0010] In order to overcome the shortcomings of the prior art, the present application provides a CAD-based wall model generation method, device, equipment and storage medium, so as to split the wall model into the wall side and wall top surfaces and generate them separately, thereby achieving more accurate processing of the wall top surface structure, reducing generation errors and improving the accuracy of model generation.

[0011] The technical solution adopted by this application to solve its technical problem is: A method for generating a wall model based on CAD, the method comprising: Parsing the target CAD file to obtain a graphic element group; Convert each graphic element in the graphic element group to obtain a bottom vertex array; Obtaining an externally inputted height value, so as to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array; Adding indices to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall; A top surface model and a side surface model of the wall are generated according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

[0012] Optionally, the step of converting each graphic element in the graphic element group to obtain a bottom vertex array includes: Parsing the graphic element to obtain the corresponding graphic element type and three-dimensional space coordinate information; Determine a bottom vertex array corresponding to the graphic element according to the graphic element type and the three-dimensional space coordinate information.

[0013] Optionally, the step of determining the bottom vertex array corresponding to the graphic element according to the graphic element type and the three-dimensional space coordinate information includes: If the graphic element is a circle, the bottom vertex array is determined using the following formula based on the three-dimensional space coordinate information: ; ; in, , Corresponding to the three-dimensional space coordinate information Axis coordinate values ​​and Axis coordinate values, is the radius of the circle, For the circular edge value, For the circular edge value, Used to express angles.

[0014] Optionally, the step of determining the top surface vertex array and the total vertex array according to the height value and the bottom surface vertex array includes: Traversing the bottom vertex array, and generating a top vertex array based on the height value; The top vertex array is concatenated with the bottom vertex array to generate the total vertex array.

[0015] Optionally, the step of adding indexes to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall includes: According to a preset first index rule, adjustment is performed based on the total vertex array to obtain a wall triangle array; The step of adjusting based on the total vertex array according to the preset first index rule includes: Determine whether the graphic element is a closed graphic. If the graphic element is a closed graphic, after the step of adjusting based on the total vertex array according to the preset first index rule, adjust based on the total vertex array adjusted according to the first index rule according to the preset second index rule to obtain the wall triangle array; The top surface vertex array is triangulated using an ear-cut method or a scan line method to obtain a top surface triangle array.

[0016] Optionally, after the step of generating a top surface model and a side surface model of a wall according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array, the method includes: Generate a structure mapping table according to the bottom surface vertex array, the total vertex array, the wall surface triangle array and the top surface triangle array; The top surface model and the side surface model are stored in corresponding attributes of the structure mapping table, and the key-value relationship of the structure mapping table is reversed to obtain a model vertex array table; Obtaining a model update instruction to search the model vertex array table to obtain an entry to be updated; Modifying the vertex coordinate data corresponding to the entry to be updated to obtain an updated entry; The update entry is added to a modification operation table of a corresponding structure to update a target wall model, wherein the target wall model is determined according to the model update instruction.

[0017] Optionally, the method further includes: Obtain an instruction for adding a wall top surface, and determine a plurality of wall side models of top surfaces to be generated; Based on the model vertex array table, determine the top vertex coordinate array corresponding to each of the wall side models; Sequentially splicing the top surface vertex coordinate arrays of each of the wall side models according to the model selection order to obtain a spliced ​​vertex array; Based on the spliced ​​vertex array, a top surface model corresponding to the instruction to add the top surface of the wall is generated.

[0018] A second aspect of the present application provides a CAD-based wall model generation device, comprising: A CAD file parsing module, used for parsing a target CAD file to obtain a graphic element group; A graphic element conversion module, used for converting each graphic element in the graphic element group to obtain a bottom surface vertex array; A vertex array calculation module, used for obtaining an externally inputted height value, so as to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array; A triangle array generation module, used for adding indexes to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall; The wall model creation module is used to generate a top surface model and a side surface model of the wall according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

[0019] A third aspect of the present application provides an electronic device, comprising: at least one processor and at least one memory, wherein the memory stores computer-readable instructions; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the above-mentioned CAD-based wall model generation method.

[0020] A fourth aspect of the present application provides a storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions are executed by a processor to implement the above-mentioned CAD-based wall model generation method.

[0021] The beneficial effects of the present application are as follows: parsing a CAD file that needs to be converted into a three-dimensional model to obtain a graphic element group in the file, the graphic element group including multiple graphic elements, such as rectangles, circles, polylines, etc., converting each graphic element to obtain a bottom vertex array, and then determining a total vertex array based on an externally input height value and the bottom vertex array; then adding an index to the total vertex array according to a preset index adding rule, thereby generating a wall triangle array of a wall side model, and obtaining a top triangle array based on the bottom vertex array in combination with triangulation, and then generating a top model and a side model of the wall based on the obtained vertex array and triangle array using a related three-dimensional engine, that is, generating a wall side and a wall top surface respectively, thereby reducing the error rate of model generation, thereby achieving a more accurate processing of the wall top surface structure, reducing generation errors, and improving the accuracy of model generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a flow chart of a method for generating a wall model based on CAD provided in an embodiment of the present application; Figure 2 It is a flowchart of the model updating method provided in the embodiment of the present application; Figure 3 It is a virtual structural schematic diagram of a CAD-based wall model generation device provided in this application; Figure 4 It is an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] The present application is further described below in conjunction with the accompanying drawings and embodiments.

[0024] The following will clearly and completely describe the concept, specific structure and technical effects of the present application in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. Based on the embodiments of the present application, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present application. In addition, all the connection / connection relationships involved in the patent do not simply refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features created in this application can be combined interactively without conflicting with each other.

[0025] Before describing the specific implementation of the CAD-based wall model generation method, the present application specifically describes the knowledge that needs to be understood in advance: 1. Three-dimensional models are made up of faces, and all models are "hollow", so at least three faces are required to form a "body"; 2. The faces of a 3D model are usually composed of triangular faces, and when we need to display a polygonal face, we need to divide the polygonal face into multiple triangular faces for combination; 3. Defining the shape of a 3D model usually requires a model's vertex coordinate array and triangle array. The triangle array is usually used to represent the surface of a 3D model. It is an integer array. Each entry corresponds to the subscript of the vertex coordinate array, which is used to indicate which three vertices constitute a triangle face. 4. About triangulation method: triangulation method includes but is not limited to ear cutting method, Delaunay algorithm and line scanning method. To facilitate understanding of the meaning of triangulation, this application uses ear cutting method as an example. It is worth noting that the actual application should not be limited by the embodiments provided in this application. Any application that adopts the technical concept of this application and applies the triangulation method to the solution belongs to the protection scope required by this application.

[0026] There are many ways to implement the ear cutting method, but the principle is to divide the triangle by cutting the triangle where the "ear" is located in sequence. The ear here refers to a vertex. Before confirming the ear, we need to distinguish between convex vertices and concave vertices. We can determine whether the vertex is a concave vertex based on whether the vertex angle is greater than 180°. >180° is a concave vertex, and <180° is a convex vertex. Assume that a convex vertex is Vi. If the triangle formed by the three vertices Vi-1, Vi, and Vi+1 does not contain any vertices, then the vertex is an ear.

[0027] Reference Figure 1 , Figure 1 Schematic diagram of the process of the wall model generation method based on CAD provided in the embodiment of the present application, including the following steps, which are specifically described below: In step S1, the target CAD file is parsed to obtain a group of graphic elements.

[0028] Specifically, the CAD file to be converted into a three-dimensional model is parsed to obtain a graphic element group in the file, which includes multiple graphic elements, such as rectangles, circles, polylines, etc. In this embodiment, relevant personnel can use a CAD parsing library (such as libdxfrw or dxflib) to read a CAD file in DWG or DXF format and filter out the main graphic elements from the CAD file.

[0029] More specifically, CAD files can usually be saved in two formats: DWG and DXF. The DXF format is more commonly used for data exchange between different CAD software. Here, taking the DXF format as an example, you can use common DXF parsing libraries such as libdxfrw and dxflib to read DXF element information. In addition, CAD plane drawings are mainly composed of different lines, which are referred to as graphic elements in the following content.

[0030] In order to lower the usage threshold, the solution provided in this application does not require standardized drawing rules for drawing. Since standardized CAD drawings are not made, the annotations and layer names may not correspond to the wall structure in the drawings (that is, there is no binding relationship at the data level), and the required corresponding elements cannot be found directly through characters. Therefore, it is necessary to use a parsing library to filter out all rectangles, circles, arcs, polylines and other graphic elements composed of points and lines in the drawings.

[0031] In step S2, each graphic element in the graphic element group is converted to obtain a bottom vertex array.

[0032] Specifically, each graphic element is converted to obtain a bottom vertex array, and this step specifically includes: Parsing the graphic element to obtain the corresponding graphic element type and three-dimensional space coordinate information; Determine a bottom vertex array corresponding to the graphic element according to the graphic element type and the three-dimensional space coordinate information.

[0033] Specifically, the target CAD file is screened for graphic elements composed of points and lines, such as rectangles, circles, arcs, and polylines, and the obtained graphic elements are converted into vertex arrays that can be used to describe the graphic elements through a calculation method corresponding to the graphic elements. The array is a three-dimensional coordinate array. Among them, the graphic elements are divided into two categories: curves and straight lines. For example, a curve graphic element can be a circle, and a straight line graphic element can be a polyline. In the embodiments provided in this application, a circle (curve) and a polyline (straight line) are used as examples for explanation: About polylines: After the CAD polylines are parsed by the parsing library, a three-dimensional coordinate array (x, y, 0) arranged in the drawing order can be obtained. This array is the vertex array required to draw the line.

[0034] Regarding the circle: If the graphic element is a circle, the bottom vertex array is determined using the following formula based on the three-dimensional space coordinate information: ; ; in, , Corresponding to the three-dimensional space coordinate information Axis coordinate values ​​and Axis coordinate values, is the radius of the circle, For the circular edge value, For the circular edge value, Used to express angles.

[0035] Specifically, if the graphic element is a circle, obtain the coordinate values ​​of its three spatial axes x, y, and z and the radius of the circle through analysis, take the x-axis coordinate value and the y-axis coordinate value, use the calculation formula, accumulate degrees from 0 to 360 to obtain the vertex array composed of (CircleX, CircleY, 0) used to describe the circle, where the larger the accumulated value of degrees, the closer the circle is to a perfect circle.

[0036] In step S3, an externally inputted height value is obtained to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array.

[0037] Specifically, the total vertex array is determined according to the height value and the bottom vertex array input externally. In this step, the top vertex array is also generated, which specifically includes the following steps: Traversing the bottom vertex array, and generating a top vertex array based on the height value; The top vertex array is concatenated with the bottom vertex array to generate the total vertex array.

[0038] Specifically, combined with the bottom vertex array, generating a surface from a line also requires external input of the height value dimensional information. Because the side of the wall is composed of multiple regular rectangles, the z-axis value of each bottom vertex coordinate can be modified to the corresponding height value to generate a new vertex array, namely the top vertex array.

[0039] In step S4, an index is added to the total vertex array to generate a wall triangle array of the wall side model, and triangulation is performed on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall.

[0040] Specifically, according to the preset index adding rule, the index is added to the total vertex array to generate the wall triangle array of the wall side model, and the top triangle array is obtained according to the bottom vertex array combined with triangulation. The index rule is customized by relevant personnel.

[0041] More specifically, the steps of adding indexes to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the wall top surface according to the top surface vertex array to generate a top surface triangle array of the wall top surface include: According to a preset first index rule, adjustment is performed based on the total vertex array to obtain a wall triangle array; The step of adjusting based on the total vertex array according to the preset first index rule includes: Determine whether the graphic element is a closed graphic. If the graphic element is a closed graphic, after the step of adjusting based on the total vertex array according to the preset first index rule, adjust based on the total vertex array adjusted according to the first index rule according to the preset second index rule to obtain the wall triangle array; The top surface vertex array is triangulated using an ear-cut method or a scan line method to obtain a top surface triangle array.

[0042] Specifically, a custom triangle array is made based on a known vertex array. In this application, a counterclockwise definition of a triangle array is taken as an example. Based on the cyclic accumulation of the first index rule, an index is added to the total vertex array. In addition, considering that the graphic elements have a closed attribute, if the graphic is closed, the second index rule is executed on the array adjusted by the first index rule to obtain a triangle array for corner triangle division; because the top and bottom surfaces of the model may be irregular and variable surfaces, it is necessary to use the ear cutting method or the scanning line method to triangulate the top surface of the model, so as to obtain the top surface triangle array; Considering that the bottom surface of the wall does not need to be observed in general, if there are special cases that need to be considered, the same steps as the top surface triangle array generation can be performed to obtain the bottom surface triangle array.

[0043] For example, the first index rule can use a loop, starting from 0 and gradually increasing to half the length of the total vertex array minus 1, with the loop variable i. In each loop, the following index is added to the triangle array: (i, i+1,SumVertexArray.Length / 2 +i , i+ 1, SumVertexArray.Length / 2+i+1,SumVertexArray.Length / 2 +i) Among them, SumVertexArray.Length refers to the length of the total vertex array. Further, considering that the graph has a closed attribute, such as the closed graph, a second index rule is added to the corresponding end of the total vertex array, for example: (SumVertexArray.Length / 2-1,0,SumVertexArray.Length-1, 0,SumVertexArray.Length / 2,SumVertexArray.Length-1) After completing the above steps, you can obtain the bottom vertex, top vertex, total model vertex, and triangle array used for wall triangle division of each graphic element in CAD.

[0044] In step S5, a top surface model and a side surface model of the wall are generated according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

[0045] Specifically, based on the obtained vertex array and triangle array, a relevant three-dimensional engine (such as UnrealEngine, Unity, three.js, etc.) is used to generate the top surface model and side surface model of the wall, that is, the wall side surface and wall top surface are generated respectively, thereby reducing the error rate of model generation, and then achieving more accurate processing of the wall top surface structure, reducing generation errors, and improving the accuracy of model generation.

[0046] Furthermore, in actual projects, CAD drawings may be updated frequently, and designers need to re-modify the 3D model according to the latest drawings. The above solution of the present application has provided a method for generating the side and top surfaces of the wall model respectively. The model generated by this method can be updated in the following way to conveniently update the wall model. Figure 2 , Figure 2 This is a flow chart of the model updating method provided in the embodiment of the present application. Figure 2 To explain in detail: In step S6, a structure mapping table is generated according to the bottom surface vertex array, the total vertex array, the wall surface triangle array and the top surface triangle array; In step S7, the top surface model and the side surface model are stored in corresponding attributes of the structure mapping table, and the key-value relationship of the structure mapping table is reversed to obtain a model vertex array table; In step S81, a model update instruction is obtained to search the model vertex array table to obtain entries to be updated; In step S91, the vertex coordinate data corresponding to the entry to be updated is modified to obtain an updated entry; In step S101, the update entry is added to the modification operation table of the corresponding structure to update the target wall model, and the target wall model is determined according to the model update instruction.

[0047] Specifically, a corresponding structure mapping table is defined, which is used to store the acquired top vertex array, bottom vertex array, total vertex array, wall triangle array, top triangle array, bottom triangle array and two meshes respectively. After the model data is stored in the structure mapping table, the table is used for relationship mapping between the graphic elements parsed by CAD and the generated wall, so as to facilitate model modification after subsequent file update; The top surface model and the side surface model are stored in the corresponding attributes of the structure mapping table, and the key-value relationship of the structure mapping table is reversed, thereby obtaining a model vertex array table for subsequent search and modification of the corresponding relationship. For the modification of the top surface of the side surface of the wall, the corresponding entry is retrieved from the model vertex array table, the corresponding vertex coordinate data is modified, and the updated entry is added to the modification operation table of the same structure, thereby realizing partial update of the model and reducing repeated generation of the model.

[0048] The above solution is applicable to deletion and modification type model updates. When deleting a wall, the corresponding entry is retrieved from the model vertex array table according to the selected wall model, and added to a deletion operation table of the same structure, and then the specified model object is destroyed. In some possible cases, it may be necessary to add the top surface of the wall in modification, deletion or other update items. The following is a specific description of this scenario: In step S82, an instruction to add a wall top surface is obtained, and a plurality of wall side models of the top surfaces to be generated are determined; In step S92, based on the model vertex array table, a top surface vertex coordinate array corresponding to each of the wall side models is determined; In step S102, the top surface vertex coordinate arrays of each of the wall side models are sequentially spliced ​​according to the model selection order to obtain a spliced ​​vertex array; In step S112, a top surface model corresponding to the instruction to add the top surface of the wall is generated based on the spliced ​​vertex array.

[0049] Specifically, for the scenario where the top surface of a wall needs to be added, multiple wall side models that need to generate the top surface are selected in the scene, the corresponding vertex array is found through the model vertex array table, and then the corresponding top surface vertex array is found from the structure mapping table; according to the order in which the models are selected, the multiple models are spliced ​​into a new vertex array, namely the spliced ​​vertex array, and then the above steps of generating the top surface model are executed to generate a new model top surface based on the spliced ​​vertex array.

[0050] It is worth noting that here we need to splice the vertex arrays in sequence according to the order in which the model is selected because the vertex array required for triangulation of irregular polygons is arranged clockwise or counterclockwise. If the order of vertices is irregular, triangulation cannot be performed.

[0051] In summary, this application has at least one of the following beneficial effects: 1. Compared with the existing solutions, this application is more user-friendly and flexible, does not require too many requirements and specifications for CAD drawings, and can be suitable for non-model professional designers and amateurs to generate and adjust accurate wall frame models that meet their needs through this solution, and can update the drawings in real time without affecting the modified parts of the model.

[0052] 2. This solution can be applied to most architectural and interior designs. It can quickly convert CAD drawings into the spatial layout structure of the building, and can be adjusted and optimized according to customer needs. At the same time, it can update the changes in the drawings to the model at any time, quickly display the scene structure to the customer, and assist designers to use this method to timely analyze the spatial structure and then carry out scene design.

[0053] The second aspect of the present application provides a CAD-based wall model generation device, please refer to Figure 3 , Figure 3 It is a virtual schematic diagram of a CAD-based wall model generation device provided in this application, including: The CAD file parsing module 100 is used to parse the target CAD file to obtain a graphic element group; A graphic element conversion module 200, configured to convert each graphic element in the graphic element group to obtain a bottom surface vertex array; The vertex array calculation module 300 is used to obtain an externally inputted height value, so as to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array; A triangle array generation module 400 is used to add indices to the total vertex array to generate a wall triangle array of the wall side model, and to perform triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall; The wall model creation module 500 is used to generate a top surface model and a side surface model of the wall according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

[0054] The CAD-based wall model generation device described in the embodiment of the present application can execute the CAD-based wall model generation method provided in the above embodiment. The CAD-based wall model generation device has the corresponding functional steps and beneficial effects of the CAD-based wall model generation method described in the above embodiment. Please refer to the above embodiment of the CAD-based wall model generation method for details. The embodiment of the present application will not be repeated here.

[0055] The present application also provides an electronic device. Figure 4 , Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include a processor and a memory, wherein the processor and the memory may be connected via a bus or other means. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various types of chips. The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the CAD-based wall model generation method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the CAD-based wall model generation method in the above method embodiment is realized.

[0056] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. The one or more modules are stored in the memory, and when executed by the processor, the CAD-based wall model generation method in the above-mentioned method embodiment is executed. The specific details of the above-mentioned electronic device can be understood by corresponding to the corresponding descriptions and effects in the above-mentioned method embodiment, and will not be repeated here. Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program, when executed, may include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

[0057] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0058] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims, the inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present application.

[0059] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.

Claims

1. A method for generating a wall model based on CAD, characterized in that: The method comprises: Parsing the target CAD file to obtain a graphic element group; Convert each graphic element in the graphic element group to obtain a bottom vertex array; Obtaining an externally inputted height value, so as to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array; Adding indices to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall; A top surface model and a side surface model of the wall are generated according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

2. The CAD-based wall model generation method according to claim 1, characterized in that: The step of converting each graphic element in the graphic element group to obtain a bottom vertex array comprises: Parsing the graphic element to obtain the corresponding graphic element type and three-dimensional space coordinate information; Determine a bottom vertex array corresponding to the graphic element according to the graphic element type and the three-dimensional space coordinate information.

3. The CAD-based wall model generation method according to claim 2, characterized in that: The step of determining the bottom vertex array corresponding to the graphic element according to the graphic element type and the three-dimensional space coordinate information comprises: If the graphic element is a circle, the bottom vertex array is determined using the following formula based on the three-dimensional space coordinate information: ; ; in, , Corresponding to the three-dimensional space coordinate information Axis coordinate values ​​and Axis coordinate values, is the radius of the circle, For the circular edge value, For the circular edge value, Used to express angles.

4. The CAD-based wall model generation method according to claim 1, characterized in that: The step of determining the top surface vertex array and the total vertex array according to the height value and the bottom surface vertex array comprises: Traversing the bottom vertex array, and generating a top vertex array based on the height value; The top vertex array is concatenated with the bottom vertex array to generate the total vertex array.

5. The CAD-based wall model generation method according to claim 4, characterized in that: The steps of adding indexes to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall include: According to a preset first index rule, adjustment is performed based on the total vertex array to obtain a wall triangle array; The step of adjusting based on the total vertex array according to the preset first index rule includes: Determine whether the graphic element is a closed graphic. If the graphic element is a closed graphic, after the step of adjusting based on the total vertex array according to the preset first index rule, adjust based on the total vertex array adjusted according to the first index rule according to the preset second index rule to obtain the wall triangle array; The top surface vertex array is triangulated using an ear-cut method or a scan line method to obtain a top surface triangle array.

6. The CAD-based wall model generation method according to claim 1, characterized in that: After the step of generating a top surface model and a side surface model of a wall according to the bottom surface vertex array, the total vertex array, the wall surface triangle array and the top surface triangle array, the method comprises: Generate a structure mapping table according to the bottom surface vertex array, the total vertex array, the wall surface triangle array and the top surface triangle array; The top surface model and the side surface model are stored in corresponding attributes of the structure mapping table, and the key-value relationship of the structure mapping table is reversed to obtain a model vertex array table; Obtaining a model update instruction to search the model vertex array table to obtain an entry to be updated; Modifying the vertex coordinate data corresponding to the entry to be updated to obtain an updated entry; The update entry is added to a modification operation table of a corresponding structure to update a target wall model, wherein the target wall model is determined according to the model update instruction.

7. The CAD-based wall model generation method according to claim 6, characterized in that: The method further comprises: Obtain an instruction for adding a wall top surface, and determine a plurality of wall side models of top surfaces to be generated; Based on the model vertex array table, determine the top vertex coordinate array corresponding to each of the wall side models; Sequentially splicing the top surface vertex coordinate arrays of each of the wall side models according to the model selection order to obtain a spliced ​​vertex array; Based on the spliced ​​vertex array, a top surface model corresponding to the instruction to add the top surface of the wall is generated.

8. A CAD-based wall model generation device, characterized in that: include: A CAD file parsing module, used for parsing a target CAD file to obtain a graphic element group; A graphic element conversion module, used for converting each graphic element in the graphic element group to obtain a bottom surface vertex array; A vertex array calculation module, used for obtaining an externally inputted height value, so as to determine a top surface vertex array and a total vertex array according to the height value and the bottom surface vertex array; A triangle array generation module, used for adding indexes to the total vertex array to generate a wall triangle array of the wall side model, and performing triangulation on the top surface of the wall according to the top surface vertex array to generate a top surface triangle array of the top surface of the wall; The wall model creation module is used to generate a top surface model and a side surface model of the wall according to the bottom surface vertex array, the total vertex array, the wall triangle array and the top surface triangle array.

9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein the memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the CAD-based wall model generation method according to any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by a processor to implement the CAD-based wall model generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Engineering drawing preprocessing method and device, electronic equipment and storage medium

    CN113205024A

  • Building CityGML modeling method combining house type plane graph and inclination model

    CN115186347A

  • Method, device, equipment and product for constructing building model in electronic map

    CN116257919A

  • Method and apparatus for generating 3D building model

    KR1020090038127A

  • Three-dimensional building information model generation systems and methods

    US20210049812A1