Three-dimensional model layer height matching method based on interpolation search

Through the three-dimensional model layer height matching method based on interpolation search, the intersection location is quickly positioned, and the problem of low efficiency of traditional methods is solved, and efficient and stable layer height matching processing is achieved.

CN119399402APending Publication Date: 2025-02-07CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411222050.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing three-dimensional model layer height matching method is inefficient, especially for complex models and large three-dimensional models. The traditional method has a large amount of calculation, high memory usage, and poor processing efficiency.

Method used

The three-dimensional model layer height matching method based on interpolation search is adopted to quickly locate possible intersection positions through interpolation calculation, reduce the number of triangular panels that need to be accurately calculated, and avoid building complex spatial index structures.

Benefits of technology

It significantly improves the efficiency of layer height matching, is suitable for processing large and complex three-dimensional models, reduces computing time and memory usage, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399402A_ABST
    Figure CN119399402A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional model floor height matching method based on interpolation lookup, which comprises the following steps: S1, reading a three-dimensional model triangular patch file needing floor height matching, traversing the triangular patch file, and obtaining a floor height list ZS of triangular patches; s2, positioning indexes corresponding to the lowest point ZMin and the highest point ZMax of each triangular patch in the ZS through an interpolation lookup algorithm; s3, searching all layer height values intersected with the current triangular patch in an index range obtained by positioning; s4, the lowest layer height value serves as a starting point, and the intersection layer height values of the triangular patches are sorted in the ascending sequence direction; and traversing all triangular patches to quickly obtain upper and lower limit serial numbers start and stop of element values in a corresponding floor height list ZS, and then adding ZS [start]-ZS [stop] into the corresponding patches one by one to complete floor height matching of the three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional model processing, and in particular to a three-dimensional model layer height matching method based on interpolation search. Background Art

[0002] With the rapid development of 3D printing technology, the processing of three-dimensional models has become an indispensable part of industrial production. In the 3D printing process, converting complex three-dimensional models into a printable two-dimensional layer sequence is a key step. This process is usually called "slicing", which divides the three-dimensional model into a series of thin layers along a specific direction (usually the Z axis). Each layer represents a cross-section of the model at that height, and this cross-sectional information guides the 3D printer to build the object layer by layer. Therefore, efficient and accurate layer height matching of three-dimensional models has become an important research topic in the field of 3D printing.

[0003] Traditional 3D model layer height matching methods mainly include brute force intersection method, spatial index method and scanning plane method. The brute force intersection method traverses all triangular facets in the model to determine whether each facet intersects with the slice plane. This method is simple to implement, but the amount of calculation is huge, especially for complex models containing a large number of triangular facets, the processing efficiency is extremely low. The spatial index method uses data structures such as octrees or KD trees to divide the three-dimensional space into several subspaces to quickly locate triangular facets that may intersect with the slice plane. Although this method significantly improves the search efficiency, it requires additional memory overhead and preprocessing time to establish and maintain the spatial index structure. The scanning plane method scans the model along a specific direction and records the intersection of the scan line and the triangular facet. This method can use spatial continuity to reduce repeated calculations, but its efficiency is still unsatisfactory for models with complex geometric shapes. Summary of the invention

[0004] The purpose of the present invention is to overcome the above-mentioned shortcomings and provide a three-dimensional model layer height matching method based on interpolation search. This method utilizes the continuity characteristics of the model in space and quickly locates possible intersection positions through interpolation calculation, thereby greatly reducing the number of triangles that need to be accurately calculated. Compared with traditional methods, the interpolation search method has the following advantages: first, it does not need to construct a complex spatial index structure and occupies less memory; second, this method can maintain good adaptability and stability for models of various complexities.

[0005] In order to realize the above technical features, the object of the present invention is achieved as follows: a three-dimensional model layer height matching method based on interpolation search comprises the following steps: S1: Batch read the triangular patch files of the 3D model that needs to be matched for layer height, traverse the triangular patch files, and obtain the layer height list ZS of the triangular patch, where ZS contains all possible layer height values, and n=Len(ZS); S2: Locate the index corresponding to the lowest point ZMin and the highest point ZMax of each triangle in ZS through the interpolation search algorithm; S3: Search for all layer height values ​​intersecting with the current triangle within the index range obtained by positioning; take the lowest layer height value as the starting point and sort the intersecting layer height values ​​of the triangle in ascending order; S4: Traverse all triangular facets, obtain the upper and lower limit sequence numbers start and stop of the element values ​​in the corresponding layer height list ZS, and then add ZS[start]~ZS[stop] to the corresponding facets one by one, and finally generate the final layer height matching file to complete the automatic layer height matching of the 3D model.

[0006] Preferably, the specific process of S1 is: Read the 3D model triangular patch file that needs layer height matching. Suppose a total of n triangular patch data are read. Sort the n triangular patches according to their characteristics. The order indicates the processing priority of the triangular patches. Traverse the triangular patch file to obtain all possible layer height values ​​to form a layer height list ZS. Suppose ZS contains a total of m elements, which are arranged in ascending order.

[0007] Preferably, the characteristics of the triangular facet include area and normal vector.

[0008] Preferably, the S2 process is: The interpolation search algorithm is used to locate the index corresponding to the lowest point ZMin and the highest point ZMax of each triangle in ZS. The interpolation search determines the position of the next search based on the approximate position of the search value in the sequence. The search formula is as follows: ; Among them, low and up are the lower and upper bound indexes of the current search range respectively, target is the target search value ZMin or ZMax, and mid is the calculated middle position index.

[0009] Preferably, when S2 is specifically implemented: First, enter the first layer loop, traverse each triangle in all triangles, and obtain its lowest point ZMax and highest point ZMin; Initialize the upper limit up, middle value mid and lower limit low of the interpolation search, that is, low=mid=0, up=n-1; Enter the conditional loop and use the interpolation formula to calculate mid. , where target is the target height; Judge the relationship between ZS[mid] and ZMin. If ZS[mid] < ZMin, then assign low = mid; otherwise, assign up = mid; When up - low ≤ 1, exit the conditional loop and assign start = up; If ZS(mid) = ZMin, then assign start = low. At this time, the lower limit serial number start has been obtained; Next, obtain the upper limit serial number. First, also assign low = mid = 0, up = n - 1, enter the conditional loop, and calculate mid using the interpolation formula; Judge the relationship between ZS[mid] and ZMax. If ZS[mid] < ZMax, then assign low = mid; otherwise, assign up = mid; When up - low ≤ 1, exit the conditional loop and assign stop = low; If ZS(mid) = ZMax, then assign stop = up. At this time, the upper limit serial number stop has been obtained; This process gradually narrows the search range by continuously adjusting the position of mid and updating low or up until the position closest to the target value is found or the exact position of the target value in ZS is determined; Finally, for ZMin, the obtained low value is the position index of it in ZS; for ZMax, the obtained up value is the position index of it in ZS.

[0010] The present invention has the following beneficial effects: 1. Compared with the traditional brute - force intersection method, the interpolation search method of the present invention can converge to the target height faster, significantly improving the efficiency of layer height matching.

[0011] 2. This method is particularly suitable for processing large and complex 3D models, and can effectively reduce the calculation time.

[0012] 3. This method is easy to implement and can be integrated into existing 3D printing, CAD / CAM systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The present invention will be further described below in conjunction with the drawings and embodiments.

[0014] Figure 1 Overall flowchart of interpolation search for layer height matching.

[0015] Figure 2 Is the algorithm flowchart in interpolation search for layer height matching.

[0016] Figure 3A solid surface rendering of the 3D example model.

[0017] Figure 4 Schematic diagram of the hierarchical slice outline of the example model. DETAILED DESCRIPTION

[0018] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.

[0019] Embodiment 1: Reference Figure 1 The present invention provides a three-dimensional model layer height matching method based on interpolation search, comprising the steps of: S1: Batch read the 3D model triangular patch files that need to be matched for layer height, traverse the triangular patch files, and obtain the layer height list ZS of the triangular patch, where ZS contains all possible layer height values, and n=Len(ZS); S2: Locate the index corresponding to the lowest point ZMin and the highest point ZMax of each triangle in ZS through the interpolation search algorithm; S3: Search for all layer height values ​​intersecting with the current triangle within the index range obtained by positioning; take the lowest layer height value as the starting point and sort the intersecting layer height values ​​of the triangle in ascending order; S4: By traversing all triangular faces, you can quickly get the upper and lower limit numbers start stop of the element values ​​in the corresponding layer height list ZS, and then add ZS[start]~ZS[stop] to the corresponding faces one by one, and finally generate the final layer height matching file to complete the automatic layer height matching of the 3D model.

[0020] The step S1 of the present invention is specifically as follows: Read the 3D model triangular patch file that needs to be matched for layer height. Suppose that a total of n triangular patch data is read. Sort the n triangular patch data according to the characteristics of the triangular patch (such as area, normal vector, etc.). The order represents the processing priority of the triangular patch. Traverse the triangular patch file to obtain all possible layer height values ​​to form a layer height list ZS. Suppose that ZS contains a total of m elements, which are arranged in ascending order.

[0021] Reference Figure 2 , step S2 is specifically as follows: The interpolation search algorithm is used to locate the index corresponding to the lowest point ZMin and the highest point ZMax of each triangle in ZS. The core idea of ​​interpolation search is to determine the next search position based on the approximate position of the search value in the sequence. The search formula is as follows: ; Among them, low and up are respectively the lower and upper bound indices of the current search range, target is the target search value (ZMin or ZMax), and mid is the calculated middle position index.

[0022] When specifically implemented: First, enter the first-layer loop, traverse each triangular patch Triangle in Triangles, and obtain its lowest point ZMax and highest point ZMin; Furthermore, initialize the upper limit up, middle value mid, and lower limit low of the interpolation search, that is, low = mid = 0, up = n - 1; Furthermore, enter the conditional loop and calculate mid using the interpolation formula, , where target is the target height; Furthermore, judge the relationship between ZS[mid] and ZMin. If ZS[mid] < ZMin, then assign low = mid; otherwise, assign up = mid; Furthermore, when up - low ≤ 1, exit the conditional loop and assign start = up; Furthermore, if ZS(mid) = ZMin, then assign start = low, and at this time, the lower limit serial number start has been obtained; Furthermore, to obtain the upper limit serial number next, first assign low = mid = 0, up = n - 1 in the same way, enter the conditional loop, and calculate mid using the interpolation formula; Furthermore, judge the relationship between ZS[mid] and ZMax. If ZS[mid] < ZMax, then assign low = mid; otherwise, assign up = mid; Furthermore, when up - low ≤ 1, exit the conditional loop and assign stop = low; Furthermore, if ZS(mid) = ZMax, then assign stop = up, and at this time, the upper limit serial number stop has been obtained; This process gradually narrows the search range by continuously adjusting the position of mid and updating low or up until the position closest to the target value is found or the exact position of the target value in ZS is determined.

[0023] Finally, for ZMin, the obtained low value is the position index of it in ZS; for ZMax, the obtained up value is the position index of it in ZS.

[0024] Refer to Figure 3-4 , the feasibility and superiority of a three-dimensional model floor height matching method based on interpolation search provided by the present invention are verified through experiments. The specific experiments include: The classic Hello Kitty model was used as the test object to compare the performance of the proposed method with the traditional brute force method under different layer thickness conditions. The experiment used five different layer thickness parameters: 0.1mm, 0.05mm, 0.03mm, 0.02mm and 0.01mm, and used two methods to slice the model respectively. Figure 3 Shows a 3D view of the Hello Kitty model. Figure 4 Schematic diagrams of the model's layered slices are shown, and these two figures intuitively present the complexity of the experimental object.

[0025] Table 1 is a comparison table of the computational efficiency of the interpolation search method and the violent interception method based on different layer thickness parameters. The specific data show that when the layer thickness is 0.1mm, the violent interception method takes 3.347 seconds, while the interpolation search method only takes 0.365 seconds; when the layer thickness is 0.05mm, the two methods take 5.207 seconds and 0.437 seconds respectively; when the layer thickness is 0.03mm, the time consumption is 8.490 seconds and 0.477 seconds respectively; when the layer thickness is 0.02mm, the time consumption is 11.074 seconds and 1.048 seconds respectively; when the layer thickness is 0.01mm, the violent interception method takes up to 20.105 seconds, while the interpolation search method only takes 1.980 seconds. The above experimental data fully demonstrate the significant advantages of the method of the present invention in improving computational efficiency, especially when processing high-precision slices (smaller layer thickness), the advantages of the interpolation search method are more prominent. As the layer thickness decreases, the calculation time of both methods increases, but the calculation time of the interpolation search method is significantly shorter than that of the brute force intersection method, which shows the effectiveness and superiority of this method.

[0026] Table 1 is a comparison table of the calculation efficiency of the interpolation search method and the brute force intersection method based on different layer thickness parameters

[0027] Although the present invention has been described in detail above by means of general description, specific implementation methods and experiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.

Claims

1. A three-dimensional model layer height matching method based on interpolation search, characterized in that: It includes the following steps: S1: Batch read the triangular facet file of the 3D model that needs to perform layer height matching, traverse the triangular facet file, and obtain the layer height list ZS of the triangular facets. Among them, ZS contains all possible layer height values. Denote n = Len(ZS); S2: Locate the indices corresponding to the lowest point ZMin and the highest point ZMax of each triangular facet in ZS through the interpolation search algorithm; S3: Within the located index range, search for all layer height values that intersect with the current triangular facet; use the lowest layer height value as the starting point, and sort the intersecting layer height values of this triangular facet in ascending order; S4: Traverse all triangular facets to obtain the upper and lower limit indices start and stop of the element values in the corresponding layer height list ZS, and then add ZS[start]~ZS[stop] to the corresponding facets one by one. Finally, generate the final layer height matching file to complete the automatic layer height matching of the 3D model.

2. According to the three-dimensional model layer height matching method based on interpolation search as described in claim 1, it is characterized in that: The specific process of S1 is as follows: Read the triangular facet file of the 3D model that needs to perform layer height matching. Assume that a total of n triangular facet data are read, and sort the n triangular facets according to the characteristics of the triangular facets. This order represents the processing priority of the triangular facets; traverse the triangular facet file to obtain all possible layer height values and form the layer height list ZS. Assume that ZS contains a total of m elements, and these elements are arranged in ascending order.

3. According to the three-dimensional model layer height matching method based on interpolation search as described in claim 2, it is characterized in that: The characteristics of the triangular facets include area and normal vector.

4. The three-dimensional model layer height matching method based on interpolation search according to claim 2 is characterized in that: The process of S2 is as follows: Locate the indices corresponding to the lowest point ZMin and the highest point ZMax of each triangular facet in ZS through the interpolation search algorithm. Among them, interpolation search determines the position of the next search according to the approximate position of the search value in the sequence. The search formula is as follows: ; Among them, low and up are the lower and upper bound indices of the current search range respectively, target is the target search value ZMin or ZMax, and mid is the calculated middle position index.

5. The three-dimensional model layer height matching method based on interpolation search according to claim 2 is characterized in that: In the specific implementation of S2: First, enter the first-level loop, traverse each triangular facet in all triangular facets, and obtain its lowest point ZMax and highest point ZMin; Initialize the upper limit up, the middle value mid, and the lower limit low of the interpolation search, that is, low = mid = 0, up = n - 1; Enter the conditional loop and use the interpolation formula to calculate mid. , where target is the target height; Judge the relationship between ZS[mid] and ZMin. If ZS[mid] < ZMin, then assign low = mid, otherwise up = mid; When up - low ≤ 1, exit the conditional loop and assign start = up; If ZS(mid) = ZMin, then assign start = low. At this time, the lower limit index start has been obtained; Next, obtain the upper limit index. First, also assign low = mid = 0, up = n - 1, enter the conditional loop, and calculate mid using the interpolation formula; Judge the relationship between ZS[mid] and ZMax. If ZS[mid] < ZMax, then assign low = mid, otherwise up = mid; When up - low ≤ 1, exit the conditional loop and assign stop = low; If ZS(mid)=ZMax, then assign stop=up, and the upper limit sequence number stop has been obtained; This process gradually narrows the search range by continuously adjusting the position of mid and updating low or up until the position closest to the target value is found or the exact position of the target value in ZS is determined; Finally, for ZMin, the obtained low value is its position index in ZS; for ZMax, the obtained up value is its position index in ZS.