High-precision NURBS surface tracing method based on surface modeling optical system
By performing parameterized expression and subdividing grid processing on the NURBS surface model, the effective surface element center point is determined as the iteration starting point, and the Newtonian method is used for ray tracing, which solves the accuracy and efficiency of ray tracing in the optical system, achieving high-precision and efficient ray tracing effect.
Patent Information
- Application Number
- CN202411042777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Prior art In optical systems, especially wide-angle and X-ray optical systems, the accuracy and efficiency of the ray tracing algorithm are difficult to meet the high-precision requirements, and the accumulated errors lead to unavailability of ray data, especially when the intersection tangent plane of the NURBS surface model is close to parallel, ray tracing fails or is abnormal.
By establishing the parameterized expression of the NURBS surface model, a subdivided grid is constructed, the effective surface element center point is determined as the iteration starting point, the Newtonian method is used for high-precision ray tracing, and the position coordinates of the surface element center point are used as the iteration initial value to reduce unnecessary cross product operations and improve calculation efficiency and accuracy.
It realizes high-precision ray tracing, reduces the calculation amount, improves the robustness and adaptability of ray tracing, meets the accuracy requirements of the order of 10-9mm, and is suitable for non-high configuration computing platforms.
Smart Images

Figure CN118839527B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ray tracing, and in particular relates to a high-precision NURBS surface tracing method based on a surface modeling optical system. Background Art
[0002] Ray tracing based on NURBS (Non-Uniform Rational B-Spline) surface models has been widely used in computer graphics. In terms of optical system data calculation, the accuracy of ray tracing is particularly important. The precision and efficiency of ray tracing algorithms are important criteria for judging whether ray tracing algorithms are feasible. Taking imaging optical systems as an example, some wide-angle and X-ray optical systems are close to parallel to the tangent plane of the intersection of the tracing ray and the NURBS surface model. Therefore, after the tracing ray passes through the control point grid, due to the large angle of incidence, the intersection point with the control point grid is still far from the surface composed of the value points. Using this point as the iterative starting point of ray tracing may lead to failure or abnormality of ray tracing. If the intersection judgment of the face elements of these grids is performed by encrypting the control point grid, a large number of cross product operations will be introduced, which greatly reduces the efficiency of ray tracing. On the other hand, for the minimum accuracy requirement of 10 -9 For mm-scale lithography systems, the error caused by the tracing data of a single NURBS surface model in industrial software can reach 10 -7 The light data obtained cannot be applied because the error is above the mm level and due to the accumulation of errors in multiple optical elements. Summary of the Invention
[0003] In view of this, the present invention aims to provide a high-precision NURBS surface tracing method based on a surface modeling optical system, which improves the computational efficiency and robustness of the high-precision NURBS surface tracing method by providing a good iterative initial value for the iterative method with high precision requirements before optical tracing.
[0004] To achieve the above object, the technical solution created by the present invention is implemented as follows:
[0005] A high-precision NURBS surface tracing method based on a surface modeling optical system specifically includes the following steps:
[0006] S1: Establish a NURBS surface model and perform parameterized expression on the NURBS surface model;
[0007] S2: Construct each subdivision grid of the NURBS surface model based on the node vectors in two directions of the NURBS surface model;
[0008] S3: Based on the coordinate information of each subdivided grid of the NURBS surface model and all traced rays, the position coordinates of the center point of each valid surface element of the NURBS surface model are obtained;
[0009] S4: The tracing ray passing through the effective surface element is used as the effective tracing ray, and the position coordinates of the center point of the effective surface element are used as the iteration starting coordinates. The Newton method is used to iterate the ray tracing of the NURBS surface model to obtain the final high-precision numerical solution of the effective tracing ray and the NURBS surface model.
[0010] Furthermore, in step S1, the NURBS surface model is parameterized by the following formula:
[0011] (1);
[0012] (2);
[0013] (3);
[0014] in, is the function expression of the NURBS surface model, is the node vector in the u direction, , u i is the node on the node vector in the u direction, is the i+p+1th node in the u direction, is the i+1th node in the u direction, is the i+pth node in the u direction, is the node vector in the v direction, , v i is the node on the node vector in the v direction, is the j+1th node in the v direction, is the j+q+1th node in the v direction, is the j+qth node in the v direction, p is The number of constructions on the node vector in the u direction, q is the number of constructions on the node vector in the v direction, is the first i indivual p Sub-B-spline basis functions, is the first j indivual q Sub-B-spline basis functions, is the weight factor, is the control point grid in the u and v directions, n is the total number of B-spline basis functions in the u direction, and m is the total number of B-spline basis functions in the v direction.
[0015] Furthermore, in step S2, the node vectors in the two directions are retained at the original endpoints of the NURBS surface model, and the intermediate data of the node vectors in the two directions are evenly divided using the following formula. A two-dimensional node grid matrix is constructed using all the u-direction coordinates and all the v-direction coordinates after the equalization, and all the nodes contained in the two-dimensional node grid matrix are sequentially substituted into formula (1) to obtain the coordinate information of each subdivided grid of the NURBS surface model in the spatial rectangular coordinate system:
[0016] (4);
[0017] (5);
[0018] Where r is the number of grids subdivided by the node vector in the u direction, and s is the number of grids subdivided by the node vector in the v direction.
[0019] Furthermore, step S3 specifically includes the following steps:
[0020] S31: According to the coordinate information of each subdivided mesh of the NURBS surface model, four vertices are selected on each subdivided mesh, and the spatial rectangular coordinate values of the four vertices of each subdivided mesh are obtained, and a plane passing through the four vertices of each subdivided mesh and perpendicular to the Z axis of the spatial rectangular coordinate system is used as a facet;
[0021] S32: Determine the incident directions of all tracing rays using the following formula, extend all tracing rays along their respective incident directions, and use the bins intersecting the tracing rays as valid bins, and obtain the position coordinates of the center point of each valid bin in the spatial rectangular coordinate system:
[0022] (6);
[0023] in, is the starting coordinate of the tracing ray, is the coordinate of the intersection point where the tracing ray intersects the surface element, s To trace the distance traveled by the ray, is the incident direction cosine of the tracing ray.
[0024] Furthermore, step S4 specifically includes the following steps:
[0025] S41: Take the tracing rays passing through the effective surface element as the effective tracing rays, randomly select two orthogonal planes in the spatial rectangular coordinate system, and use the two orthogonal planes to represent each effective tracing ray:
[0026] (7);
[0027] (8);
[0028] in, is the orthogonal vector perpendicular to the direction cosine of the light in the first of the two orthogonal planes, is the orthogonal vector perpendicular to the direction cosine of the light in the second of the two orthogonal planes, d1 is the distance from the origin of the coordinate system to the first plane in the first of the two orthogonal planes, and d2 is the distance from the origin of the coordinate system to the second plane in the second of the two orthogonal planes;
[0029] S42: According to equations (7) and (8), the high-precision numerical solution of each effective tracing ray and the NURBS surface model is calculated by the following equation:
[0030] (9);
[0031] in, Points of the NURBS surface model The value of , that is, the high-precision numerical solution, To efficiently trace rays to points on a NURBS surface model distance;
[0032] S43: If , the high-precision numerical solution obtained in step S42 is used as the final high-precision numerical solution, otherwise, step S44 is executed;
[0033] S44: Update by and Value:
[0034] (10);
[0035] in, is the inverse matrix of the Jacobian matrix;
[0036] S45: Using the updated and Iterate Equation (9) with the value of , and repeat steps S42-S44 until the final high-precision numerical solution is obtained.
[0037] Furthermore, in step S43, The value of is customized according to the user's requirements for the accuracy of the intersection coordinate solution of the effective traced ray and the NURBS surface model.
[0038] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0039] The present invention creates a high-precision NURBS surface tracing method based on a surface modeling optical system. First, the NURBS surface model is parameterized to obtain the node vectors of the NURBS surface model in two directions. Then, the subdivided grids of the NURBS surface model are constructed based on the node vectors in the two directions. Then, the effective face elements are determined according to the intersection state of the subdivided grids of the NURBS surface model and the tracing light. This avoids unnecessary cross product operations when judging the intersection state, and provides a good iterative initial value for the high-precision NURBS surface tracing method. It reduces unnecessary calculations while ensuring the accuracy of the light solution. The present invention processes the prior information of the NURBS surface model before performing ray tracing. Therefore, the present invention is closer to the surface shape representation of the constructed NURBS surface model, and has good adaptability to the calculation of incident light at various angles. The present invention does not need to call a complex mathematical calculation library, has stable performance, strong robustness, and is also applicable to non-high-configuration computing platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which constitute part of the present invention, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0041] Figure 1 A schematic flow chart of a high-precision NURBS surface tracing method based on a surface modeling optical system according to an embodiment of the present invention;
[0042] Figure 2 This is a schematic diagram of the structure of the intersection of the tracing light and the surface element described in the embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.
[0044] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.
[0045] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second" and the like are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, features defined as "first", "second" and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0046] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art can understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0047] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0048] like Figure 1 As shown, the present invention provides a high-precision NURBS surface tracing method based on a surface modeling optical system, which specifically includes the following steps:
[0049] S1: Establish a NURBS surface model and perform parameterized expression on the NURBS surface model;
[0050] In step S1, the NURBS surface model is parameterized by the following formula:
[0051] (1);
[0052] (2);
[0053] (3);
[0054] in, is the function expression of the NURBS surface model, is the node vector in the u direction, ,u i is the node on the node vector in the u direction, is the i+p+1th node in the u direction, is the i+1th node in the u direction, is the i+pth node in the u direction, is the node vector in the v direction, , v i is the node on the node vector in the v direction, is the j+1th node in the v direction, is the j+q+1th node in the v direction, is the j+qth node in the v direction, p is The number of constructions on the node vector in the u direction, q is the number of constructions on the node vector in the v direction, is the first i indivual p Sub-B-spline basis functions, is the first j indivual q Sub-B-spline basis functions, is the weight factor, is the control point grid in the u and v directions, n is the total number of B-spline basis functions in the u direction, and m is the total number of B-spline basis functions in the v direction.
[0055] S2: Construct each subdivision grid of the NURBS surface model based on the node vectors in two directions of the NURBS surface model.
[0056] In step S2, the node vectors in the two directions are retained at the original endpoints of the NURBS surface model, and the intermediate data of the node vectors in the two directions are evenly divided by the following formula. All the u-direction coordinates and all the v-direction coordinates after the equalization are used to construct a two-dimensional node grid matrix, and all the nodes contained in the two-dimensional node grid matrix are substituted into formula (1) in turn to obtain the coordinate information of each subdivided grid of the NURBS surface model in the spatial rectangular coordinate system:
[0057] (4);
[0058] (5);
[0059] Where r is the number of grids subdivided by the node vector in the u direction, and s is the number of grids subdivided by the node vector in the v direction.
[0060] S3: Based on the coordinate information of each subdivided grid of the NURBS surface model and all traced rays, the position coordinates of the center point of each valid surface element of the NURBS surface model are obtained.
[0061] S31: According to the coordinate information of each subdivided mesh of the NURBS surface model, four vertices are selected on each subdivided mesh, and the spatial rectangular coordinate values of the four vertices of each subdivided mesh are obtained, and a plane passing through the four vertices of each subdivided mesh and perpendicular to the Z axis of the spatial rectangular coordinate system is used as a facet;
[0062] like Figure 2 As shown, the projection of the four vertices (P1, P2, P3, P4) is a quadrilateral, and Ray1 is the tracing ray.
[0063] S32: Determine the incident directions of all tracing rays using the following formula, extend all tracing rays along their respective incident directions, and use the bins intersecting the tracing rays as valid bins, and obtain the position coordinates of the center point of each valid bin in the spatial rectangular coordinate system:
[0064] (6);
[0065] in, is the starting coordinate of the tracing ray, is the coordinate of the intersection point where the tracing ray intersects the surface element, s To trace the distance traveled by the ray, is the incident direction cosine of the tracing ray.
[0066] S4: The tracing ray passing through the effective surface element is used as the effective tracing ray, and the position coordinates of the center point of the effective surface element are used as the iteration starting coordinates. The Newton method is used to iterate the ray tracing of the NURBS surface model to obtain the final high-precision numerical solution of the effective tracing ray and the NURBS surface model.
[0067] The purpose here is to provide a reliable initial value for ray tracing. After the effective tracing ray intersects with the effective surface element, it obtains a rough intersection range. In the parametric coordinate system, the position coordinates of the center point of the effective surface element intersecting with the effective tracing ray are used as guess values to give the iterative initial value of the effective tracing ray.
[0068] S41: Take the tracing rays passing through the effective surface element as the effective tracing rays, randomly select two orthogonal planes in the spatial rectangular coordinate system, and use the two orthogonal planes to represent each effective tracing ray:
[0069] (7);
[0070] (8);
[0071] in, is the orthogonal vector perpendicular to the direction cosine of the light in the first of the two orthogonal planes, is the orthogonal vector perpendicular to the direction cosine of the light in the second of the two orthogonal planes, d1 is the distance from the origin of the coordinate system to the first plane in the first of the two orthogonal planes, and d2 is the distance from the origin of the coordinate system to the second plane in the second of the two orthogonal planes;
[0072] S42: According to equations (7) and (8), the high-precision numerical solution of each effective tracing ray and the NURBS surface model is calculated by the following equation:
[0073] (9);
[0074] in, Points of the NURBS surface model The value of , that is, the high-precision numerical solution, To efficiently trace rays to points on a NURBS surface model distance;
[0075] The intersection coordinates (x, y, and z elements) of the effective tracing ray and the NURBS surface model.
[0076] S43: If , the high-precision numerical solution obtained in step S42 is used as the final high-precision numerical solution, otherwise, step S44 is executed;
[0077] The value of is the exit condition of the iteration, which is customized according to the user's requirements for the accuracy of the intersection coordinate solution of the effective traced light and the NURBS surface model. The value can be 1E-10 or 1E-12, or other values. The higher the accuracy requirement, the smaller the value is set.
[0078] S44: Update by and Value:
[0079] (10);
[0080] in, is the inverse matrix of the Jacobian matrix;
[0081] S45: Using the updated and Iterate Equation (9) with the value of , and repeat steps S42-S44 until the final high-precision numerical solution is obtained.
[0082] The present invention uses MATLAB 2018b platform on a PC with AMD(R) CPU 2.9GHz to perform ray tracing simulation on a sphere with a radius of 21.48138mm.
[0083] Table 1 shows the comparison results of ray tracing data in the present invention and the commercial optical software CodeV on the market, with the tracing ray with an incident position of [0, -6, 0] and a field of view angle of [0°, 85°] as the verification tracing ray. The intersection position calculated in the optical software (verifying the intersection position of the tracing light and the NURBS surface model) is [0, -3.22214425909634, 0.243030886239477]; while the intersection position calculated using the present invention (verifying the intersection position of the tracing light and the NURBS surface model) is [0, -3.22214425909634, 0.243030886239475]; the data deviation of the intersection position coordinates of the two is [1.57717286607850e-16, 9.769962616701378e-15, 1.582067810090848e-15], and the coordinate position deviation is within 10 -15 It is of the order of magnitude, meeting the computational accuracy requirements when tracing rays are incident on NURBS surfaces at large angles.
[0084] Table 1
[0085]
[0086] Table 2 compares the runtime required to solve for valid bins using the present invention and the cross-product method for 2600 traced rays at different node vector subdivision grid numbers. Comparing the data in Table 2, we can see that the present invention has a shorter runtime and higher computational efficiency at different subdivision numbers.
[0087] Table 2
[0088]
[0089] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved. This is not limited herein.
[0090] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A high-precision NURBS surface tracing method based on a surface modeling optical system, characterized by: The specific steps include: S1: establishing a NURBS surface model and performing parameterized expression on the NURBS surface model; S2: constructing each subdivision grid of the NURBS surface model based on the node vectors in two directions of the NURBS surface model; S3: Based on the coordinate information of each subdivided grid and all traced rays of the NURBS surface model, obtaining the position coordinates of the center point of each valid surface element of the NURBS surface model; S4: using the tracing ray passing through the effective surface element as the effective tracing ray, and using the position coordinates of the center point of the effective surface element as the iteration starting coordinates, performing ray tracing iteration on the NURBS surface model using the Newton method to obtain a final high-precision numerical solution of the effective tracing ray and the NURBS surface model; The step S4 specifically includes the following steps: S41: taking the tracing ray passing through the effective surface element as the effective tracing ray, randomly selecting two orthogonal planes in the spatial rectangular coordinate system, and using the two orthogonal planes to represent each effective tracing ray: (7); (8); in, is the orthogonal vector perpendicular to the direction cosine of the light in the first of the two orthogonal planes, is the orthogonal vector perpendicular to the direction cosine of the light in the second of the two orthogonal planes, d1 is the distance from the origin of the coordinate system to the first plane in the first of the two orthogonal planes, and d2 is the distance from the origin of the coordinate system to the second plane in the second of the two orthogonal planes; S42: According to equations (7) and (8), the high-precision numerical solution of each effective tracing ray and the NURBS surface model is calculated by the following equation: (9); in, Points of the NURBS surface model The value of , that is, the high-precision numerical solution, To efficiently trace rays to points on a NURBS surface model distance; S43: If , the high-precision numerical solution obtained in step S42 is used as the final high-precision numerical solution, otherwise, step S44 is executed; S44: Update by and Value: (10); in, is the inverse matrix of the Jacobian matrix; S45: Using the updated and Iterate Equation (9) with the value of , and repeat steps S42-S44 until the final high-precision numerical solution is obtained.
2. The high-precision NURBS surface tracing method based on a surface modeling optical system according to claim 1, characterized in that: In step S1, the NURBS surface model is parameterized by the following formula: (1); (2); (3); in, is the function expression of the NURBS surface model, is the node vector in the u direction, , u i is the node on the node vector in the u direction, is the i+p+1th node in the u direction, is the i+1th node in the u direction, is the i+pth node in the u direction, is the node vector in the v direction, , v i is the node on the node vector in the v direction, is the j+1th node in the v direction, is the j+q+1th node in the v direction, is the j+qth node in the v direction, p for The number of constructions on the node vector in the u direction, q is the number of constructions on the node vector in the v direction, is the first i indivual p Sub-B-spline basis functions, is the first j indivual q Sub-B-spline basis functions, is the weight factor, is the control point grid in the u and v directions, n is the total number of B-spline basis functions in the u direction, and m is the total number of B-spline basis functions in the v direction.
3. The high-precision NURBS surface tracing method based on a surface modeling optical system according to claim 2, characterized in that: In step S2, the node vectors in two directions are retained at the original endpoints of the NURBS surface model, and the intermediate data of the node vectors in two directions are evenly divided using the following formula. A two-dimensional node grid matrix is constructed using all the u-direction coordinates and all the v-direction coordinates after the equalization, and all the nodes contained in the two-dimensional node grid matrix are sequentially substituted into formula (1) to obtain the coordinate information of each subdivided grid of the NURBS surface model in the spatial rectangular coordinate system: (4); (5); Where r is the number of grids subdivided by the node vector in the u direction, and s is the number of grids subdivided by the node vector in the v direction.
4. The high-precision NURBS surface tracing method based on a surface modeling optical system according to claim 3, characterized in that: The step S3 specifically includes the following steps: S31: Select four vertices on each subdivided mesh according to the coordinate information of each subdivided mesh of the NURBS surface model, obtain the spatial rectangular coordinate values of the four vertices of each subdivided mesh, and use a plane passing through the four vertices of each subdivided mesh and perpendicular to the Z axis of the spatial rectangular coordinate system as a facet; S32: Determine the incident directions of all tracing rays using the following formula, extend all tracing rays along their respective incident directions, and use the bins intersecting the tracing rays as valid bins, and obtain the position coordinates of the center point of each valid bin in the spatial rectangular coordinate system: (6); in, is the starting coordinate of the tracing ray, is the coordinate of the intersection point where the tracing ray intersects the surface element, s To trace the distance traveled by the ray, is the incident direction cosine of the tracing ray.
5. The high-precision NURBS surface tracing method based on a surface modeling optical system according to claim 1, characterized in that: In step S43, The value of is customized according to the user's requirements for the accuracy of the intersection coordinate solution of the effective traced ray and the NURBS surface model.
Citation Information
Patent Citations
Ray tracing method and system based on NURBS curved surface
CN110208769A
Optical system high-precision ray tracing method and device based on NURBS surface
CN115453753A