Triangle generation device, triangle generation method, and triangle generation program
By performing pre-shaping and segmentation processing in the triangle generation device, the problem of segmentation triangle deviation from the regular triangle is solved, and the analysis accuracy is improved and the calculation time is reduced.
Patent Information
- Application Number
- CN202380048710.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-06-24
- Filing Date
- 2023-06-23
- Publication Date
- 2025-02-11
AI Technical Summary
When the prior art splits triangles, it is easy for the generated new triangle to deviate from the regular triangle, resulting in a decrease in analytical accuracy and an increase in operation time.
A triangle generation device is used to obtain the vertex coordinates of the basic triangle and determine its consistency with the regular triangle. If it is inconsistent, it is pre-shaped and divided into multiple triangles with higher consistency with the regular triangle.
It effectively suppresses the situation where the triangle deviates from the regular triangle after segmentation, improves the analysis accuracy and reduces the operation time.
Smart Images

Figure CN119422173A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] The present international application claims the priority based on Japanese Patent Application No. 2022-102151 filed with the Japan Patent Office on June 24, 2022, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to a technology for splitting a triangle to generate a plurality of new triangles. Background Art
[0004] For example, Patent Document 1 listed below discloses a technique for tessellation in which a triangle is bisected so as to have a size smaller than or equal to a predetermined size.
[0005] Patent Document 1: U.S. Patent No. 10832473
[0006] Tessellation is one of the image calculation methods in computer graphics. Tessellation is a technique for further finely dividing many polygons (e.g., triangular polygons) used to represent a three-dimensional solid on a two-dimensional image, and is a technique for representing a three-dimensional solid in more detail and smoothly based on the divided triangles.
[0007] In the method described in Patent Document 1, the following is repeatedly performed: a dividing line is drawn from a vertex of a triangle toward its opposite side, and the triangle is bisected by the dividing line. In this method, for example, if the triangle before the division is a relatively long and thin triangle, the triangle after the division may also be a relatively long and thin triangle. That is, the triangle after the division may deviate from a regular triangle.
[0008] However, it is known that in image calculations in computer graphics, the more a triangle deviates from an equilateral triangle (that is, the lower the aspect ratio of the triangle), the more it leads to a decrease in analysis accuracy, an increase in calculation time, and the like. Summary of the invention
[0009] In one aspect of the present disclosure, it is preferable to suppress a new triangle generated by splitting a triangle from deviating from an equilateral triangle.
[0010] One aspect of the present disclosure is a triangle generation device. The triangle generation device as one aspect of the present disclosure includes an acquisition unit and a triangle division unit. The acquisition unit is configured to acquire a vertex coordinate group including coordinates of each vertex for one or more basic triangles. The triangle division unit is configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles. In addition, the triangle division unit includes an object determination unit, a pre-shaping execution unit, and an addition unit.
[0011] The object determination unit is configured to determine whether each basic triangle defined by the vertex coordinate group is a target triangle having a shape with a relatively large degree of consistency with an equilateral triangle. The pre-shaping execution unit is configured to divide the basic triangle determined not to be the target triangle into a plurality of triangles so as to form a shape with a relatively large degree of consistency with an equilateral triangle. The adding unit is configured to generate a new vertex coordinate group including the vertex coordinates of the divided triangles.
[0012] The triangle dividing unit calculates, for each of the basic triangles defined by the coordinates of the vertices included in the new vertex coordinate group generated by the adding unit, the coordinates of the vertices of a plurality of subdivided triangles that divide the region of the basic triangle into smaller ones than the basic triangle.
[0013] In the triangle generation device as one mode of the present disclosure thus constructed, the basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group generated by the adding unit has a shape that is relatively consistent with the equilateral triangle by the execution of the pre-shaping execution unit. The triangle generation device as one mode of the present disclosure calculates the coordinates of the vertices of a plurality of finely divided triangles for each of the basic triangles having such a shape that is relatively consistent with the equilateral triangle. Therefore, compared with the case where the basic triangle is divided into finely divided triangles without executing the pre-shaping execution unit, the triangle generation device as one mode of the present disclosure can obtain finely divided triangles that are relatively consistent with the equilateral triangle. As a result, it is possible to suppress the new finely divided triangles generated by dividing the basic triangle from deviating from the equilateral triangle.
[0014] Another aspect of the present disclosure is a triangle generation method that obtains a vertex coordinate group including coordinates of each vertex for one or more basic triangles, and divides each basic triangle defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles.
[0015] The triangle generation method as another aspect of the present disclosure configured in this way is a method executed by the triangle generation device as one aspect of the present disclosure, and can obtain the same effects as the triangle generation device as one aspect of the present disclosure.
[0016] Another aspect of the present disclosure is a triangle generation program executed by a triangle generation device, which includes an acquisition step and a triangle segmentation step. The triangle generation program as another aspect of the present disclosure is a program executed by a triangle generation device as one aspect of the present disclosure, and by executing the program, the same effect as that of the triangle generation device as one aspect of the present disclosure can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a block diagram showing the structure of a radar simulator.
[0018] Figure 2 This is a flowchart of the triangle generation process.
[0019] Figure 3 It is a flowchart of triangle segmentation.
[0020] Figure 4 It is a pre-shaped flowchart.
[0021] Figure 5 This is an explanatory diagram for explaining rearrangement of opposite side lengths in descending order.
[0022] Figure 6 It is an explanatory diagram showing the element vertices[] of the array before rearrangement.
[0023] Figure 7 It is an explanatory diagram showing the element vertices[] of the rearranged array.
[0024] Figure 8 This is an explanatory diagram for explaining the division of non-target triangles.
[0025] Fig. 9 It is an explanatory diagram showing a plurality of basic triangles for explaining the preliminary shaping operation.
[0026] Fig.10 It is an explanatory diagram showing each array for explaining the pre-shaping operation.
[0027] Fig.11 It is a multi-segment flow chart.
[0028] Fig.12 This is an explanatory diagram for explaining each side and each vertex in a basic triangle.
[0029] Fig.13 This is an explanatory diagram for explaining the outline of processing on a branch line.
[0030] Fig.14 This is an explanatory diagram for explaining the outline of the fine segmentation process.
[0031] Fig.15 This is the flowchart for the main line processing.
[0032] Fig.16 This is a flowchart of the processing on the branch line.
[0033] Fig.17 This is a flowchart of the prim_lookup_idx array generation process.
[0034] Fig.18 This is a flowchart of the fine segmentation process.
[0035] Fig.19 This is a flowchart of the maj_line_lookup_idx array generation process.
[0036] Fig. 20 This is an explanatory diagram for explaining the work being processed on the main line.
[0037] Fig.21 This is an explanatory diagram for explaining the operation of processing on the branch line.
[0038] Fig. 22 This is an explanatory diagram for explaining the fine segmentation process.
[0039] Fig.23 This is an explanatory diagram for explaining combination information.
[0040] Fig.24 This is an explanatory diagram showing an example of the array prim_lookup_idx[].
[0041] Fig.25 This is an explanatory diagram showing an example of the array maj_line_lookup_idx[].
[0042] Fig.26 It means in Figure 20 to Figure 23 This is an explanatory diagram of subdividing triangles that divide the area between the pair of branch lines set for the first main line upper point specified by maj_div_idx=3 in the basic triangle specified by prim_id=0.
[0043] Fig. 27 It is an explanatory diagram showing an example of the displacement amount of the main division point identification number.
[0044] Fig.28 It is an explanatory diagram showing an example of the shift amount of the sub-division point identification number.
[0045] Fig.29 is used in Figure 20 to Figure 23 This is an explanatory diagram for explaining each parameter in each basic triangle specified by prim_id=0 to 2.
[0046] Fig.30 It is a flowchart of accumulation and parallel processing.
[0047] Fig.31 This is an explanatory diagram for explaining the operation of accumulation and parallel processing. DETAILED DESCRIPTION
[0048] [First embodiment]
[0049] The following is a first embodiment of the present disclosure and the attached Figure 1 Let me explain.
[0050] [1-1. Structure]
[0051] like Figure 1 As shown, the radar simulator 1 of the present embodiment includes a display unit 11 , an operation input unit 12 , a data storage unit 13 , a data input / output unit 14 , and a control unit 15 .
[0052] The display unit 11 includes a display device (not shown) and displays various images on a display screen of the display device.
[0053] The operation input unit 12 outputs input operation information for specifying an input operation performed by a user via a keyboard and a mouse (not shown).
[0054] The data storage unit 13 is a storage device for storing various data.
[0055] The data input / output unit 14 performs data input / output with an external device connected via wire or wirelessly.
[0056] The control unit 15 is composed mainly of a microcomputer including an electronic computing device (hereinafter referred to as the computing device 20), ROM 23, and RAM 24. The computing device 20 includes at least one of a CPU 21 and a GPU 22. The various functions of the microcomputer are realized by executing a program stored in a non-migrating physical recording medium by the computing device 20. In this example, ROM 23 is equivalent to a non-migrating physical recording medium storing the program. In addition, by executing the program, a method corresponding to the program is executed. In addition, a part or all of the functions performed by the computing device 20 may be constituted in hardware by one or more ICs. In addition, the number of microcomputers constituting the control unit 15 may be one or more.
[0057] For example, the ROM 23 stores a simulation program 25, a drawing program 26, and a triangle generation program 27. The simulation program 25, the drawing program 26, and the triangle generation program 27 may be pre-installed in the radar simulator 1, or may be installed via a recording medium or a network. Examples of the recording medium include an optical disk, a magnetic disk, and a semiconductor memory.
[0058] The simulation program 25 is a program for reproducing the three-dimensional shape of the road and the three-dimensional shape of the road periphery in the virtual space, and executing a simulation of causing a vehicle to travel on the road reproduced in the virtual space. For example, the simulation may include a simulation of the transmission and reception of radar waves by a radar device mounted on the vehicle in the vehicle traveling in the virtual space displayed on the display device. The activation of the simulation program 25 may also execute a radar simulation that simulates the travel of the vehicle and the transmission and reception of radar waves by the radar device.
[0059] The simulation program 25 may be started to obtain data (hereinafter referred to as polygon data) that represents the three-dimensional shape of the road and the surrounding area of the road to be reproduced in the virtual space as a plurality of polygons. In addition, calculations that simulate the transmission and reception of radar waves based on the polygon data representing the three-dimensional shape may also be performed. In addition, various other simulations may be included in the simulation.
[0060] For example, the drawing program 26 is a program for generating an image representing the three-dimensional shape of the road and the surrounding area of the road, etc., which are reproduced in the virtual space used for the above-mentioned radar simulation. The drawing program 26 may be started up when the simulation program 25 is started up, or the drawing program 26 may be started up independently. By starting the drawing program 26, polygon data of the three-dimensional shape of the road and the surrounding area of the road, etc., which should be reproduced in the above-mentioned virtual space, may be acquired to generate an image representing the three-dimensional shape.
[0061] A plurality of polygon data representing three-dimensional shapes and the like may be stored in advance in the data storage unit 13, or may be acquired from outside the radar simulator 1 via the data input / output unit 14. The polygon data includes polygon vertex coordinate data representing coordinates of each vertex of a plurality of polygons (e.g., triangular polygons) (hereinafter referred to as vertex coordinates).
[0062] For example, the triangle generation program 27 is a program for dividing each triangular polygon (hereinafter also referred to as a basic triangle) defined by vertex coordinates included in the polygon vertex coordinate data into a plurality of triangles smaller than the basic triangle. The processing performed by the computing device 20 executing the triangle generation program 27 is also referred to as triangle generation processing.
[0063] The triangle generation process outputs new vertex coordinate data including vertex coordinates of a triangle smaller than the basic triangle, and an image representing a three-dimensional shape is generated based on the vertex coordinate data. Thus, a more detailed and smoother image is generated when the display unit 11 draws on the display device.
[0064] [1-2. Processing]
[0065] use Figure 2The flowchart of FIG. 2 illustrates the process of the triangle generation process executed by the computing device 20. For example, the triangle generation process is started by the execution of the simulation program 25 or the execution of the drawing program 26. The execution of the triangle generation process is not limited to the execution of the simulation program 25 or the drawing program 26, but may be executed at any time.
[0066] When executing the triangle generation process, in S1, the computing device 20 acquires polygon vertex coordinate data. For example, the polygon vertex coordinate data includes vertex coordinates for a plurality of basic triangles.
[0067] Next, in S2, the computing device 20 performs triangle segmentation. In the triangle segmentation, the basic triangle is segmented, and a plurality of triangles smaller than the basic triangle (hereinafter also referred to as fine segmentation triangles) are generated. In addition, the generation of triangles hereinafter referred to includes performing calculations of vertex coordinates of the calculated triangles, and outputting (i.e., storing) the calculated vertex coordinates to a memory such as the RAM 24.
[0068] In S3, the computing device 20 outputs new vertex coordinate data including vertex coordinates of triangles smaller than the basic triangle (i.e., finely divided triangles). For example, the computing device 20 may output the vertex coordinate data to any memory that can be used in the simulation program 25, the drawing program 26, or other application programs. The computing device 20 then terminates the triangle generation process.
[0069] Next, based on Figure 3 The flowchart shown in FIG. 1 illustrates the details of the triangle division (ie, triangle generation processing) executed by the computing device 20 in S2 .
[0070] In S11, the computing device 20 performs pre-tessellation reshaping. Pre-tessellation reshaping is a process for reshaping a triangle having a shape with a relatively small degree of consistency with an equilateral triangle among basic triangles into a plurality of triangles having a shape with a relatively large degree of consistency with an equilateral triangle based on polygon vertex coordinate data.
[0071] In the next S12, the computing device 20 performs multi-segment segmentation (i.e., Cascade Tessellation). Multi-segment segmentation refers to a process for generating fine segmentation triangles for each basic triangle. In the present embodiment, before multi-segment segmentation (i.e., before generating fine segmentation triangles), the above-mentioned pre-shaping process is performed as a pre-processing. That is, in the present embodiment, multi-segment segmentation is performed on a basic triangle having a shape relatively close to an equilateral triangle. In addition, in the present embodiment, the fine segmentation triangle is a plurality of triangles smaller than the basic triangle obtained by segmenting a basic triangle having a shape relatively close to an equilateral triangle. The computing device 20 thus ends the triangle segmentation.
[0072] [1-2-1. Preliminary shaping]
[0073] based on Figure 4 The flowchart shown in FIG. 1 will explain the details of the preliminary shaping executed by the calculation device 20 in S11.
[0074] <Processing>
[0075] First, in S105, the computing device 20 obtains polygon vertex coordinate data. Each basic triangle has three vertex coordinates. Here, the polygon vertex coordinate data is set to include vertex coordinates of L basic triangles. For example, each element included in the polygon vertex coordinate data, such as (v0, v1, v2, v3, v4, v5, ..., v 3k , v 3k+1 , v 3k+2 , ...). K is an integer from 0 to L-1. V is a vertex coordinate. The vertex coordinate v can be represented by coordinates such as (x, y) or by a position vector.
[0076] In the following, polygon vertex coordinate data is recorded as an array vertices[]. The element vertices[] of the array is represented by floating points. In addition, regarding the elements of the array, there is a case where [] is omitted to record the elements of the array vertices[] only as vertices. The index (hereinafter, idx) is a variable used to specify the elements of the array, and here 0≦idx≦L-1 is set as the range. That is, the elements vertices[3idx], vertices[3idx+1], vertices[3idx+2] of the array represent the vertex coordinates of a basic triangle specified by idx. 3idx, or 3*idx means 3 multiplied by idx. For example, the basic triangle specified by idx=0 is a basic triangle with the vertex coordinates stored in the elements vertices[0], vertices[1], vertices[2] of the array (that is, specifically, the above-mentioned (v0, v1, v2)) as the vertices of the triangle.
[0077] In S110-S130, the computing device 20 determines a triangle that is not an object triangle from the basic triangles specified by the value stored in idx. The object triangle refers to a triangle having a shape that is relatively close to an equilateral triangle. A shape that is relatively close to an equilateral triangle is a shape that is relatively consistent with the equilateral triangle. The consistency with the equilateral triangle is represented by, for example, the aspect ratio. The aspect ratio is in the range of 0≦aspect ratio≦1, and the aspect ratio of an equilateral triangle is 1. The larger the aspect ratio is relatively (i.e., the closer it is to 1), the greater the consistency with the equilateral triangle. The object triangle can also be said to be a triangle with a relatively large aspect ratio (i.e., relatively close to 1). Hereinafter, triangles that are not object triangles will also be referred to as non-object triangles.
[0078] First, in S110 , the computing device 20 stores 0 in idx.
[0079] Next, in S115, the computing device 20 changes the storage order of the vertex coordinates in the array vertices[] for the basic triangle specified by the value stored in idx so that the lengths of the opposite sides are in descending order. That is, the vertex coordinates stored in the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array are rearranged so that the lengths of the opposite sides are in descending order. The opposite side refers to the side opposite to the vertex. Descending order means arranging in order from long to short.
[0080] For example, Figure 5 Represents the graph of a basic triangle specified by idx=k. Figure 6, the elements of the array before rearrangement are shown in FIG. That is, the vertex coordinates stored in the element vertices[3k] of the array are V 3k , the vertex coordinates stored in the array element vertices[3k+1] are V 3k+1 , the vertex coordinates stored in the array element vertices[3k+2] are V 3k+2 .
[0081] First, the computing device 20 calculates the vertex coordinates v based on the vertex coordinates. 3k The length of the opposite side a of the vertex shown, the vertex coordinate v 3k+1 The length of the opposite side b of the vertex shown, the vertex coordinates v 3k+2 The length of the opposite side c of the vertex shown. Then, the computing device 20 determines the order of length from long to short (i.e., the descending order of length) for the opposite sides a, b, and c. Figure 5 In the example of , the lengths of the opposite sides are c>b>a. The computing device 20 rearranges the order of the vertices so that the vertices corresponding to the determined order of the lengths of the opposite sides (ie, c>b>a) are arranged in order.
[0082] Therefore, after rearrangement, Figure 7 As shown, v is stored as an element of the array vertices[3k] 3k+1 , storing v as the element of the array vertices[3k+1] 3k+2 , storing v as the element of the array vertices[3k+2] 3k That is, rearrange the vertex coordinates so that the lengths of the opposite sides are in descending order.
[0083] Next, in S120, the computing device 20 determines whether the basic triangle specified by the value stored in idx is the above-mentioned target triangle. Here, in the present embodiment, the computing device 20 determines that it is a target triangle when the maximum value of the internal angle is lower than the predetermined allowable angle. On the other hand, the computing device 20 determines that it is a non-target triangle when the maximum value of the internal angle is greater than the allowable angle. In the present embodiment, the allowable angle is 120°. In addition, the allowable angle is not limited to 120°, and may be any angle within a specified range including 120°.
[0084] As described above, the vertex coordinates of the basic triangle specified by the value stored in idx are rearranged in the array vertices[] in descending order of the length of the opposite side. That is, the vertex coordinates stored in the first array element vertices[3idx] among the array elements vertices[3idx], vertices[3idx+1], vertices[3idx+2] represent the vertex with the largest internal angle.
[0085] The computing device 20 uses the cosine theorem, i.e., c 2 =a 2 +b 2 -2abcosθ, calculate θ as the angle representing the maximum value of the internal angle. Here, c is the length of the opposite side of the vertex with the largest internal angle, and a and b are the lengths of the remaining sides. The opposite side of the vertex with the largest internal angle is the opposite side of the vertex represented by the vertex coordinates stored in the element vertices[3idx] of the array that is the first of the three vertex coordinates. The remaining sides are the opposite sides of the vertices represented by the vertex coordinates stored in the elements vertices[3idx+1] and vertices[3idx+2] of the array.
[0086] The array flag[idx] indicates the value of the flag associated with the basic triangle specified by the value stored in idx. Here, when the computing device 20 determines that the basic triangle is an asymmetric triangle, that is, when the maximum value θ of the internal angle is greater than the allowable angle, 1 is stored in the array flag[idx]. On the other hand, when the computing device 20 determines that the basic triangle is a symmetric triangle, that is, when the maximum value of the internal angle is less than the allowable angle, 0 is stored in the array flag[idx].
[0087] In S125, the calculation device 20 increments idx. That is, the calculation device 20 stores a value obtained by adding 1 to the value stored in idx in idx.
[0088] In S130, the computing device 20 determines whether the value stored in idx is greater than L. Here, the computing device 20 moves the process to S135 when it is determined to be greater than L. On the other hand, when it is determined to be less than L, the computing device 20 moves to S115 and repeats the processes of S115 to S130 until idx is greater than L.
[0089] In S135, the computing device 20 stores the cumulative sum of the array element flag[] in the array scan[idx] specified by the value stored in idx. The cumulative sum of the array element flag[] here refers to the sum of the values of the array elements flag[0] to flag[idx].
[0090] For example, the value stored as the array element flag[0] is stored as the array element scan[0], and the sum (i.e., cumulative sum) of the value stored as the array element flag[0] and the value stored as the array element flag[1] is stored as the array element scan[1]. Thus, when the value stored in idx is L-1, the total number of non-target triangles among the L basic triangles is stored as the array element scan[L-1].
[0091] In S140 to S165 , the computing device 20 divides the basic triangle determined as a non-target triangle in S120 into a plurality of (for example, two in the present embodiment) triangles so as to have a relatively large degree of coincidence with the equilateral triangle.
[0092] First, in S140 , the computing device 20 stores 0 in idx.
[0093] In S145, the computing device 20 determines whether the basic triangle specified by the value stored in idx is a target triangle or a non-target triangle. Here, when the value stored as the element flag[idx] of the array is 1, the computing device 20 determines that it is a non-target triangle, and moves the processing to S150. On the other hand, when the value stored as the element flag[idx] of the array is 0, the computing device 20 determines that it is a target triangle, and moves the processing to S160.
[0094] In S150 , the computing device 20 divides the basic triangle specified by the value stored in idx into two along the bisector of the internal angle indicating the maximum value so that the divided triangles have a relatively large degree of consistency with the equilateral triangle.
[0095] As described above, in the basic triangle specified by the value stored in idx, the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array represents the vertex with the largest internal angle. Figure 8 As shown, from the vertex with the largest internal angle (for example, vertex coordinate v 3k+1 ) is the bisector of the interior angle, the intersection of the dividing line DL and the opposite side c is set as point M. The opposite side c is divided into m:n=a:b by point M. The computing device 20 calculates the coordinates of point M based on equation (1).
[0096] [Formula 1]
[0097]
[0098] Here, the computing device 20 stores the vertex coordinates (ie, Figure 8 v 3k+1 ), the vertex coordinates stored in the element vertices[3idx+1] of the array (i.e., v 3k+2 ), the coordinates of point M are stored as array elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] respectively.
[0099] On the other hand, the computing device 20 stores the vertex coordinates (ie, Figure 8 v 3k+1 ), the vertex coordinates stored in the element vertices[idx+2] of the array (i.e., v 3k ), the coordinates of point M are added to the end of the array vertices[] as the vertex coordinates of the new basic triangle.
[0100] Specifically, the computing device 20 stores the value stored in idx at the end of the specified array vertices[], i.e., L-1, plus the value stored in the element scan[idx] of the array in the variable aidx. aidx = (L-1) + scan[idx]. Then, aidx is set to the vertex of the basic triangle specified as idx, and the vertex coordinates stored in the element vertices[3idx] of the array (i.e., v 3k+1 ), the vertex coordinates stored in the element vertices[3idx+2] of the array (i.e., v 3k ), the coordinates of point M are stored as array elements vertices[3aidx], vertices[3aidx+1], and vertices[3aidx+2] respectively. Thus, the vertex coordinates of the new basic triangle are added to the end of the array vertices[].
[0101] In addition, the computing device 20 may also make the array storing the vertex coordinates of the divided triangles reverse to the above content. That is, in the above example, the vertex coordinates v 3k+1 , vertex coordinates v 3k The coordinates of the points M are stored as the elements of the array vertices[3idx], vertices[3idx+1], and vertices[3idx+2]. 3k+1 , vertex coordinates v 3k+2 , and the coordinates of point M are stored as array elements vertices[3aidx], vertices[3aidx+1], and vertices[3aidx+2] respectively.
[0102] In S160, the calculation device 20 increments idx. That is, the calculation device 20 stores a value obtained by adding 1 to the value stored in idx in idx.
[0103] In S165, the computing device 20 determines whether the value stored in idx is greater than L. Here, the computing device 20 moves the process to S170 when it is determined to be greater than L. On the other hand, when it is determined to be less than L, the computing device 20 moves the process to S145 and repeats the processes of S145 to S165 until idx is greater than L.
[0104] In S170-S185, the computing device 20 again rearranges the vertex coordinates stored in the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array for the basic triangle specified by the value stored in idx so that the lengths of the opposite sides are in descending order. In addition, in S170-S185, idx is in the range of 0≦idx≦P. P is (L-1)+the value stored as the element scan[L-1] of the array. The processing of S170, S175, and S180 is the same as S110, S115, and S125, respectively.
[0105] In S185, when the calculation device 20 determines that idx is greater than or equal to P, the pre-shaping process ends here.
[0106] Therefore, the vertex coordinates of the basic triangles whose maximum internal angle is less than 120° are stored in order in the array vertices[].
[0107] <Work>
[0108] use Fig. 9 as well as Fig.10 The operation of the preliminary shaping process will be described. Fig. 9 This shows an example in which vertices[] contains the vertex coordinates of 10 basic triangles (ie, L=10). Fig.10 Represents the array vertices[], array flag[], array scan[]. In addition, Fig.10 In the vertices[] array, the value stored in the vertices[3idx] array is recorded as vert[0], the value stored in the vertices[3idx+1] array is recorded as vert[1], and the value stored in the vertices[3idx+2] array is recorded as vert[2].
[0109] In S115, the computing device 20 rearranges the vertices in the basic triangle so that the lengths of the opposite sides are in descending order. Fig.10As shown, in the array vertices[] (ie, vert[0] to vert[2]), the coordinates of each vertex are stored such as v0, v1, v2, ...
[0110] In S120, the computing device 20 determines non-object triangles. Fig.10 As shown, the basic triangles specified by idx=3, 5, 8, 9 are determined as non-target triangles, and 1 is stored as elements flag[3], [5], [8], [9] of the array.
[0111] In S135, the computing device 20 determines the cumulative sum of flag[]. Thus, for example, Fig.10 As shown, 1 is stored as an element of the array scan[3] specified by idx=3, and 4, which is a cumulative value, is stored as an element of the array scan[9] specified by idx=9.
[0112] In S150, the computing device 20 divides the basic triangle specified by idx=3, 5, 8, 9 that is determined as a non-object triangle, and updates the array vertices[]. For example, the basic triangle specified by idx=5 is divided by the dividing line DL into a triangle with v15, v16, and point M5 as vertex coordinates, and a triangle with v15, v17, and point M5 as vertex coordinates. The value obtained by adding 9 (i.e., the value representing L-1) to the value stored in the array element scan[5], which is 2, is stored in the variable aidx, that is, 11.
[0113] Here, v15, v16, and point M5 are stored as elements of the array vertices[3*5][3*5+1][3*5+2]. That is, v15, v16, and point M5 are stored as elements of the array vert0[5], vert1[5], and vert2[5] in the basic triangle specified by idx=5. On the other hand, v15, v17, and point M are stored as elements of the array vertices[3*11][3*11+1][3*11+2]. That is, v15, v16, and point M5 are stored as elements of the array vert0
[11] , vert1
[11] , and vert2
[11] in the basic triangle specified by the new idx (i.e., aidx)=11.
[0114] In S175, the computing device 20 again rearranges the vertices in the basic triangle so that the lengths of the opposite sides are in descending order. Thus, although not shown, in the new array vertices[], the coordinates of each vertex in the basic triangle specified by the value stored in idx are stored so that the lengths of the opposite sides are in descending order.
[0115] [1-2-2. Overview of multi-segment division]
[0116] based on Fig.11 The flowchart shown, and Figure 12 to Figure 14 , an overview of the multi-segment division performed by the computing device 20 in S12 is described. Figure 12 to Figure 14 The triangle shown represents a basic triangle defined by the vertex coordinates included in the above array vertices[]. In this embodiment, since the pre-shaping is performed as described above, the basic triangles defined by the vertex coordinates included in the array vertices[] have shapes that are relatively consistent with regular triangles.
[0117] <Name>
[0118] First, the names of line segments and vertices in a basic triangle are explained.
[0119] The so-called first main line is, for example, Fig.12 The longest side in a basic triangle is the side opposite to the internal angle IA having the largest angle in the basic triangle, as shown in FIG. 1. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the element vertices[3idx+1] of the array and the vertex indicated by the vertex coordinates stored in vertices[3idx+2] is equivalent to the first main line l0.
[0120] The so-called second main line is, for example, Fig.12 The second longest side in the basic triangle is the side opposite to the side having an internal angle that is second only to the maximum angle in the basic triangle, as in the second main line l1 shown in FIG. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array and the vertex indicated by the vertex coordinates stored in vertices[3idx+2] is equivalent to the second main line l1.
[0121] The so-called third main line is, for example, Fig.12 The shortest side in a basic triangle is the side opposite to the internal angle with the smallest angle in the basic triangle, as in the second main line l1 shown in FIG. In the basic triangle specified by the value stored in idx, the side connecting the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array and the vertex indicated by the vertex coordinates stored in vertices[3idx+1] is equivalent to the third main line l2.
[0122] In addition, in the basic triangle, vertex A is also B Base Point A B The so-called base point AB It refers to the vertex that is the intersection of the first main line l0 and the second main line l1. R It is called right vertex A R The so-called right vertex A R It refers to the vertex that is the intersection of the first main line l0 and the third main line l2. L It is called right vertex A L The so-called left vertex A L It refers to the vertex that becomes the intersection point of the second main line l1 and the third main line l2.
[0123] <Operator>
[0124] Operators used in the following description are described.
[0125] As an operator, floor(a) is a function that returns the largest integer less than a. Ceil(a) is a function that returns the smallest integer greater than a. mod(a, b) represents a function that returns the remainder when a is divided by b. a / b represents a divided by b. In addition, float(a) means a represented as a floating point number. Here, when a and b are integers, a / b returns the value after discarding the remainder from the result of the division. For example, 5 / 2=2. On the other hand, when a and b are both floating point numbers, a / b is the result of the division, for example, 5.0 / 2.0=2.5.
[0126] <Overview of the Process>
[0127] First, in S21, the computing device 20 performs main line processing. In the main line processing, the computing device 20 calculates the number of main divisions (e.g., M) in each basic triangle. M is an integer of M≧1. The number of main divisions is the number of divisions when the first main line (e.g., based on a predetermined division length d0) is equally divided in each basic triangle. The equal division referred to here includes multiple divisions of more than 2 and single division.
[0128] The first main line points are multiple (for example, M+1) points at the positions where the first main line 10 is equally divided by the number of main divisions. The first main line points include the two end points of the first main line 10 (i.e., the base point A B and the right vertex A R ). That is, the points on the first main line l0 include at least two first main line points. The number of points on the first main line referred to below refers to the number of first main line points on the first main line (for example, the M+1 points mentioned above). Fig.12 , an example is shown in which four first main line points are included on the first main line 10 in the basic triangle. In addition, maj_vert_num described later corresponds to the number of first main line points.
[0129] Next, in S22, the computing device 20 performs branch line processing. In the branch line processing, the computing device 20 sets a sub-division number (e.g., N) for each of the plurality of first main line points set on the first main line l0. N is an integer of N≧0. The sub-division number is the number of divisions when the set branch line (e.g., based on the above-mentioned division length d0) is equally divided for each of the plurality of first main line points. The equal division referred to here includes multiple divisions of 2 or more, one division, and zero division.
[0130] The branch line is a line segment that passes through the upper point of the first main line from the first main line l0 to the second main line l1 and along the third main line l2. The line segment along the third main line l2 refers to a line segment parallel to the third main line l2, and the line segment along the third main line l2 also includes the third main line l2 itself. The branch line includes both the line segment along the third main line l2 and the base point A as the upper point of the first main line. B The set line segment also includes the third main line l2 itself.
[0131] exist Fig.13 In the example, the basic triangle has four branches (i.e., ml0 to ml3) respectively set for the four first main line points. The number of sub-divisions of ml0 is 0, the number of sub-divisions of ml1 is 1, the number of sub-divisions of ml2 is 2, and the number of sub-divisions of ml3 is 3. The computing device 20 calculates the coordinates of the first main line point and the second main line point. In addition, as described above, Fig.13 In the example, ml3 is the third main line l2 and is also a branch line.
[0132] Next, in S23, the computing device 20 performs fine segmentation processing. In the fine segmentation processing, the computing device 20 uses the array vertices[] that has been pre-shaped as the vertex coordinate group, the number of main segmentations, and the combination information to calculate the coordinates of the vertices of the fine segmentation triangle for each branch line pair set for the first main line points. The combination information is information that specifies the combination method of the branch line points belonging to each fine segmentation triangle.
[0133] The branch line point is a point that includes the two end points of the branch line and divides the branch line equally by the above-mentioned sub-division number (for example, N+1). The two end points of the branch line are the points on the first main line and the points on the second main line located at the two ends of the branch line. The number of branch line points referred to below refers to the number of branch line points on the branch line (for example, the above-mentioned N+1). The mai_vert_num described below is equivalent to the number of branch line points.
[0134] Hereinafter, an overview of branch line pairs, the number of finely divided triangles in the branch line pairs, and combination information will be described.
[0135] <About branch line pairs>
[0136] The so-called branch line pair refers to a combination of any two adjacent branches among the branches. The so-called finely divided triangle refers to one or more triangles that divide the area of the basic triangle sandwiched by the branch line pair without duplication, using the branch line points on the two branches belonging to the branch line pair as vertices. Hereinafter, the area of the basic triangle sandwiched by the branch line pair is also referred to as the area sandwiched by the branch line pair.
[0137] In addition, the branch lines set for the first main line points are also referred to as reference branch lines. B The adjacent branches are called adjacent branches. That is, a branch pair is a combination of a reference branch and an adjacent branch. In addition, a fine segmentation triangle is one or more triangles that use the branch point on the reference branch belonging to the branch pair and the branch point on the adjacent branch as vertices to segment the area between the branch pair without duplication.
[0138] exist Fig.13 In the example, the two end points of the branch line are points on the first main line l0 and points on the second main line l1. For example, among the four branch lines (i.e., ml0 to ml3), ml0 has one branch line upper point (i.e., min_vert_num=1 described later), and ml1 has two branch line upper points (i.e., min_vert_num=2). ml2 has three branch line upper points (i.e., min_vert_num=3), and ml3 has four branch line upper points (i.e., min_vert_num=4). For base point A B The branch line ml0 set on the upper side has a branch line point (i.e., base point A B ).
[0139] exist Fig.13 In the example, regarding the right vertex A as a point on the first main line R , for the right vertex A R The branch line ml3 is set, and the branch line ml4 is set at the right vertex A. R Base point A B The branch line ml2 set for the first main line upper point (hereinafter also referred to as point A2) adjacent to the side is a branch line pair. In this branch line pair, ml3 is equivalent to the reference branch line, and ml2 is equivalent to the adjacent branch line. Regarding point A2, which is a point on the first main line, the branch line ml2 (i.e., the reference branch line) set for point A2 and the branch line ml3 (i.e., the reference branch line) set for the base point A2 are B The branch line ml1 (i.e., the adjacent branch line) set for the point adjacent to the side (hereinafter, also referred to as point A1) is a branch line pair. Similarly, with respect to point A1 which is a point on the first main line, the branch line ml1 (i.e., the reference branch line) set for point A1 and the branch line ml2 (i.e., the reference branch line) set for the base point A1 are B The adjacent point on the side (i.e., base point A B) set the branch line ml0 (i.e., adjacent branches) to be a branch line pair.
[0140] In addition, in the basic triangle, from the base point A B From the first main line point farther away, go towards the base point A B In this embodiment of setting the branch line pair, for the base point A which is the top point of the first main line B The branch line you set is not set as the reference branch line. Fig.13 As shown, the number of branch line pairs set in the basic triangle as an example is three.
[0141] <About the number of subdivided triangles in branch line pairs>
[0142] For example, regarding the right vertex A as a point on the first main line mentioned above R , will be for the right vertex A R The triangle formed by the branch line pair consisting of the set branch line ml3 and the adjacent branch line ml2 without overlapping each other is a fine segmentation triangle. In the segmentation, the points on the two branches ml3 (i.e., the reference branch line) and ml2 (i.e., the adjacent branch line) belonging to the branch line pair are set as the vertices of the fine segmentation triangle. In the above example, Fig.13 As shown, for example, the split is for the right vertex A R The number of subdivided triangles in the basic triangle area between the set reference branch line ml3 and the adjacent branch line ml2 is calculated to be five.
[0143] In addition, each of the fine segmentation triangles in the area of the basic triangle sandwiched by the segmentation branch pair can also be independently identified by the intra-area identification number (i.e., tess_prim_idx described later). The intra-area number is a number assigned to the fine segmentation triangles in the area sandwiched by the segmentation branch pair, and can be a number starting from the first main line side (i.e., 0) and increasing as it moves away from the first main line. For example, in Fig.14 The underlined number in the table is equivalent to the identification number within the area. Fig.13 As shown, the split is for the right vertex A R The subdivided triangles of the area between the set reference branch line ml3 and the adjacent branch line ml2 may be sequentially numbered as 0, 1, 2, 3, 4 from the first main line side.
[0144] <About group information>
[0145] The combination information specifies the combination of points on the branch line belonging to each subdivided triangle. The combination information specifies the combination of points on the main line belonging to each subdivided triangle in order from the subdivided triangle on the first main line side, and the details will be described later.
[0146] For example, in the branch line pair of the reference branch line ml3 and the adjacent branch line ml2, the combination information first specifies the combination method of the branch line points as follows for the first subdividing triangle observed from the first main line. The first subdividing triangle observed from the first main line refers to the subdividing triangle with the identification number = 0 in the area. That is, the first one is set as the branch line point on ml3 and the first branch line point observed from the first main line. The second one is set as the branch line point on ml2 and the first branch line point observed from the first main line. The third one is set as the branch line point on ml3 and the second branch line point observed from the first main line.
[0147] In addition, the combination information specifies the combination method of the branch line points for the second subdividing triangle observed from the first main line as follows. The second subdividing triangle observed from the first main line refers to the subdividing triangle with the identification number = 1 in the area. That is, the first one is set as the branch line point on ml2 and the first branch line point observed from the first main line. The second one is set as the branch line point on ml3 and the second branch line point observed from the first main line. The third one is set as the branch line point on ml2 and the second branch line point observed from the first main line.
[0148] The combination information specifies the combination of the points on the branch line in such a way that the third subdividing triangle observed from the first main line becomes a triangle convex toward the base point AB side, similarly to the first subdividing triangle. The third subdividing triangle observed from the first main line refers to the subdividing triangle with the identification number = 2 in the region. That is, the first one is set as the point on the branch line on ml3 and the second point on the branch line is observed from the first main line. The second one is set as the point on the branch line on ml2 and the second point on the branch line is observed from the first main line. The third one is set as the point on the branch line on ml3 and the third point on the branch line is observed from the first main line. At this time, the point on the branch line designated as the first one is set as the point on the branch line adjacent to the point on the branch line designated as the first one in the first subdividing triangle in the direction along the branch line (i.e., the direction away from the first main line).
[0149] The combination information specifies the combination of the branch points in a manner such that the fourth subdividing triangle observed from the first main line becomes a triangle protruding to the opposite side of the base point AB, similarly to the second subdividing triangle. The fourth subdividing triangle observed from the first main line refers to the subdividing triangle with the identification number = 3 in the region. That is, the first one is set as the branch point on ml2 and the second branch point is observed from the first main line. The second one is set as the branch point on ml3 and the third branch point is observed from the first main line. The third one is set as the branch point on ml2 and the third branch point is observed from the first main line. At this time, the branch point designated as the first one is set as the branch point adjacent to the branch point designated as the first one in the second subdividing triangle in the direction along the branch line (i.e., the direction away from the first main line). The same applies to the following.
[0150] That is, the combination information such as Fig.14 The combination information may specify the combination of the points on the branch line for each branch line pair, as shown by the dotted line with an arrow in FIG. 1 . In other words, the combination information may specify the combination of the points on the branch line in a manner such that, for example, when the identification number in the area is an even number, the combination of the points on the branch line is a triangle protruding toward the base point AB (hereinafter also referred to as the first designation mode). In addition, when the identification number in the area is an odd number, the combination of the points on the branch line is specified in a manner such that, for example, the combination of the points on the branch line is a triangle protruding toward the opposite side of the base point AB (hereinafter also referred to as the second designation mode).
[0151] The points on the branch lines can be identified by the main division point identification number (i.e., maj_div_idx) and the sub-division point identification number (i.e., mai_div_idx) described later. As described later, the combination information identifies the subdivision triangle of the area between the branch line pair by the area identification number, and specifies the combination of the points on the branch lines belonging to the identified subdivision triangle based on the main division point identification number and the subdivision identification number. In addition, as described later, the combination information can also specify the combination of the points on the branch lines belonging to the subdivision triangle based on the displacement of the main division point identification number and the displacement of the subdivision point identification number.
[0152] In this embodiment, the computing device 20 generates combination information that specifies the combination of branch line points belonging to the finely divided triangles as described above. The computing device 20 calculates the coordinates of the vertices of the finely divided triangles for each branch line pair set for the first main line points, using the vertex coordinate group, the number of main divisions, and the combination information. The computing device 20 generates finely divided triangles in all basic triangles, in other words, in all first main line points, and ends the multi-segment division.
[0153] [1-2-3. Details of multi-segment division]
[0154] The details of multi-segment division will be specifically described.
[0155] (1) Mainline processing
[0156] based on Fig.15 The flowchart shown in the figure explains the main line processing performed in S21 of multi-segment division. In this processing, the array vertices[] after the above-mentioned pre-shaping is set as the input array to output the following array. The so-called output array refers to the generated array (that is, the values are stored in the elements of the array). The output array is also called the output array. The output array is the array prim_id[idx], the array maj_vert_num[idx], and the array csum_maj_vert_num[idx].
[0157] Here, the variable idx (hereinafter referred to as idx) is in the range of 0≦idx≦P-1. The total number of idx used in this process is equal to the total number of basic triangles defined by the vertex coordinates stored in the array vertices[] (hereinafter also referred to as the number of basic triangles P). In addition, for the purpose of distinction, the idx used in the main line processing is also referred to as idx_p.
[0158] <Description of each array>
[0159] The array prim_id[idx] is an array that stores the values of the identification numbers (hereinafter also referred to as basic IDs) for identifying each basic triangle among the basic triangles defined by the vertex coordinates stored in the array vertices[]. The array maj_vert_num[idx] is an array that stores the number of points on the first main line described above for the basic triangle specified by idx. In addition, in the following, similar to the description of multi-segment segmentation, there is also a case where only the elements of the array are recorded, such as prim_id.
[0160] Furthermore, the element vertices[] of the array is expressed as a floating point, the element prim_id[] of the array is expressed as an integer greater than or equal to 0, and the element maj_vert_num[] of the array is expressed as a positive integer.
[0161] <Processing>
[0162] First, in S200 , the computing device 20 stores 0 in idx.
[0163] Next, in S210, the computing device 20 sets the basic triangle number P. The computing device 20 stores the number of basic triangles defined by the vertex coordinates stored in the array vertices[] after the pre-shaping process is performed in the basic triangle number P. The basic triangle number P corresponds to the number of loops (i.e., the number of repetitions) of the process of S220 to S260 described later.
[0164] In S220 , the computing device 20 stores the value stored in idx in the array prim_id[idx]. For example, when idx=0, 0 is stored as the element prim_id[0] of the array, and 0 is set as the basic ID of the first basic triangle defined by the array vertices[].
[0165] Next, in S230 , the computing device 20 obtains the vertex coordinates of the basic triangle specified by the value stored in idx, that is, the computing device 20 obtains the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array.
[0166] In the next S240, the computing device 20 calculates the number of points on the first main line for the basic triangle specified by the value stored in idx. Fig.12 As shown, the vertices A at both ends of the first main line l0 are included. B , A R .
[0167] The computing device 20 calculates the number of points on the first main line based on equation (2), and stores the calculated value in the array maj_vert_num[idx].
[0168] [Formula 2]
[0169] [Formula 2]
[0170] maj_vert_num[idx] = ceil(length of the longest side of the triangle / division length)+1…(2)
[0171] The first term in formula (2) is equivalent to the above-mentioned number of main divisions. That is, the computing device 20 calculates the value obtained by dividing the length of the first main line by the division length d0, and sets the calculated value to the value rounded to the nearest integer above the calculated value, and calculates the value obtained by adding 1 to the rounded value as the number of points on the first main line. Since the rounded value is used, the interval between the points on the first main line is a length equivalent to the division length d0. The length equivalent to the division length d0 may not be a length strictly consistent with the division length d0, but may be a length within a specified range that only includes the division length d0. The division length d0 may also be pre-stored in a memory such as ROM23. The division length d0 is a value that can be appropriately set according to the application (for example, the accuracy required by computer graphics, etc.). According to formula (2), the number of points on the first main line is calculated to be an integer greater than 2.
[0172] The length of the first main line is calculated based on the vertex coordinates stored in the array elements vertices[3idx+1] and vertices[3idx+2]. For example, when the value stored in idx is 0, for the basic triangle with 0 stored in the array element prim_id[0] as the basic ID, the value indicating the number of points on the first main line is stored as the array element maj_vert_num[0].
[0173] Next, in S250 , the computing device 20 increments idx. That is, the computing device 20 stores in idx a value obtained by adding 1 to the value stored in idx.
[0174] In the next S260 , the computing device 20 determines whether the value stored in idx is greater than or equal to the basic triangle number P. Here, when the value stored in idx is greater than or equal to the basic triangle number P, the process proceeds to S270 .
[0175] On the other hand, when the value stored in idx is lower than the basic triangle number P, the computing device 20 moves to S220 and repeats the processes of S220 to S260 based on the value newly stored in idx.
[0176] In S270, the computing device 20 may calculate the total number of array elements maj_vert_num[idx] by varying idx by 1 within the range of 0≦idx≦P-1, and store the calculated total number in csum_maj_vert_num[idx]. The total number of array elements maj_vert_num[idx] is the sum of array elements maj_vert_num[0] to maj_vert_num[idx].
[0177] When P-1 is stored in idx, the element csum_maj_vert_num[P-1] of the array corresponds to the total number Q of points on the first main line included in all the P basic triangles (hereinafter also referred to as cumulative sum Q). Then, the calculation device 20 ends the main line processing at this point.
[0178] <Work>
[0179] use Fig. 20 , Fig.29 , an example of work being processed on the main line is described. Fig. 20 In the example of the basic triangle number P = 3, it is explained. When the number of loops processed on the main line is equal to the value stored in the basic triangle number P as described above, by repeating S220, the value is stored in the array prim_id[0] to prim_id[P-1] (for example, P = 2). Fig. 20 In the example, Fig.29 As shown, 0, 1, and 2 are stored as array elements prim_id[0] to prim_id[2], respectively, and basic IDs 0, 1, and 2 are set in order from the first triangle.
[0180] In addition, when it is set to be repeated through S240, for example, Fig. 20 As shown, when calculating the number of points on the first main line for each basic triangle, Fig.29 As shown, 4, 3, and 3 are stored as array elements maj_vert_num[0] to maj_vert_num[2], respectively.
[0181] In addition, by executing S270, Fig.29 As shown, as the elements of the array csum_maj_vert_num[0] to csum_maj_vert_num[2], 4, 7, and 10 are stored respectively. That is, the value 10 stored as the element of the array csum_maj_vert_num[P-1] (for example, P=3) is calculated as the total number Q of the points on the first main line of all the basic triangles (that is, the cumulative sum Q).
[0182] In addition, hereinafter, the array prim_id[], the array maj_vert_num[], and the array csum_maj_vert_num[] are also collectively referred to as triangle parameter arrays.
[0183] (2) Processing on branch lines
[0184] based on Fig.16The flowchart shown in FIG. 1 illustrates the branch line processing executed in S22 of the multi-segment division. In this processing, the array vertices[] and the above-mentioned triangle parameter array are set as input arrays, and the following array is set as output array.
[0185] The output arrays are array prim_lookup_idx[idx], array maj_div_idx[idx], array point_on_maj_line0[idx], array point_on_maj_line1[idx], array min_vert_num[idx], array prim_num_per_edge[idx], array csum_prim_num_per_edge[idx].
[0186] Here, the idx indicating the element of the array is in the range of 0≦idx≦Q-1. The total number of idx used in this process is equal to the total number of points Q on the first main line included in all basic triangles (i.e., the cumulative sum Q). In addition, for distinction, the idx used in the branch line processing is also recorded as idx_m below.
[0187] <Description of each array>
[0188] The array prim_lookup_idx[idx] is a so-called lookup table used to refer to the above-mentioned triangle parameter array when executing the branch line processing. In other words, the array prim_lookup_idx[idx] is the correspondence information used to establish a correspondence between a first main line point specified by idx (i.e., idx_m) and the basic ID (i.e., idx_p) of the basic triangle containing the first main line point.
[0189] The array maj_div_idx[idx] stores the main division point identification number for the first main line point specified by the value stored in idx (ie, idx_m).
[0190] The array point_on_maj_line0[idx] stores the position vector for the first main line point specified by the value stored in idx (i.e., idx_m). The array point_on_maj_line1[idx] stores the position vector of the second main line point corresponding to the first main line point specified by the value stored in idx (i.e., idx_m). The second main line point is a point at a position where the second main line is equally divided at the same division ratio as the division ratio that divides the first main line.
[0191] The array min_vert_num[idx] stores, for the first main line point specified by the value stored in idx (ie, idx_m), the number of branch line points on the branch line set for the first main line point.
[0192] The array prim_num_per_edge[idx] stores, for the first main line point specified by the value stored in idx (ie, idx_m), the number of finely divided triangles used to divide the region sandwiched by the branch line pair set for the first main line point using the branch line point.
[0193] In addition, the array element prim_lookup_idx[], the array element maj_div_idx[], the array element prim_num_per_edge[], and the array element csum_prim_num_per_edge[] are expressed as integers greater than 0. The array element min_vert_num[] is expressed as a positive integer. The array element point_on_maj_line0[] and the array element point_on_maj_line1[] are expressed as floating-point numbers.
[0194] <Processing>
[0195] First, in S300 , the arithmetic device 20 executes a prim_lookup_idx array generation process in order to generate an array prim_lookup_idx[idx].
[0196] In the prim_lookup_idx array generation process, such as Fig.17 As shown, first, in S400 , the computing device 20 obtains the cumulative sum Q.
[0197] Next, in S401 , the computing device 20 stores 0 in idx.
[0198] In the next S402 , the computing device 20 stores the array element maj_vert_num[idx] in the variable rep_num. In addition, the computing device 20 stores the difference between the array element csum_maj_vert_num[idx] and the array element maj_vert_num[idx] in the variable ofs_idx.
[0199] Next, in S403 , the computing device 20 determines whether the value stored in rep_num is greater than 0. The computing device 20 moves the process to S404 when the value stored in rep_num is greater than 0, and moves the process to S408 when the value stored in rep_num is less than 0.
[0200] In S404 , the computing device 20 stores 0 in the variable m.
[0201] Next, in S405 , the calculation device 20 stores the value stored in idx as the element prim_lookup_idx[ofs_idx+m] of the array specified by “ofs_idx+m”.
[0202] In the next S406, the computing device 20 increments the variable m. That is, the computing device 20 stores the value stored in the variable m plus 1 in the variable m.
[0203] Next, in S407, the computing device 20 determines whether the value stored in the variable m is equal to or greater than the value stored in rep_num. If the value stored in the variable m is equal to or greater than the value stored in rep_num, the process proceeds to S408.
[0204] On the other hand, when the value stored in the variable m is lower than the value stored in rep_num, the calculation device 20 moves to S405 and repeats the processing of S405 to S407 based on the value newly stored in the variable m.
[0205] In S408, the calculation device 20 increments idx. That is, the calculation device 20 stores the value stored in idx plus 1 in idx.
[0206] Next, in S409 , the calculation device 20 determines whether the value stored in idx is equal to or greater than the cumulative sum Q. Here, if the value stored in idx is equal to or greater than the cumulative sum Q, the prim_lookup_idx array generation process is terminated.
[0207] On the other hand, when the value stored in idx is lower than the cumulative sum Q, the computing device 20 moves to S402 and repeats the processing of S402 to S409 based on the value newly stored in idx. Then, when the value stored in idx is greater than the cumulative sum Q, the computing device 20 ends the prim_lookup_idx array generation processing.
[0208] Back to Fig.16 Continue with the description.
[0209] In S310 , the computing device 20 stores 0 in idx.
[0210] Next, in S320, the computing device 20 obtains the total number Q of points on the first main line (ie, the cumulative sum Q). The cumulative sum Q corresponds to the number of cycles (ie, the number of repetitions) of S350 to S380 described later.
[0211] First, in S330, the computing device 20 calculates a main dividing point identification number for the first main line point specified by the value stored in idx. The main dividing point identification number is a number assigned to each first main line in the basic triangle including the first main line point specified by idx. In the present embodiment, the main dividing point identification number is a number assigned to each first main line from the base point A which is a vertex of the basic triangle and connects the first main line and the second main line. B Starting from the base point A B The numbering starts from 0, from the base point A B Towards right vertex A B The calculation device 20 stores the calculated main division point identification number in the array maj_div_idx[idx]. The main division point identification number, ie, the element maj_div_idx[idx] of the array, is calculated based on equations (3) and (4).
[0212] [Formula 3]
[0213] lookup_idx=prim_lookup_id[idx]…(3)
[0214] maj_div_idx[idx]=idx-csum_maj_vert_num[lookup_idx]+maj_vert_num[lookup_idx]…(4)
[0215] The lookup_idx shown in the formula (3) corresponds to an index (ie, idx_p) for specifying a triangle parameter array to be referenced.
[0216] Next, in S340, the computing device 20 calculates the position vector for the first main line point specified by the value stored in idx, and stores it in the array point_on_maj_line0[idx]. In addition, the computing device 20 calculates the position vector for the second main line point corresponding to the first main line point specified by the value stored in idx, and stores it in the array point_on_maj_line1[idx]. The correspondence here refers to the position vector from the base point A to the second main line point corresponding to the first main line point specified by the value stored in idx. B The order of counting is the same.
[0217] The coordinates of the point on the first main line are calculated by dividing the first main line at the ratio of maj_div_idx[idx] / maj_vert_num[idx]. Similarly, the coordinates of the point on the second main line are calculated by dividing the second main line at the ratio of maj_div_idx[idx] / maj_vert_num[idx]. In addition, the point on the first main line specified by the value stored in idx is the base point A. BIn the case of , the coordinates of the point on the first main line are consistent with the coordinates of the point on the second main line corresponding to the coordinates.
[0218] First, the calculation device 20 calculates lookup_idx in the same manner as in the above-mentioned equation (3).
[0219] Next, the computing device 20 converts the base point A to B The coordinates of are stored in the variable org.
[0220] [Formula 4]
[0221] org=verices[3*lookup_idx+2]…(5)
[0222] Next, the calculation device 20 calculates the edge vector edge0 of the first main line which is the longest side and the edge vector edge1 of the second main line which is the second longest side based on equations (6) and (7).
[0223] [Formula 5]
[0224] edge0=vertices[3*lookup_idx+1]-vertices[3*lookup_idx+2]…(6)
[0225] edge1=vertices[3*lookup_idx+0]-vertices[3*lookup_idx+2]…(7)
[0226] Then, the computing device 20 calculates the base point A based on equation (8). B The coordinates of the points on the first main line are calculated based on the third main line as the shortest side (i.e., the vertices of the opposite side) and stored in the array point_on_maj_line0[idx]. Similarly, the computing device 20 calculates the coordinates of the points on the first main line based on equation (9) with the base point A B Calculate the coordinates of the points on the second main line for the reference and store them in the array point_on_maj_line1[idx].
[0227] [Formula 6]
[0228] point_on_maj_line0[idx]=org+((float)maj_div_idx / (float)(maj_vert_num-1))*edge0
[0229] …(8)
[0230] point_on_maj_line1[idx]=org+((float)maj_div_idx / (float)(maj_vert_num-1))*edge1
[0231] …(9)
[0232] In the next S350, the computing device 20 calculates the number of points on the branch line set for the first main line point specified by the value stored in idx. The computing device 20 stores the calculated number of points on the branch line in the array min_vert_num[idx]. The length of the branch line is calculated based on the array element point_on_maj_line0[idx] and the array element point_on_maj_line1[idx]. That is, the array element min_vert_num[idx] is calculated by the following formula (10) in the same way as the above-mentioned array maj_vert_num[idx].
[0233] [Formula 7]
[0234] [Formula 7]
[0235] min_vert_num[idx]=ceil((point_on_maj_line1[idx]-point_on_maj_line0[idx]) / division length)+1
[0236] …(10)
[0237] The first term in the formula (10) corresponds to the above-mentioned number of sub-divisions. In addition, the first main line point whose array element maj_dev_idx[idx] is 0 among the first main line points specified by the value stored in idx corresponds to the base point A. B . For base point A B , 1 is stored as the element min_vert_num[idx] of the array.
[0238] In the next S360, the computing device 20 calculates the number of finely divided triangles that divide the area between the branch line pair for each branch line pair set for the first main line point specified by the value stored in idx. The computing device 20 stores the calculated number in the array prim_num_per_edge[idx].
[0239] In addition, the reference branch line point referred to below refers to the branch line point on the reference branch line. The adjacent branch line point refers to the branch line point on the adjacent branch line. That is, the adjacent branch line point refers to the branch line (i.e., the reference branch line) set for the first main line specified by the value stored in idx at the base point A.B In the present embodiment, the branch line set for the first main line point with a larger maj_div_idx among the two branch lines forming a pair is set as the reference branch line.
[0240] In the area of the basic triangle between the reference branch and its paired adjacent branch, the number of vertices constituting the fine segmentation triangle is the sum of the points on the reference branch and the points on the adjacent branches. When 0 is stored in idx, the number of fine segmentation triangles in the area between the pair of segmentation branches is calculated based on formula (11). The calculated value is stored in the array prim_per_edge[idx].
[0241] [Formula 8]
[0242] if(idx==0){
[0243] prim_num_per_edge[idx]=0;
[0244] }
[0245] else{
[0246] prim_num_per_edge[idx]=min_vert_num[idx]+min_vert_num[idx-1]-2;
[0247] }…(11)
[0248] Next, in S370, the computing device 20 increments idx. That is, the computing device 20 adds 1 to the value stored in idx and stores it in idx.
[0249] In the next S380 , the calculation device 20 determines whether the value stored in idx is equal to or greater than the cumulative sum Q. Here, when it is determined that the value stored in idx is equal to or greater than the cumulative sum Q, the process proceeds to S390 .
[0250] On the other hand, when it is determined that the value stored in idx is lower than the cumulative sum Q, the calculation device 20 moves to S330 and repeats the processes of S330 to S380 based on the value newly stored in idx.
[0251] In S390, the computing device 20 may, for example, change idx by 1 in the range of 0≦idx≦Q-1 to calculate the total number of array elements prim_num_per_edge[idx], and store the calculated total number in the array csum_prim_num_per_edge[idx]. The total number of array elements prim_num_per_edge[idx] refers to the sum of array elements prim_num_per_edge[0] to prim_num_per_edge[idx].
[0252] The element csum_prim_num_per_edge[Q-1] of the array when idx stores Q-1 corresponds to the total number R of finely divided triangles (hereinafter also referred to as cumulative sum R) that divide the area between the branch line pairs set for all Q first main line upper points. In other words, the cumulative sum R is the total number of finely divided triangles included in all basic triangles (i.e., P). The computing device 20 ends the branch line processing at this point.
[0253] <Work>
[0254] use Figure 20 to Figure 22 , Fig.24 , Fig.29 , the operation of the branch line is explained. When the number of loops is set to the cumulative sum Q as described above, through S300, the values are stored in the elements prim_lookup_idx[0] to prim_lookup_idx[Q-1] of the array. For example, Fig.21 As shown in , when Q=10 and the first main line point is configured, Fig.24 , Fig.29 As shown, as the elements of the array prim_lookup_idx[0] to prim_lookup_idx[9], 0, 0, 0, 0, 1, 1, 1, 2, 2, 2 are stored respectively. That is, the index (that is, the basic ID) when referring to the triangle parameter array is stored for each of the first main line points.
[0255] In addition, by repeating S330, Fig.21 , Fig.29 As shown in FIG. 1 , as the elements of the array maj_div_idx[0] to maj_div_idx[9], 0, 1, 2, 3, 0, 1, 2, 0, 1, 2 are stored respectively. That is, for each basic triangle, the base point A is B If it is 0, the main division point identification numbers are set for the first main line points in sequence.
[0256] In addition, by repeating S340, Fig.29As shown, as the elements of the array point_on_maj_line0[0] to point_on_maj_line0[9], mv00, mv01, ..., mv09 are stored respectively. Similarly, as the elements of the array point_on_maj_line1[0] to point_on_maj_line1[9], mv10, mv11, ..., mv19 are stored respectively. Mv is a position vector.
[0257] In addition, by repeating S350, Fig.21 , Fig.29 As shown in FIG. 1 , as the elements of the array min_vert_num[0] to min_vert_num[9] (i.e., the number of points on the branch line), 1, 2, 3, 4, 1, 2, 3, 1, 2, 3 are stored respectively. In addition, by repeating S360, as shown in FIG. Fig. 22 , Fig.29 As shown, the elements of the array prim_num_per_edge[0] to prim_num_per_edge[9] store 0, 1, 3, 5, 0, 1, 3, 0, 1, 3, respectively.
[0258] For example, in Fig.21 In the basic triangle specified by prim_id=0, the first main line point specified by idx=3 is the right vertex A. R In this case, if Fig. 22 As shown, the number of fine segmentation triangles in the area sandwiched by the segmentation branch line pair is 5, as shown in Fig.29 As shown, 5 is stored in prim_num_per_edge[3]. In this branch line pair, the reference branch line is a branch line set for the first main line point specified by idx=3, and the adjacent branch line is a branch line set for the first main line point specified by idx=2.
[0259] In addition, by executing S390, Fig. 22 , Fig.29 As shown, the array elements csum_prim_num_per_edge[0] to csum_prim_num_per_edge[9] store 0, 1, 4, 9, 9, 10, 13, 13, 14, and 17, respectively.
[0260] exist Figure 20 to Figure 22 In the example, the value stored as the element csum_maj_vert_num[9] of the array, i.e., 17, corresponds to the total number of finely divided triangles (i.e., cumulative sum R) that divide the area between the branch line pairs set for the 9 (i.e., Q=9) first main line points. In other words, 17 corresponds to Figure 20 to Figure 22The total number R of finely divided triangles contained in all three (ie, P=3) basic triangles shown.
[0261] In addition, below, the array prim_lookup_idx[idx], the array maj_div_idx[idx], the array point_on_maj_line0[idx], the array point_on_maj_line1[idx], the array min_vert_num[idx], the array prim_num_per_edge[idx], and the array csum_prim_num_per_edge[idx] are collectively referred to as the main line parameter array.
[0262] (3) Fine segmentation processing
[0263] based on Fig.18 The flowchart shown in FIG. 1 illustrates the fine segmentation process performed in S23 of the multi-segment segmentation. In this process, the above-mentioned main line parameter array is set as an input array, and the following arrays are set as output arrays. The output arrays are the array maj_line_lookup_idx[idx] and the array tess_vert[idx].
[0264] Here, the idx indicating the element of the array is in the range of 0≦idx≦R-1. The total number of idx used in this process is equal to the total number R of subdivided triangles included in all basic triangles (i.e., cumulative sum R). In addition, for distinction, the idx used in the subdividing process is also described as idx_sub below.
[0265] <Description of each array>
[0266] The array maj_line_lookup_idx[idx] is a lookup table used to refer to the main line parameter array in the execution of the subdivision process. In other words, the array maj_line_lookup_idx[idx] is the correspondence information for establishing a correspondence between a subdivision triangle specified by idx (i.e., idx_sub) and the number of the first main line point (i.e., idx_m) that identifies and sets the branch line pair containing the subdivision triangle.
[0267] The array tess_vert[idx] stores the vertex coordinates for the subdivided triangle specified by the value stored in idx (i.e., idx_sub). The elements of the array tess_vert[3idx], tess_vert[3idx+1], and tess_vert[3idx+2] respectively represent the three vertex coordinates in a subdivided triangle. In addition, similar to the above-mentioned array vertices[], the array tess_vert[idx] can also be recorded as tess_vert[idy][idx]. Idy is in the range of 0≦idy≦2. That is, tess_vert[0][idx] stores the vertex coordinates specified as the first for the subdivided triangle specified by the value stored in idx. Similarly, tess_vert[1][idx] stores the vertex coordinates specified as the second for the subdivided triangle specified by the value stored in idx, and tess_vert[2][idx] stores the vertex coordinates specified as the third for the subdivided triangle specified by the value stored in idx.
[0268] Furthermore, the array element maj_line_lookup_idx[idx] is expressed as an integer greater than or equal to 0, and the array element tess_vert[idx] is expressed as a floating point number.
[0269] <Processing>
[0270] like Fig.18 As shown, first, in S500, the computing device 20 executes a maj_line_lookup_idx array generation process to generate an array maj_line_lookup_idx[idx]. In the maj_line_lookup_idx array generation process, as shown in FIG. Fig.19 As shown, S410, S412, S415, S419 and Fig.17 The prim_lookup_idx array generation process shown in the figure is different, but the other contents are the same, so the description is omitted here. That is, the cumulative sum R is used instead of the cumulative sum Q in the prim_lookup_idx array generation process, and the array maj_vert_num[] is used instead of the prim_num_per_edge[]. In addition, the array csum_prim_num_per_edge[] is used instead of the array csum_maj_vert_num[]. Thus, the array maj_line_lookup_idx[idx] is output. Return to Fig.18 Continue with the description.
[0271] In S505 , the computing device 20 stores 0 in idx.
[0272] Next, in S510 , the computing device 20 obtains the total number R of finely divided triangles (ie, the cumulative sum R). The cumulative sum R corresponds to the number of loops (ie, the number of repetitions) of S515 to S570 .
[0273] In S515 to S570 , the computing device 20 calculates vertex coordinates for the subdivided triangle specified by the value stored in idx, and stores the calculated vertex coordinates in tess_vert[idy][idx].
[0274] First, in S515 , the computing device 20 stores the value of the index (ie, idx_m) used to refer to the main line parameter array in the variable lookup_idx, as shown in equation (12).
[0275] [Formula 9]
[0276] lookup_idx=maj_line_lookup_idx[idx]…(12)
[0277] This allows the main line parameters associated with the subdivided triangle specified by the value stored in idx (ie, idx_sub) to be specified. That is, the main line parameters already stored in the memory can be referenced without re-reading the main line parameter array.
[0278] In the next S520, the computing device 20 calculates the number of the triangle in the subdividing triangle that indicates the subdividing triangle specified by the value stored in idx (i.e., idx_sub) is the triangle number observed from the first main line, which indicates the subdividing triangle in the area sandwiched by the pair of dividing branches of the subdividing triangle. That is, the above-mentioned intra-area identification number is calculated. The computing device 20 stores the calculated intra-area identification number in the array tess_prim_id[idx].
[0279] [Formula 10]
[0280] tess_prim_idx=idx-csum_prim_num_per_edge[lookup_idx]+prim_num_per_edge[lookup_idx]
[0281] …(13)
[0282] In S525 and S530, the computing device 20 generates combination information. As described above, the combination information is information that specifies the combination of points on the branch lines belonging to the determined fine segmentation triangles by the intra-region identification number, and specifies the combination of points on the branch lines based on the main segmentation point identification number and the secondary segmentation identification number. In the present embodiment, as described above, the combination information specifies the combination to become the first specified mode when the intra-region identification number is an even number, and specifies the combination to become the second specified mode when the intra-region identification number is an odd number. The first specified mode is a mode that specifies the combination of points on the branch lines in a manner that becomes a triangle convex to the base point AB side, and the second specified mode is a mode that specifies the combination of points on the branch lines in a manner that becomes a triangle convex to the opposite side of the base point AB. The even number referred to here includes 0.
[0283] In this embodiment, the combination information specifies the combination method of the points on the branch lines belonging to the fine dividing triangle based on the shift amount of the main dividing point identification number and the shift amount of the sub-dividing point identification number.
[0284] First, in S525, the displacement of the main division point identification number is calculated. Here, when only the main division point identification number (ie, maj_div_idx) is considered, in the first designation mode, as Fig.26 As shown in the figure, the combination of branch line points is represented as maj_div_idx[idx]→maj_div_idx[idx-1]→maj_div_idx[idx], with the main division point number of the first main line point of the branch line pair being set as maj_div_idx[idx]. Here, when maj_div_idx[idx], which is the main division point number of the first main line point of the branch line pair, is used as a reference, the combination of branch line points is represented by the displacement of the main division point identification number, such as 0→-1→0. On the other hand, in the second designation mode, when maj_div_idx[idx], which is the main division point number of the first main line point of the branch line pair, is used as a reference, the combination of branch line points is represented by the displacement of the main division point identification number, such as -1→0→-1.
[0285] Therefore, in this step, the computing device 20 calculates the value stored in the variable maj_div_ofset for the subdivided triangle specified by the value stored in idx based on equation (14). The value stored in the variable maj_div_ofset indicates the displacement of the main division point identification number.
[0286] [Formula 11]
[0287] maj_div_offset=
[0288] {-mod(tess_prim_id[idx],2),
[0289] -mod(tess_prim_id[idx]+1,2),
[0290] -mod(tess_prim_id[idx],2)}…(14)
[0291] Therefore, if Fig. 27 As shown, when tess_prim_idx[idx] is an even number, (0, -1, 0) is calculated as the shift amount of the main division point identification number. When tess_prim_idx[idx] is an odd number, (-1, 0, -1) is calculated as the shift amount of the main division point identification number.
[0292] Next, in S530, the displacement of the secondary division point identification number is calculated. Here, only the secondary division point identification number (ie, mai_div_idx) is considered. In the first designation mode, Fig.26 As shown, the combination of points on the branch line is represented as 0→0→1 (for example, a finely divided triangle with identification number = 0 in the area), 1→1→2 (for example, a finely divided triangle with identification number = 2 in the area), and 2→2→3 (for example, a finely divided triangle with identification number = 4 in the area). On the other hand, in the second specified mode, the combination of points on the branch line is represented as 0→1→1 (for example, a finely divided triangle with identification number = 1 in the area), and 1→2→2 (for example, a finely divided triangle with identification number = 3 in the area).
[0293] Here, the sub-division identification number (hereinafter also referred to as the reference sub-division identification number) of the branch line point designated as the second one in each combination is used as the reference. In the first designation mode, for example, for the combination of the branch line points, the displacement of the sub-division point identification number relative to the reference sub-division identification number is expressed as 0→0→+1 (for example, the reference sub-division identification number=0) for the sub-division triangle with the region identification number=0. Similarly, for the sub-division triangle with the region identification number=2, the displacement of the sub-division point identification number relative to the reference sub-division identification number is expressed as 0→0→+1 (for example, the reference sub-division identification number=1). On the other hand, in the second designation mode, for the combination of the branch line points, the displacement of the sub-division point identification number relative to the reference sub-division identification number is expressed as -1→0→0 (for example, the reference sub-division identification number=1) for the sub-division triangle with the region identification number=1. Similarly, for the subdivision triangle with the in-region identification number = 3, the displacement of the sub-division point identification number with respect to the reference sub-division identification number is expressed as -1→0→0 (for example, reference sub-division identification number = 2).
[0294] Therefore, in this step, the computing device 20 calculates the value stored in the variable mai_div_ofset for the fine division triangle specified by the value stored in idx based on equation (15). The value stored in the variable mai_div_ofset indicates the displacement amount of the sub-division point identification number.
[0295] [Formula 12]
[0296] min_div_offset=
[0297] {-mod(tess_prim_id[idx],2),
[0298] 0,
[0299] mod(tess_prim_id[idx]+1,2)}…(15)
[0300] Therefore, if Fig.28 As shown, when tess_prim_idx[idx], which is the region identification number, is an even number, (0, 0, 1) is calculated as the shift amount of the sub-division point identification number. When tess_prim_idx[idx] is an odd number, (-1, 0, 0) is calculated as the shift amount of the sub-division point identification number.
[0301] Next, in S535-S560, for the finely divided triangles specified by the value stored in idx, the combination of the points on the branch line is stored in the array tess_vert[idy][idx] in order. When specifying the combination of points on the branch line, the main division point identification number and the secondary division point identification number are used. In this embodiment, the main division point identification number and the secondary division point identification number of the combination of points on the branch line are determined based on the displacement of the main division point identification number and the displacement of the secondary division point identification number.
[0302] First, in S535 , the computing device 20 stores 0 in the variable idy.
[0303] Next, in S540, the computing device 20 calculates the coordinates of the two end points of the branch line including the point specified by the value stored in idy among the branch line points of the finely divided triangle specified by the value stored in idx. The branch line point specified by the value stored in idy is the branch line point specified as the idy+1th in the combination method based on the combination information. The two end points are the first main line point and the second main line point.
[0304] The computing device 20 stores the position vector (i.e., coordinates) of the first main line point as one of the two end points in the variable point_0 based on equation (16). In addition, the computing device 20 stores the position vector (i.e., coordinates) of the second main line point as the other of the two end points in the variable point_1 based on equation (17).
[0305] [Formula 13]
[0306] point_0=point_on_maj_line0[lookup_idx+maj_div_offset[idy]]…(16)
[0307] point_1=point_on_maj_line1[lookup_idx+maj_div_offset[idy]](17)
[0308] In the next S545, first, the computing device 20 calculates the sub-division identification number for the upper point of the branch line specified by the value stored in idy in the fine segmentation triangle specified by the value stored in idx based on formula (18). The sub-division identification number is calculated based on the base sub-division identification number and the displacement of the sub-division identification number calculated in S530. The computing device 20 stores the calculated sub-division identification number in the variable min_div_idx. floor((tess_prim_id[idx]+1) / 2) in formula (18) represents the sub-division identification number. Then, the computing device 20 uses the calculated sub-division identification number to calculate the internal division ratio based on formula (19) and stores it in the variable div_ratio.
[0309] [Formula 14]
[0310] min_div_idx=floor((tess_prim_id[idx]+1) / 2)+min_div_offset[idy]…(18)
[0311] div_ratio=min_div_idx / min_vert_num[lookup_idx+maj_div_offset[idy]]…(19)
[0312] The internal division ratio indicates a division ratio of the branch line point specified by the value stored in idy among the branch line points belonging to the finely divided triangle specified by the value stored in idx into a branch line including the point.
[0313] Next, in S550 , the computing device 20 stores the coordinates calculated based on equation (20) in the array tess_vert[idy][idx].
[0314] [Formula 15]
[0315] tess_vert[idy][idx]=point_0+div_ratio*(point_1-point_0)…(20)
[0316] In the next S555, the calculation device 20 increments idy. That is, the calculation device 20 stores the value stored in idy plus 1 in idy.
[0317] Next, in S560, the computing device 20 determines whether the value stored in idy is greater than 3. Here, the computing device 20 moves the process to S565 when it is determined to be greater than 3. On the other hand, when it is determined to be less than 3, the computing device 20 moves to S540 and repeats the processes of S540 to S560 until idy is greater than 3.
[0318] In S565, the computing device 20 increments idx. That is, the computing device 20 stores a value obtained by adding 1 to the value stored in idx in idx.
[0319] In S570, the computing device 20 determines whether the value stored in idx is greater than or equal to R. If the computing device 20 determines that the value is less than R, the processing proceeds to S515 and the processing of S515 to S570 is repeated. On the other hand, if the computing device 20 determines that the value is greater than or equal to R, the subdivision processing ends.
[0320] <Work>
[0321] use Figure 20 to Figure 23 , Fig.25 , Fig.29 , the work of fine segmentation processing is explained.
[0322] As described above, when the number of loops is the cumulative sum R, the elements of the array maj_line_lookup_idx[0] to maj_line_lookup_idx[R-1] are stored by repeating S515. Fig. 22 As shown in , it is assumed that each branch line point is configured as Q = 10. Fig.29 As shown, as array elements maj_line_lookup_idx[0] to maj_line_lookup_idx[Q-1], 1, 2, 2, 2, 3, 3, 3, 3, 3, 5, ... are stored respectively. That is, the index (i.e., idx_m) when referring to the main line parameter array is set for each subdivided triangle specified by the value stored in idx.
[0323] The following, Figure 20 to Figure 23 The operation of the case where idx=9 (i.e., idx_sub=9) in the example shown will be described. Fig. 22 As shown, the finely divided triangle specified by idx=9 is included in the basic triangle specified by prim_id=1.
[0324] In S515, for the finely divided triangle specified by idx=9, maj_line_lookup_idx[9]=5 is set as lookup_idx. Fig.29 As shown by the arrow, the main line parameter array can be referenced. For example, the main division point identification number (maj_div_idx) for the first main line point on the branch line pair including the fine division triangle specified by idx=9 is determined to be 1. That is, maj_div_idx[lookup_idx]=1 (for example, lookup_idx=5).
[0325] In S520 , for the finely divided triangle specified by idx=9, the intra-region identification number (ie, tess_prim_id[9]) is calculated as 9−10+1=0 based on equation (13).
[0326] In S525 , maj_div_offset is calculated as (0, −1, 0) based on equation (14), and in S530 , mai_div_offset is calculated as (0, 0, 1) based on equation (15).
[0327] In S535 to S560, when idy=0, the two end points of the reference branch line (i.e., the branch line set for the first main line point with maj_div_idx=1) in the branch line pair are determined in S540. In S545, the sub-division identification number is calculated as 0 based on equation (18), and the internal division ratio is calculated as 0. In S550, based on the internal division ratio, the coordinates of the first main line point, which is one of the two end points of the reference branch line, are determined as the first branch line point belonging to the fine division triangle.
[0328] Similarly, when idy=1, the two endpoints (i.e., the base point A in this example) of the adjacent branch line in the branch line pair (i.e., the branch line set for the first main line point at maj_div_idx=0) are determined in S540. B ). In S545, the sub-division identification number is calculated as 0 based on equation (18), and the internal division ratio is calculated as 0. In S550, based on the internal division ratio, the coordinates of the first main line point (i.e., the base point A in this example) which is one of the two end points of the adjacent branch line are calculated. B ) is determined to be the second branch point belonging to the finely divided triangle.
[0329] Similarly, when idy=2, the two end points of the reference branch line in the branch line pair (i.e., the branch line set for the first main line point with maj_div_idx=1) are determined in S540. The sub-division identification number is calculated as 1 based on equation (18) in S545, and the internal division ratio is calculated as 1 / 1=1. In S550, based on the internal division ratio, the coordinates of the second main line point, which is the other of the two end points of the reference branch line, are determined as the third branch line point belonging to the fine division triangle.
[0330] Thus, for the subdivided triangle specified by idx=9, the combination of points on the branch lines belonging to the subdivided triangle (i.e., the first specified mode) is determined. Then, the position vectors (i.e., coordinates) determined in the order of the combination are stored in the array tess_vert[idy][idx].
[0331] The arithmetic device 20 executes the same processing for the subdivided triangles specified by idx=0 to R-1. As a result, an array tess_vert[idy][idx] including the vertex coordinates of a total of R subdivided triangles is obtained.
[0332] In this way, according to a simple rule using the displacement amount as the combination information, the area sandwiched by the branch line pair is divided without overlapping each other, and finely divided triangles are generated by connecting points on the branch lines that are close to each other.
[0333] [1-3. Effect]
[0334] According to the first embodiment described in detail above, the following effects are achieved.
[0335] (1a) In S2, the computing device 20 performs pre-shaping (i.e., S11). In the pre-shaping, the computing device 20 determines in S120 whether each basic triangle defined by the polygon vertex coordinate data (i.e., the array vertices[]) is an object triangle. In S150, the computing device 20 shapes the basic triangle determined not to be an object triangle (i.e., the basic triangle determined to be a non-object triangle) into a shape with a relatively large consistency with an equilateral triangle. That is, the basic triangle determined not to be an object triangle is divided into a plurality of triangles so as to become a shape with a relatively large consistency with an equilateral triangle.
[0336] In S155, the computing device 20 generates a new array vertices[] including the vertex coordinates of the divided triangles. In S2, the computing device 20 calculates the coordinates of the vertices of a plurality of fine divided triangles that divide the area of the basic triangle into smaller areas than the basic triangle for each of the basic triangles defined by the coordinates of each vertex included in the new vertex coordinate group generated by S155 in the multi-segment division after pre-shaping (i.e., S12).
[0337] In such a computing device 20, the basic triangle defined by the coordinates of each vertex included in the new array vertices[] generated in S155 has a shape that is relatively consistent with the regular triangle by executing S150. The computing device 20 calculates the coordinates of the vertices of a plurality of subdivided triangles for such a basic triangle, and thus can obtain subdivided triangles that are relatively consistent with the regular triangle, compared with the case where the basic triangle is divided into subdivided triangles without executing S150. As a result, it is possible to suppress the new subdivided triangles generated by dividing the basic triangle from deviating from the regular triangle.
[0338] (1b) Specifically, the computing device 20 determines whether the maximum value of the internal angle of each basic triangle is less than the allowed angle, and when the maximum value of the internal angle is less than the allowed angle, the computing device 20 determines that the basic triangle is a target triangle. In addition, when the maximum value of the internal angle is greater than the allowed angle, the computing device 20 determines that the basic triangle is not a target triangle (that is, a non-target triangle). The computing device 20 can use the maximum value of the internal angle to simply determine whether the basic triangle is a target triangle through a formula.
[0339] (1c) When the computing device 20 determines that the basic triangle is not the target triangle, the basic triangle is divided into two by a bisector that bisects the internal angle having the maximum value in the basic triangle. Thus, for example, when the triangle before division is a shape that is relatively not close to an equilateral triangle, such as when the maximum internal angle is greater than 120°, the triangle is divided into two to bisect the maximum internal angle. Compared with the case where the triangle is divided by repeatedly bisecting an arbitrary internal angle (for example, the minimum internal angle), the computing device 20 can make the divided triangle have a shape that is relatively consistent with an equilateral triangle.
[0340] (1d) For example, the allowable angle is 120°. Thus, the computing device 20 can make the maximum interior angle of the divided triangles 60°≦maximum interior angle<90°, and can make the divided triangles close to a shape with a relatively high degree of consistency with an equilateral triangle.
[0341] (1e) In S2, the computing device 20 performs multi-segment division (i.e., S12). In the multi-segment division, the computing device 20 sets the main division number as the number of divisions when dividing the first main line into a plurality of basic triangles in S21. The first main line is divided equally based on the division length d0. In S22, the computing device 20 sets the sub-division number when dividing the set branch line equally for each of the plurality of first main line points set on the first main line. The branch lines are divided equally based on the same division length d0 as when dividing the first main line points.
[0342] In S23, the computing device 20 uses the array vertices[], maj_vert_num, and the combination information to calculate the coordinates of the vertices of the finely divided triangle for each branch line pair set for the first main line point. The combination information is information that specifies the combination of the branch line points belonging to each finely divided triangle for each branch line pair set for the main line point. The so-called finely divided triangle refers to one or more triangles that divide the area of the basic triangle sandwiched by the branch line pair without duplication, with the branch line points on the two branches belonging to the branch line pair as vertices for each branch line pair.
[0343] Such a computing device 20 can make the intervals between the points on the first main line and the points on the branch line approximately the same intervals by performing segmentation based on the segmentation length d0. That is, the sides along two of the three sides in the finely segmented triangle can be made to be almost the same length. The two sides refer to the side along the first main line at the points on the set first main line, and the branch line at the points on the set branch line. Therefore, the basic triangle can be segmented into finely segmented triangles having a shape that is relatively consistent with the equilateral triangle. As a result, it is possible to suppress the new finely segmented triangles generated by segmenting the basic triangle from deviating from the equilateral triangle. In addition, in the present embodiment, in the case where the basic triangle has a shape that is relatively consistent with the equilateral triangle, a greater effect can be obtained.
[0344] (1f) The computing device 20 sets the opposite side of the internal angle with the largest angle as the first main line, the opposite side of the internal angle with the angle next to the largest angle as the second main line, and the opposite side of the internal angle with the smallest angle as the third main line in the basic triangle. That is, the second main line has a length that is relatively closer to the first main line than the third main line. By dividing the second main line with the same division ratio as the first main line, the interval between the points on the second main line can be relatively close to the interval between the points on the first main line (that is, the division length d0).
[0345] Such a calculation device 20 can make the side along the second main line of the three sides of the subdivided triangle relatively close to the division length d0. As a result, the subdivided triangle can be made closer to a shape with a relatively high degree of consistency with an equilateral triangle.
[0346] (1g) When specifying a branch line point belonging to a finely divided triangle, the combination information specifies the branch line point as follows for each branch line pair set for the first main line point. The combination information specifies the branch line point on the branch line set for the first main line point (i.e., the reference branch line point) and the branch line point adjacent to the reference branch line point (i.e., the adjacent branch line point) in sequence along the branch line.
[0347] In order along the branch line means in the order in which the branch line points are arranged on the branch line. Alternating means that after specifying a reference branch line point, an adjacent branch line point is specified, and after specifying an adjacent branch line point, a reference branch line point is specified.
[0348] The computing device 20 can specify a point on a branch line belonging to a subdivided triangle including two sides corresponding to the dividing length d0 by alternately moving two branches in the branch line pair and specifying a point on the branch line belonging to the triangle. The two sides corresponding to the dividing length d0 refer to a side parallel to the first main line and a side included in the branch line in the subdivided triangle of the area sandwiched by the branch line pair. As a result, the basic triangle can be divided into a plurality of subdivided triangles having shapes with a relatively large degree of consistency with the regular triangle.
[0349] (1) In addition, in the above (1g), specifically, the combination information may include at least one of the first designation mode and the second designation mode when specifying the branch point belonging to the fine splitting triangle. The first designation mode specifies the branch point belonging to the fine splitting triangle in the order of the base branch point, the adjacent branch point, and the adjacent other base branch points. That is, the branch points that are closest to each other and belong to the triangle are specified. The second designation mode specifies the branch point belonging to the fine splitting triangle in the order of the adjacent branch point, the base branch point, and the adjacent other adjacent branch points. That is, similar to the first designation mode, the branch points that are closest to each other are specified.
[0350] The calculation device 20 can obtain a shape that is relatively consistent with an equilateral triangle for the subdivided triangle that protrudes toward the base point AB in the first designation mode and the subdivided triangle that protrudes toward the opposite side of the base point AB in the second designation mode.
[0351] (2) In (1g) (1) above, the combination information may alternately designate the first designation mode and the second designation mode when there are a plurality of fine division triangles for dividing the area between the branch line pair. The computing device 20 repeats the division of the fine division triangles in the first designation mode and the second designation mode based on the combination information, thereby enabling the area of the basic triangle between the branch line pair to be divided without duplication.
[0352] (1h) In any of (1g) and (1g) (1) and (2) above, in S330, the computing device 20 sets a main division point identification number (i.e., maj_div_idx) to the first main line upper point. In S545, the computing device 20 sets a secondary division point identification number (i.e., mai_div_idx) to the branch line upper point. For example, the secondary division point identification numbers are set in order from the first main line side. Each of the branch line points is identified by the main division point identification number and the secondary division point identification number. The combination information specifies the combination method of the branch line points of the fine division triangles belonging to the area of the basic triangle sandwiched by the branch line pair based on the main division point identification number and the secondary division point identification number.
[0353] The computing device 20 can use the combination information to uniquely identify the combination of points on the branch lines that belong to the finely divided triangle.
[0354] (1) In the above (1h), in the computing device 20, the combination information may specify a combination of points on the branch lines belonging to the subdividing triangle based on the displacement amount of the main dividing point identification number and the displacement amount of the subdividing point identification number.
[0355] The combined information can be made simple information having regularity based on the displacement amount, so the amount of the combined information can be reduced. As a result, when the computing device 20 generates the combined information, generation becomes easy, and when the computing device 20 stores the combined information in advance, its storage capacity can be reduced.
[0356] (2) In (1) of (1h) above, in the computing device 20, the displacement amount of the main division point identification number may be expressed as the displacement amount relative to the main division point identification number of the branch line point set for the first main line point. The displacement amount of the sub-division identification number may be expressed as the displacement amount relative to the sub-division point identification number of the branch line point designated as the second when designating the branch line point belonging to the subdivision triangle. The computing device 20 can generate the subdivision triangles such as the first designated pattern and the second designated pattern described above by the same method for each first main line point using the combination information based on the displacement amount. In addition, when the computing device 20 is a device capable of parallel processing, the same parallel processing can be performed for each first main line point.
[0357] (3) As described above, the combination information may be generated by the computing device 20. Since it is not necessary to store a table indicating the combination information in advance in a storage device or the like, the storage capacity in the computing device 20 can be reduced.
[0358] <Correspondence of terms>
[0359] The computing device 20 is equivalent to a triangle generating device. The array vertices[] is equivalent to a vertex coordinate group. The value of the first term in formula (2) is equivalent to the number of primary divisions, and the value of the first term in formula (10) is equivalent to the number of secondary divisions. The first main line is equivalent to the first side, the second main line is equivalent to the second side, and the third main line is equivalent to the third side. The upper point of the first main line is equivalent to the primary division point, and the upper point of the branch line is equivalent to the secondary division point. maj_div_idx is equivalent to the primary division point identification number, and min_div_idx is equivalent to the secondary division point identification number. maj_div_offset is equivalent to the displacement of the primary division point identification number, and min_div_offset is equivalent to the displacement of the secondary division point identification number.
[0360] S1 is equivalent to the processing as the acquisition unit, S2 is equivalent to the processing as the triangle division unit. S120 is equivalent to the processing as the object determination unit, S150 is equivalent to the processing as the pre-shaping execution unit, and S155 is equivalent to the processing as the addition unit. S21 and S240 are equivalent to the processing as the main division number setting unit, S22 and S350 are equivalent to the processing as the secondary division number setting unit, and S23 is equivalent to the processing as the execution unit. S330 is equivalent to the processing as the main recognition setting unit, and S545 is equivalent to the processing as the secondary recognition setting unit.
[0361] [2. Second Embodiment]
[0362] [2-1. Structure]
[0363] The second embodiment of the present disclosure is described below. Figure 1 In the second embodiment, the parts different from the first embodiment are described. The same reference numerals are used for the common structures.
[0364] The computing device 20 of the second embodiment is different from the first embodiment in that it includes a GPU 22 and executes various processes in parallel using the GPU 22. For example, the GPU 22 of the computing device 20 may execute the pre-shaping in S11 and the multi-segment division in S12.
[0365] For example, in the pre-shaping performed in S11 , the GPU 22 performs in parallel, by parallel processing, the processing to be repeatedly performed for each basic triangle specified by the value stored in idx.
[0366] Specifically, due to Figure 4 S105 to S130 shown are repeated processing for each idx, so GPU22 can also set threads for each idx in S105 to S130, and execute the processing of S105 to S120 in parallel in each thread. In addition, since S140 to S165 are repeated processing for each idx, GPU22 can also set threads for each idx in S140 to S165, and execute the processing of S140 to S155 in parallel in each thread. In addition, since S170 to S185 are repeated processing for each idx, GPU22 can also set threads for each idx in S170 to S185, and execute the processing of S170 to S175 in parallel in each thread.
[0367] In addition, for example, GPU22 can also perform processing repeatedly performed for each basic triangle specified by the value stored in idx, or processing repeatedly performed for each first main line point specified by the value stored in idx in parallel in the multi-segment division performed in S12.
[0368] Specifically, due to Fig.15 S200 to S260 shown in the figure are repeated processes for each idx, so GPU22 can also set threads for each idx in S200 to S260 and execute the processes of S200 to S240 in parallel in each thread. Fig.16 S300 to S380 shown in the figure are repeated processes for each idx, so GPU22 can also set threads for each idx in S300 to S380 and execute the processes of S300 to S360 in parallel in each thread. Fig.18 S500 to S570 shown are repeated processes for each idx, so the GPU 22 may set a thread for each idx in S500 to S570 and execute the processes of S500 to S560 in parallel in each thread.
[0369] [2-2. Effect]
[0370] (2a) Such a computing device 20 rearranges the vertex coordinates of each basic triangle in descending order in parallel during pre-shaping and determines whether it is a target triangle, thereby increasing the processing speed of pre-shaping and, in turn, the processing speed of triangle segmentation.
[0371] In addition, such a computing device 20 sets the first main line point in parallel for each basic triangle in the multi-segment segmentation, thereby increasing the processing speed of the multi-segment segmentation, and further increasing the processing speed of the triangle segmentation. In addition, such a computing device 20 calculates the coordinates of the vertices of the finely divided triangles in parallel for each first main line point in the multi-segment segmentation, thereby increasing the processing speed of the multi-segment segmentation, and further increasing the processing speed of the triangle segmentation.
[0372] In the second embodiment, the GPU 22 corresponds to the triangle processing device. In addition, the above-mentioned parallel processing may be performed by the CPU 21 capable of performing parallel processing instead of the GPU 22. In this case, the CPU 21 capable of performing parallel processing corresponds to the triangle generating device.
[0373] [2. Third embodiment]
[0374] [3-1. Structure]
[0375] The third embodiment of the present disclosure is described below. Figure 1 In the third embodiment, the parts different from the second embodiment are described. The same reference numerals are used for the common structures.
[0376] In the second embodiment described above, for example, in the process of calculating the cumulative sum such as S135, S270, and S390, a method is shown in which parallel processing by the GPU 22 is not performed. However, the GPU 22 may also perform parallel processing in the process of calculating the cumulative sum by, for example, performing the cumulative sum parallel processing described later.
[0377] [3-2. Processing]
[0378] based on Fig.30 The flowchart shown illustrates the accumulation and parallel processing.
[0379] <Array description>
[0380] In this process, the array input[idx] is set as the input array. The array input[idx] is an array that stores the values for which the cumulative sum is to be calculated.
[0381] When the accumulation and parallel processing is completed, the accumulation sum of the array input[idx] is stored in the array input[idx]. For example, when S accumulation sums are calculated for the arrays input[0] to input[S-1], when the accumulation and parallel processing is completed, the element input[0] of the array specified by idx=0 is stored in the array input[0]. The sum of the element input[0] of the array specified by idx=0 and the element input[1] of the array specified by idx=1 is stored in the array input[1]. Then, the sum of the elements input[0] of the array to the elements input[S-1] of the array is stored in the array input[S-1].
[0382] <Processing>
[0383] First, in S600 , GPU 22 obtains an array input[idx] whose number of elements is S. The range of idx is 0≦idx≦S−1.
[0384] Next, in S610 , GPU 22 stores 1 in the variable stride.
[0385] In the next S620 , GPU 22 stores 0 in idx.
[0386] Next, in S630 , GPU 22 determines whether idx-stride≧0. Here, if idx-stride<0, GPU 22 moves the process to S650 . On the other hand, if idx-stride≧0, GPU 22 moves the process to S640 .
[0387] In S640 , the sum of the array element input[idx] and the array element input[idx-stride] is stored as a new array element input[idx].
[0388] In S650 , GPU 22 increments idx. That is, GPU 22 stores the value stored in idx plus 1 in idx.
[0389] In S670 , GPU 22 determines whether the value stored in idx is greater than S. Here, if GPU 22 determines that it is greater than S, the process proceeds to S670 . On the other hand, if GPU 22 determines that it is less than S, the process proceeds to S630 , and the processes of S630 to S660 are repeated.
[0390] In S670 , stride*2 is stored as the new stride value.
[0391] In S680 , stride is incremented. That is, GPU 22 adds 1 to the value stored in stride and stores it in stride.
[0392] In S690, GPU 22 determines whether the value stored in stride is greater than S. If it is determined to be less than S, GPU 22 moves the process to S620 and repeats the processes of S620 to S690. On the other hand, if it is determined to be greater than S, the computing device 20 ends the accumulation and parallel processing.
[0393] <Work>
[0394] By performing accumulation and parallel processing, Fig.31 As shown, the sum of array elements input[0] to array elements input[S-1] is stored in array input[S-1].
[0395] For example, in S135 , the array input[ ] may be replaced with the array flag[ ]. By executing the above-mentioned accumulation and parallel processing, the sum (ie, the accumulation sum) of the array element flag[idx] is stored in the array element flag[L−1].
[0396] In addition, for example, in S270 , the array input[ ] may be replaced with the array maj_vert_num[ ]. By executing the above-mentioned accumulation and parallel processing, the accumulation sum Q is stored in the array element maj_vert_num[P−1].
[0397] In addition, for example, in S390 , the array input[ ] may be replaced with the array prim_num_per_edge[ ]. By executing the above-mentioned accumulation and parallel processing, the accumulation sum R is stored in the array element maj_vert_num[Q−1].
[0398] [3-3. Effect]
[0399] Thus, the computing device 20 can further improve the processing speed by performing parallel processing for each idx even in the cumulative sum. In addition, the computing device 20 can set a thread for each first main line point and perform triangle segmentation in parallel for each first main line point, thereby further improving the processing speed.
[0400] In the third embodiment, the GPU 22 corresponds to the triangle processing device. In addition, the above-mentioned parallel processing may be performed by the CPU 21 capable of performing parallel processing instead of the GPU 22. In this case, the CPU 21 capable of performing parallel processing corresponds to the triangle generating device.
[0401] [4. Other embodiments]
[0402] As mentioned above, although embodiment of this disclosure was described, this disclosure is not limited to the said embodiment, Various deformation|transformation and implementation are possible.
[0403] (4a) In the above-mentioned embodiment, a method is shown in which a basic triangle is determined to be a target triangle when the maximum internal angle of the basic triangle is less than a specified angle (for example, 120°). However, the basic triangle may be determined to be a target triangle when the length ratio of the remaining sides relative to the length of a certain side is within a specified range. For example, h1≦length ratio≦h2 (for example, h1<1, h2≧1). The range of the length ratio is not limited to this and can be set arbitrarily.
[0404] (4b) In the above-mentioned embodiment, the computing device 20 generates the combination information and generates finely divided triangles based on the generated combination information (i.e., acquires the generated combination information). However, the computing device 20 may store the combination information as a table in the memory in advance and generate finely divided triangles based on the combination information stored in the memory. In this way, the processing load of the computing device 20 can be reduced.
[0405] (4c) In the above embodiment, the base point A is shown as a vertex of the basic triangle and connects the first main line and the second main line. BHowever, the main dividing point identification numbers may be set with either of the two end points of the first main line being 0. For example, the main dividing point identification numbers may be set as 0, 1, 2, etc., starting from the right vertex A which is the vertex of the basic triangle and the intersection of the first main line and the second main line. R Starting from base point A B The main division point identification numbers are set in order. In this case, in the branch line pair, the main division point identification number + 1 of the reference branch line point becomes the main division point identification number of the adjacent branch line point. In this case, for example, when tess_prim_idx[idx] is an even number, (0, +1, 0) may be calculated as the displacement of the main division point identification number. In addition, for example, when tess_prim_idx[idx] is an odd number, (+1, 0, +1) may be calculated as the displacement of the main division point identification number.
[0406] (4d) In the above embodiment, the secondary division point identification numbers are set in order from the first main line side in the basic triangle. However, the secondary division point identification numbers may be set with either of the two end points of the branch line being 0. For example, the secondary division point identification numbers may be set in order from the second main line side to the first main line side, such as 0, 1, 2, etc. In this case, the same displacement amount as in the above embodiment may be used as the displacement amount of the secondary division point identification number.
[0407] (4e) In the above embodiment, the computing device 20 performs both pre-shaping and multi-segment division in the triangle division process. However, the computing device 20 may perform only multi-segment division in the triangle division process.
[0408] (4f) In the above-mentioned embodiment, a method is shown in which, in a basic triangle, the first main line is the opposite side of the internal angle having the largest angle, the second main line is the opposite side of the internal angle having an angle second only to the largest angle, and the third main line is the opposite side of the internal angle having the smallest angle. However, for example, the first main line may be the opposite side of the internal angle having an angle second only to the largest angle, the second main line is the opposite side of the internal angle having the largest angle, and the third main line is the opposite side of the internal angle having the smallest angle.
[0409] (4g) The computing device 20 and the method thereof described in the present disclosure may also be implemented by a special-purpose computer, which is provided by constituting a processor and a memory programmed to execute one or more functions embodied by a computer program. Alternatively, the computing device 20 and the method thereof described in the present disclosure may also be implemented by a special-purpose computer, which is provided by constituting a processor composed of one or more special-purpose hardware logic circuits. Alternatively, the computing device 20 and the method thereof described in the present disclosure may also be implemented by one or more special-purpose computers, which are constituted by a combination of a processor and a memory programmed to execute one or more functions and a processor composed of one or more hardware logic circuits. In addition, a computer program may also be stored as an instruction executed by a computer in a non-migratable tangible recording medium that can be read by a computer. The method for realizing the functions of each part included in the computing device 20 does not necessarily need to include software, and all of its functions may also be implemented using one or more hardware.
[0410] (4h) It is also possible to implement multiple functions of one component of the above-mentioned embodiment by multiple components, or to implement one function of one component by multiple components. In addition, it is also possible to implement multiple functions of multiple components by one component, or to implement one function implemented by multiple components by one component. In addition, a part of the structure of the above-mentioned embodiment may be omitted. In addition, it is also possible to add or replace at least a part of the structure of the above-mentioned embodiment with respect to the structure of other above-mentioned embodiments.
[0411] (4i) In addition to the above-mentioned computing device 20, the present disclosure may be implemented in various forms such as a device that uses the computing device 20 as a component, a system, a program for making the computing device 20 function, a non-migrating physical recording medium such as a semiconductor memory that records the program, a triangle generation method, etc. The device that uses the computing device 20 as a component may include, for example, a radar simulator.
[0412] [Technical ideas disclosed in this specification]
[0413] [Project 1]
[0414] A triangle generating device, wherein:
[0415] An acquisition unit (S1) is configured to acquire a vertex coordinate group including coordinates of each vertex for one or more basic triangles; and
[0416] The triangle dividing unit (S2) is configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles.
[0417] The above-mentioned triangle dividing part has:
[0418] an object determination unit (S120) configured to determine whether each of the basic triangles defined by the vertex coordinate group is an object triangle having a shape with a relatively large degree of consistency with an equilateral triangle;
[0419] a pre-shaping execution unit (S150) configured to divide the basic triangle determined not to be the target triangle into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle; and
[0420] The adding unit (S155) is configured to generate a new vertex coordinate group including vertex coordinates of the divided triangle.
[0421] For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group generated by the adding unit, coordinates of vertices for dividing a region of the basic triangle into a plurality of subdivided triangles smaller than the basic triangle are calculated.
[0422] [Project 2]
[0423] The triangle generating device according to item 1, wherein:
[0424] The object determination unit determines whether the maximum value of the internal angle of the basic triangle is lower than the allowed angle. When the maximum value of the internal angle is lower than the allowed angle, the basic triangle is determined to be the object triangle. When the maximum value of the internal angle is greater than the allowed angle, the basic triangle is determined not to be the object triangle.
[0425] [Item 3]
[0426] The triangle generating device according to item 1 or item 2, wherein:
[0427] When the object determination unit determines that the basic triangle is not the object triangle, the preliminary shaping execution unit divides the basic triangle into two using a bisector that bisects an internal angle having a maximum value in the basic triangle.
[0428] [Item 4]
[0429] The triangle generating device (20) as described in any one of items 1 to 3, wherein:
[0430] The above-mentioned triangle dividing part further comprises:
[0431] A main division number setting unit (S21, S240) is configured to set the main division number (M) when the first side of the basic triangle is equally divided based on a predetermined division length;
[0432] A sub-division number setting unit (S22, S350) configured to set, for each of the plurality of main division points set on the first side, the sub-division number (N) for equally dividing the set branch line based on the division length; and
[0433] The execution unit (S23) obtains the above-mentioned combination information by using the sub-division points on the two branches belonging to the branch line pair as vertices for each of the above-mentioned main division points according to each branch line pair set, and one or more triangles that divide the area of the above-mentioned basic triangle sandwiched by the above-mentioned branch line pair without duplication as the above-mentioned sub-division triangles, and by using information specifying the combination method of the above-mentioned sub-division points belonging to each sub-division triangle as combination information, and calculates the coordinates of the vertices of the above-mentioned sub-division triangle according to each of the above-mentioned branch line pairs set respectively for the above-mentioned main division points using the above-mentioned vertex coordinate group, the above-mentioned main division number, and the above-mentioned combination information,
[0434] The main division points are a plurality of (M+1) points including both end points of the first side and located at positions that divide the first side into equal parts by the number of main divisions.
[0435] The branch line is a line segment that passes through the main dividing point from the first side to the second side and along the third side.
[0436] The sub-division points are a plurality of (N+1) points including the two end points of the branch line and dividing the branch line equally by the sub-division number.
[0437] The branch line pair is a combination of any two adjacent branches among the branches.
[0438] The above-mentioned triangle division unit sets the above-mentioned main division number through the above-mentioned main division number setting unit, sets the above-mentioned sub-division number through the above-mentioned sub-division number setting unit for each of the basic triangles defined by the coordinates of each vertex included in the above-mentioned new vertex coordinate group generated by the above-mentioned adding unit, and calculates the coordinates of the vertices of the above-mentioned fine division triangles smaller than the above-mentioned basic triangle through the above-mentioned execution unit for dividing the area of the above-mentioned basic triangle into a plurality of the above-mentioned fine division triangles.
[0439] [Item 5]
[0440] The triangle generating device described in item 4, wherein:
[0441] In the above-mentioned basic triangle, the above-mentioned first side is the side opposite to the internal angle with the largest angle, the above-mentioned second side is the side opposite to the internal angle with the angle second only to the above-mentioned largest angle, and the above-mentioned third side is the side opposite to the internal angle with the smallest angle.
[0442] [Item 6]
[0443] The triangle generating device described in item 4 or item 5, wherein:
[0444] When specifying the sub-division points belonging to one of the fine-division triangles, the combination information alternately specifies sub-division points on the branch lines set for the main division points and sub-division points on the adjacent branch lines for each pair of branch lines set for the main division points.
[0445] [Item 7]
[0446] The triangle generating device as described in any one of items 4 to 6, wherein:
[0447] A main division point identification setting unit (S330) is configured to set a main division point identification number for identifying each main division point, respectively, for the main division points; and
[0448] The sub-division point identification setting unit (S545) is configured to set sub-division point identification numbers for identifying each sub-division point, respectively, to the sub-division points.
[0449] Each of the above-mentioned secondary division points is determined by the above-mentioned primary division point identification number and the above-mentioned secondary division point identification number,
[0450] The combination information specifies a combination method of the sub-division points belonging to the sub-division triangle based on the main division point identification number and the sub-division identification number.
[0451] [Item 8]
[0452] The triangle generating device as described in any one of items 4 to 7, wherein:
[0453] The execution unit calculates coordinates of vertices of the subdivided triangle in parallel for each of the main division points.
[0454] [Item 9]
[0455] A triangle generation method is a method for generating a triangle, which is configured to obtain a vertex coordinate group including coordinates of each vertex for one or more basic triangles, and to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles, wherein:
[0456] For each of the basic triangles defined by the vertex coordinate group, it is determined whether the basic triangle is a target triangle having a shape with a relatively large degree of consistency with an equilateral triangle (S120).
[0457] The basic triangle determined not to be the target triangle is divided into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle (S150),
[0458] Generate a new vertex coordinate group including the vertex coordinates of the divided triangle (S155),
[0459] For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group, coordinates of vertices of a plurality of subdivided triangles that divide the region of the basic triangle into smaller regions than the basic triangle are calculated.
[0460] [Item 10]
[0461] A triangle generation program is a triangle generation program that causes a computer to function as a triangle generation device, wherein the program comprises:
[0462] A step (S1) of acquiring a vertex coordinate group including coordinates of each vertex for one or more basic triangles; and
[0463] a triangle dividing step (S2, S12) of dividing each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles,
[0464] The above triangle segmentation steps have:
[0465] An object determination step (S120) of determining whether each of the basic triangles defined by the vertex coordinate group is an object triangle having a shape that is relatively consistent with an equilateral triangle;
[0466] a pre-shaping execution step (S150) configured to divide the basic triangle determined not to be the target triangle into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle; and
[0467] The adding step (S155) is configured to generate a new vertex coordinate group including the vertex coordinates of the divided triangle.
[0468] For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group generated by the adding step, coordinates of vertices of a plurality of subdivided triangles that divide the area of the basic triangle into smaller areas than the basic triangle are calculated.
Claims
1. A triangle generating device (20), wherein: have: An acquisition unit (S1) is configured to acquire a vertex coordinate group including coordinates of each vertex for one or more basic triangles; and The triangle dividing unit (S2) is configured to divide each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles. The above-mentioned triangle dividing part has: an object determination unit (S120) configured to determine whether each of the basic triangles defined by the vertex coordinate group is an object triangle having a shape with a relatively large degree of consistency with an equilateral triangle; a pre-shaping execution unit (S150) configured to divide the basic triangle determined not to be the target triangle into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle; and The adding unit (S155) is configured to generate a new vertex coordinate group including vertex coordinates of the divided triangle. For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group generated by the adding unit, coordinates of vertices for dividing a region of the basic triangle into a plurality of subdivided triangles smaller than the basic triangle are calculated.
2. The triangle generating device according to claim 1, wherein: The object determination unit determines whether the maximum value of the internal angle of the basic triangle is lower than the allowed angle. When the maximum value of the internal angle is lower than the allowed angle, the basic triangle is determined to be the object triangle. When the maximum value of the internal angle is greater than the allowed angle, the basic triangle is determined not to be the object triangle.
3. The triangle generating device according to claim 1 or 2, wherein: When the object determination unit determines that the basic triangle is not the object triangle, the preliminary shaping execution unit divides the basic triangle into two using a bisector that bisects an internal angle having a maximum value in the basic triangle.
4. The triangle generating device according to claim 1, wherein: The above-mentioned triangle dividing part further comprises: A main division number setting unit (S21, S240) is configured to set the main division number (M) when the first side of the basic triangle is equally divided based on a predetermined division length; A sub-division number setting unit (S22, S350) configured to set, for each of the plurality of main division points set on the first side, the sub-division number (N) for equally dividing the set branch line based on the division length; and The execution unit (S23) obtains the above-mentioned combination information by using the sub-division points on the two branches belonging to the branch line pair as vertices for each of the above-mentioned main division points according to each branch line pair set, and one or more triangles that divide the area of the above-mentioned basic triangle sandwiched by the above-mentioned branch line pair without duplication as the above-mentioned sub-division triangles, and by using information specifying the combination method of the above-mentioned sub-division points belonging to each sub-division triangle as combination information, and calculates the coordinates of the vertices of the above-mentioned sub-division triangle according to each of the above-mentioned branch line pairs set respectively for the above-mentioned main division points using the above-mentioned vertex coordinate group, the above-mentioned main division number, and the above-mentioned combination information, The main division points are a plurality of (M+1) points including both end points of the first side and located at positions that divide the first side into equal parts by the number of main divisions. The branch line is a line segment that passes through the main dividing point from the first side to the second side and along the third side. The sub-division points are a plurality of (N+1) points including the two end points of the branch line and dividing the branch line equally by the sub-division number. The branch line pair is a combination of any two adjacent branches among the branches. The above-mentioned triangle division unit sets the above-mentioned main division number through the above-mentioned main division number setting unit, sets the above-mentioned sub-division number through the above-mentioned sub-division number setting unit for each of the basic triangles defined by the coordinates of each vertex included in the above-mentioned new vertex coordinate group generated by the above-mentioned adding unit, and calculates the coordinates of the vertices of the above-mentioned fine division triangles smaller than the above-mentioned basic triangle through the above-mentioned execution unit for dividing the area of the above-mentioned basic triangle into a plurality of the above-mentioned fine division triangles.
5. The triangle generating device according to claim 4, wherein: In the above-mentioned basic triangle, the above-mentioned first side is the side opposite to the internal angle with the largest angle, the above-mentioned second side is the side opposite to the internal angle with the angle second only to the above-mentioned largest angle, and the above-mentioned third side is the side opposite to the internal angle with the smallest angle.
6. The triangle generating device according to claim 4 or 5, wherein: When specifying the sub-division points belonging to one of the fine-division triangles, the combination information alternately specifies sub-division points on the branch lines set for the main division points and sub-division points on the adjacent branch lines for each pair of branch lines set for the main division points.
7. The triangle generating device according to claim 4, wherein: Also available: A main division point identification setting unit (S330) is configured to set a main division point identification number for identifying each main division point, respectively, for the main division points; and The sub-division point identification setting unit (S545) is configured to set sub-division point identification numbers for identifying each sub-division point, respectively, for the sub-division points. Each of the above-mentioned secondary division points is determined by the above-mentioned primary division point identification number and the above-mentioned secondary division point identification number, The combination information specifies a combination method of the sub-division points belonging to the sub-division triangle based on the main division point identification number and the sub-division identification number.
8. The triangle generating device according to claim 4, wherein: The execution unit calculates coordinates of vertices of the subdivided triangle in parallel for each of the main division points.
9. A triangle generation method, comprising obtaining a vertex coordinate group including coordinates of each vertex for one or more basic triangles, and dividing each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of finely divided triangles, wherein: For each of the basic triangles defined by the vertex coordinate group, it is determined whether the basic triangle is a target triangle having a shape with a relatively large degree of consistency with an equilateral triangle (S120). The basic triangle determined not to be the target triangle is divided into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle (S150), Generate a new vertex coordinate group including the vertex coordinates of the divided triangle (S155), For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group, coordinates of vertices for dividing the region of the basic triangle into a plurality of subdivided triangles smaller than the basic triangle are calculated.
10. A triangle generation program, which is a triangle generation program that causes a computer to function as a triangle generation device, wherein: have: A step (S1) of acquiring a vertex coordinate group including coordinates of each vertex for one or more basic triangles; and a triangle dividing step (S2, S12) of dividing each of the basic triangles defined by the coordinates of each vertex included in the vertex coordinate group into a plurality of subdivided triangles, The above triangle segmentation steps have: An object determination step (S120) of determining whether each of the basic triangles defined by the vertex coordinate group is an object triangle having a shape that is relatively consistent with an equilateral triangle; a pre-shaping execution step (S150) configured to divide the basic triangle determined not to be the target triangle into a plurality of triangles so as to form a shape having a relatively large degree of consistency with the equilateral triangle; and The adding step (S155) is configured to generate a new vertex coordinate group including the vertex coordinates of the divided triangle. For each basic triangle defined by the coordinates of each vertex included in the new vertex coordinate group generated by the adding step, coordinates of vertices for dividing the region of the basic triangle into a plurality of subdivided triangles smaller than the basic triangle are calculated.
Citation Information
Patent Citations
Medical device
JP2022102151A
Tessellation method using displacement factors
US10832473B2