Image-based Tri-Dexel model efficient generation method

Through image processing and GPU parallel computing, the problems of low efficiency of traditional Tri-Dexel models and difficulty in distinguishing non-watertight models are solved, and efficient Tri-Dexel model generation and simulation system improvements are achieved.

CN118587386APending Publication Date: 2024-09-03BEIHANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410708021.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The traditional Tri-Dexel model creation method based on ray intersection is inefficient, and it is difficult to distinguish the inside and outside of the model in non-watertight models, so it cannot effectively improve the efficiency of the Tri-Dexel algorithm.

Method used

By visualizing the triangular patch projection of the Tri-Dexel model, storing potential intersection information in pixels, introducing the fusion of slice images and projection images, using GPU parallel computing to accelerate ray intersection operations, achieving point-to-point ray intersection, and generating efficient Tri-Dexel model.

Benefits of technology

It significantly reduces redundant intersection operations, improves the efficiency of Tri-Dexel model generation, solves the problem of distinguishing inside and outside in non-watertight models, and improves the efficiency and real-time performance of the simulation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587386A
    Figure CN118587386A
Patent Text Reader

Abstract

The invention belongs to the field of intelligent manufacturing numerical control machining, and discloses an image-based Tri-Dexel model efficient generation method. According to the method, projection images of triangular patches of a Tri-Dexel model on a plane are converted, information of the triangular patches which are potentially intersected with the triangular patches is stored in pixels, and therefore point-to-point ray intersection is achieved, and a large amount of redundant intersection operation is reduced. And introducing a section image after processing the non-watertight model subjected to voxelization segmentation, and fusing the section image with a projection image to form a composite image for distinguishing the inner side and the outer side of the model during ray intersection. The GPU parallel computing technology is adopted to accelerate ray intersection operation and Dexcel wire harness creation, and the Tri-Dexcel efficiency of the model is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of intelligent manufacturing numerical control machining, and in particular relates to an efficient generation method of a Tri-Dexel model based on an image. Background Art

[0002] With the deep integration of the new generation of information network technology and the manufacturing industry, reducing costs and increasing efficiency and accelerating digital transformation have become the general trend for the manufacturing industry. Accurate and efficient cutting simulation algorithms have been proven to have significant economic benefits in the field of CNC machining. The key technology to achieve cutting simulation lies in the establishment of simulation models, which is also one of the important indicators for evaluating the quality of simulation systems. At the same time, with the increasingly close integration of digital twin technology and the field of CNC machining, the demand for online simulation, which is different from offline simulation, has become increasingly strong, which means that there are more stringent requirements for the high precision, efficiency and real-time performance of cutting simulation.

[0003] The current geometric simulation algorithm can be divided into solid modeling and discrete modeling according to different modeling methods. Geometric simulation based on discrete models is an approximate simulation method, which can improve the computational efficiency to a certain extent. Among them, the Tri-dexel modeling method is widely used in cutting geometry simulation due to its high expression accuracy. However, the traditional Tri-Dexel model creation method based on ray intersection requires all rays emitted from the three planes XOY, XOZ and YOZ to intersect and judge the triangular facet model. For each ray, it is necessary to traverse all triangular facets in the model to accurately solve the intersection of the ray and the model. Although its accuracy is higher than that of discrete modeling methods such as the Dexel method and the Z-Map method, its efficiency is significantly reduced. Therefore, how to improve the efficiency of the Tri-Dexel algorithm while ensuring the accuracy of the discrete model has become an urgent problem to be solved. The Chinese invention patent with publication number CN110955934A discloses an improved Dexel model based on a bounding box and a binary tree. The bounding box limits the area where the ray intersection needs to be performed, and the binary tree is used to efficiently store the valid line segments obtained by the intersection, thereby improving the generation efficiency of the model. The Chinese invention patent with publication number CN115618529A discloses a method for dynamic voxel partitioning, which reduces a large number of redundant intersection operations by reducing the area of ​​the model Tri-Dexel. However, the essence of the ray intersection algorithm of the two is to perform intersection calculations on all triangular facets of the model for each ray, which is not efficient. At the same time, the latter will have the problem of difficulty in distinguishing the inside and outside of the model when Tri-Dexel modeling is performed on a non-watertight model in a single voxel. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention provides an image-based efficient generation method of a Tri-Dexel model, which realizes point-to-point ray intersection by imaging the projection of the triangular facets of the Tri-Dexel model on a plane and storing the information of the potentially intersecting triangular facets in pixels, thereby reducing a large number of redundant intersection operations. When processing a non-watertight model after voxelization and segmentation, a section image is introduced and fused with the projection image into a composite image for distinguishing the inside and outside of the model during ray intersection. GPU parallel computing technology is used to accelerate ray intersection operations and the creation of Dexel bundles, further improving the efficiency of the Tri-Dexel model.

[0005] The technical solution of the present invention is as follows:

[0006] An efficient generation method of a Tri-Dexel model based on an image comprises the following steps:

[0007] Step S1, three-dimensional modeling of the workpiece;

[0008] Step S2, establishing a bounding box for the three-dimensional model of the workpiece, and projecting it to the X, Y, and Z directions to obtain three blank projection images;

[0009] Step S3, projecting all triangular facets of the three-dimensional model onto three blank projection images respectively to obtain projection images, and mapping to obtain pixel data structures;

[0010] Step S4, selectively encoding the information contained in each pixel in the pixel data structure to obtain a grayscale projection image;

[0011] Step S5, generating three composite images by introducing the section image and fusing it with the grayscale projection image;

[0012] Step S6: Based on the three composite images obtained, ray intersection calculation and Dexel line bundle creation are performed to generate a Tri-Dexel model.

[0013] Preferably, the bounding box in step S2 is an AABB bounding box.

[0014] Preferably, the projection and mapping method of the triangular face in step S3 is as follows:

[0015] (1) Orthogonally project the three vertices of the triangular face onto the blank projection image in the X, Y, and Z directions to obtain three projected triangles;

[0016] (2) discretizing the projected triangle into a plurality of pixels;

[0017] (3) Add the index value of the triangle to the triangle list of the pixel data structure.

[0018] Preferably, the step S4 specifically includes:

[0019] The number of index values ​​in the triangle patch list of the pixel data structure is encoded, and the three-dimensional model of the workpiece is converted into three 8-bit grayscale projection images in three projection images.

[0020] Preferably, the step S5 specifically includes:

[0021] (1) voxelizing and segmenting the three-dimensional model of the workpiece, extracting the intersection points between the voxel boundary and the three-dimensional model, and obtaining a cross-sectional image;

[0022] (2) The 8-bit binary number of the grayscale projection image and the binary information of the cross-sectional image are fused and encoded to obtain three composite images.

[0023] Preferably, the step S6 specifically includes:

[0024] Based on the composite image, GPU parallel computing technology is used to perform ray intersection operations on all pixels of the projection image. For several intersection points obtained by ray intersection of a single pixel, the inside and outside of the model are distinguished according to the normal vector, and the internal line segments are retained to generate a Dexel model. The Dexel models of the three projection images are combined to finally generate a Tri-Dexel model.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] (1) The present invention proposes an efficient image-based Tri-Dexel model generation method. In the generation of the Tri-Dexel model of the workpiece, ray intersection operations are performed based on the projection image. By querying the information recorded by the pixels of the projection image, point-to-point calculations between rays and triangular facets can be achieved, thereby avoiding a large amount of redundant calculations caused by the traditional method of traversing all triangular facets each time, thereby achieving efficient Tri-Dexelization of the model.

[0027] (2) The image-based efficient Tri-Dexel model generation method proposed in the present invention uses the section image as a supplement to the projection image for the voxelized non-closed triangular face model, thereby improving the topological information of the model and solving the problem of being unable to distinguish the inside and outside of the model during the ray intersection process.

[0028] (3) The present invention proposes to encode the information of each pixel data structure of the projected image and the composite image, and use GPU parallel computing technology to process the triangular face information, internal and external information of the model, etc. recorded by each pixel point, thereby further improving the efficiency of Tri-Dexel model generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. The features and advantages of the present invention can be more clearly understood by referring to the drawings. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 It is a flow chart of an efficient method for generating an image-based Tri-Dexel model proposed by the present invention.

[0031] Figure 2 It is a schematic diagram of the bounding box of the three-dimensional model.

[0032] Figure 3 It is a list of triangle patches that make up the pixel data structure.

[0033] Figure 4 It is the triangular patch projection image of the workpiece's three-dimensional model.

[0034] Figure 5 It is the shape of the triangular patch projection image before and after discretization.

[0035] Figure 6a It is a schematic diagram of a non-closed triangular patch workpiece model generated after voxelization.

[0036] Figure 6b It is the projection image of the three-dimensional model of the workpiece.

[0037] Figure 7 is a schematic diagram of the introduced cross-sectional image.

[0038] Figure 8 It is the fusion effect of the projection image and the cross-section image.

[0039] Fig. 9 It is a schematic diagram of the ray intersection process for all pixels of the projected image.

[0040] Fig.10 This is a rendering of an efficient method for generating an image-based Tri-Dexel model proposed in the present invention. DETAILED DESCRIPTION

[0041] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0043] The present invention provides an efficient generation method of Tri-Dexel model based on image, such as Figure 1 As shown, firstly, three-dimensional space modeling is performed on the workpiece to be processed to obtain a three-dimensional model.

[0044] Then, a bounding box is established for the three-dimensional model and projected to the X, Y, and Z directions to obtain three blank projection images. In order to locate the area that potentially requires ray intersection operations and reduce a large number of unnecessary intersection calculations, the present invention establishes a bounding box for the three-dimensional model. The model bounding box is projected in three directions, and the projection area is evenly gridded. Since the two-dimensional grid and image are essentially a two-dimensional matrix, a single pixel is used to represent a cell, and the two-dimensional grid can be imaged. Since the grid image will be used for the projection and mapping of the three-dimensional model triangle facets, it is called a projection image.

[0045] Then all the triangular facets of the three-dimensional model are projected to three blank projection images respectively to obtain projection images, and the pixel data structure is mapped. By traversing all the triangular facets of the three-dimensional model, for each triangular facet, its three vertices are orthogonally projected to the projection images in the three directions of X, Y and Z to obtain three projection triangles. Since the projection triangle has only three vertices and cannot be directly mapped to the projection image, the present invention adopts a scan line algorithm to realize the pixel filling of the projection triangle, and adds the index value of the corresponding triangular facet to the triangular facet list of the data structure of several filled pixels, thereby realizing the mapping of the triangular facet to the projection image. Since the pixels of the projection image are shared by all the triangular facets, it means that the triangular facet list of a single pixel stores the index values ​​of all the triangular facets mapped to the pixel. After the traversal is completed, the superimposed projection of the model in three directions will be obtained, and each direction is a three-dimensional data structure, which is composed of several pixel data structures, which are called the pixel data structure of the projection image.

[0046] The information contained in each pixel in the pixel data structure is selectively encoded to obtain a grayscale projection image; since each pixel in the obtained pixel data structure in three directions contains the index values ​​of all triangular facets of the model mapped to the pixel, in order to visualize it for easy display and analysis, the information contained in a single pixel is selectively encoded. The present invention mainly encodes the internal and external information of the model in the projection result, and the stacking degree information of the projection of the model at a certain position. Specifically, the number of index values ​​contained in the triangular facet list of the pixel data structure is encoded to express the projection image as a grayscale projection image. The encoded grayscale projection image will provide a reference for the subsequent ray intersection, and is used to improve the generation efficiency of the Tri-Dexel model.

[0047] By introducing the section image and fusing it with the grayscale projection image, three composite images are generated. In general, the three-dimensional model of the workpiece is assumed to be watertight by default, but in special scenarios, the model needs to be voxelized, and Tri-Dexel modeling is performed on the non-watertight model after voxelization and segmentation. Because the projection results of the outside and inside of the model are consistent, when the ray intersection is performed based on the projection image, the inside and outside of the model will be excluded and no intersection operation will be performed, resulting in obvious errors. To solve this problem, the present invention introduces a section image based on the projection image, which is an image generated by extracting the intersection of the voxel boundary and the three-dimensional model (i.e., the triangular face model) when the model is voxelized and segmented, specifically a binary image, and the topological information of the non-closed voxel model can be supplemented based on the section image. Since the size of the projection image is consistent with the size of the section image, the information of the corresponding pixels of the section image is added on the basis of encoding the number of triangles in the triangular face list of the projection image pixels for fusion encoding, and finally a composite image is encoded.

[0048] Finally, based on the three composite images, ray intersection operations and Dexel line bundle creation are performed to generate a Tri-Dexel model. GPU parallel computing technology can be used to perform ray intersection operations on all pixels of the projection image. For several intersection points obtained by ray intersection of a single pixel, the inside and outside of the model are distinguished according to the normal vector, and the internal line segments are retained, and then the Dexel model in the corresponding direction can be generated based on a single projection image. The Tri-Dexel model can be generated by combining the Dexel models in three directions generated by the three projection images.

[0049] For ease of understanding, the technical solution of the present invention is described in more detail below.

[0050] Example 1

[0051] Step 1: According to the characteristics of the workpiece, three-dimensional modeling of the workpiece is performed. The specific simulation modeling method can be selected from existing modeling methods, such as VR technology, CAD, OpenGL, etc.

[0052] Step 2: Create a blank projection image.

[0053] Reference Figure 2 In this embodiment, the bounding box of the three-dimensional model of the workpiece is first calculated. Since the purpose of introducing the bounding box is to orthogonally project it to determine the model position and area, the AABB bounding box (Axis-aligned Bounding Box) itself has the characteristics of axis alignment and simple calculation. Therefore, the AABB bounding box is selected from the commonly used bounding boxes to establish the model bounding box as follows: Figure 2 shown.

[0054] Orthogonally project the AABB bounding box of the model onto the XOY, XOZ and YOZ planes, divide the projection area into uniform grids, and convert the three obtained two-dimensional grids into three projection images. For each pixel of the projection image, a data structure is constructed, which includes its own position information and a triangle face list to save the triangle face information mapped to the pixel.

[0055] Step 3: Projection and mapping of triangular patches of the 3D model.

[0056] Traverse all the triangular facets of the 3D model and perform the following processing on each triangular facet:

[0057] (1) Orthogonally project the three vertices of the triangular patch onto the blank projection images in three directions to obtain three projected triangles, such as Figure 3 As shown, the triangular facet is projected toward the projection image in the XOZ direction and a projected triangle is obtained.

[0058] (2) Discretize the obtained projected triangle into several pixels. The specific discretization rule is that all pixels inside the projected triangle or intersecting with the edge of the projected triangle are used as elements of the pixelated projected triangle. The scan line algorithm is used to implement this process. Figure 4 It shows the shape of the projected triangle before and after discretization.

[0059] (3) Map the pixelated projected triangle to the pixel, specifically by adding the index value of its triangle face to the triangle face list of the pixel data structure, such as Figure 5 The resulting pixel triangle list will contain the indices of all potentially intersecting triangles, making it easier to perform point-to-point operations when intersecting rays.

[0060] Step 4: Projection image generation.

[0061] When extracting and visualizing the information of the projection image data structure, this embodiment specifically encodes the number of index values ​​contained in the triangular facet list of the pixel data structure. Since the number of triangular facets projected to a single pixel in a general model in one direction is usually small, the grayscale range of 0-255 of the grayscale image is sufficient to meet the demand, so the projection of the model in one direction is converted into an 8-bit grayscale image. When the ray intersection is performed later, the pixel with a grayscale value of 0 in the grayscale image indicates that the ray drawn by the pixel will definitely not intersect with the model, and the intersection operation can be directly excluded, thereby improving the generation efficiency of the Tri-Dexel model.

[0062] Step 5: Composite image generation.

[0063] For example Figure 6a The non-closed triangular face model generated after voxelization shown in the figure has a projection image obtained through the above steps as shown in the figure Figure 6b As shown in FIG. 1 , the model interior and the model exterior are both blank in the projection image, and the grayscale value is 0 in the grayscale projection image. Therefore, when performing ray intersection in the vertical direction, this area will be directly skipped and directly identified as the model exterior. Therefore, the established Tri-Dexel model will lose a large number of model interior line bundles. In this embodiment, the introduced cross-sectional image is as follows: Figure 7 As shown in , when encoding, the first 7 bits of the 8-bit binary number are allocated to the projection image to store the number of triangles, and the last bit is reserved for the section image to store the binary information of the section. After encoding, a composite image that integrates the projection image and the section image information will be obtained, as shown in Figure 8 As shown in the figure, the projection of the interior of the model on the composite image will appear as a grayscale value of 1, which is distinguished from the exterior of the model.

[0064] Step 6: Efficient generation of Tri-Dexel model.

[0065] Based on the information stored in the pixel data structure, point-to-point ray intersection can be realized. GPU parallel computing technology is used to batch process the operation and the creation process of Dexel bundles. The intersection results of all pixels in three directions are combined to quickly generate the Tri-Dexel model of the corresponding model, which greatly improves the generation efficiency of the Tri-Dexel model. The specific ray intersection process is as follows: Fig. 9 As shown in the left figure, for a conventional closed model, for the intersection points obtained by the single pixel ray intersection, the inside and outside of the model are directly distinguished based on the normal vector of the intersection point, and then the part of the ray located inside the model is retained, that is, the solid line segment inside the model in the figure. For the ray intersection of the voxelized non-closed triangular face model, the ray intersection based on the composite image is divided into three cases, such as Fig. 9 As shown in the right figure. When the ray is outside the model (grayscale value is 0), no intersection calculation is performed; when the ray intersects with the model triangle (grayscale value is non-0 even number), ray intersection is performed and the part inside the model is retained, such as the solid line part between the two intersection points in the figure; when the ray intersects with the section image (grayscale value is 1 or other odd number), ray intersection is performed and the part inside the model is retained, such as the solid line part after the intersection point in the figure. The present invention obtains good results through ray intersection operation regardless of whether it is a conventional closed model or a non-closed model after voxelization, as shown in the figure. Fig.10 shown.

[0066] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like 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 a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0067] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

[0068] In the present invention, the terms "first", "second", "third", "fourth" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. The term "plurality" refers to two or more, unless otherwise clearly defined.

[0069] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An efficient method for generating a Tri-Dexel model based on an image, characterized in that: The following steps are involved: Step S1, three-dimensional modeling of the workpiece; Step S2, establishing a bounding box for the three-dimensional model of the workpiece, and projecting it to the X, Y, and Z directions to obtain three blank projection images; Step S3, projecting all triangular facets of the three-dimensional model onto three blank projection images respectively to obtain projection images, and mapping to obtain pixel data structures; Step S4, selectively encoding the information contained in each pixel in the pixel data structure to obtain a grayscale projection image; Step S5, generating three composite images by introducing the section image and fusing it with the grayscale projection image; Step S6: Based on the three composite images obtained, ray intersection calculation and Dexel line bundle creation are performed to generate a Tri-Dexel model.

2. The efficient generation method of the Tri-Dexel model according to claim 1, characterized in that: The bounding box in step S2 is an AABB bounding box.

3. The efficient generation method of the Tri-Dexel model according to claim 1, characterized in that: The projection and mapping method of the triangular face in step S3 is as follows: (1) Orthogonally project the three vertices of the triangular face onto the blank projection image in the X, Y, and Z directions to obtain three projected triangles; (2) discretizing the projected triangle into a plurality of pixels; (3) Add the index value of the triangle to the triangle list of the pixel data structure.

4. The efficient generation method of the Tri-Dexel model according to claim 3, characterized in that: The step S4 specifically includes: The number of index values ​​in the triangle patch list of the pixel data structure is encoded, and the three-dimensional model of the workpiece is converted into three 8-bit grayscale projection images in three projection images.

5. The efficient generation method of the Tri-Dexel model according to claim 4, characterized in that: The step S5 specifically includes: (1) voxelizing and segmenting the three-dimensional model of the workpiece, extracting the intersection points between the voxel boundary and the three-dimensional model, and obtaining a cross-sectional image; (2) The 8-bit binary number of the grayscale projection image and the binary information of the cross-sectional image are fused and encoded to obtain three composite images.

6. The efficient generation method of Tri-Dexel model according to claim 5, characterized in that: The step S6 specifically includes: Based on the composite image, GPU parallel computing technology is used to perform ray intersection operations on all pixels of the projection image. For several intersection points obtained by ray intersection of a single pixel, the inside and outside of the model are distinguished according to the normal vector, and the internal line segments are retained to generate a Dexel model. The Dexel models of the three projection images are combined to finally generate a Tri-Dexel model.

Citation Information

Patent Citations

  • Cutting simulation implementation method for real-time machining monitoring

    CN110955934A

  • Dynamic voxel division method based on tool path look-ahead

    CN115618529A