Three-dimensional model cavity volume estimation method, system and equipment and storage medium
By building a triangular mesh in the modeling software and using the octree algorithm to segment the cube, the problem of inefficiency of traditional volume estimation methods is solved, and efficient and accurate volume estimation of complex cavity structures is achieved, design efficiency is improved and cost is reduced.
Patent Information
- Application Number
- CN202510416763.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-22
AI Technical Summary
In the equipment manufacturing industries such as automobiles, engineering machinery and rail transit, traditional volume estimation methods are inefficient and prone to errors, and it is particularly difficult to accurately estimate the volume of complex cavity structures, especially lightweight data.
The three-dimensional model cavity volume estimation method based on modeling software is used to construct a triangular mesh, and the octree algorithm is used to recursively segment the cube, judge and block the space nodes, and calculate the sum of the volumes of the empty cube to estimate the cavity volume.
It realizes efficient and accurate volume estimation, significantly improves design efficiency and reduces R&D costs, and is suitable for volume estimation requirements in various scenarios.
Smart Images

Figure CN120355773A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a three-dimensional model processing method based on a modeling software, and specifically, to a method for estimating the cavity volume of a three-dimensional model based on a modeling software. In addition, the present invention also relates to a system for estimating the cavity volume of a three-dimensional model based on a modeling software, a three-dimensional model processing device, and a computer-readable storage medium. Background Art
[0002] In complex scenarios of internal space design of equipment in the fields of equipment manufacturing such as automobiles, construction machinery, and rail transit, traditional methods for volume estimation require cumbersome manual operations to extract contour surfaces and perform operations such as trimming and closing, and finally generate a complete solid to measure the volume, such as fuel tanks, trunks, glove boxes, cockpits, train carriages, etc. This method is inefficient and error-prone, especially for lightweight data (such as simplified mesh models), and it is difficult to achieve accurate estimation through manual operations. In the prior art, although some tools support simple volume estimation, they lack the ability to automatically process complex cavity structures and cannot efficiently handle problems such as multi-connected regions, tiny gaps, and non-closed patches.
[0003] Therefore, there is an urgent need for a volume estimation method that is efficient, accurate, and supports automatic processing. Summary of the Invention
[0004] The technical problem solved by the present invention is to provide a technology for estimating the cavity volume of a three-dimensional model based on a modeling software, which can efficiently process complex models and lightweight data, accurately estimate the volume of the three-dimensional model, thereby providing accurate design parameters for users, improving design efficiency, and reducing R & D costs.
[0005] To solve the above technical problem, the present invention provides a method for estimating the cavity volume of a three-dimensional model based on a modeling software, which includes the following steps: obtaining a three-dimensional model in the modeling software, constructing a triangular mesh for the three-dimensional model, and performing preprocessing calculations on the triangular mesh; obtaining an initial cube of the three-dimensional model, recursively dividing the initial cube into a preset minimum cube by using an octree algorithm, and determining whether the divided cube contains the triangular mesh. If it contains the triangular mesh, it is a non-empty cube, and if it does not contain the triangular mesh, it is an empty cube; correcting and blocking the spatial nodes of the cube recursively divided by the octree algorithm; obtaining the sum of the volumes of all the empty cubes inside the three-dimensional model to obtain the estimated cavity volume of the three-dimensional model.
[0006] Preferably, the method for estimating the cavity volume of a three-dimensional model based on a modeling software further includes generating a visual empty cube to display the internal cavity volume of the three-dimensional model.
[0007] Preferably, the octree algorithm includes: obtaining the size information of the initial cube, where the size of the initial cube is a cube that is an exponential multiple of 2 of the size of the preset minimum cube; using the octree algorithm to divide the initial cube into eight sub-cubes, and determining whether each sub-cube contains the triangular mesh; if the sub-cube does not contain the triangular mesh, the sub-cube will not continue to be divided according to the octree algorithm, and the sub-cube information will be saved; if the sub-cube contains the triangular mesh, the sub-cube will continue to be divided by the octree algorithm, and it will be determined whether the divided cube contains the triangular mesh, and this step will be recursively performed until the size of the divided cube is the size of the preset minimum cube, and it will be determined whether there is an intersection relationship between the cube and the triangular mesh.
[0008] Preferably, the modification and plugging processing of the spatial nodes of the cube recursively divided by the octree algorithm includes: correcting the spatial nodes through the internal and external connectivity of the empty cube, adopting the search methods from the inside out and from the outside in, and automatically plugging through two-way search to find the internal and external connectivity.
[0009] Preferably, the search method includes: obtaining the center point of the initial cube as the internal starting point for internal calculation, and searching for the empty cube closest to the internal starting point as the internal starting cube; obtaining the minimum coordinate point of the initial cube as the external starting point for external calculation, and searching for the empty cube closest to the external starting point as the external starting cube; according to the external starting cube and the internal starting cube, performing two-way search and recording the path, when the passing distance in the channel is less than a preset multiple of the preset minimum size, setting the non-passable attribute for the corresponding position of the cube and performing plugging processing on the position.
[0010] Preferably, obtaining the total volume of all the empty cubes inside the three-dimensional model to obtain the estimated cavity volume of the three-dimensional model includes: recursively finding all the adjacent empty cubes to the internal starting cube, and the non-empty cubes adjacent to the adjacent empty cubes with overlapping faces, pairing the adjacent empty cubes and the adjacent non-empty cubes, and saving the paired adjacent non-empty cubes as valid non-empty cubes; recursively calculating the effective volume of the valid non-empty cubes and the total volume of all the empty cubes inside the three-dimensional model as the estimated cavity volume of the three-dimensional model.
[0011] Preferably, calculating the effective volume of the effective non-empty cube includes: obtaining the center points of the adjacent empty cubes and the centroid points of the triangular surface meshes within the adjacent non-empty cubes, connecting the centroid points of the triangular surface meshes and the three vertices of the triangular surface meshes to the center points of the adjacent empty cubes respectively, and determining whether the connections intersect with other triangular surface meshes. If any of the connections does not intersect with the triangular surface mesh, then the triangular surface mesh is a visible triangular surface mesh; dividing the cubes having an intersection relationship with the triangular surface mesh into preset equal small cubes, calculating all the visible triangular surface meshes within the non-empty cube, and determining whether the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular surface mesh. If the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular surface mesh, then the small cube is an effective small cube; calculating the sum of the volumes of all the effective small cubes to obtain the effective volume.
[0012] Correspondingly, the present invention further provides a three-dimensional model cavity volume estimation system based on modeling software, which includes: a processing module for obtaining a three-dimensional model in the modeling software, constructing a triangular surface mesh for the three-dimensional model, and performing preprocessing calculations on the triangular surface mesh; a recursive segmentation module for obtaining an initial cube of the three-dimensional model, recursively dividing the initial cube into preset minimum cubes by using an octree algorithm, and determining whether the cube after recursive segmentation contains the triangular surface mesh. If it contains the triangular surface mesh, it is a non-empty cube, and if it does not contain the triangular surface mesh, it is an empty cube; a plugging module for correcting and plugging the spatial nodes of the cube recursively divided by the octree algorithm; and a calculation module for obtaining the sum of the volumes of all the empty cubes inside the three-dimensional model to obtain the estimated cavity volume of the three-dimensional model.
[0013] In addition, the present invention further provides a three-dimensional model processing device, including a memory storing a computer program, wherein the computer program, when executed by a processor, implements the method for estimating the cavity volume of a three-dimensional model based on modeling software according to any one of the above technical solutions.
[0014] Correspondingly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for estimating the cavity volume of a three-dimensional model based on modeling software according to any one of the above technical solutions.
[0015] The three-dimensional model cavity volume estimation method based on modeling software of the present invention has the following advantages: By discretizing and using the octree algorithm for multi-threaded parallel processing, the data processing time is significantly reduced, ensuring that the deviation between the estimated result and the actual result is small; it is applicable to the volume estimation requirements in various scenarios and supports automatic sealing of gaps, reducing manual iterative data repair. This method can efficiently process complex models, thereby providing users with accurate volume estimation, improving design efficiency and reducing R & D costs, with significantly improved accuracy and more efficient calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a step block diagram of the three-dimensional model cavity volume estimation method based on modeling software in the specific embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of establishing whether a judgment point is within a triangular surface by the centroid method in the specific embodiment of the present invention;
[0018] Figure 3 is a three-dimensional schematic diagram of recursive segmentation using the octree algorithm in the specific embodiment of the present invention;
[0019] Figure 4 is an internal space schematic diagram of recursive segmentation using the octree algorithm in the specific embodiment of the present invention;
[0020] Figure 5 is a schematic diagram of calculating the volume of all recursive segmentations using the octree algorithm in the specific embodiment of the present invention. SPECIFIC EMBODIMENTS
[0021] The following further details the specific embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not intended to limit the present invention.
[0022] See Figures 1 to 5 As shown, the three-dimensional model cavity volume estimation method based on modeling software in the basic embodiment of the present invention includes the following steps:
[0023] S10. Obtain a three-dimensional model in the modeling software, construct a triangular surface mesh for the three-dimensional model, and perform preprocessing calculations on the triangular surface mesh.
[0024] Specifically, the modeling software can be CATIA, and of course it is not limited thereto. It can also be other modeling software such as UG, CREO, etc. Obtain a three-dimensional model through the modeling software, construct a triangular surface mesh for the obtained three-dimensional model, and perform preprocessing calculations on the triangular surface mesh. In addition, preprocessing calculations can also be performed on data such as parametric geometric topology data, non-parametric geometric topology data, lightweight data, and point cloud data in the three-dimensional model.
[0025] S20. Obtain the initial cube of the 3D model, recursively divide the initial cube into preset minimum cubes using the octree algorithm, and determine whether the divided cube contains the triangular mesh surface. If it contains the triangular mesh surface, it is a non-empty cube; if it does not contain the triangular mesh surface, it is an empty cube.
[0026] Specifically, obtain the initial cube of the 3D model. The initial cube is a cube that can enclose the 3D model. Recursively divide the initial cube into preset minimum cubes using the octree algorithm, and determine whether each divided cube contains the triangular mesh surface. If the cube contains the triangular mesh surface, mark the cube as a non-empty cube and continue to divide the cube using the octree algorithm; if the cube does not contain the triangular mesh surface, mark the cube as an empty cube and do not continue the division.
[0027] S30. Modify the spatial nodes of the cubes recursively divided by the octree algorithm and perform plugging processing.
[0028] Specifically, perform plugging and filling processing on the gaps and holes in the spatial nodes of the cubes recursively divided by the octree algorithm in the above S20 step.
[0029] S40. Obtain the total volume of all the empty cubes inside the 3D model to obtain the estimated cavity volume of the 3D model.
[0030] Specifically, among the empty cubes in the initial cube that encloses the 3D model, some are outside the 3D model and some are inside the 3D model. Only obtain the volumes of all the empty cubes inside the 3D model, and the sum of their volumes is the estimated cavity volume of the 3D model.
[0031] Based on the above basic embodiment, the above method for estimating the cavity volume of a 3D model based on modeling software of the present invention may further include generating visual empty cubes to display the internal volume of the 3D model. Its essence is to generate visual cubes to display the internal structure of the 3D model, which is more convenient for operators to perform operation calculations.
[0032] In the above basic embodiment, the S20 step further includes:
[0033] Obtain the size information of the initial cube. Generally, the size of the initial cube can be a cube that is an exponential multiple of 2 of the size of the preset minimum cube;
[0034] The initial cube is divided into eight sub-cubes using the octree algorithm, and it is determined whether each sub-cube contains the triangular mesh. If the sub-cube does not contain the triangular mesh, the sub-cube will not be further divided according to the octree algorithm, and the sub-cube information will be saved. If the sub-cube contains the triangular mesh, the sub-cube will be further divided using the octree algorithm, and it is determined whether the divided cube contains the triangular mesh. This step is recursively performed until the size of the divided cube reaches the preset minimum cube size, and it is determined whether there is an intersection relationship between the cube and the triangular mesh.
[0035] Specifically, the size information of the initial cube is obtained. The size information may include the side length of the cube, the three-dimensional coordinate information of each vertex of the cube, etc. The initial cube is a cube whose size or side length is an exponential multiple of 2 of the size or side length of the preset minimum cube. The initial cube is evenly divided into eight sub-cubes using the octree algorithm, and it is determined whether each sub-cube contains the triangular mesh. If the sub-cube does not contain the triangular mesh, the sub-cube will not be further divided, and the sub-cube information will be saved. If the sub-cube contains the triangular mesh, the cube will be further divided using the octree algorithm, and it is determined whether the divided cube contains the triangular mesh. This step is recursively performed until the size of the divided cube reaches the preset minimum cube size, and the intersection relationship between all the cubes and the triangular mesh is saved and determined.
[0036] In the above basic embodiment, step S30 further includes:
[0037] The space nodes are corrected through the internal and external connectivity of the empty cube. An in-out and / or out-in search method is adopted, and the internal and external connectivity is searched through two-way search for automatic plugging.
[0038] The above search method specifically includes:
[0039] The center point of the initial cube is obtained as the internal starting point for internal calculation, and the empty cube closest to the internal starting point is searched as the internal starting cube;
[0040] The minimum coordinate point of the initial cube coordinates is obtained as the external starting point for external calculation, and the empty cube closest to the external starting point is searched as the external starting cube;
[0041] Based on the external starting cube and the internal starting cube, two-way search is performed, and the path is recorded. When the channel passing distance is less than a preset multiple of the preset minimum size, the corresponding cube is set with the attribute of not being passable, and the position is plugged.
[0042] Specifically, the present invention corrects the spatial nodes according to the internal and external connectivity, adopts a two-way search method from the inside out and from the outside in, searches for the internal and external connectivity through the two-way search and performs automatic plugging. The specific search method is as follows: Obtain the center point of the initial cube as the internal starting point for internal calculation. If there are multiple chambers inside the three-dimensional model, multiple internal starting points can be selected. In addition, the center point of some initial cubes may be outside the three-dimensional model. In this case, it is necessary to manually select and confirm its internal starting point. In this embodiment, taking the example that there is only one chamber inside the three-dimensional model and the center point of the initial cube is inside the three-dimensional model, search for the empty cube closest to the internal starting point and not containing triangular mesh faces as the internal starting cube; Obtain the point with the smallest three-dimensional coordinates (the smallest x, y, and z coordinates) in the initial cube as the external starting point for external calculation, and search for the empty cube closest to the external starting point as the external starting cube; Then, according to the external starting cube and the internal starting cube, perform a two-way search and record the search path. When the distance of the passage is less than a preset multiple of the preset minimum size, set the corresponding cube to have the attribute of not being passable, and perform plugging or filling treatment on this position as a gap or hole. The method for determining that the distance is less than a preset multiple of the preset minimum size is to calculate the distance from the center point of the cube along the x-axis direction on the two-way search path to the two intersection points of the triangular mesh face. The distance between the two intersection points is the minimum distance in the x-axis direction. Calculate the distances in the y-axis and z-axis directions in the same way. In the two-way search passage, search for a length less than three times the size of the preset minimum cube from the outside in and from the inside out, and it is considered that the position of the gap or hole is found, and plugging or filling treatment is performed on this position.
[0043] In the above basic embodiment, step S40 further includes:
[0044] Recursively find all the empty cubes adjacent to the internal starting cube, and the non-empty cubes adjacent to the adjacent empty cubes with overlapping faces, pair the adjacent empty cubes and the adjacent non-empty cubes, and save the paired adjacent non-empty cubes as valid non-empty cubes;
[0045] Recursively calculate the effective volume of the valid non-empty cubes and the total volume of all the empty cubes inside the three-dimensional model as the estimated cavity volume of the three-dimensional model.
[0046] Specifically, by recursively finding all the empty cubes adjacent to the internal starting cube, as well as the non-empty cubes adjacent (excluding those adjacent only by vertices or only by edges) to these empty cubes that have overlapping faces with them, pairing all these adjacent empty cubes and adjacent non-empty cubes, and saving the paired adjacent non-empty cubes as valid non-empty cubes, the volume obtained by adding the effective volume of the above-mentioned valid non-empty cubes and the total volume of all the empty cubes inside the three-dimensional model is the estimated cavity volume of the three-dimensional model.
[0047] The calculation of the effective volume of the above-mentioned valid non-empty cubes includes:
[0048] Obtain the center points of the adjacent empty cubes and the center of gravity points of the triangular surface meshes inside the adjacent non-empty cubes, connect the center of gravity points of the triangular surface meshes and the three vertices of the triangular surface meshes with the center points of the adjacent empty cubes respectively, and judge whether the connections intersect with other triangular surface meshes. If any one of the connections does not intersect with the triangular surface mesh, then the triangular surface mesh is a visible triangular surface mesh;
[0049] Divide the cube with an intersection relationship with the triangular surface mesh into preset equal small cubes, calculate all the visible triangular surface meshes inside the non-empty cube, and judge whether the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular surface mesh. If the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular surface mesh, then the small cube is a valid small cube;
[0050] Calculate that the total volume of all the valid small cubes is the effective volume.
[0051] Specifically, obtain the center points of adjacent empty cubes paired with adjacent non-empty cubes, and the centroid points of the triangular face meshes within the adjacent non-empty cubes. Among them, the centroid points of the triangular face meshes may be inside or outside the triangular face meshes. Connect the centroid points of the triangular face meshes and the three vertices of the triangular face meshes to the center points of the adjacent empty cubes respectively, and determine whether these connections intersect with other triangular face meshes. If any one of these connections does not intersect with the triangular face mesh, then it can be determined that the triangular face mesh is a visible triangular face mesh. Divide the cubes having an intersection relationship with the triangular face mesh into preset equally divided small cubes. For example, here it can be 1000 equally divided small cubes. Calculate all the visible triangular face meshes within the non-empty cube, and determine whether the center points of the small cube and the empty cube are on the same side of the visible triangular face mesh. Among them, connect the center points of the empty cube and the small cube, and determine whether there is an intersection point between the connection and the visible triangular face mesh. If there is no intersection point with all the triangular face meshes, then it can be judged that the center points of the small cube and the empty cube are on the same side of the visible triangular face mesh. If the center points of the small cube and the empty cube are on the same side of the visible triangular face mesh, then the small cube is a valid small cube; calculate the total volume of all valid small cubes as the above-mentioned valid volume.
[0052] Among them, the constant formula for judging whether the centroid point of the triangular face mesh is inside the triangular face mesh by the centroid method is as follows: As Figure 2 shown, A, B, and C are the coordinates of the three vertices of the triangle, P is the coordinate of any point within the triangle plane, v0 is the vector from point A to point C, v1 is the vector from point A to point B, v2 is the vector from point A to point P. Move u distance along the v0 direction from point A, and then move v distance along the v1 direction to obtain point P. For any point P within the triangle plane, it can be represented by the following equation: P = A + u * v0 + v * v1; the calculation shows that:
[0053] u = [(v1 * v1)(v2 * v0) - (v0 * v1)(v2 * v1)] / [(v0 * v0)(v1 * v1) - (v0 * v1)(v1 * v0)]
[0054] v = [(v0 * v0)(v2 * v1) - (v0 * v1)(v2 * v0)] / [(v0 * v0)(v1 * v1) - (v0 * v1)(v1 * v0)]
[0055] If three conditions are met: u >= 0, v >= 0, u + v <= 1, it indicates whether the centroid point of the triangular face mesh is inside the triangular face mesh.
[0056] In addition to using the centroid method to determine whether the centroid point of a triangular mesh is inside or outside the triangular mesh, the triangle interior angle method or the cross product and dot product same direction method can also be used to make the determination. After verification, the centroid method has the highest efficiency.
[0057] Specifically, recursively calculating the effective volume of the effective non-empty cube and the total volume of all the empty cubes inside the three-dimensional model to obtain the estimated cavity volume of the three-dimensional model further includes:
[0058] See Figure 5 , where the fully black areas (such as B3, B4, B5) are empty cubes outside the three-dimensional model and are not involved in the calculation at all. The fully white areas (such as B2, B6, B7) are empty cubes inside the three-dimensional model and are all involved in the calculation. The gray areas (such as B1, B8) are effective non-empty cubes inside the three-dimensional model and need to be further calculated after recursively dividing using the octree algorithm. The cumulative total volume is the estimated cavity volume of the three-dimensional model. The specific calculation formula is:
[0059]
[0060] Among them, A B is the cavity volume of the three-dimensional model.
[0061] Corresponding to the above three-dimensional model cavity volume estimation method based on modeling software, the present invention also provides a three-dimensional model cavity volume estimation system based on modeling software, which includes: a processing module for obtaining a three-dimensional model in the modeling software, constructing a triangular mesh for the three-dimensional model, and performing preprocessing calculations on the triangular mesh; a recursive division module for obtaining an initial cube of the three-dimensional model, recursively dividing the initial cube to a preset minimum cube using the octree algorithm, and determining whether the recursively divided cube contains the triangular mesh. If it contains the triangular mesh, it is a non-empty cube, and if it does not contain the triangular mesh, it is an empty cube; a plugging module for correcting the spatial nodes of the cube recursively divided by the octree algorithm and performing plugging processing; and a calculation module for obtaining the volume of all the empty cubes inside the three-dimensional model and obtaining the estimated cavity volume of the three-dimensional model.
[0062] In addition, as an implementation form, the present invention further provides a three-dimensional model processing device, which includes a memory storing a computer program. When the computer program is executed by a processor, it implements the three-dimensional model cavity volume estimation method based on modeling software according to any of the above technical solutions. Correspondingly, the present invention further provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the three-dimensional model cavity volume estimation method based on modeling software according to any of the above technical solutions. The computer-readable storage medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program included on the computer-readable medium may be transmitted by any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0063] The three-dimensional model cavity volume estimation method based on modeling software of the present invention has the following advantages: By discretizing and using the octree algorithm for multi-threaded parallel processing, the data processing time is significantly reduced, ensuring that the deviation between the estimated result and the actual result is small; it is applicable to the volume estimation requirements in various scenarios and supports automatic gap sealing, reducing manual iterative data patching. This method can efficiently process complex models, thereby providing users with accurate volume estimation, improving design efficiency and reducing R & D costs, with significantly improved accuracy and more efficient calculation efficiency.
[0064] The preferred embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solutions of the present invention, and these simple modifications all fall within the protection scope of the present invention.
[0065] In addition, it should be noted that, in the above specific embodiments, the various specific technical features described can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present invention will not separately describe various possible combination methods.
[0066] Furthermore, any combination can be made between various different embodiments of the present invention as long as it does not violate the idea of the present invention, and it should also be regarded as the content disclosed by the present invention.
Claims
1. A method for estimating the cavity volume of a 3D model based on modeling software, characterized in that, The steps are as follows: Obtain a 3D model in modeling software, construct a triangular mesh for the 3D model, and perform preprocessing calculations on the triangular mesh; Obtain the initial cube of the 3D model, recursively divide the initial cube into preset minimum cubes using the octree algorithm, and determine whether the divided cubes contain the triangular mesh. If a cube contains the triangular mesh, it is a non-empty cube; if it does not contain the triangular mesh, it is an empty cube; Correct the spatial nodes of the cubes recursively divided by the octree algorithm and perform plugging processing; Obtain the total volume of all the empty cubes inside the 3D model to obtain the estimated cavity volume of the 3D model.
2. The three-dimensional model cavity volume estimation method based on modeling software according to claim 1, wherein It also includes generating visual empty cubes to display the internal cavity volume of the 3D model.
3. The three-dimensional model cavity volume estimation method based on modeling software according to claim 1, characterized in that The octree algorithm includes: Obtain the size information of the initial cube, where the size of the initial cube is a cube that is an exponential multiple of 2 of the size of the preset minimum cube; Use the octree algorithm to divide the initial cube into eight sub-cubes, and determine whether each sub-cube contains the triangular mesh; if a sub-cube does not contain the triangular mesh, the sub-cube will not continue to be divided by the octree algorithm, and the sub-cube information will be saved; if a sub-cube contains the triangular mesh, the sub-cube will continue to be divided by the octree algorithm, and determine whether the divided cube contains the triangular mesh, and recursively perform this step until the size of the divided cube is the size of the preset minimum cube, and determine whether there is an intersection relationship between the cube and the triangular mesh.
4. The three-dimensional model cavity volume estimation method based on modeling software according to claim 3, characterized in that, The correcting the spatial nodes of the cubes recursively divided by the octree algorithm and performing plugging processing includes: Correct the spatial nodes through the internal and external connectivity of the empty cubes, adopt the search methods from inside to outside and from outside to inside, and perform automatic plugging by searching for internal and external connectivity bidirectionally.
5. The three-dimensional model cavity volume estimation method based on modeling software according to claim 4, characterized in that, The search method includes: Obtain the center point of the initial cube as the internal starting point for internal calculation, and search for the empty cube closest to the internal starting point as the internal starting cube; Obtain the minimum coordinate point of the initial cube as the external starting point for external calculation, and search for the empty cube closest to the external starting point as the external starting cube; According to the external starting cube and the internal starting cube, perform bidirectional search, record the path, and when the distance passed through the channel is less than a preset multiple of the preset minimum size, set the corresponding position of the cube with the attribute of not being passable, and perform plugging processing on the position.
6. The method for estimating the cavity volume of a three-dimensional model based on modeling software according to claim 3 or 5, characterized in that, The obtaining the total volume of all the empty cubes inside the 3D model to obtain the estimated cavity volume of the 3D model includes: Recursively find all the adjacent empty cubes to the internal starting cube, and the adjacent non-empty cubes that have overlapping faces with the adjacent empty cubes, pair the adjacent empty cubes and the adjacent non-empty cubes, and save the paired adjacent non-empty cubes as valid non-empty cubes; The effective volume of the effective non-empty cubes and the total volume of all the empty cubes inside the three-dimensional model are recursively calculated to obtain the estimated cavity volume of the three-dimensional model.
7. The three-dimensional model cavity volume estimation method based on modeling software according to claim 6, characterized in that The calculation of the effective volume of the effective non-empty cubes includes: Obtain the center points of the adjacent empty cubes and the centroid points of the triangular mesh surfaces inside the adjacent non-empty cubes, connect the centroid points of the triangular mesh surfaces and the three vertices of the triangular mesh surfaces to the center points of the adjacent empty cubes respectively, and determine whether the connections intersect with other triangular mesh surfaces. If any one of the connections does not intersect with the triangular mesh surface, then the triangular mesh surface is a visible triangular mesh surface; Divide the cubes that have an intersection relationship with the triangular mesh surface into preset equal small cubes, calculate all the visible triangular mesh surfaces inside the non-empty cubes, and determine whether the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular mesh surface. If the center points of the small cubes and the center points of the empty cubes are on the same side of the visible triangular mesh surface, then the small cubes are effective small cubes; Calculate the total volume of all the effective small cubes to obtain the effective volume.
8. A three-dimensional model cavity volume estimation system based on modeling software, characterized in that, It includes: A processing module, configured to obtain a three-dimensional model in modeling software, construct a triangular mesh surface for the three-dimensional model, and perform preprocessing calculations on the triangular mesh surface; A recursive splitting module, configured to obtain the initial cube of the three-dimensional model, recursively split the initial cube into preset minimum cubes by using an octree algorithm, and determine whether the cube after recursive splitting contains the triangular mesh surface. If it contains the triangular mesh surface, it is a non-empty cube, and if it does not contain the triangular mesh surface, it is an empty cube; A plugging module, configured to correct the spatial nodes of the cubes recursively split by the octree algorithm and perform plugging processing; and A calculation module, configured to obtain the total volume of all the empty cubes inside the three-dimensional model to obtain the estimated cavity volume of the three-dimensional model.
9. A three-dimensional model processing device, including a memory storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for estimating the cavity volume of a three-dimensional model based on modeling software according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for estimating the cavity volume of a three-dimensional model based on modeling software according to any one of claims 1 to 7.