A method and system for generating a multi-period grating three-dimensional texture
By setting grating structures with different reference grating periods in 3D textures and adjusting the spatial orientation of array units, the problem of high geometric data complexity of texture units in multi-period 3D textures is solved, and independent expression and consistent presentation of grating structures are achieved.
Patent Information
- Application Number
- CN202611309112.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-20
AI Technical Summary
In 3D textures, as the types of target raster periods increase, the complexity of the geometric data of texture units that need to be configured and managed increases, and the raster structures of different raster periods are difficult to express independently in the same texture unit.
By setting grating structures with different reference grating periods on different bearing surfaces of the same unit geometric model, and determining the target bearing surface and orientation transformation according to the target grating period, the grating structure on the target bearing surface is located outside the support surface, while the grating structures on other bearing surfaces are located inside the support body. The independent expression of the grating structure is realized by utilizing the spatial attitude configuration of the array unit.
It reduces the complexity of configuring and managing texture unit geometric data in multi-period 3D textures, improves the consistency of expression of different target raster periods at each sampling position, and reduces the dependence on different texture unit geometric models.
Smart Images

Figure CN123141684A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of three-dimensional texture technology, and more specifically, to a method and system for generating multi-period raster three-dimensional textures. Background Technology
[0002] 3D texturing technology can be used to arrange texture units with micro / nano structures on the surface of a support, and to form predetermined surface optical effects through the geometry, arrangement, and orientation of the texture units. For 3D textures with grating structures, different grating periods can correspond to different optical responses. When different sampling positions of the same 3D texture need to be configured with different grating periods, it is usually necessary to configure the corresponding texture structure or texture unit geometry for different target grating periods, and to call the corresponding texture unit according to the sampling position when generating the 3D texture.
[0003] However, as the types of target grating periods increase, the amount of texture unit geometry data that needs to be configured and managed also increases accordingly. At the same time, if we try to set up grating structures with multiple periods in the same texture unit, we also need to avoid grating structures with non-target periods participating in surface texture representation at the same time.
[0004] Therefore, how to reduce the dependence of different target grating periods on different texture unit geometric models when different grating periods need to be configured at different sampling positions of a 3D texture, and how to make each sampling position present only the grating structure corresponding to its target grating period, has become a technical problem that needs to be solved. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a method and system for generating multi-period grating three-dimensional textures.
[0006] In a first aspect, this application provides a method for generating multi-period raster 3D textures, including: Acquire multiple sampling points and the target grating period of each sampling point; For each of the sampling points, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, a target bearing surface is determined from the multiple bearing surfaces, and a first orientation transformation is determined, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; The sampling points are mapped to surface mapping points on the support surface of the support body. The arrangement position of the array unit generated based on the unit geometric model relative to the support surface is determined according to the surface mapping points. The orientation of the array unit is determined according to the first orientation transformation. The first direction points to the outside of the support surface. The arrangement position and the orientation make all the grating structures on the target bearing surface located outside the support surface, and all the grating structures on other bearing surfaces located inside the support body. Output a three-dimensional texture file, which includes the arrangement position and orientation of each array unit.
[0007] Optionally, determining the orientation of the array element based on the first orientation transformation includes: Obtain the orientation value of the sampling point, and determine the second rotation based on the orientation value, wherein the second rotation is about the first direction; The second rotation is performed after the first orientation change, and the attitude is determined based on the first orientation change and the second rotation.
[0008] Optionally, when each of the bearing surfaces is determined as the target bearing surface, the corresponding first orientation transformation is an orthogonal transformation with a determinant of 1. After undergoing the corresponding first orientation transformation, the grating lines of the grating structures on each of the bearing surfaces are parallel to each other.
[0009] Optionally, when each of the bearing surfaces serves as the target bearing surface and the orientation of the array unit is determined according to the corresponding first orientation transformation, the embedded portion of the array unit within the support body has the same geometric shape. The array units and the support body are integrated using Boolean operations with the same material.
[0010] Optionally, each of the bearing surfaces is a circular protruding surface in the unit geometric model; The target bearing surface of each array unit has the same protrusion height relative to the support surface along the corresponding first direction.
[0011] Optionally, the support surface is a curved surface, and the first direction is the normal direction of the support surface pointing to the outside of the support body at the surface mapping point.
[0012] Optionally, acquiring multiple sampling points and the target grating period of each sampling point includes: Obtain multi-layer mask images with transparent channels, each layer of the mask image corresponding to one reference grating period; The transparency of each layer of the mask image at the same pixel is detected in a preset order. In response to the existence of a non-fully transparent mask image at the pixel, the pixel is determined as a sampling point, and the reference grating period corresponding to the first non-fully transparent mask image is determined as the target grating period of the sampling point. In response to the fact that the mask images of each layer are all fully transparent at the pixel, the pixel is not identified as the sampling point.
[0013] Optionally, determining the arrangement position of the array elements generated based on the element geometry model relative to the support surface according to the surface mapping points includes: Under the orientation of the array unit, with the surface mapping point as the offset reference, the offset of the array unit along the first direction is changed from small to large to determine the first critical offset corresponding to the critical state when the grating structure on the target bearing surface reaches the point where it is completely outside the support surface. Each candidate critical offset is determined when the grating structure on each of the other bearing surfaces reaches the critical state of starting to extend from the support, and the minimum value among the candidate critical offsets is determined as the second critical offset. In response to the first critical offset being less than the second critical offset, a target embedding offset greater than the first critical offset and less than the second critical offset is determined, and the arrangement position of the array element is determined based on the surface mapping point, the first direction and the target embedding offset.
[0014] Optionally, determining the first orientation change includes: Multiple candidate first orientation transformations are determined, and each candidate first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; For each of the candidate first orientation transformations, a corresponding candidate pose is determined based on the candidate first orientation transformation, and a corresponding first critical offset and a second critical offset are determined under the candidate pose. The corresponding available embedding interval is determined based on the corresponding first critical offset and the second critical offset. Candidate first orientation transformations whose corresponding first critical offset is less than the corresponding second critical offset are determined as available first orientation transformations, and one of the available first orientation transformations is selected as the first orientation transformation.
[0015] Secondly, this application provides a multi-period raster 3D texture generation system, comprising: The acquisition module is used to acquire multiple sampling points and the target grating period of each sampling point; The first processing module is used to determine a target bearing surface from multiple bearing surfaces for each sampling point, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, and to determine a first orientation transformation, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; The second processing module is used to map the sampling points to surface mapping points on the support surface of the support body, determine the arrangement position of the array unit generated based on the unit geometric model relative to the support surface according to the surface mapping points, and determine the orientation of the array unit according to the first orientation transformation; the first direction points to the outside of the support surface, and the arrangement position and the orientation are such that all the grating structures on the target bearing surface are located outside the support surface, and all the grating structures on other bearing surfaces are located inside the support body; An output module is used to output a three-dimensional texture file, the three-dimensional texture file including the arrangement position and orientation of each of the array units.
[0016] Compared with the prior art, this application sets grating structures with different reference grating periods on different bearing surfaces of the same unit geometric model, and determines the target bearing surface and corresponding orientation according to the target grating period of the sampling point. This makes the grating structure on the target bearing surface located outside the support surface, while the grating structures on other bearing surfaces remain inside the support body. Thus, different spatial poses of the same unit geometric model can be used to correspond to different target grating periods, reducing the dependence of different target grating periods on different texture unit geometric models. At the same time, it avoids grating structures with non-target periods from participating in the surface texture expression of the current sampling position. This helps to reduce the configuration and management complexity of texture unit geometric data in multi-period three-dimensional textures and improve the consistency of expression of different target grating periods at each sampling position. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a method for generating multi-period raster 3D textures provided in this application embodiment; Figure 2 A flowchart illustrating a method for determining the orientation of an array element, provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a unit geometric model provided in an embodiment of this application; Figure 4 A schematic diagram illustrating the correspondence between a sampling location and a bearing surface, provided for an embodiment of this application; Figure 5 A schematic diagram of a multi-period grating three-dimensional texture provided in an embodiment of this application; Figure 6This is a schematic diagram of a multi-period grating three-dimensional texture generation system provided in an embodiment of this application. Detailed Implementation
[0018] To make the technical solution and its effects clearer, the present application will be further described below in conjunction with specific embodiments. It should be understood that the following embodiments are used to illustrate the technical solution of the present application, and not to unduly limit the scope of protection of the present application. Where there is no conflict, the various embodiments and their technical features can be combined with each other.
[0019] In the design of 3D textures, different sampling positions of the same texture may require different raster periods. If different unit geometry models are configured for different target raster periods, the number of unit geometry data that needs to be configured and called increases accordingly with the increase in the types of required raster periods. On the other hand, if multiple raster structures with different periods are set directly in the same unit geometry model without further distinguishing the presentation state of each raster structure on the 3D texture surface, raster structures that do not correspond to the current target raster period may also participate in the texture representation of that sampling position.
[0020] Based on this, embodiments of this application respectively set grating structures with different reference grating periods on multiple bearing surfaces of the same unit geometric model, and establish a correspondence between the target grating period and the selection of the bearing surface. For each sampling point, the target bearing surface is determined according to the target grating period of the sampling point, and the spatial orientation of the array units generated based on the unit geometric model is changed so that the target bearing surface faces the outside of the support surface; at the same time, combined with the arrangement position of the array units relative to the support surface, the grating structure on the target bearing surface is exposed outside the support surface, while the grating structures on other bearing surfaces remain inside the support. Thus, while keeping the unit geometric model unchanged, by selecting different bearing surfaces and configuring the orientation of the array units, different sampling positions can present grating structures corresponding to their target grating periods, and the arrangement position and orientation of each array unit are recorded in a three-dimensional texture file.
[0021] See Figure 1 The diagram shows a flowchart of a multi-period grating three-dimensional texture generation method provided in an embodiment of this application, including steps S101 to S104, wherein: S101: Acquire multiple sampling points and the target grating period of each sampling point; S102: For each of the sampling points, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, a target bearing surface is determined from the multiple bearing surfaces, and a first orientation transformation is determined, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; S103: Map the sampling points to surface mapping points on the support surface of the support body, determine the arrangement position of the array unit generated based on the unit geometric model relative to the support surface according to the surface mapping points, and determine the orientation of the array unit according to the first orientation transformation; the first direction points to the outside of the support surface, and the arrangement position and the orientation make all the grating structures on the target bearing surface located outside the support surface, and all the grating structures on other bearing surfaces located inside the support body; S104: Output a three-dimensional texture file, the three-dimensional texture file including the arrangement position and orientation of each array unit.
[0022] Regarding the above S101: In one embodiment, sampling points are used to characterize the discrete positions of array units that need to be configured within the 3D texture design domain. Sampling points can be represented using two-dimensional design coordinates, raster indexes, or other data that can uniquely identify the texture design position. For example, when the original design data of a 3D texture is divided into multiple raster positions along the width and height directions, a sampling point can be represented by a coordinate pair consisting of row and column indices. In this case, the sampling point represents the design position of the 3D texture before it is mapped to the support, and does not represent the actual 3D position of the array unit on the support; the spatial mapping relationship between the sampling point and the support surface can be determined in subsequent steps.
[0023] The target grating period is data associated with a sampling point, used to indicate the grating period to be presented at that sampling point. The grating period can be understood as the spacing between adjacent repeating structures along the periodic direction of the grating structure. The target grating period can be represented directly by a period value, or by a period identifier with a preset correspondence to the period value. For example, three different grating periods can be represented by period identifiers L1, L2, and L3, respectively, and the correspondence between the period identifiers and their corresponding period values can be pre-stored; after reading the period identifier, the corresponding period value can be obtained based on this correspondence.
[0024] In one specific implementation, period allocation data describing the 3D texture design results can be obtained in advance. The period allocation data can be stored in a two-dimensional data table or a two-dimensional matrix, where each data position corresponds to a raster position in the texture design domain. Data positions requiring array cell configuration record the corresponding target raster period; data positions not requiring array cell configuration record null values or preset invalid identifiers. When processing the period allocation data, the data positions recording valid target raster periods are traversed, and the row and column indices corresponding to each data position are determined as a sampling point. The period value or period identifier recorded at that data position is then determined as the target raster period for that sampling point.
[0025] For example, positions A, B, and C in the periodic allocation data record the target grating period, respectively. , and This allows the generation of three sampling points corresponding to positions A, B, and C, respectively, and the establishment of a connection between each sampling point and... , and A one-to-one correspondence is established between them. Data locations for which no valid target grating period is recorded can be excluded from being designated as sampling points. After the above processing, a set of sampling points consisting of multiple sampling point records can be obtained. Each sampling point record includes at least the design location information used to identify the sampling point and the target grating period corresponding to that sampling point.
[0026] For example, periodic allocation data can be generated by texture layout design programs, image preprocessing programs, or other preprocessing programs, and can be provided in the form of CSV files, text files, two-dimensional arrays, or in-memory data tables. When implemented programmatically, programs such as Python and C++ can be used to read the periodic allocation data and sequentially establish sampling point records according to the data positions. For data using period identifiers, the period identifiers can be converted into period values during the reading process based on a pre-configured period correspondence table; for data that directly records period values, the read period values can be directly associated with the corresponding sampling points.
[0027] After completing the above processing, step S101 outputs at least the design location information of each sampling point and the target grating period corresponding to each sampling point. The design location information is used to subsequently map the sampling points to the support surface of the support body, and the target grating period is used to subsequently determine the target support surface corresponding to the current sampling point from multiple support surfaces of the unit geometric model.
[0028] Regarding S102 above: In one embodiment, the element geometry model is the basic three-dimensional geometric model used to generate each array element. The same element geometry model has multiple support surfaces, each with a grating structure. A support surface can be understood as a surface region in the element geometry model capable of supporting the grating structure and oriented towards the outside of the support surface by changing the spatial orientation of the element geometry model. The grating structures on different support surfaces have different reference grating periods; therefore, a single element geometry model can pre-support multiple grating structures with different periods.
[0029] See Figure 3 The diagram shown is a structural schematic of a unit geometric model provided in an embodiment of this application. Figure 3 In the model, the unit geometric model has multiple bearing surfaces, and grating structures are set on each bearing surface. The grating line spacing of the grating structures on different bearing surfaces is different, thus corresponding to different reference grating periods. Figure 3 The left side shows the form of the unit geometry model under two different spatial orientations, where the bearing surface facing upwards differs with the change of spatial orientation; Figure 3 The right side shows the projection of the unit geometric model when viewed along the first direction. Figure 3 The diagram also shows the local coordinate system of the unit geometric model, where the coordinate axis labeled X and the coordinate axis labeled Y represent two local reference axes of the unit geometric model. The two local reference axes are not parallel to each other and are used to characterize the spatial orientation of the unit geometric model. When determining the orientation of the array unit, a first orientation transformation can be performed on the two local reference axes, and the transformed vectors of the two local reference axes can be used as the orientation data of the array unit.
[0030] The reference grating period is a periodic parameter of the grating structure pre-configured on the corresponding support surface, used to characterize the grating period that the support surface can provide. For example, suppose the element geometry model has six support surfaces, which can be denoted as F1 to F6, and each can be configured with a reference grating period P1 to P6, where P1 to P6 are distinct. The association between each reference grating period and its corresponding support surface can be determined and saved when the element geometry model is built. For example, a support surface configuration table can be established, where each configuration record includes at least the support surface identifier, the reference grating period corresponding to that support surface, and the normal direction of that support surface in the element geometry model coordinate system.
[0031] In one specific implementation, a six-sided geometric model can be used, with six different reference grating periods respectively configured on six bearing surfaces along the +Z, -Z, +X, -X, +Y, and -Y directions of the model coordinate system. For example, six different period parameters can be used, and a fixed correspondence can be established between them and the aforementioned six bearing surfaces. This correspondence remains unchanged after the element geometric model is established, thus eliminating the need to regenerate different element geometric models for different sampling points.
[0032] For any sampling point obtained in step S101, the target grating period corresponding to that sampling point can be read, and the target grating period can be matched with each reference grating period in the carrier surface configuration table. In response to a target grating period matching one of the reference grating periods, the carrier surface corresponding to that reference grating period is determined as the target carrier surface. For example, when the target grating period of sampling point A is P3, and the reference grating period of the grating structure on carrier surface F3 is P3, carrier surface F3 can be determined as the target carrier surface corresponding to sampling point A. In this embodiment, the input target grating period can be pre-selected from the set of reference grating periods supported by the unit geometric model; if a period value not belonging to the set of reference grating periods is read, the corresponding sampling point can be marked as an input anomaly to avoid determining an incorrect carrier surface for that sampling point.
[0033] The first orientation transformation is used to change the spatial orientation of the array elements generated based on the unit geometric model, so that the selected target bearing surface faces outwards from the support surface. Specifically, when establishing the unit geometric model, corresponding orientation transformations can be pre-configured for each bearing surface, forming an orientation transformation table. Each record in the orientation transformation table can include a bearing surface identifier and the orientation transformation data corresponding to that bearing surface. The orientation transformation data is used to transform the normal direction of the corresponding bearing surface in the unit geometric model coordinate system to the first direction, and can be represented by a rotation matrix, a transformed local coordinate axis vector, or other posture data forms that can be recognized by 3D texture generation software.
[0034] For example, when the element geometry model uses six bearing surfaces, six orientation transformation records can be pre-established. This ensures that when any of the bearing surfaces F1 to F6 is selected, there is a set of orientation transformations that can adjust the normal direction of that bearing surface to the first direction. During operation, after determining the target bearing surface, the orientation transformation table is consulted based on the bearing surface identifier of the target bearing surface to obtain the corresponding first orientation transformation. Therefore, it is not necessary to resolve a new element geometry model for each sampling point. Instead, by selecting different bearing surfaces and their corresponding orientation transformations for the same element geometry model, different sampling points can access different reference grating periods from the same element geometry model.
[0035] See Figure 4 The diagram shown is a schematic representation of the correspondence between a sampling position and a bearing surface provided in an embodiment of this application. Figure 4 The left side shows the design data used to describe the results of the 3D texture design, where different regions in the design data correspond to different target raster periods; Figure 4The right side shows the unit geometry model, where each bearing surface corresponds to a different reference grating period. For any region in the design data, based on the target grating period corresponding to that region, the bearing surface corresponding to that target grating period can be determined from multiple bearing surfaces of the unit geometry model as the target bearing surface. Thus, without changing the unit geometry model, the sampling points in different regions correspond to different bearing surfaces.
[0036] In one embodiment, the first direction is a spatial reference direction used to define the final orientation of the target bearing surface, pointing outward from the support surface. When the support surface adopts a uniform reference direction, for example, if the support surface is located in the XY plane, the +Z direction pointing from the inside of the support to the outside can be used as the first direction. For cases where the first direction needs to be determined according to the specific support geometry, it is sufficient to obtain the first direction when calculating the corresponding first orientation transformation. Step numbers S101 to S104 are used to describe the logical relationship between the various technical processes, and do not limit the calculation program to strictly follow the step numbers to complete the calculation of all intermediate data sequentially.
[0037] Regarding the above S103: In one embodiment, the surface mapping point is the spatial position obtained after converting the texture design position represented by the sampling point in step S101 to the support surface, and is used to establish the correspondence between the sampling position in the texture design domain and the support body. The surface mapping point is located on the support surface and belongs to a different object from the arrangement position of the array unit; wherein, the surface mapping point represents the corresponding position of the sampling point on the support surface, and the arrangement position of the array unit represents the spatial position of the model reference point when the array unit generated based on the unit geometric model is actually placed.
[0038] In one specific embodiment, the support surface can be a plane located in the global XY plane, with the support body located on one side of this plane, and the +Z direction pointing from the inside of the support body to the outside of the support body is defined as the first direction. For sampling points represented by row and column indices, they can be converted into physical coordinates on the support surface according to a preset texture sampling interval. For example, if the physical spacing between adjacent sampling positions in both the X and Y directions is 0.1 mm, then the sampling point with column index 300 and row index 120 can be mapped to a surface mapping point on the support surface with an X coordinate of 30 mm and a Y coordinate of 12 mm, and its Z coordinate is taken as the Z coordinate of the support surface. The above sampling interval can be preset according to the actual size and sampling resolution of the three-dimensional texture to be generated, or it can be determined according to the physical scale information carried by the texture design data.
[0039] After obtaining the surface mapping points, the arrangement positions of the array units can be determined based on the pre-configured embedding position relationships of the unit geometry model, using these points as positional references. The embedding position relationships define the depth of the array units relative to the support surface, ensuring that a portion of the array units is located inside the support and the grating structures on the target bearing surface are located outside the support surface. For example, an arrangement offset along a first direction can be pre-saved for the unit geometry model, and the position obtained by offsetting the surface mapping points along the first direction by this arrangement offset can be determined as the arrangement position of the array units. The arrangement offset can be pre-determined based on the dimensions of the unit geometry model and the positions of the grating structures on each bearing surface relative to the model reference point.
[0040] Specifically, when establishing the unit geometric model, a geometric check can be performed on the unit geometric model after the corresponding first orientation transformation, taking each bearing surface as a target bearing surface. For the current target bearing surface, the spatial range of the grating structure on the target bearing surface relative to the model reference point can be determined; for other bearing surfaces, the spatial range of the grating structure on them relative to the model reference point can be determined separately. After giving the arrangement offset, the above spatial range is transformed to a coordinate system based on the support surface, and it is checked whether all the grating structures on the target bearing surface are outside the support surface and whether the grating structures on other bearing surfaces are all inside the support. When the above conditions are met simultaneously, the corresponding arrangement offset can be saved as the available arrangement parameters of the unit geometric model. During operation, the arrangement position of the array unit can be determined according to the surface mapping points and the available arrangement parameters, without having to rebuild the unit geometric model for each sampling point.
[0041] In one example, the support surface is a plane with Z=0, the support body is located on the side with Z less than 0, and the first direction is the +Z direction. After adjusting the unit geometry model according to the first orientation transformation obtained in step S102, the array unit can be set at a preset arrangement height, so that all geometric points of the grating structure on the target support surface are located in the region with Z greater than 0, while all geometric points of the grating structure on other support surfaces are located in the region with Z less than 0. Thus, when observing from the outside of the support body or performing optical calculations, the current sampling position only exposes the grating structure corresponding to the target grating period, while the grating structures corresponding to other reference grating periods are obscured by the support body.
[0042] The attitude of the array element is used to describe the spatial orientation of the array element relative to the support body, generated based on the element geometric model. In one embodiment, the attitude can be obtained directly according to the first orientation transformation determined in step S102. The attitude can be represented using rotational transformation data or using transformed local coordinate axes. For example, two non-parallel local reference axes can be predefined in the element geometric model, the first orientation transformation can be performed on the two local reference axes, and the transformed vectors of the two local reference axes can be used as the attitude data of the array element. The orientation of the target bearing surface can be determined from this attitude data, and the normal direction of the target bearing surface can be made consistent with the first direction.
[0043] Therefore, for sampling points with different target grating periods, the adopted unit geometry model can remain unchanged, while the spatial orientation of the array units can be changed by altering the attitude corresponding to the target bearing surface. Combined with the arrangement position of the array units relative to the support surface, the grating structure on the current target bearing surface is exposed outside the support surface, while the grating structures on other bearing surfaces remain inside the support. The output of step S103 includes at least the arrangement position and attitude of the array units corresponding to each sampling point, which can be used for subsequent generation of 3D texture files.
[0044] Regarding S104 above: In one embodiment, the 3D texture file is a data file used to record the spatial arrangement information of each array unit in the 3D texture. The 3D texture file can be used in conjunction with the unit geometric model used in step S102, enabling the 3D texture generation program to generate multiple array units based on the same unit geometric model, according to different arrangement positions and orientations recorded in the file. Therefore, the 3D texture file does not need to save a complete geometric model for each array unit separately, but can save the corresponding spatial mapping data for each array unit.
[0045] After step S103 is completed, an array unit record can be established for each sampling point where an array unit needs to be generated. The array unit record includes at least the arrangement position and orientation of the array unit. The arrangement position can be represented by the three-dimensional coordinates of the model reference point of the array unit in the three-dimensional texture coordinate system, such as using X, Y and Z coordinates; the orientation can be represented by rotation transformation data, or by multiple direction vectors that can determine the orientation of the local coordinate system of the array unit.
[0046] For example, when using two local reference axis vectors to represent attitude, an array element record may include the arrangement position coordinates (x, y, z) and the local reference axis vector (u). x u y u z ) and another local reference axis vector (v x vy v z Since the two local reference axis vectors are not parallel, the spatial orientation of the array elements can be determined by combining the predefined local coordinate system of the element geometry model. After reading the arrangement position and orientation, the 3D texture generation program can transform the element geometry model to the corresponding spatial position and orientation, thereby forming the corresponding array elements.
[0047] In one specific implementation, the 3D texture file can be generated using the OPT3DMapping format, which Ansys Speos can read. During output, the number of array elements to be generated can be first counted and recorded in the file; then, for each array element, the corresponding placement coordinates and a local reference axis vector describing the attitude can be written sequentially. For example, each array element can correspond to a row of mapping records, and each mapping record corresponds to a sampling point. For positions where no valid sampling point is formed in step S101, no corresponding array element record is generated.
[0048] For example, when generating 3D textures using Ansys Speos, array cells can be used as the Pattern of the 3D Texture, and the support can be used as the Support. The Boolean operation between the Pattern and the Support can be set to "Add onsame material". When calculating the 3D texture, the corresponding Pattern and Support are processed with the same material according to the arrangement and orientation of each array cell, thereby forming the texture structure according to the actual spatial intersection relationship between the array cells and the support.
[0049] For example, for sampling point A, the arrangement position of the array unit is obtained in step S103 as (x A y A , z A And obtain two local reference axis vectors u to describe its attitude. A and v A Then, the arrangement position and the two local reference axis vectors can be written into the mapping record corresponding to sampling point A; for sampling points B and C, their respective arrangement positions and orientations can be written in the same way. Different array units can have different orientations, so that the same unit geometric model presents a grating structure supported by the corresponding target bearing surface at different sampling positions.
[0050] The 3D texture file may also include a file header, the number of array units, data field identifiers, or other auxiliary information for reading the spatial mapping data, according to the file format requirements of the target 3D texture generation software. This auxiliary information is used to meet file parsing needs without changing the spatial arrangement relationship determined by the arrangement position and orientation of each array unit.
[0051] The output in step S104 may include saving the 3D texture file to a preset storage location, or it may include sending the generated 3D texture file to a subsequent 3D texture generation program or optical simulation program. After the subsequent program reads the 3D texture file and the unit geometric model, it can instantiate and spatially transform the unit geometric model according to the arrangement position and orientation recorded in each array unit, thereby generating a multi-period grating 3D texture composed of multiple array units.
[0052] See Figure 5 The image shown is a schematic diagram of a multi-period grating three-dimensional texture provided in an embodiment of this application. Figure 5 The support structure is not shown. Figure 5 In this model, multiple array units are arranged according to the positions recorded in the 3D texture file, and each array unit is generated from the same unit geometric model. The orientation of each array unit is determined by the target grating period of its corresponding sampling point. Therefore, the bearing surface facing the first direction in different array units can be different, and the grating line direction and grating line spacing of the grating structure on it can also be different. Figure 5 The local coordinate system of the array element is shown in the middle part of the array element, where the coordinate axis labeled X and the coordinate axis labeled Y represent the two local reference axes of the array element, which are used to characterize the spatial orientation of the array element after the first orientation transformation; the spatial orientation of the two local reference axes of different array elements can be different.
[0053] In this way, different reference grating periods are configured on different support surfaces of the same unit geometry model, and the corresponding target support surface and array unit orientation are determined according to the target grating period of each sampling point. This exposes the grating structure on the target support surface outside the support surface, while the grating structures on other support surfaces are occluded by the support. Therefore, the target grating period at different sampling positions can be expressed through different spatial orientations of the same unit geometry model, reducing the dependence of different target grating periods on different texture unit geometry models. Simultaneously, by distinguishing the presentation states of target and non-target grating structures, each sampling position can only present the grating structure corresponding to its target grating period, avoiding the participation of other periodic grating structures in the texture representation of the current sampling position, thereby reducing the configuration and management complexity of unit geometry data in multi-period 3D textures.
[0054] In the above embodiments, after determining the target bearing surface based on the target grating period and performing the first orientation transformation, the grating structure corresponding to the target grating period can be oriented towards the outside of the support surface. However, even when the normal direction of the target bearing surface is consistent with the first direction, the target bearing surface can still have different in-plane orientations around the first direction. When the grating structures at different sampling points also need to have different orientations, determining the orientation of the array unit solely based on the target grating period makes it difficult to further distinguish sampling positions with the same target grating period but different grating orientations.
[0055] For this reason, see Figure 2 The flowchart illustrates a method for determining the orientation of an array element according to an embodiment of this application, including steps S201 to S202, wherein: S201: Obtain the orientation value of the sampling point, and determine a second rotation based on the orientation value, wherein the second rotation is about the first direction; S202: Perform the second rotation after the first orientation change, and determine the attitude based on the first orientation change and the second rotation.
[0056] In one embodiment, the orientation of the array element can be further determined based on the first orientation transformation using the orientation value corresponding to the sampling point.
[0057] Specifically, the orientation value corresponding to each sampling point can be obtained. The orientation value characterizes the in-plane orientation required for the grating structure on the target bearing surface at the corresponding sampling point, and can be represented by an angle value, a discrete orientation level, or a numerical value that can be converted into a rotation angle. The orientation value can be input together with the sampling points in step S101, or it can be read from texture design data that has a positional correspondence with the sampling points. Each orientation value is associated with a sampling point, thus enabling different sampling points corresponding to the same target grating period to have different orientation values.
[0058] In one specific embodiment, grayscale values within the range of 0 to 255 can be used as the orientation values, and a maximum rotation angle can be preset. A grayscale value of 0 corresponds to an additional rotation angle of 0°, and a grayscale value of 255 corresponds to the maximum rotation angle. Grayscale values between 0 and 255 can have their corresponding additional rotation angles determined according to their relative positions within that range. For example, when the maximum rotation angle is set to 90° and the grayscale value of a sampling point is 160, the additional rotation angle corresponding to that sampling point can be determined to be approximately 56.47°. The maximum rotation angle can be preset according to the design orientation range of the 3D texture; for example, it can be set to 90°, or other angle ranges can be used according to the actual texture design requirements.
[0059] After determining the additional rotation angle based on the orientation value, a second rotation can be further determined. The second rotation is centered on the first direction and changes the orientation of the target bearing surface within its own plane according to the additional rotation angle. Since the second rotation is performed around the first direction, and the normal direction of the target bearing surface after the first orientation change is already consistent with the first direction, the second rotation primarily changes the orientation of the grating structure on the target bearing surface around its normal direction, without changing the target bearing surface currently determined to face outwards from the support surface.
[0060] In one specific implementation, when the support surface is located in the global XY plane and the first direction is the global +Z direction, the current target bearing surface can be adjusted to face the +Z direction using the first orientation transformation determined in step S102. Subsequently, a second rotation is performed with the +Z direction as the rotation axis, according to the additional rotation angle of the corresponding sampling point. For example, sampling point A and sampling point B have the same target grating period and therefore correspond to the same target bearing surface. However, the orientation values of sampling point A and sampling point B correspond to additional rotation angles of 20° and 70°, respectively. In this case, the two sampling points can adopt the same first orientation transformation and perform second rotations of 20° and 70°, respectively, to obtain different final postures.
[0061] When determining the orientation of an array element, a first orientation transformation is performed, followed by a second rotation based on the spatial orientation resulting from the first orientation transformation. In other words, the first orientation transformation determines the orientation of the bearing surface corresponding to the target grating period, and the second rotation further determines its in-plane orientation while maintaining the orientation relationship of the target bearing surface. The final orientation is determined jointly by the first orientation transformation and the second rotation.
[0062] In the implementation that uses a local reference axis to represent the attitude, a first orientation transformation can be performed on the local reference axis of the unit geometry model to obtain an intermediate reference axis when the target bearing surface faces the first direction; then, the intermediate reference axis is rotated according to a second rotation to obtain a reference axis vector used to represent the final attitude of the array unit. The final attitude can continue to be used as the attitude data in step S103 to determine the array unit arrangement state and in step S104 to generate the three-dimensional texture file.
[0063] In this way, without changing the correspondence between the target grating period and the target bearing surface, the in-plane orientation of the grating structure on the target bearing surface can be further adjusted using the orientation values of each sampling point. Therefore, for multiple sampling points with the same target grating period but different orientation requirements, the orientation of the corresponding array elements can be determined by the second rotation without adding a new element geometry model or a new reference grating period.
[0064] Optionally, in the above embodiments, for different target grating periods, different bearing surfaces in the unit geometry model can be selected as target bearing surfaces, and the normal direction of the target bearing surface can be made consistent with the first direction through the corresponding first orientation transformation. However, simply limiting the bearing surface to have its normal direction consistent with the first direction does not uniquely determine the orientation of the bearing surface in its own plane. For the same bearing surface, even if its normal direction remains unchanged, it can still have multiple different spatial orientations around the normal direction. Therefore, if the first orientation transformation corresponding to different bearing surfaces adopts different in-plane reference directions, even if each target bearing surface faces the first direction, the grating structure on it may still have different initial grating line orientations.
[0065] To ensure a consistent orientation reference when different bearing surfaces are selected as target bearing surfaces, in one embodiment, the first orientation transformation corresponding to each bearing surface employs an orthogonal transformation with a determinant equal to 1. This orthogonal transformation preserves the length and angular relationships within the element geometric model. The determinant of 1 limits the orthogonal transformation to a rotational transformation that preserves the chirality of spatial directions, rather than employing an orthogonal transformation involving mirror reflection. Therefore, after performing the first orientation transformation on the element geometric model, the axial relationships of its local coordinate system remain unchanged, avoiding the reversal of the in-plane orientation relationships of the grating structure due to mirror transformation.
[0066] In one embodiment, when establishing the unit geometric model, the normal direction of the bearing surface and the grating line direction on the bearing surface can be defined for each bearing surface. The grating line direction is the direction located within the corresponding bearing surface and extending along the direction of the repeating grating fringes, which is different from the direction along the periodic variation of the grating. For each bearing surface, the bearing surface identifier, the bearing surface normal direction, the grating line direction, and the corresponding first orientation transformation can be recorded, and the above data can be saved in the orientation configuration table.
[0067] Specifically, a reference grating direction orthogonal to the first direction can be predetermined, and a first orientation transformation corresponding to each bearing surface can be constructed as follows: For any bearing surface, a local orthogonal coordinate base is established based on the normal direction and grating direction of the bearing surface, and a target orthogonal coordinate base is established based on the first direction and the reference grating direction; a first orientation transformation is constructed based on the correspondence between the local orthogonal coordinate base and the target orthogonal coordinate base, so that the normal direction of the bearing surface is transformed to the first direction, and the grating direction on the bearing surface is transformed to a direction parallel to the reference grating direction. During the construction process, the two orthogonal coordinate bases maintain the same right-handed coordinate system convention, thereby obtaining an orthogonal transformation with a determinant equal to 1.
[0068] For example, when establishing a global XYZ coordinate system and aligning the first direction with the positive global Z-axis, the global X-axis direction can be selected as the reference grid line direction. For any of the aforementioned bearing surfaces, a corresponding first orientation transformation can be determined based on the normal direction of the bearing surface and the grid line direction on the bearing surface, transforming the normal direction of the bearing surface to the positive global Z-axis direction and transforming the grid line direction on the bearing surface to be parallel to the global X-axis direction. For the other bearing surfaces, the corresponding first orientation transformation is determined in the same manner.
[0069] In one specific implementation, the first orientation transformation can be generated based on three-dimensional vector operations. For any of the bearing surfaces, the normal direction of the bearing surface can be normalized, and the grid line direction on the bearing surface can be projected into the bearing surface and normalized. Then, a cross product is used to obtain another local direction orthogonal to both of the above two directions, thus obtaining a right-handed local orthogonal coordinate base. Using the same method, a right-handed target orthogonal coordinate base is established based on the first direction and the preset reference grid line direction, and then a rotation matrix is generated based on the correspondence between the two sets of orthogonal coordinate bases. After generation, it can be checked whether the three axis vectors corresponding to the rotation matrix maintain unit length and are mutually orthogonal, and whether its determinant is 1. If floating-point calculation is used, it can also be determined whether the above conditions are met within a preset numerical tolerance range.
[0070] Thus, when different bearing surfaces are determined as target bearing surfaces, after their respective first orientation transformations, the normal directions of each bearing surface can be consistent with the first direction, and the grating line directions of the grating structures on each bearing surface are parallel to each other. Therefore, the spatial orientation changes caused by the switching of bearing surfaces corresponding to different reference grating periods will not introduce additional different in-plane orientation references.
[0071] When the aforementioned second rotation is employed, the consistent grating line direction can also serve as a common initial orientation for each bearing surface before performing the second rotation. Thus, for sampling points with different target grating periods but the same orientation value, the second rotation can be performed starting from a mutually consistent in-plane orientation reference, ensuring that the rotation amount represented by the orientation value has a consistent spatial meaning across different target bearing surfaces.
[0072] Optionally, in the above embodiments, when different bearing surfaces are determined as target bearing surfaces, different first orientation transformations need to be performed on the same unit geometric model. If the model embedding contours corresponding to each first orientation transformation are different, then when using the same arrangement reference, the array units corresponding to different target grating periods may have different embedding depths or different support overlap ranges. In order to ensure that the switching of bearing surfaces mainly changes the currently presented grating structure without changing the basic bonding relationship between the array unit and the support, the unit geometric model and the first orientation transformations corresponding to each bearing surface can be configured such that when each bearing surface is used as a target bearing surface and the array unit attitude is determined, the embedded part of the array unit within the support has the same geometric shape.
[0073] The embedded portion of an array unit can be understood as the geometric part where the array unit intersects with the space occupied by the support body after the array unit has been adjusted in posture according to the corresponding first orientation transformation and placed in the arrangement position. The identical geometric shape can be expressed as each embedded portion having the same outline, size, and topological relationship after excluding differences in its global position and spatial orientation; for example, each embedded portion can coincide with each other through rigid transformation. Different array units can be located at different surface mapping points and have different first orientations; the aforementioned positional differences and overall orientation differences do not affect the judgment of whether the geometric shapes of the embedded portions are identical.
[0074] In one embodiment, the element geometric model can be made to have rotational symmetry corresponding to multiple bearing surfaces. Each bearing surface is equidistant from the model reference point, the basic geometric portions containing each bearing surface are congruent, and the first orientation transformation corresponding to each bearing surface is selected from rotational transformations that preserve the shape of the basic geometric portion. Thus, when any bearing surface is oriented towards a first direction after the corresponding first orientation transformation, the side of the array element facing the interior of the support body all exhibit the same outer envelope; by positioning the array elements relative to the support surface according to the same embedding parameters, embedding portions with identical geometric shapes can be obtained.
[0075] For example, a unit geometric model may include a regular hexahedral base centered at a model reference point, with six congruent protrusions on its six sides. The outer surfaces of these six protrusions form six bearing surfaces. When each bearing surface serves as a target bearing surface, a spatial symmetry rotation of the regular hexahedron can be used as the corresponding first orientation transformation, causing the selected bearing surface to face a first direction. Because this spatial symmetry rotation maps the base contours of the regular hexahedron base and each protrusion to the same spatial contour, the embedded portions corresponding to each orientation can maintain the same geometric shape at the same embedding depth. The above six-sided structure is merely an example; unit geometric models with three, four, eight, or other numbers of bearing surfaces and satisfying corresponding rotational symmetry relationships can also be used.
[0076] The grating structures on different support surfaces can serve as surface texture attributes of the corresponding support surfaces, or they can be formed as fine geometric structures located on the surface of the support surfaces. When the grating structure serves as a surface texture attribute, the attribute-bearing region in the support surface configured with the surface texture attribute can be used as the geometric range of the grating structure, or the attribute-bearing region can be represented as a nominal surface with zero thickness or a thin layer with a preset numerical tolerance, and its spatial range can be characterized by its surface grid, contour curve, control points, or sampling point set, thereby determining the internal and external state of the grating structure relative to the support body; different reference grating periods will not change the basic embedding contour of the array unit. When the grating structure adopts a fine geometric structure, the protrusions below each support surface can have the same basic shape, and in the subsequent process of incorporating the same material, the non-target grating structure located inside the support body can be merged with the support body, so that the non-target grating structure does not form an independent material boundary inside the support body.
[0077] When establishing the unit geometric model, the consistency of the embedded parts can be geometrically verified in advance. Specifically, for each bearing surface, a candidate posture is generated according to the first orientation transformation corresponding to the bearing surface, and the unit geometric model under the candidate posture is placed on a test support according to the preset embedding parameters; the intersection geometry of the unit geometric model and the test support is obtained to obtain the candidate embedded parts. Subsequently, each candidate embedded part can be transformed to a unified local coordinate system, and its boundary surface, bounding size, volume and topology are compared. In response to the fact that each candidate embedded part can coincide with each other within the preset geometric tolerance, it is determined that the unit geometric model and each first orientation transformation meet the requirement that the embedded parts have the same geometric shape, and the preset embedding parameters are saved for step S103 to call. When this embodiment is combined with the method of determining the target embedding offset by mapping points per surface as described later, the aforementioned judgment of the same embedded part geometric shape is performed for the case where different bearing surfaces are used as target bearing surfaces at the same surface mapping point under the same local embedding parameters. Different target embedding offset values are used for different surface mapping points due to the different local support geometry, which does not mean that the requirement that the geometry of the embedding part is the same is no longer met; at each surface mapping point, the embedding part corresponding to different target bearing surfaces can be compared according to the same local embedding parameters.
[0078] Optionally, a Boolean operation of merging the array units and the support body using the same material is employed. "Same material" means that the solid portion of the array unit and the support body are configured with the same material region; the Boolean operation can be a Boolean union operation. Specifically, each array unit after attitude and position transformation can be sequentially joined with the support body using a Boolean union operation, or multiple array units can be joined first, and then joined with the support body using a Boolean union operation, thus obtaining a merged entity containing the support body and each array unit.
[0079] When performing the Boolean operation, the array unit geometry located inside the support body can be treated as a body of the same material intersecting with the support body, eliminating the internal contact boundary in the overlapping area, and retaining the target bearing surface and its grating structure extending beyond the support surface as the external boundary of the merged entity. Since the grating structures on other bearing surfaces are all located inside the support body, these other bearing surfaces and their grating structures do not constitute the surface of the merged entity facing outwards from the support body after Boolean merging, thus ensuring that the grating structure presented externally at the current sampling position still corresponds to the target grating period.
[0080] In practical implementation, before Boolean operations, it can be checked whether there is an overlap between the array unit and the support body that exceeds the preset numerical tolerance, to avoid instability in the Boolean operation results caused by the two being tangent only at the theoretical boundary. Boolean merging can also be performed on multiple array units in batches according to the spatial partitioning of the array units. Since the embedded parts corresponding to different target bearing surfaces have the same geometric shape, consistent Boolean tolerance and geometric processing rules can be applied to each array unit, reducing the possibility of local gaps, internal residual surfaces, or inconsistent connection states caused by different target bearing surfaces.
[0081] Optionally, each bearing surface is a circular protrusion in the unit geometry model. The circular protrusion can be formed by the outer end face of a cylindrical boss, a frustum-shaped boss, or other protrusion with a circular outer contour disposed on the surface of the base portion. The outer contour of its bearing area is circular and protrudes outward relative to the adjacent surface of the base portion. A grating structure is disposed in at least a portion of the circular protrusion, and each circular protrusion carries a reference grating period.
[0082] In one specific embodiment, cylindrical bosses of the same size can be provided on each of the six sides of the hexahedral base. The axis of each cylindrical boss is perpendicular to its respective side, and its circular end face away from the hexahedral base serves as a bearing surface. Each cylindrical boss can have the same diameter and axial protrusion dimension, and each circular end face has the same distance relative to the model reference point. Thus, after each bearing surface undergoes a corresponding first orientation transformation toward a first direction, its base outer contour and its positioning relationship relative to the supporting surface remain consistent.
[0083] When the circular protruding surface rotates around its own normal direction, its circular outer contour remains unchanged. Therefore, when using the aforementioned second rotation adjustment grating structure for in-plane orientation, the second rotation will not change the outer contour dimensions of the target bearing surface in a plane perpendicular to the first direction. For adjacent array units arranged according to a preset sampling interval, the arrangement interval of the array units can be predetermined based on the diameter of the circular protruding surface and the sampling interval, so that the target bearing surfaces maintain a consistent spacing relationship when using different second rotation angles.
[0084] The protrusion height of the target bearing surface of each array unit relative to the support surface along the corresponding first direction can be set to be the same. Specifically, a common target protrusion height can be predetermined, and for each surface mapping point, using the support surface at that surface mapping point as a height reference, the target height position relative to the support surface at the target protrusion height is determined along the corresponding first direction; then, the arrangement position of the array units is adjusted along the first direction so that the target bearing surface after attitude transformation is located at the target height position. Since the distance of each circular protrusion surface relative to the model reference point is the same, each array unit can use the same axial embedding parameters to achieve the common target protrusion height.
[0085] For example, the common target protrusion height of each target bearing surface relative to the support surface can be preset, and the axial embedding amount of the array unit can be calculated based on the positional relationship between the model reference point and the target bearing surface along the first direction after the first orientation transformation, thereby determining the arrangement position. When the support surface is the reference plane in the global coordinate system, and the support body is located on one side of the reference plane with the first direction pointing perpendicularly to the other side, each target bearing surface can be set at the same target height position as the reference plane; regardless of which bearing surface is selected as the target bearing surface, its circular protrusion surface has the same protrusion height, while keeping other bearing surfaces and their grating structures inside the support body.
[0086] When the support surface positions or first directions at different surface mapping points are different, the protrusion height can be compared using local directional distances measured along their respective first directions, without requiring each target bearing surface to have the same global coordinate value. By ensuring that each target bearing surface has the same protrusion height and that the embedded parts corresponding to each attitude have the same geometry, the basic exposed dimensions and bonding relationships of the array units relative to the support surface can be kept consistent when switching target grating periods. Combined with the Boolean operation of incorporating the same material, the support body and the array units can also form a continuous geometry of the same material, and the grating structure on non-target bearing surfaces can be kept as an internal structure that cannot be exposed from the outside of the support body.
[0087] Optionally, in the above embodiments, the support surface of the support body can be a curved surface, and the first direction determined for each sampling point is the normal direction of the support surface pointing outward from the corresponding surface mapping point. Unlike the case where a planar support surface uses a uniform first direction, on a curved support surface, the first direction corresponding to different surface mapping points can vary with the local shape of the support surface, and serve as the attitude adjustment and position adjustment reference for the corresponding array unit.
[0088] Specifically, the support surface can be represented by a parametric surface, implicit surface, non-uniform rational B-spline surface, or triangular mesh surface. When mapping sampling points to the support surface, the corresponding surface parameters, texture coordinates, or mesh patch coordinates can be determined based on the two-dimensional coordinates of the sampling points in the texture design domain, thereby obtaining the surface mapping points located on the support surface. Thus, each surface mapping point can establish a correspondence with a local surface region of the support surface.
[0089] When the support surface is represented by a parametric surface, the biased conductances of the parametric surface in two parametric directions can be calculated separately, and the cross product of the two biased conductances can be normalized to obtain the candidate normal direction at the surface mapping point. If the candidate normal direction points inward to the support body, it is inverted to obtain the unit normal direction pointing outward to the support body, and this unit normal direction is determined as the first direction corresponding to the surface mapping point. When the support surface is represented by an implicit surface, the gradient of the implicit function at the surface mapping point can also be calculated and normalized, and then its positive or negative direction can be selected as the first direction according to the relationship between the inside and outside of the support body.
[0090] When the supporting surface is represented by a triangular mesh, the first direction can be determined based on the outward normal of the triangular facet where the surface mapping point is located. When the surface mapping point is located at a mesh vertex or when continuous normals are required, the outward normals of adjacent facets can be weighted according to their area, included angle, or preset weights, and the weighting result can be normalized. For curved surfaces with edges or discontinuous normal positions, the outward normal can be determined based on the target facet or target curved surface to which the surface mapping point belongs, or the surface mapping point can be set to avoid non-differentiable positions.
[0091] To verify whether the normal direction points outward from the support, the orientation of the faces recorded by the support's solid topology can be used for judgment. Alternatively, test points can be taken along the candidate normal direction and its opposite direction, and the outward direction can be determined based on the inclusion relationship between the test points and the support entity. For example, if a test point obtained by offsetting a preset small distance along the candidate normal direction is located inside the support, the candidate normal direction can be reversed. This avoids the first direction from incorrectly pointing inward to the support due to differences in surface parameter orientation, mesh winding order, or model import method.
[0092] For any surface mapping point, a local normal axis can be established by using the first direction corresponding to that point as the local normal axis and determining two mutually orthogonal tangential axes within the tangential plane of that point. Subsequently, a first orientation transformation is determined to change the normal direction of the target bearing surface to the first direction, and the basic orientation of the array unit is determined based on this first orientation transformation. If a second rotation is required, the second rotation uses the first direction as the rotation axis, causing the grating structure to change its orientation within the corresponding local tangential plane without changing the state of the target bearing surface facing outwards from the support.
[0093] The arrangement of array units can also be determined based on the surface mapping point and the corresponding first direction. For example, the array units after attitude transformation can be translated along the positive or negative direction of the first direction, and the embedding offset can be determined according to the directed distance between the grating structure on the target bearing surface and the local support surface, so that the grating structure on the target bearing surface is located outside the local support surface, while the grating structures on other bearing surfaces are located inside the support. For the aforementioned common target protrusion height, it can be measured separately along the first direction corresponding to each surface mapping point, without requiring each target bearing surface to have the same global coordinate value. When the common target protrusion height and the method for determining the available embedding interval described later are used simultaneously, the corresponding available embedding interval can be converted into an available protrusion height interval according to the relationship between the array unit geometry at each surface mapping point and the first direction. In response to the existence of a common intersection among the available protrusion height intervals, the common target protrusion height is determined from the common intersection, and the target embedding offset corresponding to each surface mapping point is calculated in reverse; thus, the target embedding offsets can be different, while the protrusion heights of each target bearing surface remain the same. In response to the absence of a common intersection among the available protrusion height ranges, the common target protrusion height and the available embedding range requirement are not combined in the corresponding surface mapping point combination, and the array unit size, bearing surface structure, or sampling position can be adjusted and recalculated.
[0094] In practical implementation, the length, continuity, and outward direction of the calculated normals can be checked. If the bias vectors are collinear, the mesh patches are degenerate, or the normals cannot be stably determined, the normals can be recalculated using adjacent non-degenerate surface regions, or array elements can be avoided at the corresponding locations. Furthermore, the local curvature of the surface, array element size, and sampling interval can be used to check for unwanted overlap of exposed portions of adjacent array elements, and the array element size can be reduced or the sampling interval adjusted in areas of high curvature.
[0095] Optionally, obtaining multiple sampling points and the target grating period for each sampling point in step S101 can be achieved based on a multi-layer mask image with a transparency channel. The mask image can be an RGBA image with an alpha channel, or an image that records the transparency state using other data channels. Each mask image corresponds to a reference grating period, and the candidate design positions requiring the reference grating period are defined by the non-fully transparent pixels in that mask image layer.
[0096] After acquiring multi-layer mask images, the dimensions and positions of each layer can be standardized and registered to ensure that all layers have the same target width, target height, and design coordinate origin. For mask images with different original resolutions, they can be converted to the target width and target height according to preset scaling, cropping, or resampling rules. For mask images carrying physical dimensions or registration marks, alignment can also be performed according to the corresponding physical dimensions or registration marks. After the above processing, pixels with the same row and column indices in each layer of mask images correspond to the same position in the texture design domain.
[0097] A mask layer configuration table can be established, where each record includes at least a mask image identifier, a corresponding reference grating period, and a priority. Each reference grating period is consistent with but distinct from the reference grating periods corresponding to each bearing surface in the unit geometric model. The preset order can be determined by the input list order of the mask images or by the priority from high to low; the preset order is fixed before pixel-by-pixel detection begins, ensuring that the same set of mask images yields a definite period determination result.
[0098] The transparency channel values of each mask image at the same pixel can be detected layer by layer in a preset order, and the reference grating period corresponding to each layer can be read. When the first non-fully transparent mask image is detected, the pixel is determined as a sampling point, and the reference grating period corresponding to that layer is determined as the target grating period of that sampling point. Here, "first" is relative to the preset order and does not limit the name or storage location of the mask image in the file system.
[0099] The specific numerical conventions for the alpha channel can be determined based on the image format. For example, when using an 8-bit alpha channel where 0 represents full transparency and 255 represents complete opacity, pixels with an alpha value of 0 are considered fully transparent, while pixels with an alpha value greater than 0 are considered partially transparent. When using a normalized alpha channel, 0 and 1 can be used to represent full transparency and complete opacity, respectively. When reading mask images of different formats, the alpha channel can be converted to a unified numerical convention before determining whether it equals the full transparency baseline value, thus ensuring a consistent meaning for determining partial transparency across different image formats.
[0100] During pixel-by-pixel inspection, an unselected state can be initialized for the current pixel, and the transparency channel value can be read starting from the first layer in a preset order. When the first non-fully transparent mask image is detected, the reference grating period corresponding to the mask image is recorded, and the period selection for the current pixel is completed. For other mask images located after the first non-fully transparent mask image, their transparency state does not change the already determined target grating period. Optionally, subsequent layers can still be inspected, and when there are more than two non-fully transparent layers at the same pixel, mask overlap information is recorded for layout inspection.
[0101] Since the entire mask image is fully transparent at the current pixel, this pixel is not designated as a sampling point, and no array cell record is generated for this pixel. Thus, fully transparent areas in the mask image remain empty areas in the generated 3D texture, while non-fully transparent areas are assigned a unique target raster period based on the first hit mask layer, preventing the same sampling location from corresponding to multiple target surfaces simultaneously.
[0102] For example, detection is performed in the order of the first mask layer, the second mask layer, and the third mask layer, with each layer corresponding to a first reference grating period, a second reference grating period, and a third reference grating period, respectively. When a pixel is fully transparent in the first mask layer and not fully transparent in both the second and third mask layers, this pixel is identified as a sampling point, and the second reference grating period is identified as its target grating period. When the pixel is fully transparent in all three layers, no sampling point is generated for that pixel. If the preset order is adjusted, the first hit mask layer is re-determined according to the adjusted order.
[0103] When the mask image also records the orientation information of the grating using grayscale or color channels, the grayscale value or color component of the mask image at the same pixel can be read simultaneously with determining the first non-fully transparent mask image, and used as the orientation value of the sampling point or for calculating the orientation value. In this way, both the target grating period and the orientation value originate from the same selected mask layer; subsequently, the target bearing surface and the first orientation transformation can be determined based on the target grating period, and the second rotation performed around the corresponding first direction can be determined based on the orientation value.
[0104] After detecting all pixels, a set of sampling points is obtained. Each sampling point record includes at least a row and column index or design coordinates and the corresponding target grating period; no sampling point record is established for fully transparent pixels. The row and column index or design coordinates are then converted into surface mapping points on the support surface according to a preset sampling interval, surface parameter mapping relationship, or other surface mapping rules, thereby using the multi-period allocation results in the mask image for the selection of the bearing surface, attitude determination, and surface arrangement of each array unit.
[0105] Optionally, in embodiments where the support surface is curved, after the orientation of the array unit is determined, the offset of the array unit relative to the surface mapping point can be changed along the corresponding first direction to determine the arrangement position that allows the grating structure on the target support surface to be fully exposed while keeping the grating structures on other support surfaces within the support body. Since the curved surface shape and outward normal direction may be different at different surface mapping points, the offset and its critical value can be calculated separately for each surface mapping point.
[0106] Specifically, for any surface mapping point, the array element after attitude transformation can be set at a position with that surface mapping point as the offset reference, and the array element can be moved along the first direction corresponding to that point. It can be agreed that an increase in the offset indicates that the array element moves outward along the first direction towards the support, and a decrease in the offset indicates that the array element moves inward towards the support. The offset is a directional offset and can be positive, zero, or negative, with its origin determined by the offset reference between the surface mapping point and the model reference point.
[0107] With the orientation of the array elements remaining unchanged, each geometric point in the array elements translates along the same first direction with the offset. For subsequent judgment, the spatial extent of the grating structure on the target bearing surface and the spatial extent of the grating structures on other bearing surfaces can be determined separately. The method for determining the spatial extent corresponds to the expression form of the grating structure: when the grating structure is a solid micro-geometry, it can be determined by its solid boundary, surface mesh, contour curve, control points, or sampling points; when the grating structure is a surface texture attribute of the bearing surface, it can be determined by the attribute bearing region configured with the surface texture attribute, the zero-thickness nominal surface corresponding to that region, or a thin layer with a preset numerical tolerance. The spatial extent can also be determined using other geometric data that can characterize the region where the corresponding grating structure is located.
[0108] To determine whether each grating structure is located inside or outside the support, point inclusion, geometric intersection, or directed distance calculations can be performed using the solid model of the support. For example, it can be defined that a directed distance of a geometric point relative to the support greater than zero indicates that the point is outside the support, less than zero indicates that the point is inside the support, and equal to zero indicates that the point is on the support surface. For entities represented using boundaries, the directed distance can be determined based on the entity topology and the nearest boundary point; for triangular mesh entities, the ray method, the number of turns method, or a pre-established directed distance field can also be used to determine the inside and outside.
[0109] For the grating structure on the target support surface, all geometric points within its spatial range can be checked as the offset increases, and the minimum value of the directed distance corresponding to each geometric point can be taken. When the minimum value is less than zero, at least a portion of the target grating structure is still located inside the support; when the minimum value is greater than zero, the entire target grating structure is located outside the support. The critical offset corresponding to the change from less than zero to not less than zero can be determined as the first critical offset. When in the critical state, the last geometric point in the target grating structure to leave the support can be located on the support surface; as the offset continues to increase, the entire target grating structure is located outside the support surface.
[0110] For the grating structures on other bearing surfaces, the maximum value of the directed distance corresponding to each geometric point within the corresponding spatial range can be taken. When the maximum value corresponding to any bearing surface is less than zero, all the grating structures on that bearing surface are located inside the support; when the maximum value is greater than zero, at least a portion of the grating structures have extended beyond the support. The first critical offset corresponding to the change of the maximum value from less than zero to not less than zero can be determined as the candidate critical offset of that bearing surface. After obtaining the candidate critical offsets for each of the other bearing surfaces, the minimum value among them is determined as the second critical offset.
[0111] The aforementioned first critical offset and candidate critical offset can also be determined through geometric contact events. For example, the array element that has completed the attitude transformation can be translated and scanned along the first direction to obtain the final contact position between the target grating structure and the support surface, as well as the first contact position between the grating structure and the support surface on other bearing surfaces; then, the corresponding contact positions are converted into directed offsets based on the surface mapping points. For analytical surface or boundary representation models, the contact positions can be obtained by surface intersection and collision detection; for discrete mesh models, bounding box hierarchy, triangle intersection detection, or refined surface sampling can be used for calculation.
[0112] In one specific implementation, an offset search interval covering the possible arrangement range of the array elements can be preset, and the offset amount can be varied from small to large with a preset step size. When the corresponding internal and external states change for the first time, the two adjacent offset values are taken as the enclosing interval of the critical offset amount, and then the critical offset amount is refined by binary search, secant search, or other one-dimensional root-finding methods until the width of the offset interval is less than the preset offset tolerance. If the curved surface shape causes the corresponding grating structure to enter and exit the support multiple times within the search range, the first state transition corresponding to the critical state described in the claim can be selected in ascending order of offset amount, and a complete geometric verification is performed again on the obtained usable embedding interval.
[0113] In response to the first critical offset being less than the second critical offset, the open interval between them constitutes the usable embedding interval for the current attitude. Within this interval, the grating structures on the target bearing surface are all outside the support surface, while the grating structures on other bearing surfaces have not yet begun to extend beyond the support. The target embedding offset can be determined from the usable embedding interval, for example, by selecting the midpoint of the interval, or by selecting other positions within the interval according to a preset ratio.
[0114] To reduce the impact of geometric modeling errors and floating-point calculation errors on internal and external states, a safety margin can be preset, and the target embedding offset can be selected after leaving the safety margin at both ends of the available embedding interval. When the width of the available embedding interval is greater than twice the safety margin, the midpoint of the interval can be determined as the target embedding offset; when the width of the available embedding interval is insufficient to accommodate the safety margin, the safety margin can be reduced, the geometric calculation accuracy can be improved, or the current attitude can be marked as unavailable. After selecting the target embedding offset, the model reference point of the array element is moved along the first direction by the target embedding offset, using the surface mapping point as the offset reference, thereby determining the arrangement position of the array element.
[0115] If the first critical offset is greater than or equal to the second critical offset, it indicates that there is no offset interval in the current attitude that both places the target grating structure entirely outside the support surface and places all other grating structures within the support body. In this case, the current attitude can be discarded, and other candidate first orientation transformations can be detected in the manner described later. When no usable embedding interval exists in any of the candidate attitudes, array cells can be left ungenerated at the corresponding surface mapping points, or the array cell size, support surface structure, or sampling position can be adjusted and recalculated.
[0116] For example, if the first critical offset is determined to be 0.018 mm under a certain candidate attitude, and the candidate critical offsets for other bearing surfaces are 0.041 mm, 0.036 mm, and 0.049 mm respectively, then the second critical offset is 0.036 mm, and the usable embedding interval is (0.018 mm, 0.036 mm). 0.027 mm can be selected from this interval as the target embedding offset, and the position obtained by offsetting the surface mapping point outward by 0.027 mm along the first direction is determined as the arrangement position of the array element. The above values are only for illustrating the relationship between critical offsets and do not limit the actual size of the array element.
[0117] When using the above-mentioned method for determining the critical offset, the internal and external states are determined by the actual geometry of the support body, rather than by the approximate determination by the tangent plane at the surface mapping point. Therefore, even if the support surface is a sphere, cylinder, freeform surface, or mesh surface, the target embedding offset can be determined by combining the local outward normal to move the array unit and based on the actual geometric relationship between each grating structure of the array unit and the support body.
[0118] Optionally, given that the normal direction of the target bearing surface is already aligned with the first direction, the array element typically still possesses the degree of freedom to change its in-plane orientation around the first direction. Different in-plane orientations alter the spatial position of the grating structures on other bearing surfaces relative to local curved surfaces, potentially resulting in different first critical offsets, second critical offsets, and usable embedding intervals. Multiple candidate first orientation transformations can be constructed using these degrees of freedom, and the final adopted first orientation transformation can be determined based on the usable embedding intervals corresponding to each candidate first orientation transformation. Whether there are differences in the usable embedding intervals corresponding to each candidate first orientation transformation depends on the actual geometry of the support within the local neighborhood swept by the array element as the candidate rotates. When the support maintains geometric invariance about the first direction within this local neighborhood, such as in the corresponding rotationally symmetric region of a sphere or plane, each candidate first orientation transformation may yield the same first critical offset, second critical offset, and usable embedding interval. In this case, all candidate first orientation transformations satisfying that the first critical offset is less than the second critical offset are usable candidates, and one can be randomly selected according to a fixed candidate order, or selected based on the continuity of adjacent array elements, collision conditions, or a preset reference orientation. When the support does not possess the aforementioned rotational invariance within the local neighborhood, different candidate first orientation transformations may yield different usable embedding intervals. Whether or not the support possesses the aforementioned rotational invariance can be determined based on the actual geometric model of the support within the local neighborhood, and is not limited to determining it solely based on the single-point curvature parameters at the surface mapping points.
[0119] Specifically, a base rotation that transforms the original normal direction of the target bearing surface to a first direction can be determined firstly. Then, multiple candidate rotations with the first direction as the rotation axis are determined, and each candidate rotation is superimposed on the base rotation to form multiple candidate first orientation transformations. Since each candidate rotation is performed around the first direction, each candidate first orientation transformation maintains the normal direction of the transformed target bearing surface consistent with the first direction. Each candidate rotation angle can be determined based on the rotational symmetry angle of the element geometric model, or it can be discretely obtained within an allowable in-plane angle range according to preset angle intervals.
[0120] For example, for a basic profile with fourfold rotational symmetry, candidate first orientation transformations can be constructed using 0°, 90°, 180°, and 270° respectively; for a circular protruding surface, candidate values can also be generated at 15°, 30°, or other angular intervals within a preset angle range. When it is also required that the grid line directions of each bearing surface after the corresponding first orientation transformation have a common initial reference, candidate angles that satisfy the common initial reference or preset angle tolerance after transformation can be selected from all candidate angles first, and then candidate first orientation transformations can be generated based on the selected candidate angles. If only one candidate first orientation transformation is retained after selection, it is directly adopted without performing candidate comparison; if multiple candidate first orientation transformations are still retained, their available embedding intervals are determined and selected respectively.
[0121] For each candidate first orientation transformation, a corresponding candidate pose can be determined based on that candidate first orientation transformation. When the sampling point still has an orientation value and a second rotation needs to be performed, the orientation value can represent the additional rotation amount relative to the initial in-plane orientation formed by the candidate first orientation transformation according to a preset data convention, or it can represent the target in-plane orientation relative to the local surface coordinate system at the surface mapping point. In the embodiment where the orientation value represents the additional rotation amount, after each candidate first orientation transformation, a second rotation around a first direction is performed according to the same orientation value, and the pose after the combined action of the first orientation transformation and the second rotation is taken as the corresponding candidate pose; at this time, each candidate pose receives consistent additional rotation processing under the same orientation value condition, and its final in-plane orientation is determined by the candidate rotation angle and the additional rotation amount. In the embodiment where the orientation value represents the target in-plane orientation, a second rotation is determined for each candidate first orientation transformation to make the final grid line direction satisfy the target in-plane orientation or a preset angle tolerance, or the candidate first orientation transformation is first restricted to a transformation that can satisfy the target in-plane orientation or a preset angle tolerance. If only one candidate pose remains after strictly determining the orientation within the target plane, or if different candidate first orientation transformations result in the same final pose after corresponding second rotations, then the final pose is directly adopted, and the difference between the candidate first orientation transformations is no longer used as the basis for selecting different available embedding intervals; when there are no available embedding intervals for the final pose, array units may not be generated at the corresponding surface mapping points, or the array unit size, bearing surface structure, or sampling position may be adjusted and recalculated.
[0122] For each candidate pose, the first critical offset and the second critical offset are calculated according to the aforementioned method of changing the offset along the first direction, and the open interval between the two is determined as the available embedding interval corresponding to the candidate pose. When the first critical offset is less than the second critical offset, the corresponding candidate first orientation transformation is determined as the available first orientation transformation; when the first critical offset is greater than or equal to the second critical offset, the corresponding available embedding interval is empty, and the candidate first orientation transformation is excluded from the available set.
[0123] When considering geometric calculation tolerance, it can be further required that the difference between the second critical offset and the first critical offset is greater than the preset minimum interval width, or that after deducting safety margins at both ends of the available embedding interval, there are still non-empty intervals, and then the corresponding candidate first orientation transformation is determined as the available first orientation transformation. The minimum interval width or safety margin can be determined based on the unit geometric model size, surface discretization accuracy, and Boolean operation tolerance, in order to avoid selecting candidate poses that only theoretically have extremely narrow embedding intervals.
[0124] When selecting the final first orientation transformation from multiple available first orientation transformations, one can choose the candidate first orientation transformation with the largest available embedding interval width to give the target embedding offset a larger adjustment margin; or one can select a temporary embedding offset within the corresponding interval for each candidate attitude and compare the minimum exposed spacing between the target grating structure and the support surface, and the minimum concealed spacing between other grating structures and the support surface to select the candidate first orientation transformation with a larger minimum safety spacing.
[0125] Optionally, the continuity between the candidate pose and the poses of adjacent array elements, the collision situation between exposed parts of array elements, the rotation amount of the candidate pose relative to a preset reference orientation, or the candidate number can be used as additional selection conditions. For example, the candidate poses can be sorted first according to the width of the available embedding interval, and then the candidate poses with smaller differences in in-plane orientation from adjacent array elements can be selected when the difference in interval width is less than a preset threshold. If there are still multiple candidates, they can be selected according to a fixed candidate number so that the selection result can be obtained repeatedly.
[0126] After selecting the final first orientation transformation, the target embedding offset is determined according to the first critical offset and the second critical offset corresponding to the first orientation transformation, and the final arrangement position and orientation of the array elements are determined accordingly. By first eliminating candidate first orientation transformations that do not have usable embedding intervals, and then selecting the best from the available candidates, the geometric realizability of keeping the target bearing surface normal direction consistent with the first direction can be improved while maintaining the complete exposure of the target grating structure and keeping other grating structures embedded.
[0127] Based on the same inventive concept, this application also provides a multi-period grating three-dimensional texture generation system corresponding to a multi-period grating three-dimensional texture generation method. Since the principle of the system in this application is similar to the multi-period grating three-dimensional texture generation method described above in this application, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be described again. Reference Figure 6 The diagram shown is a schematic of a multi-period raster 3D texture generation system provided in an embodiment of this application. The system includes: Acquisition module 10 is used to acquire multiple sampling points and the target grating period of each sampling point; The first processing module 20 is used to determine a target bearing surface from multiple bearing surfaces for each sampling point, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, and to determine a first orientation transformation, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction. The second processing module 30 is used to map the sampling points to surface mapping points on the support surface of the support body, determine the arrangement position of the array unit generated based on the unit geometric model relative to the support surface according to the surface mapping points, and determine the orientation of the array unit according to the first orientation transformation; the first direction points to the outside of the support surface, and the arrangement position and the orientation are such that all the grating structures on the target bearing surface are located outside the support surface, and all the grating structures on other bearing surfaces are located inside the support body; Output module 40 is used to output a three-dimensional texture file, the three-dimensional texture file including the arrangement position and orientation of each array unit.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating multi-period grating three-dimensional textures, characterized in that, include: Acquire multiple sampling points and the target grating period of each sampling point; For each of the sampling points, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, a target bearing surface is determined from the multiple bearing surfaces, and a first orientation transformation is determined, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; The sampling points are mapped to surface mapping points on the support surface of the support body. The arrangement position of the array unit generated based on the unit geometric model relative to the support surface is determined according to the surface mapping points. The orientation of the array unit is determined according to the first orientation transformation. The first direction points to the outside of the support surface. The arrangement position and the orientation make all the grating structures on the target bearing surface located outside the support surface, and all the grating structures on other bearing surfaces located inside the support body. Output a three-dimensional texture file, which includes the arrangement position and orientation of each array unit.
2. The method according to claim 1, characterized in that, Determining the orientation of the array element based on the first orientation transformation includes: Obtain the orientation value of the sampling point, and determine the second rotation based on the orientation value, wherein the second rotation is about the first direction; The second rotation is performed after the first orientation change, and the attitude is determined based on the first orientation change and the second rotation.
3. The method according to claim 1 or 2, characterized in that, When each of the aforementioned bearing surfaces is determined as the target bearing surface, the corresponding first orientation transformation is an orthogonal transformation with a determinant equal to 1. After undergoing the corresponding first orientation transformation, the grating lines of the grating structures on each of the bearing surfaces are parallel to each other.
4. The method according to claim 1, characterized in that, When each of the bearing surfaces serves as the target bearing surface and the orientation of the array unit is determined according to the corresponding first orientation transformation, the embedded portion of the array unit within the support body has the same geometric shape. The array units and the support body are integrated using Boolean operations with the same material.
5. The method according to claim 4, characterized in that, Each of the aforementioned bearing surfaces is a circular protruding surface in the unit geometric model; The target bearing surface of each array unit has the same protrusion height relative to the support surface along the corresponding first direction.
6. The method according to claim 1, characterized in that, The support surface is curved, and the first direction is the normal direction of the support surface pointing to the outside of the support body at the surface mapping point.
7. The method according to claim 1, characterized in that, The acquisition of multiple sampling points and the target grating period of each sampling point includes: Obtain multi-layer mask images with transparent channels, each layer of the mask image corresponding to one reference grating period; The transparency of each layer of the mask image at the same pixel is detected in a preset order. In response to the existence of a non-fully transparent mask image at the pixel, the pixel is determined as a sampling point, and the reference grating period corresponding to the first non-fully transparent mask image is determined as the target grating period of the sampling point. In response to the fact that the mask images of each layer are all fully transparent at the pixel, the pixel is not identified as the sampling point.
8. The method according to claim 6, characterized in that, Determining the arrangement position of the array elements generated based on the element geometry model relative to the support surface according to the surface mapping points includes: Under the orientation of the array unit, with the surface mapping point as the offset reference, the offset of the array unit along the first direction is changed from small to large to determine the first critical offset corresponding to the critical state when the grating structure on the target bearing surface reaches the point where it is completely outside the support surface. Each candidate critical offset is determined when the grating structure on each of the other bearing surfaces reaches the critical state of starting to extend from the support, and the minimum value among the candidate critical offsets is determined as the second critical offset. In response to the first critical offset being less than the second critical offset, a target embedding offset greater than the first critical offset and less than the second critical offset is determined, and the arrangement position of the array element is determined based on the surface mapping point, the first direction and the target embedding offset.
9. The method according to claim 8, characterized in that, The determination of the first orientation change includes: Multiple candidate first orientation transformations are determined, and each candidate first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; For each of the candidate first orientation transformations, a corresponding candidate pose is determined based on the candidate first orientation transformation, and a corresponding first critical offset and a second critical offset are determined under the candidate pose. The corresponding available embedding interval is determined based on the corresponding first critical offset and the second critical offset. Candidate first orientation transformations whose corresponding first critical offset is less than the corresponding second critical offset are determined as available first orientation transformations, and one of the available first orientation transformations is selected as the first orientation transformation.
10. A multi-period raster 3D texture generation system, characterized in that, include: The acquisition module is used to acquire multiple sampling points and the target grating period of each sampling point; The first processing module is used to determine a target bearing surface from multiple bearing surfaces for each sampling point, based on the target grating period and the reference grating period corresponding to the grating structure on each bearing surface in the unit geometric model, and to determine a first orientation transformation, wherein the reference grating periods corresponding to each bearing surface are different from each other, and the first orientation transformation makes the normal direction of the target bearing surface consistent with the first direction; The second processing module is used to map the sampling points to surface mapping points on the support surface of the support body, determine the arrangement position of the array unit generated based on the unit geometric model relative to the support surface according to the surface mapping points, and determine the orientation of the array unit according to the first orientation transformation; the first direction points to the outside of the support surface, and the arrangement position and the orientation are such that all the grating structures on the target bearing surface are located outside the support surface, and all the grating structures on other bearing surfaces are located inside the support body; An output module is used to output a three-dimensional texture file, the three-dimensional texture file including the arrangement position and orientation of each of the array units.
