BDIM pre-processing method based on STL file reconstruction model
By generating local bounding boxes and compressing global distance calculations to adjacent triangle neighbors, the step-like distortion problem of BDIM method when dealing with complex surfaces is solved, and efficient fidelity and geometric adaptability of model reconstruction are achieved.
Patent Information
- Application Number
- CN202510447292.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-18
AI Technical Summary
When the existing BDIM method deals with complex surfaces with a radius of curvature less than 3 to 5 times the grid size, the interpolation strategy along the coordinate axis direction leads to obvious step-like distortion of the model, affecting geometric adaptability.
By generating a local bounding box with an extended ±3Δ as a spatial index structure, the global distance calculation is compressed to the neighboring triangle area, and the distance calculation, position determination and assignment operations between the grid in the bounding box and the triangle surface elements are eliminated, step-like distortion at the smaller model curvature radius.
The fidelity and efficiency of model reconstruction are improved, the step-like distortion at the smaller radius of curvature is eliminated, and the geometric adaptability of the model is enhanced.
Smart Images

Figure CN120337813A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computational fluid dynamics, and particularly relates to a BDIM preprocessing method based on an STL file reconstruction model applicable to the analysis of hydrodynamic characteristics of a fluid disturbed by an underwater immersed solid. Background Art
[0002] Currently, in the existing boundary data immersion method (BDIM), during the model preprocessing stage, an interpolation strategy along the coordinate axes direction is mainly adopted. For the division of the computational domain, a global uniform Cartesian grid is mostly used. When constructing a model, after discretizing the information file of the underwater immersed solid to the global uniform Cartesian grid points by reading the model.dat file, the fluid control equation and the solid control equation are coupled by using a kernel function to obtain a unified fluid-structure interaction equation. Although the difficulty of grid generation in the above BDIM method is smaller than that when using unstructured grids, when dealing with some complex surfaces (such as aeroengine blades) with a curvature radius less than 3 - 5 times the grid size or non-orthogonal boundaries, the interpolation strategy along the coordinate axes direction will cause obvious stepped distortion of the constructed model relative to the actual model. Therefore, this method has certain limitations in geometric adaptability. Summary of the Invention
[0003] In view of this, in response to the technical problems existing in the field, the present invention provides a BDIM preprocessing method based on an STL file reconstruction model, which specifically includes the following steps:
[0004] Step 1: Generate an STL file for the underwater immersed solid to be analyzed, and describe the solid by using a plurality of triangular facets.
[0005] Step 2: Extract the spatial position coordinate information of each triangular facet in the STL file, and calculate the bounding box of each triangular facet.
[0006] Step 3: For each grid point inside each bounding box, perform the following operations in sequence: calculate the distance information between each grid and the triangular facets inside the corresponding bounding box, determine whether the grid point is inside or outside the model, and determine the conflict position of the grid point.
[0007] Step 4: After being processed by Step 3, assign values to each grid point based on the unique distance information of each grid point to determine the boundary between the solid and the fluid.
[0008] Further, each triangular facet in the STL file generated in Step 1 is specifically set in a form where the normal direction is all oriented towards the outside of the model, each normal vector is a unit vector, and its error angle is controlled to be less than 0.5°; if the normal direction of a certain triangular facet is oriented towards the inside of the model, it is modified to be oriented towards the outside.
[0009] After all triangular facets are generated, check the closedness of the underwater submerged solid model and the adjacency at the boundaries of each triangular facet to ensure that there are no cracks in the model.
[0010] Further, in step two, the bounding boxes of each triangular facet are calculated specifically in the following way:
[0011] First, extract the spatial rectangular coordinate system coordinates of the vertices A, B, and C of any triangular facet T from the STL file. Define the minimum coordinate values as x = x0, y = y0, z = z0, and the maximum coordinate values as x = x1, y = y1, z = z1. Then, the cube enclosed by the planes x = x0 - 3Δ, y = y0 - 3Δ, z = z0 - 3Δ, x = x1 + 3Δ, y = y1 + 3Δ, z = z1 + 3Δ is the bounding box of the triangular facet T; where Δ represents the grid size.
[0012] Further, calculating the distance between each grid and the triangular facets inside the corresponding bounding box in step three specifically includes: for each grid point inside each bounding box, calculate the minimum distance d1 from it to the vertices of the triangular facets inside the bounding box, the minimum distance d2 to the three sides of the triangular facet, and the minimum distance d3 to the triangular facet, to obtain the distance information d = min(d1, d2, d3);
[0013] The process of judging whether a grid point is inside or outside the model specifically includes: connecting the grid point in the bounding box with one of the vertices of the triangular facet to form a vector, and performing a dot product calculation between this vector and the normal vector of the triangular facet. If the calculation result is negative, then the grid point is determined to be outside the model; if the numerical calculation result is positive, then the grid point is judged to be inside the model;
[0014] For grid points that are simultaneously in different bounding boxes and have inconsistent judgment conclusions regarding whether they are inside or outside the model within the bounding boxes, the process of determining the conflict position specifically includes: starting from this grid point, emitting a ray along the positive x-axis direction and calculating the number of intersection points of this ray with the model. If the number of intersection points is even (including 0), then it is determined that this grid point belongs to the outside of the model; if the number of intersection points is odd, then it is determined that this grid point belongs to the inside of the model.
[0015] Further, assigning values to each grid point in step four is specifically based on the following rules:
[0016] After determining the distance information d corresponding to each grid point in Step 3, a judgment is made in combination with the grid size Δ: when d > 2Δ, the grid point is assigned a value of 0; when d < -2Δ, the grid point is assigned a value of 1; when -2Δ ≤ d ≤ 2Δ, the grid point is assigned a value of 0.5 - d / 4 / Δ + sin(-πd / 2 / Δ) / 2 / π. The purpose of such assignment is to ensure that when -2Δ ≤ d ≤ 2Δ, the assignment of the grid point smoothly transitions between 0 and 1.
[0017] Further, when reconstructing the STL file that has undergone the above preprocessing in a global uniform Cartesian grid, a calculation path is specifically generated using the normal vectors of each triangular element to eliminate the stepped distortion in the region where the radius of curvature ranges from 3 to 5Δ.
[0018] The above BDIM preprocessing method for reconstructing a model based on an STL file provided by the present invention first generates local bounding boxes expanded by ±3Δ, and uses these bounding boxes as a spatial index structure to compress the global distance calculation to the neighborhood of adjacent triangles. Then, through the distance calculation, position determination, and assignment operation of the grid within the bounding box and the triangular element in sequence, the fidelity of model reconstruction can be effectively improved, the stepped distortion at the smaller radius of curvature of the model can be eliminated, and at the same time, the efficiency of model reconstruction is also significantly improved. Description of the Drawings
[0019] Figure 1 It is a flowchart of the method provided by the present invention. Detailed Embodiments
[0020] Next, the technical solution of the present invention will be clearly and completely described in conjunction with the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0021] The present invention provides a BDIM preprocessing method for reconstructing a model based on an STL file, as Figure 1 shown, which specifically includes the following steps:
[0022] Step 1: Generate an STL file for the underwater submerged solid to be analyzed, and describe the solid using multiple triangular elements;
[0023] Step 2: Extract the spatial position coordinate information of each triangular element in the STL file, and calculate the bounding box of each triangular element;
[0024] Step 3: For each grid point inside each bounding box, perform the following operations in sequence: calculate the distance information between each grid and the triangular element inside the corresponding bounding box, determine whether the grid point is inside or outside the model, and determine the conflict position of the grid point;
[0025] Step 4: Based on the unique distance information of each grid point after the treatment in Step 3, assign values to each grid point to determine the boundary between the solid and the fluid.
[0026] In a preferred embodiment of the present invention, each triangular facet in the STL file generated in Step 1 is specifically set in a form where the normal direction is all oriented towards the outside of the model. Each normal vector is a unit vector, and its error angle is controlled to be less than 0.5°. If the normal direction of a certain triangular facet faces towards the inside of the model, it is modified to face the outside.
[0027] After all triangular facets are generated, check the closeness of the underwater immersed solid model and the adjacency at the boundaries of each triangular facet to ensure that there are no cracks in the model.
[0028] In a preferred embodiment of the present invention, the bounding box of each triangular facet is specifically calculated in Step 2 by the following method:
[0029] First, extract the spatial rectangular coordinate system coordinates of the vertices A, B, and C of any triangular facet T from the STL file. Define the minimum coordinate values as x = x0, y = y0, z = z0, and the maximum coordinate values as x = x1, y = y1, z = z1. Then, the cube surrounded by the planes x = x0 - 3Δ, y = y0 - 3Δ, z = z0 - 3Δ, x = x1 + 3Δ, y = y1 + 3Δ, z = z1 + 3Δ is the bounding box of the triangular facet T; where Δ represents the grid size.
[0030] In a preferred embodiment of the present invention, calculating the distance between each grid and the triangular facets inside the corresponding bounding box in Step 3 specifically includes: for each grid point inside each bounding box, calculate the minimum distance d1 from it to each vertex of the triangular facets inside the bounding box, the minimum distance d2 to the three sides of the triangular facet, and the minimum distance d3 to the triangular facet, and obtain the distance information d = min(d1, d2, d3).
[0031] The judgment process of whether the grid point is inside or outside the model specifically includes: connect the grid point in the bounding box with one of the vertices of the triangular facet to form a vector, and perform a dot product calculation between this vector and the normal vector of the triangular facet. If the calculation result is negative, then determine that the grid point is outside the model; if the numerical calculation result is positive, then determine that the grid point is inside the model.
[0032] For grid points that are simultaneously in different bounding boxes and have inconsistent internal and external judgment conclusions within the model in the bounding boxes, the conflict position determination process specifically includes: starting from this grid point, emitting a ray along the positive x-axis direction and calculating the number of intersections of this ray with the model. If the number of intersections is even (including 0), it is determined that this grid point belongs to the outside of the model; if the number of intersections is odd, it is determined that this grid point belongs to the inside of the model.
[0033] In a preferred embodiment of the present invention, the assignment of each grid point in step four is specifically based on the following rules:
[0034] After determining the distance information d corresponding to each grid point in step three, combined with the grid size Δ for judgment: when d > 2Δ, the grid point is assigned 0; when d < -2Δ, the grid point is assigned 1; when -2Δ ≤ d ≤ 2Δ, the grid point is assigned 0.5 - d / 4 / Δ + sin(-πd / 2 / Δ) / 2 / π. The purpose of such assignment is to ensure that when -2Δ ≤ d ≤ 2Δ, the assignment of the grid point smoothly transitions between 0 and 1.
[0035] In a preferred embodiment of the present invention, when reconstructing the STL file that has completed the above preprocessing in a global uniform Cartesian grid, a calculation path is specifically generated using the normal vectors of each triangular facet to eliminate the stepped distortion in the region where the curvature radius ranges from 3 to 5Δ.
[0036] It should be understood that the magnitudes of the sequence numbers of the steps in the embodiments of the present invention do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0037] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A preprocessing method for BDIM based on STL file reconstruction model, characterized in that: Specifically, it includes the following steps: Step 1: Generate an STL file for the underwater immersed solid to be analyzed, and describe the solid using multiple triangular facets; Step 2: Extract the spatial position coordinate information of each triangular facet in the STL file, and calculate the bounding box of each triangular facet; Step 3: For each grid point inside each bounding box, execute in sequence: calculate the distance information between each grid and the triangular facets inside the corresponding bounding box, judge whether the grid point is inside or outside the model, and determine the conflict position of the grid point; Step 4: After being processed by Step 3, based on the unique distance information of each grid point, assign values to each grid point to determine the boundary between the solid and the fluid.
2. The method according to claim 1, characterized in that: Each triangular facet in the STL file generated in Step 1 is specifically set in a form where the normal direction all faces the outside of the model, each normal vector is a unit vector, and its error angle is controlled to be less than 0.5°; if the normal direction of a certain triangular facet faces the inside of the model, it is modified to face the outside; After all triangular facets are generated, check the closeness of the underwater immersed solid model and the adjacency at the boundaries of each triangular facet to ensure that there are no cracks in the model.
3. The method according to claim 2, characterized in that: In Step 2, the bounding box of each triangular facet is specifically calculated in the following way: First, extract the spatial rectangular coordinate system coordinates of the vertices A, B, and C of any triangular facet T from the STL file, define the minimum coordinate values as x = x0, y = y0, z = z0, and the maximum coordinate values as x = x1, y = y1, z = z1. Then, the cube surrounded by the planes x = x0 - 3Δ, y = y0 - 3Δ, z = z0 - 3Δ, x = x1 + 3Δ, y = y1 + 3Δ, z = z1 + 3Δ is the bounding box of the triangular facet T; where Δ represents the grid size.
4. The method according to claim 3, wherein: In Step 3, calculating the distance between each grid and the triangular facets inside the corresponding bounding box specifically includes: for each grid point inside each bounding box, calculate the minimum distance d1 from it to each vertex of the triangular facets inside the bounding box, the minimum distance d2 to the three sides of the triangular facet, and the minimum distance d3 to the triangular facet, and obtain the distance information d = min(d1, d2, d3); The process of judging whether the grid point is inside or outside the model specifically includes: connect the grid point in the bounding box with one of the vertices of the triangular facet to form a vector, and perform a dot product calculation between this vector and the normal vector of the triangular facet. If the calculation result is negative, then judge that the grid point is outside the model. If the numerical calculation result is positive, then judge that the grid point is inside the model; For the grid points that are simultaneously in different bounding boxes and whose inside / outside judgment conclusions in the bounding boxes are inconsistent, the process of determining their conflict positions specifically includes: starting from this grid point, emit a ray along the positive x-axis direction and calculate the number of intersection points of this ray and the model. If the number of intersection points is 0 or other even numbers, then judge that this grid point belongs to the outside of the model. If the number of intersection points is odd, then judge that this grid point belongs to the inside of the model.
5. The method according to claim 4, characterized in that: In Step 4, the assignment of each grid point is specifically based on the following rules: After determining the distance information d corresponding to each grid point in Step 3, it is judged in combination with the grid size Δ: when d > 2Δ, the grid point is assigned a value of 0; when d < -2Δ, the grid point is assigned a value of 1; when -2Δ ≤ d ≤ 2Δ, the grid point is assigned a value of 0.5 - d / 4 / Δ + sin(-πd / 2 / Δ) / 2 / π. The purpose of this assignment is to ensure that when -2Δ ≤ d ≤ 2Δ, the assignment of the grid point smoothly transitions between 0 and 1.
6. The method according to claim 3, wherein: When reconstructing the STL file that has completed the above preprocessing in a globally uniform Cartesian grid, a calculation path is specifically generated using the normal vectors of each triangular element to eliminate the stepped distortion in the region where the curvature radius ranges from 3 to 5Δ.