Curved surface layered slicing method based on intersection detection of inner and outer bounding boxes

Through the surface layered slicing method based on the intersect detection of inner and outer bounding box, the possible intersecting pairs are screened out and the intersecting calculation is performed, which solves the problem of excessive running time caused by violent intersecting in the prior art, and achieves more efficient surface layered slicing.

CN119693585APending Publication Date: 2025-03-25CHINA THREE GORGES UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411684927.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the existing surface hierarchical slicing method, the intersecting calculation between triangle-shaped panels is mostly brute force intersecting, resulting in too long running time or even memory crashes.

Method used

The surface layered slicing method based on the intersect detection of the inner and outer bounding box is used to filter out the triangular plate pairs that may intersect on the biased surface through three detections, perform intersecting calculations and generate slice profiles.

Benefits of technology

It reduces unnecessary interpolation calculations between triangle panels, reduces the running time of the method, and improves execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693585A_ABST
    Figure CN119693585A_ABST
Patent Text Reader

Abstract

The invention provides a curved surface hierarchical slicing method based on intersection detection of inner and outer bounding boxes. The method comprises the following steps: extracting a curved surface part of a model as an initial curved surface according to included angles between a triangular patch on the model and an adjacent triangular patch and a Z plane; the vertexes of the triangular patches on the initial curved surface are moved in the average normal direction, the moving distance is the layering thickness, and then an offset curved surface is generated according to the topological relation; screening out triangular patch pairs which may intersect on the model and the offset curved surface through three times of detection, and executing intersection calculation on the triangular patch pairs which may intersect to generate intersection segments; and carrying out directed splicing on the intersection line segments to generate a slice contour of each layer. According to the method, the situation that most triangular patches do not need to be intersected in the triangular patch intersection calculation process is avoided, so that the operation time of the method is shortened, and the execution efficiency of the method is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a surface layered slicing method based on an STL model, in particular to a surface layered slicing method based on inner and outer bounding box intersection detection. Background Art

[0002] Additive Manufacturing (AM), also known as 3D printing, is a manufacturing technology whose core concept is to create parts by gradually adding material layer by layer. AM can produce complex internal structures, thin-walled structures, and geometric shapes without the need for additional processing steps, thereby improving product performance and functionality. Furthermore, compared to traditional cutting processes, AM reduces material waste, thereby improving material utilization.

[0003] All additive manufacturing methods are based on the principle of "discrete-accumulate," where layered slicing is required during the discretization phase. Therefore, layered slicing is the core of additive manufacturing technology. Layered slicing is divided into planar layered slicing and curved surface layered slicing. Curved surface layered slicing is more complex than planar layered slicing, primarily due to the intersection calculation between the offset surface and the model. This calculation involves calculating the intersection of the triangles on the offset surface with the triangles on the model. In reality, the offset surface only intersects a small portion of the triangles on the model. If these triangles that intersect with the offset surface can be identified, unnecessary intersections between the majority of triangles can be avoided, thus reducing the method's runtime and improving efficiency. For planar layered slicing, the spatial relationship between the offset surface and the triangles can be used to eliminate triangles on the model that are completely impossible to intersect with the offset surface. However, for curved surface layered slicing, this method of eliminating triangles that are impossible to intersect with the offset surface based on spatial relationship is not feasible because each triangle on the offset surface has a different height. Summary of the Invention

[0004] The purpose of the present invention is to solve the following technical defects: the intersection calculation between triangular facets in the current surface layered slicing method is mostly brute force intersection, that is, each triangular facet on the offset surface is intersected with each triangular facet on the model. It should be noted that there are usually tens of thousands or even hundreds of thousands of triangular facets on the model, and the layer thickness in the layered slicing is at the millimeter level. If the brute force intersection method is used, the running time of the surface layered slicing method will be too long, and even memory crashes will be caused. For this reason, a surface layered slicing method based on inner and outer bounding box intersection detection is proposed.

[0005] In order to achieve the above technical features, the purpose of the present invention is achieved as follows: a surface layered slicing method based on inner and outer bounding box intersection detection includes the following steps: Step 1, extracting the surface of the three-dimensional model as the initial surface; Step 2: Move the vertices of the triangular facets on the initial surface along the average normal direction by the layer thickness, and then generate a series of offset surfaces based on the topological relationship; Step 3: Use three tests to select the triangle pairs that may intersect between the model and the offset surface; Step 4: Perform intersection calculation on the possible intersecting triangles to obtain intersection segments, and then perform directed splicing on the intersection segments to generate the slice outline.

[0006] Preferably, the step 1 specifically includes: Step 1.1, traverse the triangular face on the model, find the normal vector of the face, and calculate the angle between the normal vector and the Z axis; Step 1.2, save the triangles that meet the conditions into a list.

[0007] Preferably, the three-dimensional model file is in stl format.

[0008] Preferably, the average normal direction is the average value of the sum of the normal vectors of the triangles sharing this vertex.

[0009] Preferably, the step 3 specifically includes: Step 3.1: Construct the OBB bounding box of the bias surface and the model, find their common intersection area, and select the triangles on the model and the bias surface that are located in the common intersection area; Step 3.2: Construct a series of inscribed boxes inside the offset surface and project them onto the XOZ and YOZ planes respectively. Traverse the triangles in the common intersection area on the model and use Boolean operations to filter out triangles that cannot intersect with the offset surface. Step 3.3, finally traverse the triangles on the model that have been filtered twice and the triangles on the offset surface that are located in the common intersection area, construct their AABB bounding boxes respectively, and filter out the possible intersecting triangle pairs.

[0010] Preferably, the step 4 specifically includes: Step 4.1, find the planes p1 and p2 where the two triangles s1 and s2 are located, and determine whether the three vertices of s1 are on the same side of p2 or whether the three vertices of s2 are on the same side of p1; Step 4.2: Find the intersection line of the two planes p1 and p2. Assume that the parametric equation of the intersection line is p = p0 + t * v. Find the coordinates of the intersection points of the intersection line and the two triangles s1 and s2 respectively. Then, get the parameter value t based on the intersection coordinates. First, determine whether the two triangles intersect based on the parameter value. Then, sort all the parameter values ​​to get the intersection line of the two triangles. In step 4.3, the intersection lines of each layer are directed spliced ​​to generate the slice contour of each layer.

[0011] The present invention has the following beneficial effects: The present invention first uses three tests to identify possible intersecting triangle pairs between the model and the offset surface. It then performs intersection calculations on these potentially intersecting triangle pairs to generate intersection segments. Finally, it performs directed concatenation on these segments to generate the slice outline. This method avoids unnecessary intersections between most triangles during the triangle intersection calculation process, thereby reducing the method's runtime and improving its efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The present invention will be further described below with reference to the accompanying drawings and examples.

[0013] Figure 1 It is a flow chart of the present invention.

[0014] Figure 2 It is a schematic diagram of generating offset surface.

[0015] Figure 3 This is the overall schematic diagram of the inner and outer bounding box detection.

[0016] Figure 4 This is a schematic diagram of the triangle patch after the first detection and screening.

[0017] Figure 5 This is a schematic diagram of the construction of the inscribed bounding box.

[0018] Figure 6 (a) (b) are schematic diagrams showing that it is impossible for a triangle face to intersect with the offset surface during inscribed bounding box detection.

[0019] Figure 7 This is a schematic diagram of the triangle patch after the second detection and screening.

[0020] Figure 8 (a) (b) (c) are schematic diagrams of performing intersection calculations.

[0021] Figure 9 This is a schematic diagram of generating slice outlines. DETAILED DESCRIPTION

[0022] The following will be described in detail with reference to the technical solutions in the embodiments of the present invention. The embodiments described are only a part of the embodiments of the present invention, not all of the embodiments. Without departing from the design concept of the present invention, various improvements made by ordinary persons in this field to the technical solutions of the present invention should fall within the scope of protection of the present invention.

[0023] Example 1: See also Figure 1 A surface layered slicing method based on inner and outer bounding box intersection detection includes the following steps: Step 1: Extract the surface of the 3D model as the initial surface: Step 1.1, traverse the triangular face on the model, find the normal vector of the face, and calculate the angle between the normal vector and the Z axis; Step 1.2, save the triangles that meet the conditions into a list.

[0024] Step 2: Move the vertices of the triangular facets on the initial surface along the average normal direction by the layer thickness, and then generate a series of offset surfaces based on the topological relationship; Step 3: Use three tests to filter out the triangle pairs that may intersect between the model and the offset surface: Step 3.1: Construct the OBB bounding box of the bias surface and the model, find their common intersection area, and select the triangles on the model and the bias surface that are located in the common intersection area; Step 3.2: Construct a series of inscribed boxes inside the offset surface and project them onto the XOZ and YOZ planes respectively. Traverse the triangles in the common intersection area on the model and use Boolean operations to filter out triangles that cannot intersect with the offset surface. Step 3.3, finally traverse the triangles on the model that have been filtered twice and the triangles on the offset surface that are located in the common intersection area, construct their AABB bounding boxes respectively, and filter out the possible intersecting triangle pairs.

[0025] Step 4: Perform intersection calculation on the possibly intersecting triangles to obtain intersection segments, and then perform directed splicing on the intersection segments to generate the slice outline; Step 4.1, find the planes p1 and p2 where the two triangles s1 and s2 are located, and determine whether the three vertices of s1 are on the same side of p2 or whether the three vertices of s2 are on the same side of p1; Step 4.2: Find the intersection line of the two planes p1 and p2. Assume that the parametric equation of the intersection line is p = p0 + t * v. Find the coordinates of the intersection points of the intersection line and the two triangles s1 and s2 respectively. Then, get the parameter value t based on the intersection coordinates. First, determine whether the two triangles intersect based on the parameter value. Then, sort all the parameter values ​​to get the intersection line of the two triangles. In step 4.3, the intersection lines of each layer are directed spliced ​​to generate the slice contour of each layer.

[0026] Furthermore, the three-dimensional model file is in stl format.

[0027] Furthermore, the average normal direction is the average value of the sum of the normal vectors of the triangles sharing this vertex.

[0028] Example 2: Referring to 1-9, a surface layered slicing method based on inner and outer bounding box intersection detection includes: A. Extract the surface of the 3D model as the initial surface; B. Move the vertices of the triangles on the initial surface along the average normal direction by the layer thickness, and then generate a series of offset surfaces based on the topological relationship; C. Filter out the triangle face pairs that may intersect between the model and the offset surface through three tests; D. Perform intersection calculation on the possible intersecting triangles to obtain intersection segments, and then perform directed splicing on the intersection segments to generate the slice outline; Furthermore, the step A comprises: A1. Traverse the triangles on the model, find the normal vector of the triangle based on its three vertices, calculate the dot product of the normal vector and the Z-axis vector, and thus find the angle between the triangle and the Z plane. A2. If the angle is not 0, 90, or 180 degrees, and the angle between the adjacent triangle and the Z plane is also not 0, 90, or 180 degrees, save the triangle to a list. After traversing all the triangles on the model, the triangles in the list are the triangles on the initial surface. Furthermore, the step B includes: B1. If the vertices of a triangle on the initial surface are shared by m triangles, find the normal vector of each triangle based on the coordinates of the three vertices. B2. The average normal direction of the vertex is: N = (n1 + n2 + ... + n m ) / m, move the vertices of the triangular facets on the initial surface along the average normal direction, the moving distance is the layer thickness, and then generate the bias surface according to the topological relationship; Furthermore, the step C comprises: C1. Construct the OBB bounding box of the offset surface and the model, find their common intersection area, and select the triangles on the model and the offset surface that are located in the common intersection area. If the triangles on the model and the offset surface are outside the common intersection area, they cannot intersect; C2. Construct a series of inscribed boxes inside the offset surface and project them onto the XOZ and YOZ planes. Traverse the triangles on the model that are located in the common intersection area. If the projections of the triangle on both planes are completely inside the inscribed box projections, then the triangle cannot intersect with the offset surface. Otherwise, the triangle may intersect with the offset surface. C3. Finally, traverse the twice-filtered triangles on the model and the triangles on the offset surface that intersect with each other, and construct their AABB bounding boxes. If the two bounding boxes intersect, the triangles within the two bounding boxes may also intersect. Furthermore, the step D comprises: D1. Traverse the triangles on the offset surface and the selected triangles, and calculate the normal vectors of the two triangles s1 and s2 based on the vertex coordinates of the two triangles. Then, define the planes p1 and p2 where the two triangles are located based on the normal vectors and vertex coordinates of the two triangles. Determine whether the three vertices on triangle s1 are all on the same side of plane p2, or whether the three vertices on triangle s2 are all on the same side of plane p1. If all three vertices are on the same side of the plane, then the two triangles s1 and s2 do not intersect. D2. If the three vertices of the triangle are not on the same side of the plane, first, find the intersection line L of the two planes p1 and p2. Let the parametric equation of the intersection line L be p=p0+t*v, where p0 is any point on the intersection line L and v is the direction vector of the intersection line L. Then find the coordinates m1, m2, m3, m4 of the intersection points of the intersection line L and the two triangles s1 and s2. Substitute the intersection coordinates m1, m2, m3, m4 into the parametric equation of the intersection line L to obtain the parameters t1, t2, t3, t4. If the maximum value of t1 and t2 is less than the minimum value of t3 and t4 or the minimum value of t1 and t2 is greater than the maximum value of t3 and t4, then the triangles s1 and s2 do not intersect. Otherwise, sort t1, t2, t3, and t4 from small to large to obtain t a , t b , t c , t d , where t b With t c The line segment formed by the corresponding points is the intersection line between triangles s1 and s2; D3. After obtaining the intersection lines of each layer, perform directed splicing based on whether the first and last coordinates of the intersection lines are the same, thereby obtaining the slice outline of each layer.

[0029] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that any modifications or substitutions made do not deviate from the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application.

Claims

1. A surface layering and slicing method based on inner and outer bounding box intersection detection, characterized in that: The following steps are involved: Step 1, extracting the surface of the three-dimensional model as the initial surface; Step 2, move the vertices of the triangular facets on the initial surface along the average normal direction by the layer thickness, and then generate a series of offset surfaces according to the topological relationship; Step 3, through three tests, select the triangular face pairs that may intersect the model and the offset surface; Step 4: Perform intersection calculation on the possible intersecting triangular facets to obtain the intersection line segments, and then perform directed splicing on the intersection line segments to generate the slice contour.

2. The surface layering and slicing method based on inner and outer bounding box intersection detection according to claim 1, characterized in that: The step 1 specifically includes: Step 1.1, traverse the triangular face on the model, find the normal vector of the face, and calculate the angle between the normal vector and the Z axis; Step 1.2, save the triangles that meet the conditions into a list.

3. The surface layering and slicing method based on inner and outer bounding box intersection detection according to claim 1, characterized in that: The three-dimensional model file is in stl format.

4. The surface layering and slicing method based on inner and outer bounding box intersection detection according to claim 1, characterized in that: The average normal direction is the average value of the sum of the normal vectors of the triangles that share this vertex.

5. The surface layering and slicing method based on inner and outer bounding box intersection detection according to claim 1, characterized in that: The step 3 specifically includes: Step 3.1, construct the OBB bounding box of the offset surface and the model, find their common intersection area, and select the triangles on the model and the offset surface that are located in the common intersection area; Step 3.2, construct a series of inscribed boxes inside the offset surface, project them onto the XOZ and YOZ planes respectively, traverse the triangles in the common intersection area on the model, and filter out the triangles that cannot intersect with the offset surface through Boolean operations; Step 3.3, finally traverse the triangles on the model that have been screened twice and the triangles on the offset surface that are located in the common intersection area, construct their AABB bounding boxes respectively, and screen out possible intersecting triangle pairs.

6. The surface layering and slicing method based on inner and outer bounding box intersection detection according to claim 1, characterized in that: The step 4 specifically includes: Step 4.1, find the planes p1 and p2 where the two triangles s1 and s2 are located, and determine whether the three vertices of s1 are on the same side of p2 or whether the three vertices of s2 are on the same side of p1; Step 4.2, find the intersection line of the two planes p1 and p2, and assume that the parametric equation of the intersection line is p=p0+t*v. Find the coordinates of the intersection points of the intersection line and the two triangles s1 and s2 respectively, and then get the parameter value t according to the coordinates of the intersection points. First, determine whether the two triangles intersect according to the parameter value, and then sort all the parameter values ​​to get the intersection line of the two triangles. Step 4.3, perform directed splicing on the intersection lines of each layer to generate the slice contour of each layer.

Citation Information

Cited By

  • Method and device for measuring overall large deformation of tunnel based on laser scanning

    CN121207065A