Voxelization three-dimensional modeling method and device with variable resolution, equipment and medium

By dynamically determining the voxel position and data tree, voxel data storage and rendering at different resolutions are realized, which solves the memory occupation problem of constant resolution in 3D modeling and achieves high-precision 3D modeling and representation of large scenes. .

CN118799482APending Publication Date: 2024-10-18CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410073782.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The resolution of existing 3D modeling technology is constant, which results in large memory usage and inability to effectively represent model details. This results in poor model restoration and the inability to achieve high-precision 3D modeling.

Method used

Using a variable-resolution voxelized 3D modeling method, by obtaining resolution selection instructions and operation trajectories, the voxel position and data tree are dynamically determined to achieve storage and rendering of voxel data at different resolutions, reducing unnecessary Memory usage, supports the coexistence of extremely large resolution and extremely small resolution voxels.

Benefits of technology

It achieves the ability to represent larger scenes under limited memory, avoids the loss of details, supports high-precision three-dimensional modeling, and saves time in the post-processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799482A_ABST
    Figure CN118799482A_ABST
Patent Text Reader

Abstract

The invention provides a variable-resolution voxelization three-dimensional modeling method and device, equipment and a medium. The method comprises the steps that a resolution selection instruction is acquired, a first resolution is determined based on the resolution selection instruction, a first operation track is acquired, and a first voxel position is determined based on the first operation track; voxel data are inserted into voxel data trees corresponding to the first resolution ratios based on the first voxel positions, and each resolution ratio corresponds to one voxel data tree; and rendering is carried out based on the voxel data trees corresponding to the resolutions, and a three-dimensional model is generated. According to the invention, high-precision three-dimensional modeling can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional modeling technology, and in particular to a voxelized three-dimensional modeling method, device, equipment and medium with variable resolution. Background Art

[0002] Voxel is a pixel in 3D space, which is generally understood as a block in 3D space. Voxel is a way to represent a 3D object by using a fixed-size cubic block as the smallest unit. The resolution of a 3D scene is directly related to the size of the voxel. For a fixed 3D scene, the higher the resolution, the smaller the size of a single voxel; the lower the resolution, the larger the single voxel.

[0003] In the prior art, a unit model is represented based on pre-calculated voxels of constant resolution. High resolution will use more voxels to express each part of the model, resulting in a large memory usage. Therefore, there are limitations on resolution when performing three-dimensional modeling in the prior art. This often makes it impossible to represent information about details in the model, resulting in loss of details, poor model restoration, and inability to achieve high-precision three-dimensional modeling. Summary of the invention

[0004] The present invention provides a variable-resolution voxelized three-dimensional modeling method, device, equipment and medium to solve the defect of constant resolution in three-dimensional modeling in the prior art, realize the use of voxels of multiple resolutions in a single three-dimensional model, and realize high-precision three-dimensional modeling.

[0005] The present invention provides a voxelized three-dimensional modeling method with variable resolution, comprising:

[0006] Acquire a resolution selection instruction, determine a first resolution based on the resolution selection instruction, acquire a first operation trajectory, and determine a first voxel position based on the first operation trajectory;

[0007] Inserting voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to one voxel data tree;

[0008] Rendering is performed based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0009] According to a variable resolution voxelized 3D modeling method provided by the present invention, the determining of the first voxel position based on the first operation trajectory includes:

[0010] Obtaining the point position of each point in the first operation trajectory in the model scene by back-projection calculation;

[0011] generating a space curve based on the positions of each of the points;

[0012] The space curve is discretized according to the first resolution to obtain at least one first voxel position.

[0013] According to a variable resolution voxelized 3D modeling method provided by the present invention, each node at the bottom layer of the voxel data tree corresponds to a space, and the space corresponding to the node at the bottom layer of the voxel data tree is obtained by dividing the model scene based on the resolution corresponding to the voxel data tree; inserting voxel data into the voxel data tree corresponding to the first resolution based on the first voxel position includes:

[0014] Determine, based on the first voxel position, a target node in the lowest layer of the voxel data tree corresponding to the first resolution;

[0015] Insert voxel data at the target node.

[0016] According to a variable resolution voxelized 3D modeling method provided by the present invention, after inserting corresponding voxel data into the voxel data tree corresponding to the first resolution based on the first voxel position, the method further includes:

[0017] Searching for a first node at the bottom layer of the voxel data tree corresponding to each second resolution, wherein the second resolution is higher than the first resolution, and the space corresponding to the first node is a subspace of the space corresponding to the target node;

[0018] The voxel data inserted into the first node is deleted.

[0019] According to a variable resolution voxelized 3D modeling method provided by the present invention, the voxel data tree includes multiple layers, each layer includes at least one node, each node corresponds to a space, the space corresponding to the node in each layer is the subspace of the space corresponding to the parent node of the node in the previous layer, and the space corresponding to the topmost node of the voxel data tree is the model scene; the method also includes:

[0020] receiving a scene size update instruction, and updating the size of the model scene based on the scene size update instruction;

[0021] Based on the updated model scene, the structure of each voxel data tree is updated.

[0022] A variable resolution voxelized 3D modeling method according to the present invention further includes:

[0023] Acquire a second operation trajectory, and determine a second voxel position based on the second operation trajectory;

[0024] Based on the second voxel position, voxel data is deleted in sequence in the voxel data tree corresponding to each resolution.

[0025] The present invention also provides a voxelized three-dimensional modeling device with variable resolution, comprising:

[0026] an operation module, configured to obtain a resolution selection instruction, determine a first resolution based on the resolution selection instruction, obtain a first operation trajectory, and determine a first voxel position based on the first operation trajectory;

[0027] A data management module, configured to insert voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to one voxel data tree;

[0028] The rendering module is used to render based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0029] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a variable resolution voxelized three-dimensional modeling method as described above is implemented.

[0030] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the variable resolution voxelized three-dimensional modeling methods described above.

[0031] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the variable resolution voxelized three-dimensional modeling method as described above is implemented.

[0032] The present invention provides a variable-resolution voxelized three-dimensional modeling method, device, equipment and medium, which respectively maintain a voxel data tree for different resolutions, determine the current resolution according to a resolution selection instruction, insert corresponding voxel data into the voxel data tree corresponding to the current resolution based on the current operation trajectory, and finally render based on the voxel data trees corresponding to each resolution to generate a three-dimensional model. Since the voxel data trees corresponding to different resolutions only store the voxel data involved in the operation trajectory at the resolution, unnecessary memory usage can be reduced, and the coexistence of extremely large-resolution voxels and extremely small-resolution voxels can be achieved in the same three-dimensional scene, so that large scenes can be represented without losing model details, and high-precision three-dimensional modeling can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 It is a flow chart of the variable resolution voxelized 3D modeling method provided by the present invention;

[0035] Figure 2 It is a structural schematic diagram of a voxel data tree in the variable resolution voxelized three-dimensional modeling method provided by the present invention;

[0036] Figure 3 The invention provides a variable resolution voxelized 3D modeling method for inserting voxel data into a voxel data tree. Figure 1 ;

[0037] Figure 4 The invention provides a variable resolution voxelized 3D modeling method for inserting voxel data into a voxel data tree. Figure 2 ;

[0038] Figure 5 Schematic diagram of voxel data migration when scene is enlarged in the variable resolution voxelized 3D modeling method provided by the present invention Figure 1 ;

[0039] Figure 6 Schematic diagram of voxel data migration when scene is enlarged in the variable resolution voxelized 3D modeling method provided by the present invention Figure 2 ;

[0040] Figure 7 Schematic diagram of deleting voxels in the variable resolution voxelized 3D modeling method provided by the present invention Figure 1 ;

[0041] Figure 8 Schematic diagram of deleting voxels in the variable resolution voxelized 3D modeling method provided by the present invention Figure 2 ;

[0042] Fig. 9 Schematic diagram of deleting voxels in the variable resolution voxelized 3D modeling method provided by the present invention Figure 3 ;

[0043] Fig.10 It is a structural schematic diagram of a voxelized three-dimensional modeling device with variable resolution provided by the present invention;

[0044] Fig.11It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Combine the following Figure 1-Figure 9 The variable resolution voxelized 3D modeling method provided by the present invention is described as follows: Figure 1 As shown, the method comprises the steps of:

[0047] S110, obtaining a resolution selection instruction, determining a first resolution based on the resolution selection instruction, obtaining a first operation trajectory, and determining a first voxel position based on the first operation trajectory;

[0048] S120, inserting voxel data into a voxel data tree corresponding to a first resolution based on the first voxel position, wherein each resolution corresponds to a voxel data tree;

[0049] S130 , performing rendering based on voxel databases corresponding to each resolution to generate a three-dimensional model.

[0050] The method provided by the present invention maintains a voxel data tree corresponding to different resolutions, determines the current resolution according to a resolution selection instruction, inserts corresponding voxel data into the voxel data tree corresponding to the current resolution based on the current operation trajectory, and finally renders based on the voxel data trees corresponding to each resolution to generate a three-dimensional model. Since the voxel data trees corresponding to different resolutions only store the voxel data involved in the operation trajectory at the resolution, unnecessary memory usage can be reduced, and the coexistence of extremely large resolution voxels and extremely small resolution voxels can be achieved in the same three-dimensional scene, so that large scenes can be represented without losing details of the model, and high-precision three-dimensional modeling can be achieved.

[0051] In the method provided by the present invention, a resolution selection instruction can be received through an interface. For example, a user can switch the current voxel resolution through the operation interface, such as multiplying the current voxel resolution by a multiple of 2, or dividing it by a multiple of 2, so as to achieve the purpose of constructing details or quickly constructing large-scale blocks. A voxel data tree is maintained for each resolution. When the first resolution corresponding to the received resolution selection instruction is a new resolution, a new voxel data tree is created corresponding to it.

[0052] Each voxel data tree maintains voxel data at its corresponding resolution, that is, each voxel data tree stores the position of the voxel at its corresponding resolution. Finally, voxels of corresponding size are rendered at corresponding positions according to the data maintained in each voxel data tree.

[0053] Therefore, the method provided by the present invention allows the user to define a new voxel subdivision level. For example, the original minimum unit is a voxel of 1cm*1cm*1cm, which can be divided into 2 on this basis, with 0.5cm*0.5cm*0.5cm as the new minimum unit. This operation is to add a corresponding voxel data tree at the logical level of the present invention, which is simple and fast. In this way, the representation of tiny details can be achieved without increasing the memory overhead (the existing voxel unit representation with constant resolution, if the minimum unit is divided into 2, its memory usage will increase exponentially, and will become 8 times the original, which will be limited by the memory bottleneck. At the same time, the tree storing its voxel information needs to be regenerated, which is not flexible enough). When building a model, the modeler dynamically selects the resolution size of the current voxel, and can render high-resolution voxels when building a large area, reducing unnecessary memory usage. In this way, a larger scene can be represented under limited memory, so that the construction of a large scene model can be completed at one time without splitting, saving time in the later process. The variable pixel resolution voxel solution also allows the coexistence of extremely large resolution voxels and extremely small resolution voxels in the same scene, which can represent larger scenes without losing model details.

[0054] Specifically, each node at the bottom layer of the voxel database corresponds to a space, and the space corresponding to the node at the bottom layer of the voxel data tree is obtained by dividing the model scene based on the resolution corresponding to the voxel data tree, that is, the space size corresponding to the node at the bottom layer of the voxel data tree is the space size of the smallest unit obtained by dividing the model scene based on the resolution corresponding to the voxel data tree. After receiving the user's operation of adding voxels, voxel data is added to the bottom layer node of the corresponding voxel data tree, indicating that there are voxels in the space corresponding to the node. For nodes without voxel data inserted, the data volume is empty, so that the voxel position can be represented by a small amount of data. The existing technical solution represents the three-dimensional model based on the pre-calculated voxel unit of constant resolution. This method has a high memory usage. For example, if a 1024*1024*1024 precision model is to be represented, 1073741824 bytes of memory space are required. The dynamic resolution solution proposed in this proposal only requires 8 bytes of space in extreme cases (assuming that the model is a 1024*1024*1024 cube). On average, depending on the complexity of the model, 10% to 60% of the memory space will be saved (mainly depending on the proportion of large areas in the model).

[0055] Specifically, the first operation trajectory refers to the operation trajectory received after the resolution is set to the first resolution. The first operation trajectory is obtained based on the user's operation. The user can control the brush movement on the modeling interface to generate the first operation trajectory, and the brush unit is equal to the voxel unit. The first operation trajectory reflects the positions in the scene where the user wants to model, that is, reflects the positions where voxels need to be inserted. The first voxel position is determined based on the first operation trajectory, and the voxel data is inserted into the voxel data tree corresponding to the first resolution based on the first voxel position. The subsequent rendering is based on the voxel data tree, thereby achieving the purpose of modeling according to user needs.

[0056] Determining a first voxel position based on a first operation trajectory includes:

[0057] Obtain the point positions of each point in the first operation trajectory in the model scene through your projection calculation;

[0058] Generate a space curve based on the position of each point;

[0059] The space curve is discretized according to the first resolution to obtain a first voxel position.

[0060] The first operation trajectory is composed of a series of discrete points in the two-dimensional space of the screen. Each point in the first operation trajectory is reversely projected to calculate its point position in the three-dimensional model scene, which can also obtain a series of point positions. After that, these point positions are subjected to difference and smoothing operations to obtain a curve in the three-dimensional space, that is, the space curve mentioned above. The space curve is discretized according to the first resolution to obtain the first voxel position. When the space curve is discretized according to the first resolution, the larger the first resolution, the lower the degree of discretization, and the smaller the first resolution, the higher the degree of discretization.

[0061] Inserting voxel data in a voxel data tree corresponding to a first resolution based on the first voxel position includes:

[0062] Determine, based on the first voxel position, a target node in the lowest layer of the voxel data tree corresponding to the first resolution;

[0063] Insert voxel data at the target node.

[0064] As described above, the space corresponding to the node in the lowest layer of the voxel data tree corresponding to the first resolution is obtained after dividing the model scene according to the first resolution. For example, if the scene is 1m*1m*1m and the resolution is 10*10*10, then the voxel size after dividing the scene based on the resolution is 10cm*10cm*10cm, and the space corresponding to the node in the lowest layer of the voxel data tree corresponding to the resolution is the space of 10cm*10cm*10cm obtained after dividing the scene.

[0065] Furthermore, the voxel data tree may be a sparse voxel octree (SVO), which includes multiple layers, each layer includes at least one node, each node corresponds to a space, and the space corresponding to the node in each layer is the subspace of the space corresponding to the parent node of the node in the previous layer, and the space corresponding to the topmost node of the voxel data tree is the model scene. In other words, the model scene is divided step by step to obtain the space corresponding to each node in the voxel data tree.

[0066] like Figure 2 As shown, inserting voxel data in the voxel data tree corresponding to the first resolution based on the first voxel position can be done by performing layer-by-layer judgment in the voxel data tree. Assuming that the position of the voxel is [x, y, z] and the boundary value is [X, Y, Z], first start judging from the voxel data tree level with the largest voxel unit. The first step is to judge the positive and negative of x, y, and z. According to the result, the node position of the voxel in the first level of the voxel data tree can be known (this step also needs to judge the size relationship between x, y, z and the boundary value of the scene in initialization. If it exceeds the boundary, the voxel is directly skipped). Assume that they are all greater than 0 here. The second step is to judge the relationship between x, y, z and 0.5*X, 0.5*Y, 0.5*Z (the center coordinates of the first quadrant in the positive direction in space) to determine the position of the voxel in the second-level child node. Assuming that they are all greater than, and then follow the same logic until the target node in the bottom layer is found. Figure 2 It represents the traversal process of the voxel data tree when inserting voxel data. The nodes with arrows indicate actual voxel data, and the nodes without arrows are actually represented as empty nodes and do not occupy memory.

[0067] In one possible implementation, the target node is determined according to the first voxel position. The position of the bottom-level node of the voxel data tree with a resolution smaller than the first resolution can be traversed. If there is no voxel data in the node corresponding to the first voxel position in the bottom-level nodes of all voxel data trees with a resolution smaller than the first resolution, then the target node can be searched for in the bottom-level node of the voxel data tree corresponding to the first resolution. If voxel data already exists in the node corresponding to the first voxel position in the bottom-level node of the voxel data tree with a resolution smaller than the first resolution, it means that the first voxel position has been occupied by a larger voxel, and it is meaningless to insert a small unit of voxel. At this time, the first voxel position can be skipped, and its target node in the voxel data tree of the first resolution is no longer searched, and the next first voxel position can be processed. However, if you start from the voxel data tree with the smallest resolution (i.e., the voxel data tree with the largest voxel unit), and traverse to the voxel data tree whose voxel unit is equal to the brush voxel unit (i.e., the voxel data tree with the first resolution), for example, the brush unit is 0.5 (i.e., the voxel size corresponding to the current first resolution is 0.5*0.5*0.5), starting from the voxel data tree with a unit of 4, and traversing the voxel data trees with a unit of 4, a unit of 2, a unit of 1, and a unit of 0.5, the nodes at the corresponding positions in these voxel data trees are all empty, indicating that the spatial position is not occupied by a voxel with a larger unit, and the voxel data can be inserted at the target node.

[0068] After the insertion is completed, the voxel data tree with a higher resolution than the first resolution needs to be processed. After the corresponding voxel data is inserted into the voxel data tree corresponding to the first resolution based on the first voxel position, the method further includes:

[0069] Searching for a first node at the bottom layer of the voxel data tree corresponding to each second resolution, wherein the second resolution is higher than the first resolution, and the space corresponding to the first node is a subspace of the space corresponding to the target node;

[0070] Delete the voxel data inserted in the first node.

[0071] For voxel data trees with a resolution higher than the first resolution, that is, voxel units smaller than the voxel units corresponding to the first resolution, traverse, and if the first voxel position also has voxel data in the voxel data tree with a smaller voxel unit, the voxel data of the corresponding node in the voxel data tree with a smaller voxel unit is deleted (equivalent to the large voxel block covering the previous small voxel block). Figure 3 As shown, assuming that the voxel unit corresponding to the first resolution is 0.5m, pixel data is inserted into the voxel data tree corresponding to the first resolution, then Figure 4As shown, in a voxel data tree with a voxel unit of 0.25m, the existing voxel data at the corresponding position can be directly deleted. Similarly, the same operation is performed in a voxel data tree with a smaller scale until all voxel data trees are traversed.

[0072] Furthermore, in the prior art, due to the use of fixed-resolution voxel technology, the occupied memory and the size of the block are proportional. Therefore, the prior art needs to consider the memory usage, which will limit the size of the scene. The maximum supported scene size is often indicated in its functional description, and the common size is 256*256*256. When actually using this type of software to build a building model, if the entire scene is too large, the modeler needs to split the model in the scene, model it separately, and combine it when using it, which increases the time cost. When there are too many details of a single building, the problem of detail loss will also occur due to the limitation of fixed resolution. Through the method provided by the present invention, when the initialized scene boundary cannot meet the requirements, the user can change the boundary of the scene, such as changing the model scene from a cube space of 100m*100m*100m to 200m*200m*200m. This operation will trigger the reconstruction of all current voxel data trees, and all voxels existing in the current scene need to be re-divided into the enlarged scene. That is, the method provided by the present invention also includes the steps of:

[0073] receiving a scene size update instruction, and updating the size of the model scene based on the scene size update instruction;

[0074] Based on the updated model scene, the structure of each voxel data tree is updated.

[0075] Taking the expansion of the scene as an example, the specific embodiment of this in the voxel data tree structure is that every time the scene expands by 2 times, the depth of the tree increases by one layer, and the node that currently stores the voxel data needs to move down one layer.

[0076] Assuming the size of the voxel is 1m*1m*1m, the size of the space is 2m*2m*2m, and the center coordinates of the voxel position are [0.5,0.5,0.5], then the position of the voxel data in the tree is as follows: Figure 5 As shown, now the space is doubled, and the depth of the tree needs to be increased by one layer. For the first level, the coordinates of the voxel position [0.5, 0.5, 0.5] are still greater than 0. Therefore, the position of the voxel data in the first level remains unchanged. For the newly added second level, it is necessary to compare the relationship between the voxel coordinates [0.5, 0.5, 0.5] and the center coordinates of the first quadrant [1, 1, 1]. Here they are all less than, so we can know the position of the voxel data in the second level as follows Figure 6 As shown in the figure, by performing migration operations on each voxel data, the scene expansion is completed.

[0077] When the model scene is reduced in size, the voxel data can be migrated according to the same idea, which will not be elaborated here.

[0078] The method provided by the present invention, due to the use of variable resolution voxels, combined with the data migration operation of the subject data in the voxel data tree, can theoretically support unlimited scene sizes, thereby supporting higher precision models.

[0079] In order to more conveniently support the modification of the user during the modeling process, the method provided by the present invention not only provides a method for inserting voxel data, but also provides a method for deleting voxel data. The process of deleting voxel data includes:

[0080] Acquire a second operation trajectory, and determine a second voxel position based on the second operation trajectory;

[0081] Based on the second voxel position, the voxel data is deleted in sequence in the voxel data trees corresponding to each resolution.

[0082] The second operation trajectory is the operation trajectory received after the user selects the delete operation. The process of determining the second voxel position based on the second operation trajectory can be implemented by referring to the process of determining the first voxel position based on the first operation trajectory in the previous article, that is, the series of discrete points in the two-dimensional space included in the second operation trajectory are reversely projected, and their three-dimensional positions in the model scene are calculated. The positions are interpolated and smoothed to obtain a curve in the three-dimensional space. Then, the curve is discretized according to the resolution corresponding to the second operation trajectory (the resolution selected by the user when the second operation trajectory is received) to obtain the second voxel position.

[0083] When performing the voxel data deletion operation, it is necessary to traverse all voxel data trees, make judgments respectively, and then delete the voxel data in the corresponding nodes in the voxel data tree. Based on the second voxel position, the voxel data is deleted in the voxel data trees corresponding to each resolution respectively. The voxel data can be deleted in the voxel data trees corresponding to each resolution respectively in order from low to high resolution, which can achieve higher data processing efficiency.

[0084] Specifically, when traversing the target voxel data tree, there are two cases:

[0085] The first case is that the resolution corresponding to the second operation trajectory is smaller than the resolution corresponding to the target voxel data tree (i.e., the voxel corresponding to the second operation trajectory is larger than the voxel corresponding to the target voxel data tree). In this case, you only need to traverse the target voxel data tree to the layer with the same resolution as the second operation trajectory in the target voxel data tree, and delete all the pixel data in the child nodes of this layer. Figure 7As shown, taking a 2m*2m*2m space as an example, the first layer of division divides the space into 1m*1m*1m space, and the second layer is 0.5m*0.5m*0.5m. The voxel unit of this voxel data tree is 0.5. If the current brush unit is 1, when traversing the position of the brush voxel in this voxel data tree, you only need to traverse to the first level. If its node has child nodes, just delete it directly. In this example, if the voxel position representing deletion is at [+x,+y,+z], all the second-level child nodes below it can be deleted.

[0086] The second case is that the resolution corresponding to the second operation trajectory is greater than the resolution corresponding to the target voxel data tree (i.e., the voxel unit corresponding to the second operation trajectory is smaller than the voxel unit corresponding to the target voxel data tree). Then, when the node corresponding to the second voxel position is found in the target voxel data tree and the node has voxel data inserted, the voxel data corresponding to the node is deleted, and the voxel data tree to be processed is found. The voxel data tree to be processed is the voxel data tree with the smallest resolution among the voxel data trees that may have a resolution greater than the target voxel data tree (if there is no voxel data tree to be processed that meets the conditions in the currently established voxel data tree, then a new voxel data tree to be processed that meets the conditions is created). According to the second voxel position, the corresponding node is found in the voxel data tree to be processed and the voxel data is inserted into the node. If the resolution corresponding to the voxel data tree to be processed is equal to the resolution corresponding to the second operation trajectory, the node corresponding to the second voxel position is directly found in the voxel data tree to be processed, and the voxel data therein is deleted.

[0087] Assume that the voxel unit of the brush is 0.25m. There are currently three voxel data trees, with scales of 1m, 0.5m, and 0.25m. The three voxel data trees need to be traversed in descending order. Assume that the voxel data tree with a scale of 1m is empty (no voxel data exists), and the corresponding node is found in the voxel data tree with a scale of 0.5m. The situation is as follows: Figure 8 As shown. At this time, the voxel data in the found node needs to be deleted from the voxel data tree, and then the voxel data tree of the next level needs to be found, and the deleted node position needs to be added to the voxel data tree of the next level (from a macro perspective, a large voxel is subdivided into the next unit of small voxels, which is a subdivision operation. If there is no voxel data tree of the next level, a new one can be created. The level can be related to the scaling factor supported by the resolution. In this example, the resolution of two adjacent levels is a multiple of 2). At this time, the schematic diagram of the voxel data tree of the next level (0.25m) is as follows Fig. 9If the resolution corresponding to the second operation track is equal to the resolution of the voxel data tree, the search operation is performed normally to find the node at the corresponding position and perform the operation of deleting the voxel data. Otherwise, the current voxel data tree is searched to find the corresponding node and perform the subdivision operation until the brush voxel is equal to the voxel corresponding to the voxel data tree, and then the deletion operation is performed.

[0088] In summary, the variable resolution voxelized 3D modeling method provided by the present invention can utilize the detailed features of the model itself when using voxels to represent the 3D model, and the user can determine the size of the voxel unit to be used during runtime, so as to achieve the purpose of using fewer voxels to express the same model details, and is more friendly to building model details. Due to the use of dynamic voxel resolution, it can smoothly transition from the large voxel unit when constructing the general shape in the early stage to the small voxel unit when constructing the details. Compared with the prior art, after the voxel unit is determined, the highest detail that can be expressed is determined. The method provided by this invention is obviously more flexible, and the voxel size can be determined according to the degree of detail of the model.

[0089] The following is a description of the variable resolution voxelized 3D modeling device provided by the present invention. The variable resolution voxelized 3D modeling device described below and the variable resolution voxelized 3D modeling method described above can be referred to in correspondence with each other. Fig.10 As shown, the variable resolution voxelized 3D modeling device provided by the present invention comprises:

[0090] An operation module 1010 is used to obtain a resolution selection instruction, determine a first resolution based on the resolution selection instruction, obtain a first operation trajectory, and determine a first voxel position based on the first operation trajectory;

[0091] A data management module 1020, configured to insert voxel data into a voxel data tree corresponding to a first resolution based on the first voxel position, wherein each resolution corresponds to a voxel data tree;

[0092] The rendering module 1030 is used to perform rendering based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0093] Fig.11 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.11As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120 and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 may call the logic instructions in the memory 1130 to execute a variable resolution voxelized three-dimensional modeling method, the method comprising: obtaining a resolution selection instruction, determining a first resolution based on the resolution selection instruction, obtaining a first operation trajectory, determining a first voxel position based on the first operation trajectory; inserting voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to a voxel data tree; rendering based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0094] In addition, the logic instructions in the above-mentioned memory 1130 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the variable resolution voxelized three-dimensional modeling method provided by the above methods, the method including: obtaining a resolution selection instruction, determining a first resolution based on the resolution selection instruction, obtaining a first operation trajectory, and determining a first voxel position based on the first operation trajectory; inserting voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to a voxel data tree; rendering based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the variable resolution voxelized three-dimensional modeling method provided by the above-mentioned methods, the method comprising: obtaining a resolution selection instruction, determining a first resolution based on the resolution selection instruction, obtaining a first operation trajectory, determining a first voxel position based on the first operation trajectory; inserting voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to a voxel data tree; rendering is performed based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A variable resolution voxelized 3D modeling method, characterized in that: include: Acquire a resolution selection instruction, determine a first resolution based on the resolution selection instruction, acquire a first operation trajectory, and determine a first voxel position based on the first operation trajectory; Inserting voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to one voxel data tree; Rendering is performed based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

2. The variable resolution voxelized 3D modeling method according to claim 1, characterized in that: The determining a first voxel position based on the first operation trajectory comprises: Obtaining the point position of each point in the first operation trajectory in the model scene by back-projection calculation; generating a space curve based on the positions of each of the points; The space curve is discretized according to the first resolution to obtain at least one first voxel position.

3. The variable resolution voxelized 3D modeling method according to claim 1, characterized in that: Each node at the bottom layer of the voxel data tree corresponds to a space, and the space corresponding to the node at the bottom layer of the voxel data tree is obtained by dividing the model scene based on the resolution corresponding to the voxel data tree; The inserting voxel data into the voxel data tree corresponding to the first resolution based on the first voxel position includes: Determine, based on the first voxel position, a target node in the lowest layer of the voxel data tree corresponding to the first resolution; Insert voxel data at the target node.

4. The variable resolution voxelized 3D modeling method according to claim 3, characterized in that: After inserting corresponding voxel data into the voxel data tree corresponding to the first resolution based on the first voxel position, the method further includes: Searching for a first node at the bottom layer of the voxel data tree corresponding to each second resolution, wherein the second resolution is higher than the first resolution, and the space corresponding to the first node is a subspace of the space corresponding to the target node; The voxel data inserted into the first node is deleted.

5. The variable resolution voxelized 3D modeling method according to claim 3, characterized in that: The voxel data tree includes multiple layers, each layer includes at least one node, each node corresponds to a space, the space corresponding to the node in each layer is the subspace of the space corresponding to the parent node of the node in the previous layer, and the space corresponding to the topmost node of the voxel data tree is the model scene; The method further comprises: receiving a scene size update instruction, and updating the size of the model scene based on the scene size update instruction; Based on the updated model scene, the structure of each voxel data tree is updated.

6. The variable resolution voxelized 3D modeling method according to claim 1, characterized in that: The method further comprises: Acquire a second operation trajectory, and determine a second voxel position based on the second operation trajectory; Based on the second voxel position, voxel data is deleted in sequence in the voxel data tree corresponding to each resolution.

7. A variable resolution voxelized 3D modeling device, characterized in that: include: an operation module, configured to obtain a resolution selection instruction, determine a first resolution based on the resolution selection instruction, obtain a first operation trajectory, and determine a first voxel position based on the first operation trajectory; A data management module, configured to insert voxel data into a voxel data tree corresponding to the first resolution based on the first voxel position, wherein each resolution corresponds to one voxel data tree; The rendering module is used to render based on the voxel data trees corresponding to each resolution to generate a three-dimensional model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the variable-resolution voxelized three-dimensional modeling method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the variable resolution voxelized three-dimensional modeling method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the variable resolution voxelized three-dimensional modeling method according to any one of claims 1 to 6 is implemented.