A three-dimensional model generation method, device, storage medium and equipment

Through the three-dimensional model generation method driven by deep search and detection, the problems of cumbersomeness and high error rate in the construction of the three-dimensional model are solved, and the model is highly accurate and efficient.

CN120298606BActive Publication Date: 2025-08-22ZHEJIANG LAB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510775572.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-08-22
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The construction process of a three-dimensional model is cumbersome and has a high probability of error, which affects the accuracy and completeness of the model.

Method used

By obtaining the model structure file, using the deep search method to convert it into a model structure array, and reading the geometric shapes in turn for drawing, generating the target three-dimensional model, and detecting and re-drawing based on geometric features to improve accuracy.

Benefits of technology

It improves the accuracy, success rate and reliability of three-dimensional model generation, and improves the efficiency of finite element simulation tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120298606B_ABST
    Figure CN120298606B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, storage medium, and device for generating a three-dimensional model. The method obtains a model structure file; the model structure file includes multiple nodes, each node having node attribute information, the node attribute information including geometric shape information and Boolean attribute information, and the Boolean attribute information includes a Boolean indicator of the geometric shape under the node; converts the model structure file into a model structure array; the model structure array includes shape parameters of multiple geometric shapes and Boolean attributes of each geometric shape; sequentially reads the geometric shapes, draws the current geometric shape to obtain a corresponding geometric body, performs a Boolean operation on the geometric body and an intermediate model based on the corresponding Boolean attributes of the geometric body to generate a target three-dimensional model; and detects the target three-dimensional model based on its geometric features. If the model structure is abnormal, it is redrawn to obtain a new target three-dimensional model. In the embodiments of the present disclosure, the accuracy of model generation can be 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 method, apparatus, storage medium, and device for generating a three-dimensional model. Background Art

[0002] 3D model design and simulation are essential components of modern engineering design and analysis. The 3D model construction process often involves model repair, format conversion, and model verification. These complex and error-prone processes can negatively impact the accuracy and integrity of the 3D model. Summary of the Invention

[0003] In view of this, the present application provides a method, apparatus, storage medium and device for generating a three-dimensional model to at least solve the problems existing in the related art.

[0004] Specifically, this application is implemented through the following technical solutions:

[0005] This application provides a method for generating a three-dimensional model, comprising:

[0006] Acquire a model structure file; the model structure file includes a plurality of nodes, each node has node attribute information, the node attribute information includes geometric shape information and Boolean attribute information, the Boolean attribute information includes a Boolean indicator of the geometric shape under the node;

[0007] The model structure file is converted into a model structure array using a deep search method; the model structure array includes shape parameters of a plurality of geometric shapes and a Boolean attribute of each of the geometric shapes;

[0008] Reading geometric shapes in sequence, drawing the geometric shapes for the current geometric shapes to obtain corresponding geometric bodies, and performing Boolean operations on the geometric bodies and the intermediate model based on Boolean attributes corresponding to the geometric bodies to generate a target three-dimensional model;

[0009] The target three-dimensional model is detected based on the geometric features of the target three-dimensional model, and when the detection result indicates that the model structure of the target three-dimensional model is abnormal, the target three-dimensional model is redrawn to obtain a new target three-dimensional model.

[0010] Optionally, the converting the model structure file into a model structure array using a deep search method includes:

[0011] Reading nodes in sequence, and determining the node type of the current node for the current node; the node type includes a geometric shape node;

[0012] If the node type of the current node is the geometric shape node, record the shape parameters and Boolean attributes of the geometric shape under the current node to obtain the model structure array; or,

[0013] If the node type of the current node is the Boolean operation node, perform a Boolean operation on the geometric shape under the current node, and return to the step of "reading nodes in sequence, and judging the node type of the current node for the current node" until the node type of each node is the geometric shape node.

[0014] Optionally, the drawing of the current geometric shape to obtain a corresponding geometric body includes:

[0015] For the current geometric shape, determine the shape type of the current geometric shape; different shape types correspond to different shape drawing methods;

[0016] The current geometric shape is drawn using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body.

[0017] Optionally, the shape type includes a cylinder type; and the drawing of the current geometric shape using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body includes:

[0018] If the shape type of the current geometric shape is the cylinder type, the cylindrical axis endpoint coordinates and the cylindrical radius of the current geometric shape are read from the model structure array, and the current geometric shape is drawn based on the cylindrical axis endpoint coordinates and the cylindrical radius to obtain a cylinder.

[0019] Optionally, the shape type includes a flat plate type; and the drawing of the current geometric shape using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body includes:

[0020] If the shape type of the current geometric shape is the flat plate type, read the vertex coordinates and thickness of the flat plate;

[0021] According to the coordinates of the plate vertices, it is determined whether the vertices of each plate are coplanar. If they are coplanar, the corresponding plate is drawn according to the coordinates of each plate vertex to obtain the corresponding plate.

[0022] Optionally, the method further includes:

[0023] If at least one plate vertex is not coplanar with other plate vertices, then any plate vertex is selected as the target point. Two plate vertices are selected in sequence according to the chirality arrangement order of each plate vertex, and the corresponding sub-plate is drawn based on the coordinates of the two selected plate vertices and the coordinates of the target point.

[0024] Optionally, during the process of drawing the plane, the method further includes:

[0025] For any two vertices, the edge formed between the two vertices is used as the axis, and the plane is drawn with the thickness of the plane as the diameter to obtain the circular edge of the plate; and / or,

[0026] For each vertex, the thickness is used as the radius to obtain the rounded corners of the plate.

[0027] Optionally, redrawing the target three-dimensional model to obtain a new target three-dimensional model includes:

[0028] Obtaining a temporary file and reloading the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model; or,

[0029] The model parameters of the target three-dimensional model are modified, and the target three-dimensional model is rendered based on the modified model parameters to obtain the new target three-dimensional model.

[0030] The present application also provides a device for generating a three-dimensional model, the device comprising:

[0031] An acquisition module is configured to acquire a model structure file; the model structure file includes a plurality of nodes, each node having node attribute information, the node attribute information including geometric shape information and Boolean attribute information, the Boolean attribute information including a Boolean indicator of the geometric shape under the node;

[0032] a conversion module, configured to convert the model structure file into a model structure array using a deep search method; the model structure array includes shape parameters of a plurality of geometric shapes, each of the geometric shapes having a Boolean attribute;

[0033] a generation module, configured to sequentially read geometric shapes, draw the geometric shapes for a current geometric shape to obtain a corresponding geometric body, and perform a Boolean operation on the geometric body and the intermediate model based on a Boolean indicator corresponding to the geometric body to generate a target three-dimensional model;

[0034] The detection module is used to detect the target three-dimensional model based on the geometric features of the target three-dimensional model, and when the detection result indicates that the model structure of the target three-dimensional model is abnormal, redraw the target three-dimensional model to obtain a new target three-dimensional model.

[0035] Optionally, the conversion module is specifically used to:

[0036] Reading nodes in sequence, and determining the node type of the current node for the current node; the node type includes a geometric shape node;

[0037] If the node type of the current node is the geometric shape node, record the shape parameters and Boolean attributes of the geometric shape under the current node to obtain the model structure array; or,

[0038] If the node type of the current node is the Boolean operation node, perform a Boolean operation on the child nodes under the current node, and return to the step of "reading nodes in sequence, and judging the node type of the current node for the current node" until the node type of each node is the geometric shape node.

[0039] Optionally, the generating module is specifically configured to:

[0040] For the current geometric shape, determine the shape type of the current geometric shape; different shape types correspond to different shape drawing methods;

[0041] The current geometric shape is drawn using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body.

[0042] Optionally, the shape type includes a cylindrical type; and the generating module is specifically configured to:

[0043] If the shape type of the current geometric shape is the cylinder type, the cylindrical axis endpoint coordinates and the cylindrical radius of the current geometric shape are read from the model structure array, and the current geometric shape is drawn based on the cylindrical axis endpoint coordinates and the cylindrical radius to obtain a cylinder.

[0044] In some embodiments, the generating module is specifically configured to:

[0045] If the shape type of the current geometric shape is the flat plate type, read the vertex coordinates and thickness of the flat plate;

[0046] According to the coordinates of the plate vertices, it is determined whether the vertices of each plate are coplanar. If they are coplanar, the corresponding plate is drawn according to the coordinates of each plate vertex to obtain the corresponding plate.

[0047] Optionally, the generating module is further configured to:

[0048] If at least one plate vertex is not coplanar with other plate vertices, then any plate vertex is selected as the target point. Two plate vertices are selected in sequence according to the chirality arrangement order of each plate vertex, and the corresponding sub-plate is drawn based on the coordinates of the two selected plate vertices and the coordinates of the target point.

[0049] Optionally, during the process of drawing the plane, the generating module is further configured to:

[0050] For any two vertices, the edge formed between the two vertices is used as the axis, and the plane is drawn with the thickness of the plane as the diameter to obtain the circular edge of the plate; and / or,

[0051] For each vertex, the thickness is used as the radius to obtain the rounded corners of the plate.

[0052] Optionally, the detection module is specifically used to:

[0053] Obtaining a temporary file and reloading the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model; or,

[0054] The model parameters of the target three-dimensional model are modified, and the target three-dimensional model is rendered based on the modified model parameters to obtain the new target three-dimensional model.

[0055] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating a three-dimensional model described in any of the aforementioned embodiments.

[0056] The present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the three-dimensional model generation method described in any one of the aforementioned embodiments are implemented.

[0057] The present application also provides a computer program product, comprising a computer program, which, when executed by a processor, executes the steps of any possible three-dimensional model generation method described above.

[0058] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:

[0059] In an embodiment of the present application, each time a target three-dimensional model is generated, the target three-dimensional model can be detected based on the geometric features of the target three-dimensional model. For example, if the number of faces of the entire model is reduced by 50 after adding a new geometric body, it means that there is an error in the currently generated structure. In this way, during the model generation process, the accuracy, success rate and reliability of the three-dimensional model generation can be improved.

[0060] In addition, in the finite element simulation scenario, since the simulation task has the characteristics of high throughput, model generation through the above method can improve the efficiency of the simulation task.

[0061] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a flow chart of a method for generating a three-dimensional model shown in an exemplary embodiment of the present application;

[0063] Figure 2 This is a flowchart of a node traversal shown in an exemplary embodiment of the present application;

[0064] Figure 3 This is a flow chart of a model structure file conversion process shown in an exemplary embodiment of the present application;

[0065] Figure 4 is a schematic diagram of a non-coplanar plate vertex drawing plate shown in an exemplary embodiment of the present application;

[0066] Figure 5 This is a flow chart of a model structure detection shown in an exemplary embodiment of the present application;

[0067] Figure 6 This is a schematic structural diagram of a three-dimensional model generation device shown in an exemplary embodiment of the present application;

[0068] Figure 7 It is a hardware structure diagram of a computer device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0069] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0070] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0071] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0072] Research has found that 3D model design and simulation are an indispensable part of modern engineering design and analysis. The construction of 3D models often involves model repair, format conversion, and model verification. These processes are cumbersome and prone to errors, which can affect the accuracy and integrity of the 3D models.

[0073] Based on the above research, the present disclosure provides a method for generating a three-dimensional model, which first obtains a model structure file; the model structure file includes multiple nodes, each node has node attribute information, the node attribute information includes geometric shape information and Boolean attribute information, and the Boolean attribute information includes a Boolean indicator of the geometric shape under the node; secondly, a deep search method is used to convert the model structure file into a model structure array; the model structure array includes shape parameters of multiple geometric shapes and Boolean attributes of each of the geometric shapes; then, the geometric shapes are read in sequence, and for the current geometric shape, the geometric shape is drawn to obtain the corresponding geometric body, and based on the Boolean attributes corresponding to the geometric body, the geometric body is subjected to a Boolean operation with the intermediate model to generate a target three-dimensional model; finally, based on the geometric features of the target three-dimensional model, the target three-dimensional model is detected, and when the detection result indicates that the model structure of the target three-dimensional model is abnormal, the target three-dimensional model is redrawn to obtain a new target three-dimensional model.

[0074] In the embodiment of the present disclosure, each time a target three-dimensional model is generated, the target three-dimensional model can be detected based on the geometric features of the target three-dimensional model. For example, if the number of faces of the entire model is reduced by 50 after adding a new geometric body, it means that there is an error in the currently generated structure. In this way, during the model generation process, the accuracy, success rate and reliability of the three-dimensional model generation can be improved.

[0075] In addition, in the finite element simulation scenario, since the simulation task has the characteristics of high throughput, model generation through the above method can improve the efficiency of the simulation task.

[0076] To facilitate understanding of this embodiment, a detailed introduction to a method for generating a three-dimensional model disclosed in an embodiment of the present disclosure is first provided. The execution subject of the method for generating a three-dimensional model provided in an embodiment of the present disclosure is generally an electronic device, which may be a server. The server may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data, and artificial intelligence platforms. In other embodiments, the electronic device may also be a terminal device, wherein the terminal device may be a mobile device, a user terminal, a terminal, a handheld device, a computing device, an in-vehicle device, a wearable device, and the like.

[0077] In other embodiments, the method can also be applied to an implementation environment consisting of a terminal device and a server. In addition, the method for generating a three-dimensional model can also be implemented by a processor calling computer-readable instructions stored in a memory.

[0078] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0079] Please attend the attached Figure 1 , is a flow chart of a method for generating a three-dimensional model according to an exemplary embodiment of the present application. Figure 1 As shown, the method for generating a three-dimensional model in the embodiment of the present disclosure may include the following steps S101 to S104:

[0080] S101: Acquire a model structure file; the model structure file includes a plurality of nodes, each node has node attribute information, the node attribute information includes geometric shape information and Boolean attribute information, and the Boolean attribute information includes a Boolean indicator of the geometric shape under the node.

[0081] In the embodiment of the present disclosure, the model structure file is a schema file in json format, which defines the model structure of the three-dimensional model to be generated.

[0082] Here, the model structure file includes a plurality of nodes, each node having node attribute information, wherein the node attribute information includes geometric shape information and Boolean attribute information, and the Boolean attribute information includes a Boolean indicator of the geometric shape under the node.

[0083] The geometric shape information may include information such as a flat plate shape and a cylindrical shape, and the size, position, and orientation of the geometric shape, which is not limited here.

[0084] A Boolean indicator is used to indicate a Boolean attribute of a corresponding geometric shape. For example, a Boolean indicator may be "1" or "-1." In other embodiments, the Boolean indicator may be represented in other forms, which are not limited herein. A Boolean attribute may indicate an attribute of a Boolean operation to be performed on the geometric shape, such as a union or a difference.

[0085] In subsequent implementations, the Boolean attribute information of a geometric shape can be processed by performing corresponding Boolean operations on the geometric shape, such as Boolean addition or Boolean subtraction, to change the Boolean indicator of the geometric shape. Boolean addition can be understood as performing a union operation on the geometric shapes, and Boolean subtraction can be understood as performing a difference operation on the geometric shapes. In this implementation, Boolean addition can be represented by "*1" (union), and Boolean subtraction can be represented by "*(-1)" (difference).

[0086] S102: Convert the model structure file into a model structure array using a deep search method; the model structure array includes shape parameters of multiple geometric shapes and Boolean attributes of each of the geometric shapes.

[0087] As can be seen from the foregoing, the file format of the model structure file in this embodiment is a schema file, wherein the schema file stores information in the form of nodes, and involves the nesting of nodes. Through the deep search method, the nodes can be traversed according to the nested manner of the nodes, that is, in-depth exploration can be carried out along the branches, so that the information corresponding to each node can be traversed and read, thereby obtaining the model structure array.

[0088] Here, the model structure array may include shape parameters of a plurality of geometric shapes and a Boolean attribute of each of the geometric shapes, wherein the Boolean attribute may include “union” and “difference”.

[0089] In some embodiments, for step S102, see Figure 2 , can be converted by following the steps below:

[0090] S1021: Read the nodes in sequence, and for the current node, determine whether the node type of the current node is a Boolean operation node; if so, execute step S1022; if not, execute step S1023.

[0091] S1022: Perform Boolean operations on the child nodes under the current node, and return to step S1021.

[0092] S1023: Recording the shape parameters and Boolean attributes of the geometric shapes under the current node, and obtaining the model structure array based on the shape parameters and Boolean attributes of each geometric shape.

[0093] In the embodiment of the present application, the node type may include a geometric shape node and a Boolean operation node. The geometric shape node may be understood as the bottom-level node. As previously mentioned, the present application employs a deep search method to traverse the nodes. If the traversed node is a geometric shape node, step S1023 may be directly executed. If the traversed node is a Boolean operation node, indicating that the node has child nodes, the Boolean operation is performed on the child nodes, and the next node is read, returning to step S1021.

[0094] For example, the node type can be described by the following pseudo code:

[0095] "op_union": {

[0096] “type”: “op_union”,

[0097] “models”:[

[0098] {

[0099] "plates": {…}

[0100] "plates": {…}

[0101] } ]

[0103] }

[0104] In the above example, "op_union" is a Boolean operation node, which means that a Boolean operation needs to be performed on the child nodes under this node, and "plates" is a geometric shape node.

[0105] As mentioned above, Boolean operations include Boolean addition and Boolean subtraction, where Boolean addition refers to multiplying the Boolean indicator of each child node under the node by 1, and Boolean subtraction refers to multiplying the Boolean indicator of the first child node by 1 and the Boolean indicators of the remaining child nodes by -1.

[0106] See Figure 3 , is a flow chart of the model structure file conversion process shown in an exemplary embodiment of this application. Figure 3 As shown, the following steps are included:

[0107] S301: Input the model structure file schema and detect the schema file root node.

[0108] S302: Output “start” and Boolean indicator 1.

[0109] Here, the Boolean indicator 1 is the default output, which means that the union Boolean addition operation is performed on the nodes under the root node.

[0110] S303: traverse the nodes in the model structure file using a deep search method to determine whether the node type of the current node is a Boolean operation node; if so, execute step S309; ​​if not, execute step S304.

[0111] S304: Record the Boolean indicator and shape parameters of the geometric shape.

[0112] S305: Determine whether the Boolean indicator is 1. If so, execute step S306; if not, execute step S307.

[0113] S306: Output the shape parameters and union Boolean attributes of the geometric shape.

[0114] S307: Output the shape parameters of the geometric shape and the difference set Boolean attribute.

[0115] S308: Output model structure array.

[0116] S309: Perform Boolean addition or Boolean subtraction on the geometric shapes under the current node, and return to step S303.

[0117] The specific contents of the above steps have been described in detail in the above embodiments and will not be repeated here.

[0118] S103: Reading geometric shapes in sequence, drawing the current geometric shape to obtain a corresponding geometric body, and performing a Boolean operation on the geometric body and the intermediate model based on the Boolean attributes corresponding to the geometric body to generate a target three-dimensional model.

[0119] In this embodiment, geometric shapes may be read in sequence, and based on a preset model library (such as an open source Python OCC library), the currently read geometric shape may be drawn to obtain a corresponding geometric body.

[0120] Among them, the OCC library can provide functions such as creation, analysis and rendering of three-dimensional geometric shapes.

[0121] Specifically, for step S103, when drawing a geometric shape to obtain a corresponding geometric body, the shape type of the current geometric shape can be determined for the current geometric shape; different shape types correspond to different shape drawing methods; the current geometric shape is drawn using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body.

[0122] It is understandable that different shapes are drawn in different ways. Therefore, the shape type of the current geometric shape can be determined first, and then the shape drawing method corresponding to the shape type of the current geometric shape can be used to draw the current geometric shape, which can improve the drawing accuracy of the geometric body.

[0123] Specifically, if the currently read geometric shape is a cylinder, it can be drawn according to the corresponding shape parameters, such as the coordinates of the cylinder axis endpoints and the cylinder radius, to obtain a cylinder; if the currently read geometric shape is a plate, the coordinates of each vertex and thickness of the plate can be read and drawn to obtain a plate.

[0124] In some embodiments, after reading the vertex coordinates and thickness of the plate, it is possible to determine whether the vertices of each plate are coplanar based on the vertex coordinates of the plate. If they are coplanar, the corresponding plate is drawn based on the vertex coordinates of each plate to obtain.

[0125] It can be understood that if the vertices of the plates are coplanar, they can be drawn directly.

[0126] In other embodiments, if at least one plate vertex is not coplanar with other plate vertices, any plate vertex is selected as the target point, and two plate vertices are selected in sequence according to the chirality arrangement order of each plate vertex. The corresponding sub-plate is drawn based on the coordinates of the two selected plate vertices and the coordinates of the target point.

[0127] For example, see Figure 4 , is a schematic diagram of a non-coplanar plate vertex drawing plate shown in an exemplary embodiment of the present application. Figure 4 As shown, the plate vertices include A, B, C, D, and E. If point A is not coplanar with the other plate vertices, point B can be selected as the target point. Two plate vertices C and D are selected in clockwise order (counterclockwise order can also be used in other embodiments) according to the chirality arrangement order. Based on the coordinates of the two selected plate vertices C and D, the coordinates of point B, and the thickness, the corresponding sub-plate is drawn, that is, the shape enclosed by the plate vertices BCD and the corresponding thickness is drawn at the same time.

[0128] Similarly, you can select the plate vertex D and the plate vertex E, and draw based on the plate vertex D, the plate vertex E, the plate vertex B, and the thickness to obtain the corresponding sub-plate, that is, the shape enclosed by the plate vertices BDE and draw the corresponding thickness at the same time; you can also select the plate vertex E and the plate vertex A, and draw based on the plate vertices E, A, B, and the thickness to obtain the corresponding sub-plate, that is, the shape enclosed by the plate vertices BEA and draw the corresponding thickness.

[0129] In this way, the accuracy of the geometric body can be improved by the above-mentioned coplanarity determination method. In addition, if the plane vertices are not coplanar, this application also provides a block drawing method to further improve the drawing accuracy and integrity of the model.

[0130] Optionally, to enhance the aesthetics of the 3D model and meet model requirements, when drawing a flat plate, you can also round its edges and fillet its vertices. Specifically, for any two vertices, use the edge between them as the axis and the plane's thickness as the diameter to create a rounded edge. And / or, for each vertex, use the thickness as the radius to create a rounded corner. This ensures the model's mechanical properties, reduces stress concentration, and improves the model's practical application value.

[0131] Furthermore, after obtaining the geometric body, a Boolean operation can be performed on the geometric body and the intermediate model based on the Boolean attributes corresponding to the geometric body to generate a target three-dimensional model.

[0132] In this embodiment, each time a new geometric body is generated, a Boolean operation can be performed with the previously generated intermediate model. For example, if an octahedron is currently generated, the octahedron can be Boolean operated with the generated intermediate model based on the Boolean properties of the octahedron to generate the target three-dimensional model.

[0133] S104: Detecting the target three-dimensional model based on the geometric features of the target three-dimensional model, and redrawing the target three-dimensional model to obtain a new target three-dimensional model when the detection result indicates that the model structure of the target three-dimensional model is abnormal.

[0134] The geometric features may include the number, position, and orientation of faces, edges, and vertices, which are not limited here.

[0135] In this embodiment, after each target three-dimensional model is generated, the target three-dimensional model can be tested based on the geometric features of the target three-dimensional model. For example, if the number of faces of the entire model is reduced by 50 after adding a new geometric body, it means that there is an error in the currently generated structure. In this way, during the model generation process, the accuracy, success rate and reliability of the three-dimensional model generation can be improved.

[0136] In addition, in the finite element simulation scenario, since the simulation task has the characteristics of high throughput, model generation through the above method can improve the efficiency of the simulation task.

[0137] Furthermore, if the detection result indicates that the model structure of the target three-dimensional model is abnormal, the target three-dimensional model is redrawn to obtain a new target three-dimensional model.

[0138] In some implementations, when redrawing the target three-dimensional model to obtain a new target three-dimensional model, the drawing can be performed in the following two ways:

[0139] The first method is to obtain a temporary file and reload the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model.

[0140] After the model structure array is generated, it can be stored in a temporary file. In this way, if the target three-dimensional model needs to be redrawn, the corresponding model structure data can be reread from the temporary file and reloaded to obtain a new target three-dimensional model.

[0141] The second way is to modify the model parameters of the target three-dimensional model, and render the target three-dimensional model based on the modified model parameters to obtain the new target three-dimensional model.

[0142] Here, modifying the model parameters of the target three-dimensional model may refer to adjusting the order of Boolean operations between the geometric shapes corresponding to the target three-dimensional model, or modifying the shape information of the geometric shapes. An appropriate method may be selected according to actual conditions and is not limited here.

[0143] In other embodiments, for step S104, see Figure 5 , is a flow chart of a model structure detection shown in an exemplary embodiment of the present application. Figure 5 As shown, the following steps S1041 to S1048 may be included:

[0144] S1041: Detecting the target three-dimensional model based on the geometric features of the target three-dimensional model to obtain a detection result.

[0145] S1042: Determine whether the detection result is abnormal. If not, execute step S1043; if so, execute step S1044.

[0146] S1043: Output the target three-dimensional model.

[0147] S1044: Obtain a temporary file, and reload the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model.

[0148] The contents of steps S1041 to S1044 have been introduced in the aforementioned embodiment and will not be repeated here.

[0149] S1045: Determine whether there is any abnormality in the model structure of the new target three-dimensional model; if not, execute step S1043; if so, execute step S1046.

[0150] It can be understood that after generating a new target three-dimensional model, in order to improve the accuracy of the model, the new target three-dimensional model can be tested to determine whether there are any abnormalities in the new target three-dimensional model. If there are no abnormalities, the new target three-dimensional model can be output as the target three-dimensional model. If there are abnormalities, further adjustments are required, as shown in step S1046.

[0151] S1046: Modify the model parameters of the new target three-dimensional model, and render the target three-dimensional model based on the modified model parameters to obtain a modified target three-dimensional model.

[0152] It can be understood that if the above-mentioned reloading method still has an abnormality, then it can be considered that there is an error in the model parameters. Therefore, the model parameters of the new target three-dimensional model can be modified, such as modifying the model size, orientation, etc., and drawing can be performed here based on the modified model parameters to obtain the modified target three-dimensional model.

[0153] S1047: Determine whether there is any abnormality in the model structure of the modified target three-dimensional model; if there is no abnormality, execute step S1043; if there is an abnormality, execute step S1048.

[0154] S1048: Output error information.

[0155] Similarly, the modified target 3D model is then determined to determine whether its structure is abnormal. If no abnormality exists, the modified target 3D model is output. If an abnormality exists, an error message is output. The error message can be in text format for subsequent analysis and debugging of the model generation process. In other implementations, other formats are also possible, which are not limited here. This improves the maintainability and debuggability of the modeling process.

[0156] In addition, in the present application, when determining whether the model structure is abnormal, it can be detected based on the geometric features of the model structure as described in the aforementioned embodiments, which will not be elaborated here.

[0157] In this embodiment, after the target three-dimensional model, the new target three-dimensional model, and the modified target three-dimensional model are output, their model structures are all detected, so that the accuracy of the model structure can be improved.

[0158] Corresponding to the aforementioned embodiment of the method for generating a three-dimensional model, the present application also provides an embodiment of an apparatus for generating a three-dimensional model.

[0159] Please refer to Figure 6 , is a schematic diagram of a structure of a three-dimensional model generation device shown in an exemplary embodiment of the present application. Figure 6 As shown, the apparatus 600 includes:

[0160] An acquisition module 601 is configured to acquire a model structure file; the model structure file includes a plurality of nodes, each node having node attribute information, the node attribute information including geometric shape information and Boolean attribute information, the Boolean attribute information including a Boolean indicator of the geometric shape of the node;

[0161] A conversion module 602 is configured to convert the model structure file into a model structure array using a depth search method; the model structure array includes shape parameters of a plurality of geometric shapes, each of which has a Boolean attribute;

[0162] A generation module 603 is configured to sequentially read geometric shapes, draw the current geometric shape, obtain a corresponding geometric body, and perform a Boolean operation on the geometric body and the intermediate model based on a Boolean indicator corresponding to the geometric body to generate a target three-dimensional model;

[0163] The detection module 604 is used to detect the target 3D model based on the geometric features of the target 3D model, and redraw the target 3D model to obtain a new target 3D model when the detection result indicates that the model structure of the target 3D model is abnormal.

[0164] In some embodiments, the conversion module 602 is specifically configured to:

[0165] Reading nodes in sequence, and determining the node type of the current node for the current node; the node type includes a geometric shape node;

[0166] If the node type of the current node is the geometric shape node, record the shape parameters and Boolean attributes of the geometric shape under the current node to obtain the model structure array; or,

[0167] If the node type of the current node is the Boolean operation node, perform a Boolean operation on the child nodes under the current node, and return to the step of "reading nodes in sequence, and judging the node type of the current node for the current node" until the node type of each node is the geometric shape node.

[0168] In some implementations, the generating module 603 is specifically configured to:

[0169] For the current geometric shape, determine the shape type of the current geometric shape; different shape types correspond to different shape drawing methods;

[0170] The current geometric shape is drawn using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body.

[0171] In some embodiments, the shape type includes a cylindrical type; the generating module 603 is specifically configured to:

[0172] If the shape type of the current geometric shape is the cylinder type, the cylindrical axis endpoint coordinates and the cylindrical radius of the current geometric shape are read from the model structure array, and the current geometric shape is drawn based on the cylindrical axis endpoint coordinates and the cylindrical radius to obtain a cylinder.

[0173] In some implementations, the generating module 603 is specifically configured to:

[0174] If the shape type of the current geometric shape is the flat plate type, read the vertex coordinates and thickness of the flat plate;

[0175] According to the coordinates of the plate vertices, it is determined whether the vertices of each plate are coplanar. If they are coplanar, the corresponding plate is drawn according to the coordinates of each plate vertex to obtain the corresponding plate.

[0176] In some implementations, the generating module 603 is further configured to:

[0177] If at least one plate vertex is not coplanar with other plate vertices, then any plate vertex is selected as the target point. Two plate vertices are selected in sequence according to the chirality arrangement order of each plate vertex, and the corresponding sub-plate is drawn based on the coordinates of the two selected plate vertices and the coordinates of the target point.

[0178] In some implementations, during the process of drawing the plane, the generating module 603 is further configured to:

[0179] For any two vertices, the edge formed between the two vertices is used as the axis, and the plane is drawn with the thickness of the plane as the diameter to obtain the circular edge of the plate; and / or,

[0180] For each vertex, the thickness is used as the radius to obtain the rounded corners of the plate.

[0181] In some implementations, the detection module 604 is specifically configured to:

[0182] Obtaining a temporary file and reloading the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model; or,

[0183] The model parameters of the target three-dimensional model are modified, and the target three-dimensional model is rendered based on the modified model parameters to obtain the new target three-dimensional model.

[0184] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0185] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0186] Corresponding to the above-mentioned method for generating a three-dimensional model, the embodiment of the present disclosure further provides a computer device, such as Figure 7 FIG. 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure, including:

[0187] The computer device 700 includes a processor 710, an internal bus 720, a memory 730, a network interface 740, and a non-volatile memory 750, and may also include hardware required for other functions. One or more embodiments of this specification can be implemented based on software, such as the processor 710 reading the corresponding computer program from the non-volatile memory 750 into the memory 730 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0188] Among them, the memory 730 is also called internal memory, which is used to temporarily store the calculation data in the processor 710 and the data exchanged with the non-volatile memory 750 such as the hard disk. The processor 710 exchanges data with the non-volatile memory 750 through the memory 730.

[0189] In the embodiment of the present application, the memory 730 is specifically used to store application code for executing the solution of the present application, and the execution is controlled by the processor 710. That is, when the computer device is running, the processor 710 communicates with the network interface 740, the memory 730, and the non-volatile memory 750 respectively via the internal bus 720, so that the processor 610 executes the application code stored in the memory 730 and the non-volatile memory 750, thereby performing the three-dimensional model generation method described in the above method embodiment.

[0190] Processor 710 may be an integrated circuit chip with signal processing capabilities. Such processors may be general-purpose processors, including central processing units (CPUs) and network processors (NPs). They may also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. They may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor.

[0191] It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the computer device 700. In other embodiments of the present application, the computer device 700 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0192] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the method for generating a three-dimensional model in the above-described method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0193] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the three-dimensional model generation method in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.

[0194] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0195] Embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by the data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0196] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can be implemented as, special-purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).

[0197] Computers suitable for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to such mass storage devices to receive data from them or to transmit data to them, or both. However, a computer does not necessarily have such devices. In addition, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.

[0198] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0199] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of specific embodiments of specific inventions. Certain features described in multiple embodiments within this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claimed as such, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of the sub-combination.

[0200] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0201] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the particular order shown or sequential sequence to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0202] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.

Claims

1. A method for generating a three-dimensional model, characterized in that: The method comprises: Acquire a model structure file; the model structure file includes a plurality of nodes, each node has node attribute information, the node attribute information includes geometric shape information and Boolean attribute information, the Boolean attribute information includes a Boolean indicator of the geometric shape under the node; The model structure file is converted into a model structure array using a deep search method; the model structure array includes shape parameters of a plurality of geometric shapes and a Boolean attribute of each of the geometric shapes; Read geometric shapes in sequence, draw the current geometric shape, and obtain the corresponding geometric body. Each time a new geometric body is generated, a Boolean operation is performed on the previously generated intermediate model based on the Boolean attributes corresponding to the geometric body to generate a target three-dimensional model. The target three-dimensional model is detected based on the geometric features of the target three-dimensional model, and when the detection result indicates that the model structure of the target three-dimensional model is abnormal, the target three-dimensional model is redrawn to obtain a new target three-dimensional model.

2. The method according to claim 1, characterized in that The method of converting the model structure file into a model structure array by using a deep search method includes: Reading nodes in sequence, and determining the node type of the current node for the current node; the node type includes a geometric shape node; If the node type of the current node is the geometric shape node, record the shape parameters and Boolean attributes of the geometric shape under the current node to obtain the model structure array; or, If the node type of the current node is the Boolean operation node, perform a Boolean operation on the geometric shape under the current node, and return to the step of "reading nodes in sequence, and determining the node type of the current node for the current node" until the node type of each node is the geometric shape node.

3. The method according to claim 1, characterized in that The step of drawing the current geometric shape to obtain a corresponding geometric body includes: For the current geometric shape, determine the shape type of the current geometric shape; different shape types correspond to different shape drawing methods; The current geometric shape is drawn using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body.

4. The method according to claim 3, characterized in that The shape type includes a cylinder type; and the drawing of the current geometric shape using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body includes: If the shape type of the current geometric shape is the cylinder type, the cylindrical axis endpoint coordinates and the cylindrical radius of the current geometric shape are read from the model structure array, and the current geometric shape is drawn based on the cylindrical axis endpoint coordinates and the cylindrical radius to obtain a cylinder.

5. The method according to claim 3, characterized in that The shape type includes a flat plate type; and the drawing of the current geometric shape using a shape drawing method corresponding to the shape type of the current geometric shape to obtain a corresponding geometric body includes: If the shape type of the current geometric shape is the flat plate type, read the vertex coordinates and thickness of the flat plate; According to the coordinates of the plate vertices, it is determined whether the vertices of each plate are coplanar. If they are coplanar, the corresponding plate is drawn according to the coordinates of each plate vertex to obtain the corresponding plate.

6. The method according to claim 5, characterized in that The method further comprises: If at least one plate vertex is not coplanar with other plate vertices, then any plate vertex is selected as the target point. Two plate vertices are selected in sequence according to the chirality arrangement order of each plate vertex, and the corresponding sub-plate is drawn based on the coordinates of the two selected plate vertices and the coordinates of the target point.

7. The method according to claim 5 or 6, characterized in that During the process of drawing the tablet, the method further includes: For any two vertices, the edge formed between the two vertices is used as the axis, and the thickness of the plate is used as the diameter to draw the plate to obtain a circular edge of the plate; and / or, For each vertex, the thickness is used as the radius to obtain the rounded corners of the plate.

8. The method according to claim 1, characterized in that The step of redrawing the target three-dimensional model to obtain a new target three-dimensional model includes: Obtaining a temporary file and reloading the temporary file to redraw the target three-dimensional model to obtain the new target three-dimensional model; the temporary file is used to store the model structure of the target three-dimensional model; or, The model parameters of the target three-dimensional model are modified, and the target three-dimensional model is rendered based on the modified model parameters to obtain the new target three-dimensional model.

9. A three-dimensional model generating device, characterized in that: The device comprises: An acquisition module is configured to acquire a model structure file; the model structure file includes a plurality of nodes, each node having node attribute information, the node attribute information including geometric shape information and Boolean attribute information, the Boolean attribute information including a Boolean indicator of the geometric shape under the node; a conversion module, configured to convert the model structure file into a model structure array using a deep search method; the model structure array includes shape parameters of a plurality of geometric shapes, each of the geometric shapes having a Boolean attribute; A generation module is used to read geometric shapes in sequence, draw the current geometric shape, and obtain the corresponding geometric body. Each time a new geometric body is generated, a Boolean operation is performed on the previously generated intermediate model based on the Boolean attributes corresponding to the geometric body to generate a target three-dimensional model. The detection module is used to detect the target three-dimensional model based on the geometric features of the target three-dimensional model, and when the detection result indicates that the model structure of the target three-dimensional model is abnormal, redraw the target three-dimensional model to obtain a new target three-dimensional model.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for generating a three-dimensional model according to any one of claims 1 to 8 are implemented.

11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the three-dimensional model generation method described in any one of claims 1-8 are implemented.

Citation Information

Patent Citations

  • Automatic conversion method from XML-based Monka geometric representation to three-dimensional CAD model

    CN117475093A