Volume model generation method and device and electronic equipment
By emitting rays in the enclosing box model of the three-dimensional model to determine the intersection location and generate a volume model, the problem of low generation efficiency of non-closed model is solved, and efficient volume model generation and detail retention are achieved.
Patent Information
- Application Number
- CN202410146864.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art requires a lot of manual adjustments to generate accurate volume agents when generating volume models, especially non-closed models, resulting in inefficiency.
By obtaining the enclosing box model of the target three-dimensional model, the intersection location is determined using multiple surface plane emission rays, thereby determining the target voxel from the voxel and generating a volume model.
The volume model can be approximately generated without considering whether the three-dimensional model is closed, retaining the details of surface dents, improving the generation efficiency and wide application.
Smart Images

Figure CN120411408A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of three-dimensional virtual models, and more particularly, to a method, apparatus, and electronic device for generating a volume model. Background Art
[0002] In films and games, in order to more quickly simulate hydrodynamics and achieve natural and delicate collision interactions, the models participating in the collision usually use a simplified volume model to replace. This replacement model is called a volume collision proxy. In the related art, a volume generation scheme can be used to generate the above volume model, such as Houdini SDF, OpenVDB, etc. The above method can generate accurate results when the input model is a closed model. However, if the model is not considered for volume generation during production, a large amount of manual work is required to adjust it to a closed model before the correct volume proxy can be generated, resulting in a low generation efficiency of the volume model. Summary of the Invention
[0003] In view of this, the purpose of the present disclosure is to provide a method, apparatus, and electronic device for generating a volume model to improve the application universality on the basis of ensuring the accuracy of the volume model.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for generating a volume model, including: obtaining a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by a plurality of surface planes; the bounding box model includes a plurality of voxels; emitting rays from the plurality of surface planes to the target three-dimensional model to determine the target intersection position of the ray and the target three-dimensional model; determining target voxels from the plurality of voxels based on the target intersection position of the ray and the target three-dimensional model; and generating a volume model corresponding to the target three-dimensional model based on the target voxels.
[0005] In a second aspect, an embodiment of the present disclosure provides a device for generating a volume model, including: a model acquisition module for obtaining a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by a plurality of surface planes; the bounding box model includes a plurality of voxels; a ray emission module for emitting rays from the plurality of surface planes to the target three-dimensional model to determine the target intersection position of the ray and the target three-dimensional model; a target voxel determination module for determining target voxels from the plurality of voxels based on the target intersection position of the ray and the target three-dimensional model; and a volume model generation module for generating a volume model corresponding to the target three-dimensional model based on the target voxels.
[0006] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned method for generating a volume model.
[0007] In a fourth aspect, an embodiment of the present disclosure provides a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-mentioned method for generating a volume model.
[0008] The embodiments of the present disclosure bring the following beneficial effects:
[0009] For the above-mentioned method, apparatus, and electronic device for generating a volume model, a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model are obtained; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by a plurality of surface planes; the bounding box model includes a plurality of voxels; rays are emitted from the plurality of surface planes to the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model; based on the target intersection positions of the rays and the target three-dimensional model, target voxels are determined from the plurality of voxels; and a volume model corresponding to the target three-dimensional model is generated based on the target voxels. In this way, it is not necessary to consider whether the target three-dimensional model is closed, and the volume model of the target three-dimensional model can be approximately generated, and details such as surface indentations of the target three-dimensional model can be retained in the volume model, improving the universality of the application while ensuring the accuracy of the volume model.
[0010] Other features and advantages of the present disclosure will be described in the following specification, and some of them will become obvious from the specification, or be understood by implementing the present disclosure. The objectives and other advantages of the present disclosure are achieved and obtained by the structures specifically pointed out in the specification, claims, and drawings.
[0011] To make the above objectives, features, and advantages of the present disclosure more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings
[0012] To more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present disclosure, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0013] Figure 1 It is a schematic diagram of a model of an interstellar battleship provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic cross-sectional view of a model of an interstellar battleship provided by an embodiment of the present disclosure;
[0015] Figure 3 A flowchart of a volume model corresponding to a model of an interstellar battleship generated based on SDF provided by an embodiment of the present disclosure;
[0016] Figure 4 A flowchart of a volume model corresponding to a model of an interstellar battleship generated based on VDB provided by an embodiment of the present disclosure;
[0017] Figure 5 A flowchart of a method for generating a volume model provided by an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of the position of a target intersection point provided by an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of AABB and OBB bounding box models provided by an embodiment of the present disclosure;
[0020] Figure 8 A schematic diagram of the projection of a model of an interstellar battleship on the surface of a corresponding bounding box model provided by an embodiment of the present disclosure;
[0021] Figure 9 A schematic diagram of a projection vertex provided by an embodiment of the present disclosure;
[0022] Figure 10 A schematic diagram of a setting interface provided by an embodiment of the present disclosure;
[0023] Figure 11 A schematic diagram of the intersection of a ray and a model of an interstellar battleship provided by an embodiment of the present disclosure;
[0024] Figure 12 A schematic diagram of the ray emission result displayed on the surface of a bounding box provided by an embodiment of the present disclosure;
[0025] Figure 13 A schematic diagram of the relative relationship between a voxel and the intersection point of a ray and a model provided by an embodiment of the present disclosure;
[0026] Figure 14 A schematic diagram of a voxel determined by the surface plane of a bounding box model provided by an embodiment of the present disclosure;
[0027] Figure 15 Another schematic diagram of a voxel determined by the surface plane of a bounding box model provided by an embodiment of the present disclosure;
[0028] Figure 16Another schematic diagram of voxels determined by the surface plane of the bounding box model provided by the embodiments of the present disclosure;
[0029] Figure 17 Another schematic diagram of the relative relationship between voxels and the intersection points of rays and the model provided by the embodiments of the present disclosure;
[0030] Figure 18 Schematic structural diagram of a volume model generation device provided by the embodiments of the present disclosure;
[0031] Figure 19 Schematic diagram of the corresponding volume model of a starship model provided by the embodiments of the present disclosure;
[0032] Figure 20 Schematic structural diagram of an electronic device provided by the embodiments of the present disclosure. Detailed implementation manners
[0033] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0034] In films, television and games, in order to simulate hydrodynamics faster and achieve natural and delicate collision interactions, the models participating in collisions usually use simplified volume models to replace. Such a replacement model is called a volume collision proxy.
[0035] In the related art, a volume collision proxy can be generated using SDF (Signed Distance Field). SDF is usually a two-dimensional or three-dimensional texture map, in which each pixel stores the distance from the pixel position to the nearest object surface, and the relationship between this point and the inside and outside of the object is considered. Therefore, the returned distance may be positive or negative. In games and films, SDF is often generated based on models for further optimization operations, such as volume collision proxies. However, many models do not consider dynamic simulation during production. For example, the geometries of models downloaded from the Internet often interpenetrate each other, which is very unsuitable for directly generating volume collision proxies.
[0036] Such as Figure 1 Taking the model of the starship shown as an example, it looks very neat. However, if the scan line algorithm or the common sparse grid volume algorithm is directly used, the resulting volume is not satisfactory. This is because the model itself is not prepared for dynamics. It only looks good on the outside, and there are various interpenetrations and overlapping surfaces, which are very unfriendly to calculating the volume collision proxy. The close-up after cutting the model from the middle is asFigure 2 As shown, it can be seen that there are a large number of non-closed openings and intersections inside the model, which will cause a lot of difficulties for generating the volume of common models.
[0037] The SDF generation node in Houdini software uses a scan-line algorithm. For a closed model, it can generate accurate SDF, but the result for this model is not satisfactory. Taking Figure 1 the model of the starship shown as the target 3D model to conduct an actual test of generating the corresponding volume collision proxy. To better observe the shape of the volume and the occlusion relationship, the corresponding volume can be converted into a model, as Figure 3 shown.
[0038] In addition, the volume collision proxy of a 3D virtual model can also be determined based on the principle of a voxel data base (VDB for short). OpenVDB is an open-source and cross-platform C++ library used to represent, process, and render 3D data, especially volume data. OpenVDB uses a hierarchical grid to represent 3D data, which can efficiently store and process large-scale 3D data, and at the same time has compressibility and variable resolution. OpenVDB has extensive applications in fields such as game development, film and television production, and scientific research, such as for implementing high-quality volume rendering, particle special effects, digital character modeling, etc.
[0039] Generate the volume model of the starship model shown using OpenVDB with extremely high fault tolerance, as Figure 1 shown. As Figure 4 shown, it can be seen that due to too many openings in this model, there are great problems in the judgment of inside and outside by the VDB algorithm, and the result is unusable.
[0040] For the above-mentioned volume generation schemes, Houdini SDF and OpenVDB, accurate results can be generated when the input model is a closed model. However, if the model is not considered for volume generation during production, a large amount of manual work is required to adjust it to a closed model before the correct volume proxy can be generated.
[0041] Based on this, an embodiment of the present disclosure provides a method, device, and electronic device for generating a volume model. This technology can be applied to the process of generating the volume model corresponding to various 3D virtual models or the process of determining the volume collision proxy.
[0042] In a possible implementation manner, an embodiment of the present disclosure provides a method for generating a volume model. As Figure 5 shown, this method includes the following steps:
[0043] Step S502 , obtaining a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels.
[0044] The above-mentioned target three-dimensional model usually refers to a three-dimensional model in a virtual space, which occupies a certain space in the virtual space. This part of the space can be regarded as the volume of the target three-dimensional model. The target three-dimensional model can usually be a simple convex body, or it can be a polyhedron with a concave part, such as an inward opening, or there can be a hollow part in the internal space. When generating a volume model corresponding to the target three-dimensional model, it is usually necessary to retain the influence of the concave part of the target three-dimensional model on the volume occupied by the entire target three-dimensional model, without considering the influence of the internal hollow part on the volume. However, when the space formed by the concave part is very small and the shape is very irregular, it is also possible to consider ignoring the influence of this part.
[0045] Bounding box is an algorithm for finding the optimal bounding space of a discrete point set. The basic idea is to use a geometric body (called a bounding box) that is slightly larger in size and simpler in characteristics to approximately replace complex geometric objects. The generated bounding box model can usually be fully incorporated into the corresponding three-dimensional model. Common bounding box algorithms include AABB bounding box, bounding sphere, directional bounding box OBB, and fixed-direction convex hull FDH. Among them, AABB bounding box and directional bounding box OBB will generate a rectangular parallelepiped model, which is consistent with the bounding box surrounded by multiple surface planes used in this method. In this case, the surface planes of the bounding box are the six faces of the rectangular parallelepiped. Therefore, the bounding box corresponding to the target three-dimensional model can be generated by the AABB bounding box and OBB bounding box algorithms. If there are other methods that can also generate a bounding box surrounded by multiple surface planes, other methods can also be used to generate the bounding box corresponding to the target three-dimensional model, and there is no restriction here.
[0046] The above-mentioned voxel usually refers to a pixel point in three-dimensional space. Analogous to the pixel in a two-dimensional image, the voxel is the smallest visible element in a three-dimensional image, representing the information within a cube. In medical imaging, computer games, virtual reality and other three-dimensional graphics fields, voxels are often used to represent three-dimensional models or volume data. Each voxel can contain some data, such as color, density, temperature or other attributes, which can be processed and visualized by computer graphics algorithms. The voxels of the above-mentioned bounding box model can be obtained by segmenting along the surface plane and surface normal of the bounding box model based on the minimum resolution of the three-dimensional space, and can be regarded as multiple small cubes parallel to the surface plane.
[0047] Step S504 : emitting rays toward the target three-dimensional model based on the multiple surface planes, and determining a target intersection position between the rays and the target three-dimensional model.
[0048] Since the target 3D model is located inside the bounding box model, if a ray needs to intersect with the target 3D model, the ray needs to be emitted into the interior of the bounding box model. Specifically, the ray can be emitted vertically towards the target 3D model with respect to the surface plane.
[0049] When the ray has an intersection point with the target 3D model, it can be considered that the ray enters the interior space of the target 3D model from the interior space of the bounding box model. The positions of the voxels passed through by the ray before this intersection point are outside the target 3D model, and the voxels passed through by the ray after this intersection point are inside the target 3D model. When the ray can extend from the interior of the target 3D model, the intersection point position of the ray and the target 3D model can also indicate that the position of the voxel passed through by the ray changes from being inside the target 3D model to being outside the target 3D model. Only in the above way can it be determined whether the voxels passed through by the ray are inside the target 3D model. When determining whether all the voxels in the bounding box model are inside the target 3D model or outside the target 3D model, it is necessary to control the ray to pass through all the voxels.
[0050] At this time, for each surface plane, multiple rays need to be emitted from the surface plane. When determining the projection vertices corresponding to the rays, the surface plane can be divided into multiple regions by using the projections of the voxels on the surface plane. And a projection vertex is determined in each region, and the ray emitted from this projection vertex can pass through the voxels corresponding to this projection, so as to traverse the voxels that can produce projections on this surface plane. After performing the above operations for each surface plane, all the voxels in the bounding box model can be traversed.
[0051] When the bounding box model is a cuboid, every two opposite surface planes are parallel. If the voxel model can be regarded as a cube parallel to the surface planes of the bounding box model, the projections of the voxel model on two opposite surface planes are the same. Therefore, only one of the two opposite surface planes needs to be selected to emit rays towards the target 3D model.
[0052] When the target 3D model includes a hollowed-out part inside or a recessed part, the number of intersection points of the ray and the target 3D model is usually more than two. The intersection points of the ray and the target 3D model can all be used as the target intersection positions, or only the intersection points of the ray and the target 3D model that are the closest and the farthest from the projection vertex of the ray can be selected as the target intersection positions. Specifically, it can be set according to requirements and is not limited here.
[0053] Step S506, determine the target voxels from multiple voxels based on the target intersection positions of the ray and the target 3D model.
[0054] The above-mentioned target voxels are usually the voxels determined to be within the target 3D model based on the target intersection positions in the bounding box model. Usually, based on the target intersection positions, the position parameters of the voxels within the target 3D model can be determined, and then the positions of each voxel in the bounding box model are sequentially judged to see if they meet the position parameters of the voxels within the target 3D model. If they meet, the voxel is determined as the target voxel.
[0055] As described above, multiple intersection positions of the ray and the target 3D model can be used as the target intersection positions. At this time, multiple intersection combinations need to be determined. Each intersection combination includes two adjacent target intersection positions. The target intersection position closer to the projection vertex indicates that the ray enters the target 3D model from outside the target 3D model, and the target intersection position farther from the projection vertex indicates that the ray exits the target 3D model from within the target 3D model. Based on the two target intersection positions in each intersection combination, a position parameter range can be determined. As Figure 6 shown, the position parameter ranges [x1, x2] and [x3, x4] are determined.
[0056] By judging whether the position of the voxel passed through by the ray falls within the above position parameter range, it can be determined whether the voxel is within the target 3D model. If the above judgment process is performed on all voxels, all target voxels among the multiple voxels can be determined. When the target 3D model is a cuboid, the above judgment can be only performed on the voxels passed through by each ray emitted from one surface plane, so as to traverse all voxels and thus determine all target voxels.
[0057] However, when the target 3D model includes internally hollowed-out parts and recessed parts, it is impossible to distinguish between the internally hollowed-out parts and the recessed parts. The internally hollowed-out parts do not affect the volume model of the target 3D model. If the above processing is performed on the target intersection positions of the ray with the internally hollowed-out parts and the recessed parts, many unnecessary calculations will be carried out.
[0058] In the specific implementation process, the farthest and nearest intersection positions of the ray and the target 3D model can be used as the target intersection positions. Then in the case as Figure 6 shown, only one position parameter range [x1, x4] will be determined. At this time, it can be determined whether the voxel passed through by the ray is within the position range determined by [x1, x4]. If it is within, it is considered that the voxel is within the target 3D model in this direction.
[0059] And based on Figure 6 it can be known that when the target 3D model has recessed parts, even if the voxel is judged to be within the target 3D model in the current direction, the voxel may actually not be within the target 3D model, as Figure 6Voxels within the range of [x2, x3] in it. At this time, it is necessary to determine whether the pixel is located inside the target three-dimensional model in the corresponding direction through the target intersection positions corresponding to the rays in other directions. If the pixel is determined to be located inside the target three-dimensional model in any direction, it can be determined that the pixel is located inside the target three-dimensional model. Referring to the spatial coordinate system, if it can be determined that the pixel is located inside the target three-dimensional model in three mutually perpendicular directions, it is determined that the pixel is located inside the target three-dimensional model.
[0060] Step S508, generate a volume model corresponding to the target three-dimensional model based on the target voxels.
[0061] After determining the target voxels, the three-dimensional model composed of the target voxels can be determined as the volume model corresponding to the target three-dimensional model. Due to the different target intersection positions used, the interior of the volume model composed of the target voxels may include hollowed-out parts. To prevent unnecessary impacts caused by this part, the hollowed-out parts inside can be filled with voxels, so as to generate a volume model without internal hollowed-out parts.
[0062] The above method for generating a volume model obtains the target three-dimensional model and the bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels; emit rays from the multiple surface planes to the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model; based on the target intersection positions of the rays and the target three-dimensional model, determine the target voxels from the multiple voxels; generate a volume model corresponding to the target three-dimensional model based on the target voxels. This method can approximately generate the volume model of the target three-dimensional model without considering whether the target three-dimensional model is closed, and details such as surface indentations of the target three-dimensional model can be retained in the volume model, improving the application universality on the basis of ensuring the accuracy of the volume model.
[0063] The following embodiments provide a specific method for emitting rays from multiple surface planes to the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model.
[0064] When the bounding box model is a cuboid model (a cube is regarded as a special cuboid), three target planes can be determined from the multiple surface planes of the bounding box model; among them, any two of the three target planes are perpendicular to each other. Then, for each of the three target planes, emit rays from the target plane to the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model.
[0065] To traverse each voxel in the bounding box model, it is necessary to determine multiple projection vertices in the target plane based on the projection regions of multiple voxels in the bounding box model on the target plane. In specific implementation, it is necessary to project multiple voxels in the bounding box model onto the target plane to obtain multiple projection regions; when a voxel can be regarded as a cube model parallel to the surface of the bounding box model, the projection region of the voxel on the target plane is the same as the area of a surface plane of the cube model. For each projection region, the center position of the projection region or a vertex position of the projection region can be determined as the projection vertex in the target plane, which can be specifically set according to requirements and will not be set here. For each projection vertex, based on the normal direction of the target plane, a ray is emitted from the projection vertex into the internal space of the bounding box model to determine the position of the target intersection point of the ray and the target three-dimensional model. Since it is necessary to emit a ray into the internal space of the bounding box model, the negative direction of the normal direction of the target plane is usually used as the ray emission direction, that is, the ray is perpendicular to the target plane.
[0066] In specific implementation, there can be two target intersection positions, which are respectively called the first intersection position and the second intersection position. The position of the intersection point of the ray and the target three-dimensional model that is closest to the target plane corresponding to the ray can be determined as the first intersection position, which is also the intersection point closest to the projection vertex; the position of the intersection point of the ray and the target three-dimensional model that is farthest from the target plane corresponding to the ray can be determined as the second intersection position, which is also the intersection point farthest from the projection vertex.
[0067] The following embodiments provide a specific method for determining a target voxel from multiple voxels based on the position of the target intersection point of the ray and the target three-dimensional model.
[0068] After emitting rays from three target planes to the target three-dimensional model respectively, for each target plane, based on the position of the target intersection point of the ray corresponding to the target plane and the target three-dimensional model and the positions of multiple voxels, the attribute parameters corresponding to the target plane of multiple voxels can be determined; the attribute parameters are used to indicate the relative position relationship between the voxel and the target intersection point position; this relative position relationship is usually that the voxel is located within or outside the position range determined by the target intersection point position, and then based on the attribute parameters corresponding to the target plane of multiple voxels, the target voxel among multiple voxels can be determined.
[0069] As can be seen from the above discussion, multiple projection vertices are usually determined on a target plane. By emitting rays from each projection vertex, the target plane will correspond to multiple rays. For each ray among the multiple rays corresponding to the target plane, it is necessary to determine the attribute parameters corresponding to the target plane of the multiple voxels based on the positions of the multiple voxels through which the ray passes and the position of the target intersection point of the ray and the target three-dimensional model. Specifically, the above target intersection point position may include a first intersection point position and a second intersection point position; the first intersection point position and the second intersection point position determine a position range. For each voxel among the multiple voxels through which the ray passes, it is judged whether the position of the voxel is located between the first intersection point position and the second intersection point position corresponding to the ray; the voxel usually has a position parameter, and it can be judged whether the position parameter of the voxel is within the position parameter range determined by the first intersection point position and the second intersection point position. For example, the position parameter range is [0, 10], and the position parameter of the voxel is 5, then it can be determined that the attribute parameter corresponding to the target plane of the voxel is the first parameter; otherwise, it is determined that the attribute parameter corresponding to the target plane of the voxel is the second parameter. Subsequently, when determining the target voxel, the voxel among the multiple voxels whose attribute parameters corresponding to the three target planes are all the first parameter can be directly determined as the target voxel.
[0070] The embodiment of the present disclosure also provides another method for generating a volume model. This method is implemented on the basis of the method Figure 5 shown. This method can quickly generate a volume model or a volume collision proxy of a specified model. The result generated by this method is an approximation of the original collision object, but it can retain most of the details such as dents on the collision surface. This feature is crucial for generating natural and dynamically rich fluid simulations, and the interpenetration of the model and the internal openings have no effect on the result of this method at all.
[0071] This method is implemented in the following manner:
[0072] (1) Take the bounding box (BoundingBox) of the three-dimensional model. In practical applications, it is preferably an optimized OBB, such as Figure 7 shown. The left figure is a schematic diagram of an AABB bounding box, and the right figure is a schematic diagram of an OBB bounding box.
[0073] (2) Discretize the +X, +Y, +Z, 3 faces of the BoundingBox in its own coordinate system into points. The number of points depends on the accuracy of the target volume grid. For example, 64 * 64 = 1024 points.
[0074] (3) Project rays along their corresponding axes towards the model respectively, and record the distances min and max of the nearest and farthest intersection points with the model to the above discrete points.
[0075] (4) For each point on the projection plane in each axis direction, mark the voxel values along its corresponding axis direction and at a distance from this point between min and max as InX, InY, and InZ respectively. These three marked values respectively constitute three boolean-type volumes.
[0076] (5) Perform an intersection operation on InX, InY, and InZ to obtain an approximate volume of the original model.
[0077] For easy understanding, taking the model of the starship shown above Figure 1 as an example, describe the way to implement the above method through Houdini software, which specifically includes the following steps:
[0078] 1 Prepare the BoundingBox for projection:
[0079] Generate the BoundingBox of the model (using Bound SOP or Box SOP), as Figure 8 the dark gray shadow in shows the superposition of the outline of the original model on the BoundingBox, only for comparison.
[0080] Then add subdivision points to the BoundingBox. This process is to establish the origin of the projection rays for the subsequent projection step, and the projection result will be further used to mark the values of the volume. Therefore, in order to effectively utilize each point, make the projection point of the center of the voxel of the subsequent volume corresponding to each point on the plane where this point belongs, and the number of points on each face should also be equal to the number of voxels in the volume section. Of course, an imperfect match can also generate acceptable results. Figure 9 The local display effect after adding projection vertices to the BoundingBox, each gray point is a vertex.
[0081] 2 Projection
[0082] Use the Ray SOP node to project rays from each point of the BoundingBox generated in the previous step along the negative direction of the normal of its corresponding face towards the model, and record the hit distance to the attribute dist. The reference settings are as Figure 10 shown.
[0083] To better understand the intermediate result of this step, the following is a cross-section taken along the X-axis for the visualization of the rays. As Figure 11 , it can be seen that the rays are projected towards the model along the positive and negative directions of the Z-axis respectively, and terminate after hitting the model. The distance from the ray origin (that is, Figure 11 the length of the gray marking line in) is recorded in the point attribute dist of each origin.
[0084] As Figure 12As shown, for another form of visualization, the numerical values of the dist attributes recorded at each vertex of the BoundingBox are mapped into colors. Dark gray indicates that the model is not hit, and the gray color of other parts gradually fades from dark to light, indicating that the hitting distance is getting farther and farther from the origin of the ray.
[0085] 3 Volume markers
[0086] For each axis in X, Y, and Z, there are two faces on the BoundingBox, corresponding to the positive and negative directions respectively. Since the points on these two faces are added in the same way, their coordinates are in one-to-one correspondence.
[0087] Given the dist attributes recorded for each point and its corresponding point, based on these two attributes and combined with the coordinates of the point itself, it is possible to determine whether a point in space lies within the range of the contour formed by the projection according to the following idea.
[0088] For ease of expression, a column of voxels in the volume can be described in one-dimensional space to address this problem, as Figure 13 shown.
[0089] For any point P1 on the BoundingBox with coordinates and the object length d, according to the characteristics of the BoundingBox, P2 = P1 + d can be found.
[0090] The distance at which the ray hits the object recorded at P1 is dist1, and the distance recorded at P2 is dist2. Then, for any voxel in this column of volume passing through P1 with position v, it can be determined whether it is approximately between the points where the two rays hit the object in the positive and negative directions using the following C code:
[0091] Bool IsInside = v > P1 + dist1 && v < P2 – dist2.
[0092] If IsInside is true, fill the volume (represented by white), otherwise clear it (represented by black).
[0093] Apply this strategy to each of the three axes, as Figure 14 、 Figure 15 and Figure 16 respectively visualize the results calculated for each of the three axes. It can be seen that for each axis, due to the ray not being able to penetrate the object, many redundant voxels are marked after hitting the first surface closest to the BoundingBox. However, when we take the intersection of the volumes calculated for each of the three axes, this problem can be greatly alleviated, and a volume range very similar to the original model is obtained.
[0094] For ease of description, as Figure 17Shown is a simplified version of a two-dimensional space: the black voxels are those excluded by both the horizontal and vertical axis rays, and the gray ones are those excluded only by the vertical or horizontal axis. It can be seen that there are still 2 voxels that are clearly outside the object but are marked as inside the object because they are not covered by the rays. Figure 17 In Figure 17 , the colors of the borders of these two voxels are deepened. However, the impact of these voxels on the visual effect of fluid simulation in the context of film and games is very small. As Figure 18 shown, the volume model obtained by processing the model of the starship shown in Figure 1 can be used as a volume collision proxy.
[0095] This method can quickly generate an approximate volume collision proxy, allowing for arbitrary intersections and openings inside the model. Although the result is only an approximation, for cases where internal details need to be retained, such as indoors, due to the principle of simplification based on projection, it is not possible to generate a suitable proxy result in one go. However, for fluid simulation, scene simplification, etc., the requirements for the model can be greatly reduced. In the above cases, since most of the details of the collision-occurring areas are on the outside, they can all be retained. Overall, it is a suitable way to generate volume models or volume collision proxies.
[0096] For the above method embodiments, refer to Figure 19 the volume model generation device shown in
[0097] A model acquisition module 1902, configured to acquire a target three-dimensional model and the bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located within the bounding box model; the bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels;
[0098] A ray emission module 1904, configured to emit rays towards the target three-dimensional model based on the multiple surface planes to determine the target intersection positions of the rays and the target three-dimensional model;
[0099] A target voxel determination module 1906, configured to determine target voxels from the multiple voxels based on the target intersection positions of the rays and the target three-dimensional model;
[0100] A volume model generation module 1908, configured to generate a volume model corresponding to the target three-dimensional model based on the target voxels.
[0101] The above-mentioned generating device for a volume model obtains a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located within the bounding box model; the bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels; based on the multiple surface planes, rays are emitted towards the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model; based on the target intersection positions of the rays and the target three-dimensional model, target voxels are determined from the multiple voxels; and based on the target voxels, a volume model corresponding to the target three-dimensional model is generated. This method can approximately generate a volume model of the target three-dimensional model without considering whether the target three-dimensional model is closed, and details such as surface indentations of the target three-dimensional model can be retained in the volume model, improving the generality of the application while ensuring the accuracy of the volume model.
[0102] The above-mentioned ray emission module is further configured to: determine three target planes from the multiple surface planes; any two of the three target planes are perpendicular to each other; for each of the three target planes, rays are emitted towards the target three-dimensional model based on the target plane to determine the target intersection positions of the rays and the target three-dimensional model.
[0103] The above-mentioned ray emission module is further configured to: based on the projection regions of the multiple voxels in the bounding box model on the target plane, determine multiple projection vertices in the target plane; for each projection vertex, based on the normal direction of the target plane, rays are emitted from the projection vertex into the internal space of the bounding box model to determine the target intersection positions of the rays and the target three-dimensional model.
[0104] The above-mentioned ray emission module is further configured to: project the multiple voxels in the bounding box model onto the target plane to obtain multiple projection regions; for each projection region, the central position of the projection region is determined as the projection vertex in the target plane.
[0105] The above-mentioned target intersection positions include a first intersection position and a second intersection position; the above-mentioned ray emission module is further configured to: determine the position of the intersection of the ray and the target three-dimensional model that is closest to the target plane corresponding to the ray as the first intersection position; the target plane corresponding to the ray is perpendicular to the ray; and determine the position of the intersection of the ray and the target three-dimensional model that is farthest from the target plane corresponding to the ray as the second intersection position.
[0106] The above-mentioned multiple surface planes include three target planes; any two of the three target planes are perpendicular to each other; the ray is perpendicular to the corresponding target plane; the above-mentioned ray emission module is further configured to: for each of the three target planes, based on the position of the target intersection of the ray corresponding to the target plane and the positions of multiple voxels, determine the attribute parameters corresponding to the target plane for the multiple voxels; the attribute parameters are used to indicate the relative position relationship between the voxel and the target intersection position; based on the attribute parameters corresponding to the target plane for the multiple voxels, determine the target voxels among the multiple voxels.
[0107] The above-mentioned target voxel determination module is further configured to: for each ray among the multiple rays corresponding to the target plane, based on the positions of the multiple voxels passed through by the ray and the position of the target intersection of the ray and the target 3D model, determine the attribute parameters corresponding to the target plane for the multiple voxels.
[0108] The above-mentioned target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection farthest from the target plane corresponding to the ray; the attribute parameters include a first parameter or a second parameter; the above-mentioned target voxel determination module is further configured to: for each voxel among the multiple voxels passed through by the ray, determine whether the position of the voxel is between the first intersection position and the second intersection position corresponding to the ray; if so, determine that the attribute parameter corresponding to the target plane for the voxel is the first parameter; if not, determine that the attribute parameter corresponding to the target plane for the voxel is the second parameter.
[0109] The above-mentioned target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection farthest from the target plane corresponding to the ray; the attribute parameters include a first parameter; the first parameter indicates that the voxel is between the first intersection position and the second intersection position corresponding to the ray passing through the voxel; the above-mentioned target voxel determination module is further configured to: determine the voxels among the multiple voxels whose attribute parameters corresponding to the three target planes are all the first parameter as the target voxels.
[0110] This embodiment further provides an electronic device, including a processor and a memory, the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned method for generating a volume model, for example:
[0111] Obtain a target 3D model and the bounding box model corresponding to the target 3D model; the target 3D model is located within the bounding box model; the bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels; emit rays from the multiple surface planes towards the target 3D model to determine the target intersection positions of the rays and the target 3D model; determine target voxels from the multiple voxels based on the target intersection positions of the rays and the target 3D model; generate a volume model corresponding to the target 3D model based on the target voxels.
[0112] The above method can approximately generate a volume model of the target 3D model without considering whether the target 3D model is closed, and details such as surface indentations of the target 3D model can be retained in the volume model. On the basis of ensuring the accuracy of the volume model, the application universality is improved.
[0113] Optionally, the step of emitting rays from the multiple surface planes towards the target 3D model to determine the target intersection positions of the rays and the target 3D model includes: determining three target planes from the multiple surface planes; any two of the three target planes are perpendicular to each other; for each of the three target planes, emit a ray from the target plane towards the target 3D model to determine the target intersection position of the ray and the target 3D model.
[0114] Optionally, the step of emitting a ray from the target plane towards the target 3D model to determine the target intersection position of the ray and the target 3D model includes: determining multiple projection vertices in the target plane based on the projection regions of the multiple voxels in the bounding box model on the target plane; for each projection vertex, emit a ray from the projection vertex towards the internal space of the bounding box model based on the normal direction of the target plane to determine the target intersection position of the ray and the target 3D model.
[0115] Optionally, the step of determining multiple projection vertices in the target plane based on the projection regions of the multiple voxels in the bounding box model on the target plane includes: projecting the multiple voxels in the bounding box model onto the target plane to obtain multiple projection regions; for each projection region, determine the center position of the projection region as the projection vertex in the target plane.
[0116] Optionally, the target intersection positions include a first intersection position and a second intersection position; the step of determining the target intersection positions of the rays and the target 3D model includes: determining the position of the intersection point of the ray and the target 3D model that is closest to the target plane corresponding to the ray as the first intersection position; the target plane corresponding to the ray is perpendicular to the ray; determining the position of the intersection point of the ray and the target 3D model that is farthest from the target plane corresponding to the ray as the second intersection position.
[0117] Optionally, the above-mentioned multiple surface planes include three target planes; any two of the three target planes are perpendicular to each other; the ray is perpendicular to the corresponding target plane; the step of determining the target voxel from the multiple voxels based on the position of the target intersection point between the ray and the target three-dimensional model includes: for each of the three target planes, based on the position of the target intersection point between the ray corresponding to the target plane and the target three-dimensional model and the positions of the multiple voxels, determining the attribute parameters corresponding to the target plane for the multiple voxels; the attribute parameters are used to indicate the relative position relationship between the voxel and the target intersection point position; determining the target voxel among the multiple voxels based on the attribute parameters corresponding to the target plane for the multiple voxels.
[0118] Optionally, the step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the position of the target intersection point between the ray corresponding to the target plane and the target three-dimensional model and the positions of the multiple voxels includes: for each ray among the multiple rays corresponding to the target plane, based on the positions of the multiple voxels passed through by the ray and the position of the target intersection point between the ray and the target three-dimensional model, determining the attribute parameters corresponding to the target plane for the multiple voxels.
[0119] Optionally, the above-mentioned target intersection point position includes a first intersection point position and a second intersection point position; the first intersection point position is the position of the intersection point closest to the target plane corresponding to the ray; the second intersection point position is the position of the intersection point farthest from the target plane corresponding to the ray; the attribute parameters include a first parameter or a second parameter; the step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the positions of the multiple voxels passed through by the ray and the position of the target intersection point between the ray and the target three-dimensional model includes: for each voxel among the multiple voxels passed through by the ray, determining whether the position of the voxel is between the first intersection point position and the second intersection point position corresponding to the ray; if so, determining the attribute parameter corresponding to the target plane for the voxel as the first parameter; if not, determining the attribute parameter corresponding to the target plane for the voxel as the second parameter.
[0120] Optionally, the above-mentioned target intersection point position includes a first intersection point position and a second intersection point position; the first intersection point position is the position of the intersection point closest to the target plane corresponding to the ray; the second intersection point position is the position of the intersection point farthest from the target plane corresponding to the ray; the attribute parameter includes a first parameter; the first parameter indicates that the voxel is between the first intersection point position and the second intersection point position corresponding to the ray passing through the voxel; the method of determining the target voxel among the multiple voxels based on the attribute parameters corresponding to the target plane for the multiple voxels includes: determining the voxel whose attribute parameters corresponding to the three target planes are all the first parameter among the multiple voxels as the target voxel.
[0121] See Figure 20As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100, and the processor 100 executes the machine-executable instructions to implement the above method for generating a volume model.
[0122] Furthermore, The electronic device shown further includes a bus 102 and a communication interface 103. The processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
[0123] Among them, the memory 101 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 103 (which can be wired or wireless), a communication connection is realized between this system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 20 Figure 20 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0124] The processor 100 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 100 or instructions in the form of software. The above-mentioned processor 100 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute each method, step, and logic block diagram disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and combines its hardware to complete the steps of the method in the foregoing embodiments. <> <>
[0125] This embodiment also provides a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the above-mentioned method for generating a volume model. <> <>
[0126] A method, apparatus, and electronic device for generating a volume model provided by an embodiment of the present disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the foregoing method embodiments, for example: <> <>
[0127] Obtain a target three-dimensional model and a bounding box model corresponding to the target three-dimensional model; the target three-dimensional model is located in the bounding box model; the bounding box model is surrounded by a plurality of surface planes; the bounding box model includes a plurality of voxels; based on the plurality of surface planes, emit rays towards the target three-dimensional model to determine the target intersection positions of the rays and the target three-dimensional model; based on the target intersection positions of the rays and the target three-dimensional model, determine target voxels from the plurality of voxels; and generate a volume model corresponding to the target three-dimensional model based on the target voxels. <>
[0128] The above method can approximately generate the volume model of the target 3D model without considering whether the target 3D model is closed, and details such as surface indentations of the target 3D model can be retained in the volume model, which improves the universality of the application on the basis of ensuring the accuracy of the volume model.
[0129] Optionally, the step of emitting rays from multiple surface planes to the target 3D model to determine the target intersection point positions of the rays and the target 3D model includes: determining three target planes from the multiple surface planes; any two of the three target planes are perpendicular to each other; for each of the three target planes, emitting rays from the target plane to the target 3D model to determine the target intersection point positions of the rays and the target 3D model.
[0130] Optionally, the step of emitting rays from the target plane to the target 3D model to determine the target intersection point positions of the rays and the target 3D model includes: determining multiple projection vertices in the target plane based on the projection regions of multiple voxels in the bounding box model on the target plane; for each projection vertex, emitting rays from the projection vertex into the internal space of the bounding box model based on the normal direction of the target plane to determine the target intersection point positions of the rays and the target 3D model.
[0131] Optionally, the step of determining multiple projection vertices in the target plane based on the projection regions of multiple voxels in the bounding box model on the target plane includes: projecting multiple voxels in the bounding box model onto the target plane to obtain multiple projection regions; for each projection region, determining the center position of the projection region as the projection vertex in the target plane.
[0132] Optionally, the target intersection point positions include a first intersection point position and a second intersection point position; the step of determining the target intersection point positions of the rays and the target 3D model includes: determining the position of the intersection point closest to the target plane corresponding to the ray among the intersection points of the ray and the target 3D model as the first intersection point position; the target plane corresponding to the ray is perpendicular to the ray; determining the position of the intersection point farthest from the target plane corresponding to the ray among the intersection points of the ray and the target 3D model as the second intersection point position.
[0133] Optionally, the above-mentioned multiple surface planes include three target planes; any two of the three target planes are perpendicular to each other; the ray is perpendicular to the corresponding target plane; the step of determining the target voxel from the multiple voxels based on the target intersection position of the ray and the target three-dimensional model includes: for each of the three target planes, based on the target intersection position of the ray corresponding to the target plane and the positions of the multiple voxels, determining the attribute parameters corresponding to the target plane for the multiple voxels; the attribute parameters are used to indicate the relative position relationship between the voxel and the target intersection position; based on the attribute parameters corresponding to the target plane for the multiple voxels, determining the target voxel among the multiple voxels.
[0134] Optionally, the step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the target intersection position of the ray corresponding to the target plane and the positions of the multiple voxels includes: for each ray among the multiple rays corresponding to the target plane, based on the positions of the multiple voxels passed through by the ray and the target intersection position of the ray and the target three-dimensional model, determining the attribute parameters corresponding to the target plane for the multiple voxels.
[0135] Optionally, the above-mentioned target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection point closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection point farthest from the target plane corresponding to the ray; the attribute parameters include a first parameter or a second parameter; the step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the positions of the multiple voxels passed through by the ray and the target intersection position of the ray and the target three-dimensional model includes: for each voxel among the multiple voxels passed through by the ray, determining whether the position of the voxel is between the first intersection position and the second intersection position corresponding to the ray; if so, determining the attribute parameter corresponding to the target plane for the voxel as the first parameter; if not, determining the attribute parameter corresponding to the target plane for the voxel as the second parameter.
[0136] Optionally, the above-mentioned target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection point closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection point farthest from the target plane corresponding to the ray; the attribute parameter includes a first parameter; the first parameter indicates that the voxel is between the first intersection position and the second intersection position corresponding to the ray passing through the voxel; the method of determining the target voxel among the multiple voxels based on the attribute parameters corresponding to the target plane for the multiple voxels includes: determining the voxel whose attribute parameters corresponding to the three target planes are all the first parameter among the multiple voxels as the target voxel.
[0137] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0138] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific situations.
[0139] If the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the present disclosure, in essence, or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present disclosure. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0140] In the description of the present disclosure, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present disclosure. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and should not be construed as indicating or implying relative importance.
[0141] Finally, it should be noted that the above embodiments are only specific implementation manners of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than limiting them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A method for generating a volume model, characterized in that, Including: Obtain a target 3D model and a bounding box model corresponding to the target 3D model; The target 3D model is located within the bounding box model; The bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels; Based on the multiple surface planes, emit rays towards the target 3D model to determine the target intersection positions of the rays and the target 3D model; Based on the target intersection positions of the rays and the target 3D model, determine target voxels from the multiple voxels; Based on the target voxels, generate a volume model corresponding to the target 3D model.
2. The method according to claim 1, wherein The step of emitting rays towards the target 3D model based on the multiple surface planes to determine the target intersection positions of the rays and the target 3D model includes: Determine three target planes from the multiple surface planes; any two of the three target planes are perpendicular to each other; For each of the three target planes, emit a ray towards the target 3D model based on the target plane to determine the target intersection position of the ray and the target 3D model.
3. The method according to claim 2, characterized in that, The step of emitting a ray towards the target 3D model based on the target plane to determine the target intersection position of the ray and the target 3D model includes: Based on the projection regions of the multiple voxels in the bounding box model on the target plane, determine multiple projection vertices in the target plane; For each of the projection vertices, emit a ray from the projection vertex towards the internal space of the bounding box model based on the normal direction of the target plane to determine the target intersection position of the ray and the target 3D model.
4. The method according to claim 3, wherein The step of determining multiple projection vertices in the target plane based on the projection regions of the multiple voxels in the bounding box model on the target plane includes: Project the multiple voxels in the bounding box model onto the target plane to obtain multiple projection regions; For each of the projection regions, determine the center position of the projection region as the projection vertex in the target plane.
5. The method according to claim 2 or 3, characterized in that, The target intersection positions include a first intersection position and a second intersection position; The step of determining the target intersection positions of the rays and the target 3D model includes: Determine the position of the intersection point of the ray and the target 3D model that is closest to the target plane corresponding to the ray as the first intersection position; the target plane corresponding to the ray is perpendicular to the ray; Determine the position of the intersection point of the ray and the target 3D model that is farthest from the target plane corresponding to the ray as the second intersection position.
6. The method according to claim 1, wherein The multiple surface planes include three target planes; any two of the three target planes are perpendicular to each other; the ray is perpendicular to the corresponding target plane; The step of determining target voxels from the multiple voxels based on the target intersection positions of the rays and the target 3D model includes: For each of the three target planes, based on the target intersection positions of the rays corresponding to the target plane and the positions of the multiple voxels, determine the attribute parameters corresponding to the target plane for the multiple voxels; the attribute parameters are used to indicate the relative position relationship between the voxel and the target intersection position; Based on the attribute parameters corresponding to the target plane for the multiple voxels, determine the target voxels among the multiple voxels.
7. The method according to claim 6, characterized in that, The step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the target intersection positions of the rays corresponding to the target plane and the positions of the multiple voxels includes: For each ray among the multiple rays corresponding to the target plane, based on the positions of the multiple voxels passed through by the ray and the target intersection position of the ray and the target 3D model, determine the attribute parameters corresponding to the target plane for the multiple voxels.
8. The method according to claim 7, wherein The target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection farthest from the target plane corresponding to the ray; the attribute parameters include a first parameter or a second parameter; The step of determining the attribute parameters corresponding to the target plane for the multiple voxels based on the positions of the multiple voxels passed through by the ray and the target intersection position of the ray and the target 3D model includes: For each voxel among the multiple voxels passed through by the ray, determine whether the position of the voxel is between the first intersection position and the second intersection position corresponding to the ray; If so, determine the attribute parameter corresponding to the target plane for the voxel as the first parameter; If not, determine the attribute parameter corresponding to the target plane for the voxel as the second parameter.
9. The method according to claim 6, characterized in that, The target intersection position includes a first intersection position and a second intersection position; the first intersection position is the position of the intersection closest to the target plane corresponding to the ray; the second intersection position is the position of the intersection farthest from the target plane corresponding to the ray; the attribute parameter includes a first parameter; the first parameter indicates that the voxel is between the first intersection position and the second intersection position corresponding to the ray passing through the voxel; The method for determining the target voxels among the multiple voxels based on the attribute parameters corresponding to the target plane for the multiple voxels includes: Determine the voxels whose attribute parameters corresponding to the three target planes are all the first parameter among the multiple voxels as the target voxels.
10. A generating device for a volume model, characterized in that, Includes: A model acquisition module, configured to acquire a target 3D model and the bounding box model corresponding to the target 3D model; The target 3D model is located in the bounding box model; The bounding box model is surrounded by multiple surface planes; the bounding box model includes multiple voxels; A ray emission module, configured to emit rays to the target 3D model based on the multiple surface planes and determine the target intersection positions of the rays and the target 3D model; A target voxel determination module, configured to determine a target voxel from the plurality of voxels based on the position of the target intersection point between the ray and the target three-dimensional model; A volume model generation module, configured to generate a volume model corresponding to the target three-dimensional model based on the target voxel.
11. An electronic device, characterized in that, It includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the volume model generation method according to any one of claims 1-9.
12. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the volume model generation method according to any one of claims 1-9.