The present disclosure relates to a technology for generating a plurality of new triangles by dividing a triangle.
For example, a technology related to tessellation is known in which a triangle is bisected to become a predetermined size or smaller.
Tessellation is an image calculation method in computer graphics. Tessellation is a technique in which, for example, multiple polygons (such as triangular polygons) used to express a three-dimensional object in a two-dimensional image are further divided into smaller parts. The technique is used to express the three-dimensional object more smoothly and in greater detail based on the triangles after division.
One aspect of the present disclosure provides a triangle generation apparatus that includes an acquisition unit and a triangle division unit. The acquisition unit acquires a vertex coordinate group including coordinates of each vertex of one or a plurality of basic triangles. The triangle division unit divides each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles. The triangle division unit determines whether each basic triangle defined by the vertex coordinate group is a target triangle that has a shape having a relatively high degree of similarity to an equilateral triangle. The triangle division unit divides the basic triangle determined to not be the target triangle into a plurality of triangles to have the shape having a relatively high degree of similarity to an equilateral triangle. The triangle division unit generates the new vertex coordinate group including the vertex coordinates of the triangles after division. For each basic triangle defined by the coordinates of the vertices of the new vertex coordinate group, the triangle division unit calculates the coordinates of the vertices of a plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle.
In the accompanying drawings:
In a method described in U.S. Pat. No. 10,832,473 B2, a division line being drawn from a certain vertex of a triangle toward an opposing side thereof and the triangle being bisected by the division line is repeatedly performed. For example, in this method, in cases in which the triangle before division is a relatively elongated triangle, the triangle after division may also become a relatively elongated triangle. That is, the triangle after division may become less like an equilateral triangle.
However, in image calculation in computer graphics, it is known that, as a triangle becomes less like an equilateral triangle (that is, as an aspect ratio of a triangle decreases), analysis accuracy decreases, calculation time increases, and the like.
It is thus desired to preferably suppress a new triangle generated by a triangle being divided from becoming less like an equilateral triangle.
An exemplary embodiment of the present disclosure is a triangle generation apparatus that 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 of one or a plurality of basic triangles. The triangle division unit is configured to divide each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles. In addition, the triangle division unit has a target determining unit, a pre-shaping execution unit, and an addition unit.
The target determining unit is configured to determine whether each basic triangle defined by the vertex coordinate group is a target triangle that has a shape having a relatively high degree of similarity to an equilateral triangle. The pre-shaping execution unit is configured to divide the basic triangle determined to not be the target triangle into a plurality of triangles to have the shape having a relatively high degree of similarity to an equilateral triangle. The addition unit is configured to generate the new vertex coordinate group including the vertex coordinates of the triangles after division.
For each basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group generated by the addition unit, the triangle division unit calculates the coordinates of the vertices of a plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle.
In the triangle generation apparatus according to an exemplary embodiment of the present disclosure configured in this manner, the basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group generated by the addition unit has the shape having a relatively high degree of similarity to an equilateral triangle through execution by the pre-shaping execution unit. The triangle generation apparatus according to an aspect of the present disclosure calculates the coordinates of the vertices of the plurality of subdivided triangles for each basic triangle that has the shape having a relatively high degree of similarity to an equilateral triangle such as this. Therefore, compared to a case in which the basic triangle is divided into subdivided triangles without execution by the pre-shaping execution unit, the triangle generation apparatus according to an aspect of the present disclosure can obtain a subdivided triangle having a relatively high degree of similarity to an equilateral triangle. As a result, the new subdivided triangle generated by the basic triangle being divided can be suppressed from becoming unlike an equilateral triangle.
Another exemplary embodiment of the present disclosure is a triangle generation method that is configured to acquire a vertex coordinate group including coordinates of each vertex of one or a plurality of basic triangles and divide each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles.
The triangle generation method according to another exemplary embodiment of the present disclosure configured in this manner is a method performed by a triangle generation apparatus according to an aspect of the present disclosure and can achieve effects similar to those of the triangle generation apparatus according to an aspect of the present disclosure.
Still another exemplary embodiment of the preset disclosure is a triangle generation program executed by a triangle generation apparatus according to an aspect of the present disclosure and includes an acquiring step and a triangle dividing step. The triangle generation program according to another aspect of the present disclosure is a program that is executed by the triangle generation apparatus according to an aspect of the present disclosure and can achieve effects similar to those of the triangle generation apparatus according to an aspect of the present disclosure as a result of the program being executed.
A first embodiment of the present disclosure will hereinafter be described with reference to the drawings.
As shown in
The display unit 11 includes a display apparatus (not shown) and displays various types of images on a display screen of the display apparatus.
The operation input unit 12 outputs input operation information for identifying an input operation performed by a user through a keyboard and a mouse (not shown).
The data storage unit 13 is a storage apparatus for storing therein various types of data.
The data input/output unit 14 performs input and output of data to and from an external apparatus that is connected wirelessly or by wired connection.
The control unit 15 is mainly configured by a microcomputer that includes an electronic calculation apparatus (referred to, hereafter, as a calculation apparatus 20), a read-only memory (ROM) 23, a random access memory (RAM) 24, and the like. The calculation apparatus 20 includes at least either of a central processing unit (CPU) 21 and a graphics processing unit (GPU) 22. Various functions of the microcomputer are actualized by the calculation apparatus 20 executing a program stored in a non-transitory, tangible storage medium. In this example, the ROM 23 corresponds to the non-transitory, tangible storage medium in which the program is stored. In addition, as a result of the program being executed, a method corresponding to the program is performed. Here, some or all functions provided by the calculation apparatus 20 may be configured by hardware using one or a plurality of integrated circuits (ICs) or the like. In addition, the control unit 15 may be configured by a single or a plurality of microcomputers.
For example, the ROM 23 may store 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 installed in the radar simulator 1 in advance or may be installed through a storage medium or over a network. For example, an optical disc, a magnetic disk, and a semiconductor memory can be given as the storage medium.
The simulation program 25 is a program for executing a simulation in which a three-dimensional shape of a road, three-dimensional shapes surrounding the road, and the like are reproduced in a virtual space, and a vehicle is made to travel on the road reproduced in the virtual space. For example, the simulation may include a simulation in which, in the vehicle that travels in the virtual space displayed in the display apparatus, transmission and reception of radar waves by a radar apparatus mounted in the vehicle is simulated. Radar simulation in which the traveling of the vehicle, and the transmission and reception of radar waves by the radar apparatus are simulated may be performed by the simulation program 25 being started.
Data (hereafter, polygon data) in which the above-described three-dimensional shapes of the road and the road surroundings, and the like to be reproduced in the virtual space are expressed by numerous polygons may be acquired by the simulation program 25 being started. In addition, calculation simulating transmission and reception of radar waves may be performed based on the polygon data indicating the three-dimensional shapes. Here, simulation may include various other types of simulations.
For example, the drawing program 26 may be a program for generating an image that shows the three-dimensional shapes of the road and the road surroundings, and the like reproduced in the virtual space used in the above-described radar simulation. The drawing program 26 may be started with the start of the simulation program 25 as a trigger. Alternatively, the drawing program 26 may be started by itself. The above-described polygon data of the three-dimensional shapes of the roads and the road surroundings, and the like to be reproduced in the virtual space may be acquired, and an image indicating the three-dimensional shapes may be generated by the drawing program 26 being started.
Numerous pieces of polygon data expressing the three-dimensional shapes and the like may be stored in the data storage unit 13 in advance or may be acquired from outside the radar simulator 1 through the data input/output unit 14. The polygon data includes polygon vertex coordinate data that indicates coordinates of each vertex (hereafter, vertex coordinates) of numerous polygons (such as triangular polygons).
For example, the triangle generation program 27 may be a program for dividing each triangular polygon (also referred to, hereafter, a basic triangle) defined by the vertex coordinates included in the polygon vertex coordinate data into a plurality of triangles smaller than the basic triangle. A process performed by the calculation apparatus 20 executing the triangle generation program 27 is also referred to as a triangle generation process.
Through the triangle generation process, new vertex coordinate data including the vertex coordinates of the triangles that are smaller than the basic triangle is outputted, and an image showing the three-dimensional shapes is generated based on the outputted vertex coordinate data. As a result, a smoother, more detailed image is generated in drawings and the like in the display apparatus by the display unit 11.
Steps in the triangle generation process performed by the calculation apparatus 20 will be described with reference to a flowchart in
When the triangle generation process is performed, at S1, the calculation apparatus 20 acquires the polygon vertex coordinate data. For example, the polygon vertex coordinate data may include the vertex coordinates of a plurality of basic triangles.
Next, at S2, the calculation apparatus 20 performs triangle division. In triangle division, the basic triangle is divided and a plurality of triangles (also referred to, hereafter, as subdivided triangles) smaller than the basic triangle is generated. Here, generating a triangle as described hereafter includes performing calculation to calculate the vertex coordinates of the triangle and outputting (that is, storing) the calculated vertex coordinates to a memory such as the RAM 24.
At S3, the calculation apparatus 20 outputs new vertex coordinate data including the vertex coordinates of the triangles (that is, the subdivided triangles) smaller than the basic triangle. For example, the calculation apparatus 20 may output the above-described vertex coordinate data to an arbitrary memory or the like that can be used in the simulation program 25, the drawing program 26, and other applications. The calculation apparatus 20 then ends the triangle generation process.
Next, details of the triangle division (that is, the triangle generation process) performed by the calculation apparatus 20 at S2 will be described with reference to a flowchart shown in
At S11, the calculation apparatus 20 performs pre-shaping (that is, pre-tessellation reshaping). Pre-shaping refers to a process for shaping a triangle that, among the basic triangles, has a shape having a relatively low degree of similarity to an equilateral triangle to become a plurality of triangles that have shapes having a relatively high degree of similarity to an equilateral triangle, based on the polygon vertex coordinate data.
At subsequent S12, the calculation apparatus 20 performs multi-stage division (that is, cascade tessellation). Multi-stage division refers to a process for generating the subdivided triangles for each of the basic triangles. According to the present embodiment, the above-described pre-shaping process is performed as pre-processing before multi-stage division (that is, before the subdivided triangles are generated). That is, according to the present embodiment, multi-stage division is performed on a basic triangle having a shape relatively similar to the equilateral triangle. In addition, according to the present embodiment, the subdivided triangles are a plurality of triangles smaller than the basic triangle that are obtained by the basic triangle having a shape relatively similar to the equilateral triangle being divided. The calculation apparatus 20 then ends triangle division.
Details of pre-shaping performed by the calculation apparatus 20 at S11 will be described with reference to a flowchart shown in
First, at S105, the calculation apparatus 20 acquires the polygon vertex coordinate data. There are three vertex coordinates for each basic triangle. Here, the polygon vertex coordinate data includes the vertex coordinates of an L number of basic triangles. For example, elements included in the polygon vertex coordinate data may be indicated such as by (v0, v1, v2, v3, v4, v5, . . . , v3k, v3k+1, v3k+2, . . . ). k is an integer from 0 to L−1. vis the vertex coordinates. For example, the vertex coordinates v may be expressed by coordinates such as (x, y) or may be expressed by a position vector.
Hereafter, the polygon vertex coordinate data is written as an array vertices[ ]. An element vertices[ ] of the array is expressed by a floating-point number. Here, regarding the element of the array, the element of the array vertices[ ] may be written such that [ ] is omitted, for example, by being simply written as vertices. An index (hereafter, idx) is a variable for specifying an element in the array. Here, the index is within a range of 0≤idx≤L−1. That is, elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array indicate the vertex coordinates of a single basic triangle specified by idx. 3idx or 3*idx expresses a multiplication of 3 and idx. For example, a basic triangle specified by idx=0 may be a basic triangle in which the vertex coordinates stored in elements vertices[0], vertices[1], and vertices[2] of the array (that is, specifically, (v0, v1, v2) described above) are the vertices of the triangle.
At S110 to S130, the calculation apparatus 20 identifies a triangle that is not a target triangle among the basic triangles specified by the values stored in idx. The target triangle is a triangle that has a shape relatively similar to an equilateral triangle. A shape relatively similar to an equilateral triangle is a shape that has a relatively high degree of similarity to an equilateral triangle. The degree of similarity to an equilateral triangle may be, for example, expressed by an aspect ratio. The aspect ratio has a range of 0≤aspect ratio≤1 and the aspect ratio of the equilateral triangle is 1. The degree of similarity to an equilateral triangle increases as the aspect ratio becomes relatively large (that is, relatively closer to 1). The target triangle can also be said to be a triangle that has a relatively large aspect ratio (that is, relatively close to 1). A triangle that is not the target triangle is also referred to hereafter as a non-target triangle.
First, at S110, the calculation apparatus 20 stores 0 in idx.
Next, at S115, the calculation apparatus 20 changes a storage order of the vertex coordinates in the array vertices[ ] so that lengths of opposing sides are in descending order for the basic triangle specified by the value stored in idx. 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 opposing sides are in descending order. The opposing side refers to a side facing the vertex. Descending order refers to arranging in order from long to short.
For example,
First, the calculation apparatus 20 calculates the length of an opposing side a of the vertex indicated by the vertex coordinates v3k, the length of an opposing side b of the vertex indicated by the vertex coordinates v3k+1, and the length of an opposing side c of the vertex indicated by the vertex coordinates v3k+2 based on the vertex coordinates. Then, the calculation apparatus 20 identifies the order from the longest length (that is, the descending order of the length) for the opposing side a, the opposing side b, and the opposing side c. In the example in
As a result, after rearrangement, as shown in
Next, at S120, the calculation apparatus 20 determines whether the basic triangle specified by the value stored in idx is the above-described target triangle. Here, according to the present embodiment, the calculation apparatus 20 determines that the basic triangle is the target triangle when a maximum value of an interior angle is less than an allowable angle prescribed in advance. Meanwhile, the calculation apparatus 20 determines that the basic triangle is the non-target triangle when the maximum value of the interior angle is equal to or greater than the allowable angle. According to the present embodiment, the allowable angle is 120°. Here, the allowable angle is not limited to 120° and may be an arbitrary angle within a predetermined range including 120°.
As described above, the vertex coordinates of the basic triangle specified by the value stored in idx are rearranged so that the lengths of the opposing sides are in descending order in the array vertices[ ]. That is, among the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array, the vertex coordinates stored as a leading element vertices[3idx] of the array indicates the vertex having the largest interior angle.
The calculation apparatus 20 calculates θ as the angle indicating the maximum value of the interior angle using c2=a2+b2−2ab cos θ that is a cosine theorem. Here, c is the length of the opposing side of the vertex having the largest interior angle, and a and b are the lengths of the remaining sides. The opposing side of the vertex having the largest interior angle is the opposing side of the vertex indicated by the vertex coordinates stored in the element vertices[3idx] of the array that is the leading vertex coordinates of the three vertex coordinates. The remaining sides are the opposing sides of the vertex coordinates stored in the elements vertices[3idx+1] and vertices[3idx+2] of the array.
An array flag[idx] indicates a value of a flag related to the basic triangle specified by the value stored in idx. Here, the calculation apparatus 20 stores 1 in the array flag[idx] when the basic triangle is deterred to be a non-target triangle, that is, the maximum value 0 of the interior angle is equal to or greater than the allowable angle. Meanwhile, the calculation apparatus 20 stores 0 in the array flag[idx] when the basic triangle is determined to be a target triangle, that is, the maximum value θ of the interior angle is less than the allowable angle.
At S125, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At S130, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than L. Here, the calculation apparatus 20 transitions the process to S135 when determined that the value is equal to or greater than L. Meanwhile, the calculation apparatus 20 transitions the process to S115 when determined that the value is less than L, and repeats the processes at S115 to S130 until idx becomes equal to or greater than L.
At S135, the calculation apparatus 20 stores a cumulative sum of elements flag[ ] of the array in an array scan[idx] specified by the value stored in idx. The cumulative sum of the elements flag[ ] of the array herein is a total sum of respective values of the elements flag[0] to flag[idx] of the array.
For example, the value stored as the element flag[0] of the array may be stored as an element scan[0] of the array. A total sum (that is, the cumulative sum) of the value stored as the element flag[0] of the array and the value stored as the element flag[1] of the array is stored as the element scan[1] of the array. As a result, a total number of non-target triangles among the L number of basic triangles is stored as the element scan[L−1] of the array when the value stored in idx is L−1.
At S140 to S165, the calculation apparatus 20 divides the basic triangle determined to be the non-target triangle at S120 into a plurality (such as two, according to the present embodiment) of triangles so as to have shapes having a relatively high degree of similarity to an equilateral triangle.
First, at S140, the calculation apparatus 20 stores 0 in idx.
At S145, the calculation apparatus 20 determines whether the basic triangle specified by the value stored in idx is the target triangle or the non-target triangle. Here, when the value stored as the element flag[idx] of the array is 1, the calculation apparatus 20 determines that the basic triangle is the non-target triangle and transitions the process to S150. Meanwhile, when the value stored as the element flag[idx] of the array is 0, the calculation apparatus 20 determines that the basic triangle is the target triangle and transitions the process to S160.
At S150, the calculation apparatus 20 divides the basic triangle specified by the value stored in idx by a bisector of the interior angle indicating the maximum value so that the triangles after division have shapes having a relatively high degree of similarity to an equilateral triangle.
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 indicates the vertex having the largest interior angle. For example, as shown in
Here, of the divided triangles, the calculation apparatus 20 respectively stores the vertex coordinates (that is, v3k+1 in
Meanwhile, of the divided triangles, the calculation apparatus 20 adds, to the end of the array vertices[ ], the vertex coordinates (that is, v3k+1 in
Specifically, for example, the calculation apparatus 20 may store, in a variable aidx, a value obtained by adding the value stored in the element scan[idx] of the array to L−1 that is the value stored in idx specifying the end of the array vertices[ ]. aidx=(L−1)+scan[idx]. Then, as the vertices of the basic triangle in which aidx is specified as idx, the vertex coordinates (that is, v3k+1) stored in the element vertices[3idx] of the array, the vertex coordinates (that is, v3k) stored in the element vertices[3idx+2] of the array, and the coordinates of the point M are respectively stored as the elements vertices[3aidx], vertices[3aidx+1], and vertices[3aidx+2] of the array. As a result, the vertex coordinates of the new basic triangle are added to the end of the array vertices[ ].
Here, the calculation apparatus 20 may reverse the array in which the vertex coordinates of the triangles after division are stored from that described above. That is, in the above-described example, the vertex coordinates v3k+1, the vertex coordinates v3k, and the coordinates of the point M may respectively be stored as the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array. In addition, the vertex coordinates v3k+1, the vertex coordinates v3k+2, and the coordinates of the point M may respectively be stored as the elements vertices[3aidx], vertices[3aidx+1], and vertices[3aidx+2] of the array.
At S160, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At S165, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than L. Here, the calculation apparatus 20 transitions the process to S170 when determined that the value is equal to or greater than L. Meanwhile, the calculation apparatus 20 transitions the process to S145 when determined that the value is less than L, and repeats the processes from S145 to S165 until idx becomes equal to or greater than L.
At S170 to S185, regarding the basic triangle specified by the value stored in idx, the calculation apparatus 20 again rearranges the vertex coordinates stored in the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array so that the lengths of the opposing sides are in descending order. Here, at S170 to S185, idx is within a range of 0≤idx≤P. P is a value stored as an element scan[L−1] of an (L−1)+ array. The processes at S170, S175, and S180 are respectively similar to those at S110, S115, and S125.
At S185, the calculation apparatus 20 ends the pre-shaping process when determined that idx is equal to or greater than P.
As a result, the vertex coordinates of the basic triangle of which the maximum value of the interior angle is equal to or less than 120° are stored in order in the array vertices[ ].
Workings of the pre-shaping process will be described with reference to
At S115, the calculation apparatus 20 rearranges the vertices inside the basic triangle so that the lengths of the opposing sides are in descending order. As a result, for example, as shown in
At S120, the calculation apparatus 20 identifies the non-target triangle. As a result, for example, as shown in
At S135, the calculation apparatus 20 identifies the cumulative sum of the flag[ ]. As a result, for example, as shown in
At S150, the calculation apparatus 20 divides the basic triangles specified by idx=3, 5, 8, and 9 identified as non-target triangles, and updates the array vertices[ ] with the triangles after division as the new basic triangles. For example, the basic triangle specified by idx=5 may be divided into a triangle of which the vertex coordinates are v15, v16, and point M5, and a triangle of which the vertex coordinates are v15, v17, and point M5 by the division line DL. In variable aidx, 11 that is a value obtained by 2 that is a value stored in the element scan[5] of the array being added to 9 (that is, a value indicating L−1) is stored.
Here, v15, v16, and point M5 are stored as the elements vertices[3*5], [3*5+1], and [3*5+2] of the array. That is, v15, v16, and point M5 are stored as the element vert0[5] of the array, the element vert1[5] of the array, and the element vert2[5] of the array in the basic triangle specified by idx=5. Meanwhile, v15, v17, and point M5 are stored as the elements vertices[3*11], [3*11+1], and [3*11+2] of the array. That is, v15, v17, and point M5 are stored as the element vert0[11] of the array, the element vert1 of the array, and the element vert2[11] of the array in the basic triangle specified by a new idx (that is, aidx)=11.
At S175, the calculation apparatus 20 again rearranges the vertices in the basic triangle so that the lengths of the opposing sides are in descending order. As a result, although not shown, in a new array vertices[ ], the vertex coordinates are stored such that the lengths of the opposing sides are in descending order in the basic triangle specified by the value stored in idx.
An overview of multi-stage division performed by the calculation apparatus 20 at S12 will be described with reference to a flowchart in
First, names of line segments and vertices of the basic triangle will be described.
A first major line is the longest side of the basic triangle, such as a first major line l0 shown in
A second major line is the second longest side of the basic triangle, such as a second major line l1 shown in
A third major line is the shortest side of the basic triangle, such as a third major line l2 shown in
In addition, in the basic triangle, a vertex AB is also referred to as a base point AB. The base point AB is a vertex that serves as an intersection between the first major line l0 and the second major line l1. A vertex AR is also referred to as a right vertex AR. The right vertex AR is a vertex that serves as an intersection between the first major line l0 and the third major line l2. A vertex AL is also referred to as a left vertex AL. The left vertex AL is a vertex that serves as an intersection between the second major line l1 and the third major line l2
Operators used in the description below will be described.
First, at S21, the calculation apparatus 20 performs a major line process. In the major line process, the calculation apparatus 20 calculates a primary division number (such as M) for each basic triangle. M is an integer of M≥1. The primary division number is a number of divisions when the first major line is equally divided (based on, for example, a division length do prescribed in advance) in each basic triangle. Equally divided herein includes a plurality of divisions of two or more, and a single division.
First major line points are a plurality (such as M+1) of points that are in positions equally dividing the first major line l0 by the primary division number. The first major line points include both end points of the first major line l0 (that is, the base point AB and the right vertex AR). That is, the first major line l0 points include at least two first major line points. A first major line point number hereafter is a number of first major line points on the first major line (such as M+1, described above). In
Next, at S22, the calculation apparatus 20 performs a minor line process. In the minor line process, the calculation apparatus 20 sets a secondary division number (such as N) for each of the plurality of first major line points set on the first major line l0. N is an integer of N≥0. The secondary division number is a number of divisions when a minor line set for each of the plurality of first major line points is equally divided (based on, for example, the above-described division length d0). Equally divided herein includes a plurality of divisions of two or more, a single division, and zero division.
The minor line is a line segment that passes through the first major line point, and runs from the first major line l0 to the second major line l1 along the third major line l2. The line segment that runs along the third major line l2 is a line segment that is parallel to the third major line l2. The line segment that runs along the third major line l2 includes the third major line l2 itself. The minor line includes a line segment that runs along the third major line l2 and is set for the base point AB that serves as a first major line point, and the third major line l2 itself.
In an example in
Next, at S23, the calculation apparatus 20 performs a subdivision process. In the subdivision process, the calculation apparatus 20 calculates the coordinates of the vertices of subdivided triangles for each minor line pair respectively set for the above-described first major line points using the array vertices[ ] after the above-described pre-shaping has been performed as a vertex coordinate group, the above-described primary division numbers, and combination information. The combination information is information specifying a combination method of the minor line points belonging to each subdivided triangle.
The minor line points are points that equally divide the minor line by the above-described secondary division number (such as N+1) and include both end points of the minor line. Both end points of the minor line are a point on the first major line and a point on the second major line positioned on both ends of the minor line. A minor line point number hereafter is a number of minor line points on the minor line (such as N+1, described above). maj_vert_num, described hereafter, corresponds to the minor line point number.
Hereafter, an overview of a minor line pair, a number of subdivided triangles in a minor line pair, and the combination information will be described.
The minor line pair is a combination of two arbitrary, adjacent minor lines among the minor lines. The subdivided triangle is one or more triangles that divide an area of a basic triangle sandwiched between the minor line pair without overlapping each other, with the minor line points on the two minor lines belonging to the minor line pair as vertices. Hereafter, the area of the basic triangle sandwiched between the minor line pair is also simply referred to as an area sandwiched between a minor line pair.
In addition, hereafter, the minor line set for each first major line point is also referred to as a reference minor line. According to the present embodiment, of the minor lines adjacent to the reference minor line, the minor line adjacent on the base point AB side is referred to as an adjacent minor line. That is, the minor line pair is a combination of the reference minor line and the adjacent minor line. In addition, the subdivided triangle is one or more triangles that divide the area sandwiched between the minor line pair without overlapping each other, with the minor line points on the reference minor line and the minor line points on the adjacent minor line belonging to the minor line pair as vertices.
In the example in
In the example in
Here, according to the present embodiment in which the minor line pairs are set in the basic triangle in order from the first major line point farthest from the base point AB towards the base point AB, the minor line set for the base point AB that serves as a first major line point is not set as a reference minor line. That is, as shown in
For example, regarding the right vertex AR that serves as the first major line point, described above, triangles that divide the area sandwiched between the minor line pair composed of the minor line ml3 set for the right vertex AR and the adjacent minor line ml2 without overlapping each other may be the subdivided triangles. In the division, the minor line points on the two minor lines ml3 (that is, the reference minor line) and ml2 (that is, the adjacent minor line) belonging to the minor line pair serve as vertices of the subdivided triangles. In the example described above, as shown in
Here, each of the subdivided triangles dividing the area of the basic triangle sandwiched between the minor line pair may be individually identified by an in-area identification number (that is, tess_prim_idx, described hereafter). The in-area identification number may be a number assigned to each subdivided triangle dividing the area sandwiched between the minor line pair, and may increase as the subdivided triangle becomes farther from the first major line with the first major line side as a starting point (that is, 0). For example, numbers that are underlined in
The above-described combination information specifies the combination method of the minor line points belonging to the subdivided triangles. Although details will be described hereafter, the combination information specifies the combination method of the minor line points belonging to the subdivided triangles in order from the subdivided triangle on the first major line side.
For example, regarding the minor line pair composed of the reference minor line ml3 and the adjacent minor line ml2, first, the combination method of the minor line points may be specified in the following manner for a first subdivided triangle when viewed from the first major line. The first subdivided triangle when viewed from the first major line is a subdivided triangle having the in-area identification number=0. That is, a first minor line point is the minor line point on ml3 that is also the first minor line point when viewed from the first major line. A second minor line point is the minor line point on ml2 that is also the first minor line point when viewed from the first major line. A third minor line point is the minor line point on ml3 that is also the second minor line point when viewed from the first major line.
In addition, the combination information specifies the combination method of the minor line points in the following manner for a second subdivided triangle when viewed from the first major line. The second subdivided triangle when viewed from the first major line is a subdivided triangle having the in-area identification number=1. That is, the first minor line point is the minor line point on ml2 that is also the first minor line point when viewed from the first major line. The second minor line point is the minor line point on ml3 that is also the second minor line point when viewed from the first major line. The third minor line point is the minor line point on ml2 that is also the second minor line point when viewed from the first major line.
Regarding a third subdivided triangle when viewed from the first major line, the combination information specifies the combination method of the minor line points in a manner similar to that for the first subdivided triangle, that is, so as to form a triangle that projects toward the base point AB side. The third subdivided triangle when viewed from the first major line is a subdivided triangle having the in-area identification number=2. That is, the first minor line point is the minor line point on ml3 that is also the second minor line point when viewed from the first major line. The second minor line point is the minor line point on ml2 that is also the second minor line point when viewed from the first major line. The third minor line point is the minor line point on ml3 that is also the third minor line point when viewed from the first major line. At this time, the minor line point specified first is a minor point line that is adjacent to the minor line point that is specified first in the first subdivided triangle in a direction along the minor line (that is, a direction away from the first major line).
Regarding a fourth subdivided triangle when viewed from the first major line, the combination information specifies the combination method of the minor line points in a manner similar to that for the second subdivided triangle, that is, so as to form a triangle that projects toward the side opposite the base point AB. The fourth subdivided triangle when viewed from the first major line is a subdivided triangle having the in-area identification number=3. That is, the first minor line point is the minor line point on ml2 that is also the second minor line point when viewed from the first major line. The second minor line point is the minor line point on ml3 that is also the third minor line point when viewed from the first major line. The third minor line is the minor line point on ml2 that is also the third minor line point when viewed from the first major line. At this time, the minor line point specified first is a minor point line that is adjacent to the minor line point that is specified first in the second subdivided triangle in the direction along the minor line (that is, the direction away from the first major line). This similarly applies hereafter.
That is, as indicated by dotted arrow lines in
Each minor line point can be identified by a primary division point identification number (that is, maj_div_idx, described hereafter) and a secondary division point identification number (that is, maj_div_idx, described hereafter) described hereafter. As described hereafter, the combination information identifies the subdivided triangles dividing the area sandwiched between the minor line pair by the in-area identification numbers, and specifies the combination method of the minor line points belonging to the identified subdivided triangle based on the primary division point identification number and the secondary division point identification number. Here, as described hereafter, the combination information may specify the combination method of the minor line points belonging to the subdivided triangle based on a displacement amount of the primary division point identification number and a displacement amount of the secondary division point identification number.
According to the present embodiment, the calculation apparatus 20 generates the combination information specifying the combination method of the minor line points belonging to the subdivided triangle as described above. The calculation apparatus 20 calculates the coordinates of the vertices of the subdivided triangles for each minor line pair set for each first major line point using the vertex coordinate group, the primary division number, and the combination information. The calculation apparatus 20 generates the subdivided triangles for all basic triangles, or in other words, all first major line points and ends multi-stage division.
Details of the multi-stage division will be specifically described.
The major line process performed at S21 in multi-stage division will be described with reference to a flowchart in
Here, the variable idx (written, hereafter, as idx) is within a range of 0≤idx≤P−1. A total number of idx used in the present process is equal to a total number of basic triangles (also referred to, hereafter, as a basic triangle number P) defined by the vertex coordinates stored in the array vertices[ ]. Here, for differentiation, idx used in the major line process is also written as idx_p hereafter.
The array prim_id[idx] is an array that stores a value (also referred to, hereafter, as a basic ID) corresponding to an identification number for identifying each basic triangle, for the basic triangle specified by idx 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 above-described first major line point number for the basic triangle specified by idx. Here, in a manner similar to the description for multi-stage division, for example, the elements of the array may simply be written as prim_id hereafter.
Here, the element vertices[ ] of the array is expressed by a floating-point number, the element prim_id[ ] of the array is expressed by an integer of 0 or greater, and the element maj_vert_num[ ] of the array is expressed by a positive integer.
First, at S200, the calculation apparatus 20 stores 0 in idx.
Next, at S210, the calculation apparatus 20 sets the basic triangle number P. The calculation apparatus 20 stores the number of basic triangles defined by the vertex coordinates stored in the array vertices[ ] after the pre-shaping process has been performed in the basic triangle number P. The basic triangle number P corresponds to a number of loops (that is, a number of repetitions) of the processes at S220 to S260, described hereafter.
First, at S220, the calculation apparatus 20 stores the value stored in idx in the array prim_id[idx]. For example, when idx=0, 0 may be stored as the element prim_id[0] of the array and 0 may be set as the basic ID of the first basic triangle defined by the array vertices[ ].
Next, at S230, the calculation apparatus 20 acquires the vertex coordinates of the basic triangle specified by the value stored idx. That is, the calculation apparatus 20 acquires the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2] of the array.
At subsequent S240, the calculation apparatus 20 calculates the first major line point number for the basic triangle specified by the value stored in idx. As described above, the first major line points include the vertices AB and AR on both ends of the first major line l0, as shown in
The first term in expression (2) corresponds to the primary division number described above. That is, the calculation apparatus 20 calculates a value obtained by dividing the length of the first major line by a division length d0, rounds the calculated value to a nearest integer equal to or greater than the calculated value, and calculates a value obtained by adding 1 to the rounded value as the first major line point number. Because the rounded value is used, an interval between the first major line points is a length corresponding to the division length d0. The length corresponding to the division length do may not strictly be a length coinciding with the division length do but rather be a length within a predetermined range including the division length d0. The division length do may be stored in a memory such as the ROM 23 in advance. The division length do is a value that may be set as appropriate based on intended use (such as required accuracy of computer graphics). The first major line point number is calculated as an integer of 2 or greater by expression (2).
A length of the first major line is calculated based on the vertex coordinates stored in the elements vertices[3idx], vertices[3idx+1], and vertices[3idx+2]. For example, when the value stored in idx is 0, the value indicating the first major line point number may be stored as the element maj_vert_num[0] of the array for the basic triangle of which 0 stored in the element prim_id[0] of the array is the basic ID.
Next, at S250, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At subsequent S260, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than the basic triangle number P. Here, when the value stored in idx is equal to or greater than the basic triangle number P, the process transitions to S270.
Meanwhile, when the value stored in idx is less than the basic triangle number P, the calculation apparatus 20 transitions to S220 and repeats the processes at S220 to S260 based on the value that is newly stored in idx.
At S270, for example, the calculation apparatus 20 may calculate the total number of the elements maj_vert_num[idx] of the array by changing idx by 1 each time within the range of 0≤idx≤P−1, and store the calculated total number in csum_maj_vert_num[idx]. A total number of the total number of the elements maj_vert_num[idx] of the array is a total sum of the elements maj_vert_num[0] to maj_vert_num[idx] of the array.
The element csum_maj_vert_num[P−1] of the array when P−1 is stored in idx corresponds to a total number Q (also referred to, hereafter, as a cumulative sum Q) of the first major line points included in all P number of basic triangles. Then, the calculation apparatus 20 thereby ends the major line process.
An example of workings of the major line process will be described with reference to
In addition, as a result of S240 being repeated, when the first major line point number is calculated for each basic triangle as shown in
In addition, as a result of S270 being performed, as shown in
Here, the array prim_id[ ], and the arrays maj_vert_num[ ] and csum_maj_vert_num[ ] are also, hereafter, collectively referred to as a triangle parameter array.
The minor line process performed at S22 in multi-stage division will be described with reference to a flowchart in
The output arrays are an array prim_lookup_idx[idx], an array maj_div_idx[idx], an array point_on_maj_line0[idx], an array point_on_maj_line1[idx], an array min_vert_num[idx], an array prim_num_per_edge[idx], and an array csum_prim_num_per_edge[idx].
Here, idx indicating an element of the array has a range of 0≤idx≤Q−1. A total number of idx used in the present process is equivalent to the total number Q (that is, the cumulative sum Q) of the first major line points included in all of the basic triangles. Here, for differentiation, idx used in the minor line process may also be written as idx_m hereafter.
The array prim_lookup_idx[idx] is a so-called lookup table used to reference the above-described triangle parameter array while the minor line process is being performed. In other words, the prim_lookup_idx[idx] is correspondence information associating one first major line point specified by idx (that is, idx_m) and the basic ID (that is, idx_p) of the basic triangle including the first major line point.
The array maj_div_idx[idx] stores the primary division point identification number for the first major line point specified by the value stored in idx (that is, idx_m).
The array point_on_maj_line0[idx] stores the position vector of the first major line point specified by the value stored in idx (that is, idx_m). Regarding the first major line point specified by the value stored in idx (that is, idx_m), the array point_on_maj_line1[idx] stores the position vector of a second major line point corresponding to the first major line point. The second major line points are points in positions equally dividing the second major line at a same division ratio as a division ratio at which the first major line is divided.
Regarding the first major line point specified by the value stored in idx (that is, idx_m), the array min_vert_num[idx] stores the minor line point number of the minor line set for the first major line point.
Regarding the first major line point specified by the value stored in idx (that is, idx_m), the array prim_num_per_edge[idx] stores the number of above-described subdivided triangles dividing the area sandwiched between the minor line pair set for the first major line point using the minor line points.
Here, an element prim_lookup_idx[ ] of the array, an element maj_div_idx[ ] of the array, an element prim_num_per_edge[ ] of the array, and an element csum_prim_num_per_edge[ ] of the array are expressed as integers of 0 or greater. An element min_vert_num[ ] of the array is expressed as a positive integer. An element point_on_maj_line0[ ] of the array and an element point_on_maj_line1[ ] of the array are expressed by floating-point numbers.
First, at S300, the calculation apparatus 20 performs a prim_lookup_idx array generation process to generate the array prim_lookup_idx[idx].
In the prim_lookup_idx array generation process, as shown in
Next, at S401, the calculation apparatus 20 stores 0 in idx.
At subsequent S402, the calculation apparatus 20 stores the element maj_vert_num[idx] of the array in a variable rep_num. In addition, the calculation apparatus 20 stores a difference between the element csum_maj_vert_num[idx] of the array and the element maj_vert_num[idx] of the array in a variable ofs_idx.
Next, at S403, the calculation apparatus 20 determines whether the value stored in rep_num is greater than 0. When the value stored in rep_num is greater than 0, the calculation apparatus 20 transitions the process to S404. When the value stored in rep_num is equal to or less than 0, the calculation apparatus 20 transitions the process to S408.
At S404, the calculation apparatus 20 stores 0 in the variable m.
Next, at S405, the calculation apparatus 20 stores the value stored in idx as the element prim_lookup_idx[ofs_idx+m] of the array specified by [ofs_idx+m].
At subsequent S406, the calculation apparatus 20 increments the variable m. That is, the calculation apparatus 20 stores, in the variable m, a value obtained by adding 1 to the value stored in the variable m.
Next, at S407, the calculation apparatus 20 determines whether the value stored in the variable m is equal to or greater than the value stored in rep_num. Here, when the value stored in the variable m is equal to or greater than the value stored in rep_num, the process is transitioned to S408.
Meanwhile, when determined that the value stored in the variable m is less than the value stored in rep_num, the calculation apparatus 20 transitions to S405 and repeats the processes at S405 to S407 based on the value newly stored in the variable m.
At S408, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
Next, at S409, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than the cumulative sum Q. Here, when the value stored in idx is equal to or greater than the cumulative sum Q, the present prim_lookup_idx array generation process is thereby ended.
Meanwhile, when the value stored in idx is less than the cumulative sum Q, the calculation apparatus 20 transitions to S402 and repeats the processes at S402 to S409 based on the value newly stored in idx. Then, when the value stored in idx is equal to or greater than the cumulative sum Q, the calculation apparatus 20 thereby ends the present prim_lookup_idx array generation process.
Returning to
At S310, the calculation apparatus 20 stores 0 in idx.
Next, at S320, the calculation apparatus 20 acquires the total value Q (that is, the cumulative sum Q) of the first major line points. The cumulative sum Q corresponds to the loop number (that is, the number of repetitions) of S350 to S380 described hereafter.
First, at S330, the calculation apparatus 20 calculates the primary division point identification number for the first major line point specified by the value stored in idx. The primary division point identification number is the number assigned to each first major line point in the basic triangle including the first major line point specified by idx. According to the present embodiment, the primary division point identification number is a number that starts in order from the base point AB that is a vertex of the basic triangle and connects the first major line and the second major line, with the base point AB as 0, and increases from the base point AB toward the right vertex AR. The calculation apparatus 20 stores the calculated primary division point identification number in the array maj_div_idx[idx]. The primary division point identification number, that is, the element maj_div_idx[idx] of the array is calculated based on expression (3) and expression (4).
Lookup_idx indicated in expression (3) corresponds to an index (that is, idx_p) for specifying the triangle parameter array to be referenced.
Next, at S340, the calculation apparatus 20 calculates the position vector of the first major line point specified by the value stored in idx and stores the position vector in the array point_on_maj_line0[idx]. In addition, the calculation apparatus 20 calculates the position vector of the second major line point corresponding to the first major line point specified by the value stored in idx and stores the position vector in the array point_on_maj_line1[idx]. Corresponding herein refers to a place in order when counting from the base point AB being the same.
The coordinates of the first major line point are calculated by the first major line being divided at a ratio maj_div_idx[idx]/maj_vert_num[idx]. In a similar manner, the coordinates of the second major line point are calculated by the second major line being divided at a ratio maj_div_idx[idx]/maj_vert_num[idx]. Here, when the first major line point specified by the value stored in idx is the base point AB, the coordinates of the first major line point and the coordinates of the second major line point corresponding thereto coincide.
First, the calculation apparatus 20 calculates lookup_idx in a manner similar to expression (3) described above.
Next, the calculation apparatus 20 stores the coordinates of the base point AB in a variable org based on expression (5).
Next, the calculation apparatus 20 calculates a side vector edge0 of the first major line that is the longest side and a side vector edge1 of the second major line that is the second longest side based on expression (6) and expression (7).
Then, the calculation apparatus 20 calculates the coordinates of the first major line point with reference to the base point AB (that is, the vertex of which the opposing side is the third major line that is the shortest side) based on expression (8), and stores the coordinates in the array point_on_maj_line0[idx]. In a similar manner, the calculation apparatus 20 calculates the coordinates of the second major line point with reference to the base point AB based on expression (9) and stores the coordinates in the array point_on_maj_line1[idx].
At subsequent S350, regarding the first major line point specified by the value stored in idx, the calculation apparatus 20 calculates the minor line point number of the minor line set for this point. The calculation apparatus 20 stores the calculated minor line point number in the array min_vert_num[idx]. The length of the minor line is calculated based on the element point_on_maj_line0[idx] of the array and the element point_on_maj_line1[idx] of the array. That is, the element min_vert_num[idx] of the array is calculated by expression (10) below in a manner similar to the above-described array maj_vert_num[idx].
The first term in expression (10) corresponds to the secondary division number described above. Here, of the first major line points specified by the value stored in idx, the first major line point of which the element maj_dev_idx[idx] of the array is 0 corresponds to the base point AB. For the base point AB, 1 is stored as the element min_vert_num[idx] of the array.
At subsequent S360, regarding the first major line point specified by the value stored in idx, the calculation apparatus 20 calculates the number of subdivided triangles dividing the area sandwiched between the minor line pair for each minor line pair set for this point. The calculation apparatus 20 stores the calculated number in the array prim_num_per_edge[idx].
Here, a reference minor line point referred to below is a minor line point on the reference minor line. An adjacent minor line point is a minor line point on the adjacent minor line. That is, the adjacent minor line point refers to a minor line point on the minor line adjacent on the base point AB side of the minor line (that is, the reference minor line) set for the first major line specified by the value stored in idx. According to the present embodiment, of the two minor lines forming a pair, the minor line set for the first major line point having the greater maj_div_idx is the reference minor line.
In the area of the basic triangle sandwiched between the reference minor line and the adjacent minor line forming a pair, the number of vertices configuring the subdivided triangles is a total value of the reference minor line points and the adjacent minor line points. Focusing on the case in which 0 is stored in idx, the number of subdivided triangles dividing the area sandwiched between the minor line pairs is calculated based on expression (11). The calculated value is stored in the array prim_per_edge[idx].
Next, at S370, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At subsequent S380, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than the cumulative sum Q. Here, when determined that the value stored in idx is equal to or greater than the cumulative sum Q, the calculation apparatus 20 transitions the process to S390.
Meanwhile, when determined that the value stored in idx is less than the cumulative sum Q, the calculation apparatus 20 transitions to S330 and repeats the processes at S330 to S380 based on the value newly stored in idx.
At S390, for example, the calculation apparatus 20 may change idx by 1 each time within a range of 0≤idx≤Q−1, calculate the total number of the element prim_num_per_edge[idx] of the array, and store the calculated total number in the array csum_prim_num_per_edge[idx]. The total number of the element prim_num_per_edge[idx] of the array is the total sum of the elements prim_num_per_edge[0] to prim_num_per_edge[idx].
The element csum_prim_num_per_edge[Q−1] of the array when Q−1 is stored in idx corresponds to a total number R (also referred to, hereafter, as a cumulative sum R) of the subdivided triangles dividing the areas sandwiched between the minor line pairs set for all Q number of first major line points. In other words, the cumulative sum R is the total number of subdivided triangles included in all basic triangles (that is, the P number of triangles).
The calculation apparatus 20 then ends the minor line process.
Workings of the minor line process will be described with reference to
In addition, as a result of S330 being repeated, as shown in
In addition, as a result of S340 being repeated, as shown in
In addition, as a result of S350 being repeated, as shown in
In addition, as a result of S390 being performed, as shown in
In the examples in
Here, 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 also collectively referred to hereafter as a major line parameter array.
The subdivision process performed at S23 in multi-stage division will be described with reference to a flowchart in
Here, idx indicating an element in the array is within a range of 0≤idx≤R−1. The total number of idx used in the present process is equivalent to the subdivided triangle total number R (that is, the cumulative sum R) of all basic triangles. Here, idx used in the subdivision process is also written as idx_sub hereafter for differentiation.
The array maj_line_lookup_idx[idx] is a lookup table used to reference the above-described major line parameter array while the subdivision process is performed. In other words, the array maj_line_lookup_idx[idx] is corresponding information for associating one subdivided triangle specified by idx (that is, idx_sub) and a number (that is, idx_m) identifying the first major line point for which the minor line pair including the subdivided triangle is set.
The array tess_vert[idx] stores the vertex coordinates of the subdivided triangle specified by the value stored in idx (that is, idx_sub). The elements tess_vert[3idx], tess_vert[3idx+1], and tess_vert[3idx+2] of the array respectively indicate three vertex coordinates of one subdivided triangle. Here, in a manner similar to the above-described array vertices[ ], the array tess_vert[idx] may be written as tess_vert[idy][idx]. idy is within a range of 0≤idy≤2. That is, tess_vert[0][idx] stores the vertex coordinates specified first for the subdivided triangle specified by the value stored in idx. In a similar manner, tess_vert[1][idx] stores the vertex coordinates specified second for the subdivided triangle specified by the value stored in idx, and tess_vert[2][idx] stores the vertex coordinates specified third for the subdivided triangle specified by the value stored in idx.
Here, the element maj_line_lookup_idx[idx] of the array is expressed as an integer of 0 or greater and the element tess_vert[idx] of the array is expressed by a floating-point number.
As shown in
At S505, the calculation apparatus 20 stores 0 in idx.
Next, at S510, the calculation apparatus 20 acquires the subdivided triangle total number R (that is, the cumulative sum R). The cumulative sum R corresponds to the loop number (that is, the number of repetitions) of S515 to S570.
At S515 to S570, the calculation apparatus 20 calculates the vertex coordinates of the subdivided triangle specified by the value stored in idx, and stores the calculated vertex coordinates in tess_vert[idy][idx].
First, at S515, as shown in expression (12), the calculation apparatus 20 stores, in variable lookup_idx, a value of the index (that is, idx_m) used to reference the major line parameter array for the subdivided triangle specified by the value stored in idx (that is, idx_sub).
As a result, the major line parameter related to the subdivided triangle specified by the value stored in idx (that is, idx_sub) can be specified. That is, the major line parameter array is not required to be newly read. The major line parameter already stored in the memory can be referenced.
At subsequent S20, based on expression (13), the calculation apparatus 20 calculates a number indicating a place in order, when viewed from the first major line, of the subdivided triangle specified by the value stored in idx (that is, idx_sub) among the subdivided triangles dividing the area sandwiched between the minor line pair including the subdivided triangle. That is, the above-described in-area identification number is calculated. The calculation apparatus 20 stores the calculated in-area identification number in the array tess_prim_id[idx].
At S525 and S530, the calculation apparatus 20 generates the combination information. As described above, the combination information is the information that identifies the subdivided triangle dividing the area sandwiched between the minor line pair by the in-area identification number and specifies the combination method of the minor line points belonging to the identified subdivided triangles based on the primary division point identification number and the secondary division point identification number. According to the present embodiment, as described above, the combination information specifies the combination method to form the first specifying pattern when the in-area identification number is an even number, and specifies the combination method to form the second specifying pattern when the in-area identification number is an odd number. The first specifying pattern is the pattern that specifies the combination method of the minor line points to form the triangle that projects toward the base point AB side. The second specifying pattern is the pattern that specifies the combination method of the minor line points to form the triangle that projects toward the side opposite the base point AB. The even number in this case includes 0.
According to the present embodiment, the combination information specifies the combination method of the minor line points belonging to the subdivided triangle based on the displacement amount of the primary division point identification number and the displacement amount of the secondary division point identification number.
First, at S525, the displacement amount of the primary division point identification number is calculated. Here, when focus is placed only on the primary division point identification number (that is, maj_div_idx), in the first specifying pattern, as shown in
Here, with reference to maj_div_idx[idx] that is the primary division point identification number of the first major line point for which the minor line pair is set, the combination method of the minor line points is indicated by the displacement amount of the primary division point identification number such as by 0→−1→0. Meanwhile, in the second specifying pattern, with reference to maj_div_idx[idx] that is the primary division point identification number of the first major line point for which the minor line pair is set, the combination method of the minor line points is indicated by the displacement amount of the primary division point identification number such as by −1→0→−1.
Therefore, at the present step, the calculation apparatus 20 calculates the value stored in the variable maj_div_offset for the subdivided triangle specified by the value stored in idx based on expression (14). The value stored in the variable maj_div_offset indicates the displacement amount of the primary division point identification number.
As a result, as shown in
Next, at S530, the displacement amount of the secondary division point identification number is calculated. Here, focus is placed only on the secondary division point identification number (that is, maj_div_idx). In the first specifying pattern, as shown in
Here, in each combination method, the secondary division identification number (also referred to hereafter as a reference secondary division identification number) of the second minor line point that is specified is referenced. In the first specifying pattern, for example, regarding the subdivided triangle having the in-area identification number=0, the combination method of the minor line points may be indicated by the displacement amount of the secondary division point identification number such as by 0→0→+1 (for example, the reference secondary division identification number=0) in relation to the reference secondary division identification number. In a similar manner, regarding the subdivided triangle having the in-area identification number=2, the combination method of the minor line points is indicated by the displacement amount of the secondary division point identification number such as by 0→0→1 (for example, the reference secondary division identification number=1), in relation to the reference secondary division identification number. Meanwhile, in the second specifying pattern, regarding the subdivided triangle having the in-area identification number=1, the combination method of the minor line points is indicated by the displacement amount of the secondary division point identification number such as by −1→0→0 (for example, the reference secondary division identification number=1), in relation to the reference secondary division identification number. In a similar manner, regarding the subdivided triangle having the in-area identification number=3, the combination method of the minor line points is indicated by the displacement amount of the secondary division point identification number such by −1→0→0 (for example, the reference secondary division identification number=2), in relation to the reference secondary division identification number.
Therefore, at the present step, the calculation apparatus 20 calculates the value stored in the variable maj_div_offset for the subdivided triangle specified by the value stored in idx based on expression (15). The value stored in the variable maj_div_offset indicates the displacement amount of the secondary division point identification number.
As a result, as shown in
Next, at S535 to S560, regarding the subdivided triangle specified by the value stored in idx, the combinations of the minor line points are stored in order in the array tess_vert[idy] [idx]. When the combinations of the minor line points are specified, the primary division point identification number and the secondary division point identification number are used. According to the present embodiment, the primary division point identification number and the secondary division point identification number specifying the combinations of the minor line points are determined based on the displacement amount of the primary division point identification number and the displacement mount of the secondary division point identification number described above.
First, at S535, the calculation apparatus 20 stores 0 in the variable idy.
Next, at S540, regarding the minor line point specified by the value stored in idy among the minor line points belonging to the subdivided triangle specified by the value stored in idx, the calculation apparatus 20 calculates the coordinates of both end points of the minor line including this point. The minor line point specified by the value stored in idy refers to the minor line point specified idy+1 th in the combination method based on the combination information. Both end points are the first major line point and the second major line point.
The calculation apparatus 20 stores the position vector (that is, the coordinates) of the first major line point that is one of both end points in a variable point_0 based on expression (16). In addition, the calculation apparatus 20 stores the position vector (that is, the coordinates) of the second major line point that is the other of both end points in a variable point_1 based on expression (17).
At subsequent S545, first, the calculation apparatus 20 calculates the secondary division identification number of the minor line point specified by the value stored in idy in the subdivided triangle specified by the value stored in idx, based on expression (18). The secondary division identification number is calculated based on the reference secondary division identification number and the displacement amount of the secondary division identification number calculated at S530. The calculation apparatus 20 stores the calculated secondary division identification number in the variable min_div_idx. floor ((tess_prim_id[idx]+1)/2) in expression (18) indicates the secondary division identification number. Then, the calculation apparatus 20 calculates an internal division ratio based on expression (19) using the calculated secondary division identification number and stores the internal division ratio in a variable div_ratio.
The internal division ratio expresses a division ratio at which the minor line point specified by the value stored in idy among the minor line points belonging to the subdivided triangle specified by the value stored in idx divides the minor line including this point.
Next, at S550, the calculation apparatus 20 stores the calculated coordinates in the array tess_vert[idy][idx] based on expression (20).
At subsequent S555, the calculation apparatus 20 increments idy. That is, the calculation apparatus 20 stores, in idy, the value obtained by adding 1 to the value stored in idy
Next, at S560, the calculation apparatus 20 determines whether the value stored in idy is equal to or greater than 3. Here, when determined that the value is equal to or greater than 3, the calculation apparatus 20 transitions the process to S565. Meanwhile, when determined that the value is less than 3, the calculation apparatus 20 repeats the processes at S540 to S560 until idy becomes equal to or greater than 3.
At S565, the calculation apparatus 20 increments idx. That is, the calculation apparatus 20 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At S570, the calculation apparatus 20 determines whether the value stored in idx is equal to or greater than R. Here, when determined that the value is less than R, the calculation apparatus 20 transitions the process to S515 and repeats the processes at S515 to S570. Meanwhile, when determined that the value is equal to or greater than R, the calculation apparatus 20 thereby ends the present subdivision process.
Workings of the subdivision process will be described with reference to
When the loop number is the cumulative sum R as described above, the elements maj_line_lookup_idx[0] to maj_line_lookup_idx[R−1] of the array are stored as a result of S515 being repeated. For example, as shown in
Hereafter, of the examples shown in
At S515, regarding the subdivided triangle specified by idx=9, maj_line_lookup_idx[9]=5 is set as lookup_idx. As a result, as indicated by an arrow in
At S520, regarding the subdivided triangle specified by idx=9, the in-area identification number (that is, tess_prim_id[9]) is calculated as 9−10+1=0 based on expression (13).
At S525, maj_div_offset is calculated as (0, −1, 0) based on expression (14), and at S530, maj_div_offset is calculated as (0, 0, 1) based on expression (15).
At S535 to S560, when idy=0, both end points of the reference minor line (that is, the minor line set for the first major line point that is maj_div_idx=1) of the minor line pair are identified at S540. At S545, the secondary division identification number is calculated as O based on expression (18), and the internal division ratio is calculated as 0. At S550, based on the internal division ratio, the coordinates of the first major line point that is either of both end points of the reference minor line is identified as the first minor line point belonging to the subdivided triangle.
In a similar manner, when idy=1, both end points (that is, the base point AB in this example) of the adjacent minor line (that is, the minor line set for the first major line point that is maj_div_idx=0) of the minor line pair is identified at S540. At S545, the secondary division identification number is calculated as 0 based on expression (18) and the internal division ratio is calculated as 0. At S550, based on the internal division ratio, the coordinates (that is, the base point AB in this example) of the first major line point that is either of both end points of the adjacent minor line is identified as the second minor line point belonging to the subdivided triangle.
In a similar manner, when idy=2, both end points of the reference minor line (that is, the minor line set for the first major line point that is maj_div_idx=1) of the minor line pair is identified at S540. At S545, the secondary division identification number is calculated as 1 based on expression (18) and the internal division ratio is calculated as 1/1=1. At S550, based on the internal division ratio, the coordinates of the second major line point that is the other of both end points of the reference minor line is identified as the third minor line point belonging to the subdivided triangle.
In this manner, regarding the subdivided triangle specified by idx=9, the combination method of the minor line points belonging to the subdivided triangle is identified (that is, the first specifying pattern). Then, the position vectors (that is, the coordinates) identified in order based on the combination method are stored in the array tess_vert[idy][idx].
The calculation apparatus 20 performs a similar process for the subdivided triangles specified by idx=0 to R−1. As a result, the array tess_vert[idy] [idx] including the vertex coordinates of a total of an R number of subdivided triangles is obtained.
In this manner, based on simple rules using the displacement amount that serves as the combination information, the subdivided triangles that divide the area sandwiched between the minor line pair without overlapping one another and connect minor line points that are adjacent to each other are generated.
The following effects are achieved according to the first embodiment described in detail above.
At S155, the calculation apparatus 20 generates the new array vertices[ ] including the vertex coordinates of the triangles after division. At S2, in multi-stage division (that is, S12) following pre-shaping, the calculation apparatus 20 calculates the coordinates of the vertices of the plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle for each basic triangle defined by the coordinates of the vertices including the new vertex coordinate group generated at S155.
In the calculation apparatus 20 such as this, the basic triangle defined by the coordinates of the vertices included in the new array vertices[ ] generated at S155 has a shape having a relatively high degree of similarity to an equilateral triangle as a result of S150 being performed. The calculation apparatus 20 calculates the coordinates of the vertices of the plurality of subdivided triangles for each of the basic triangles such as this. Therefore, compared to a case in which the basic triangle is divided into the subdivided triangles without S150 being performed, the subdivided triangles having a relatively high degree of similarity to an equilateral triangle can be obtained. As a result, the new subdivided triangles generated by the basic triangle being divided can be suppressed from becoming less like an equilateral triangle.
At S23, the calculation apparatus 20 calculates the coordinates of the vertices of the subdivided triangle for each minor line pair set for each first major line using the array vertices[ ], maj_vert_num, and the combination information. The combination information is information specifying the combination method of the minor line points belonging to each subdivide triangle for each minor line pair that is set for each major line point. The subdivided triangle refers to one or more triangles that divide an area of the basic triangle sandwiched between the minor line pair without overlapping each other with the minor line points on two minor lines belonging to the minor line pair as vertices, for each minor line pair.
The calculation apparatus 20 such as this can set a spacing of the first major line points and a spacing of the minor line points to be substantially similar through division based on the division length d0. That is, of the three sides of the subdivided triangle, sides that run along two sides can be set to substantially the same length. The two sides are the side along the first major line on which the first major line points are set and the minor line on which the minor line points are set. Therefore, the basic triangle can be divided into the subdivided triangles that have a shape having a relatively high degree of similarity to an equilateral triangle. As a result, the new subdivided triangle generated by the basic triangle being divided can be suppressed from becoming unlike an equilateral triangle. Here, according to the present embodiment, when the basic triangle has a shape having a relatively high degree of similarity to an equilateral triangle, a greater effect can be achieved.
The calculation apparatus 20 such as this can set the side that runs along the second major line on which the second major line points are set, among the three sides of the subdivided triangle, to be relatively close to the division length do. As a result, the subdivided triangle can be made to have a shape having a relatively high degree of similarity to an equilateral triangle.
In order along the minor line means in order of array of the minor line points on the minor line. Alternately refers to the adjacent minor line point being subsequently specified after the reference minor line point is specified, and the reference minor line point being subsequently specified after the adjacent minor line point is specified.
The calculation apparatus 20 can specify the minor line point belonging to the subdivided triangle including two sides corresponding to the division length do by specifying the minor line point belonging to the triangle by alternately moving between two minor lines in the minor line pair. The two sides corresponding to the division length do are the side parallel to the first major line and the side included on the minor line in the subdivided triangle dividing the area sandwiched between the minor lines. As a result, the basic triangle can be divided into a plurality of subdivided triangles that have a shape having a relatively high degree of similarity to an equilateral triangle.
The calculation apparatus 20 can obtain a shape having a relatively high degree of similarity to an equilateral triangle for the subdivided triangle that projects towards the base point AB side in the first specifying pattern and for the subdivided triangle that projects towards the side opposite the base point AB in the second specifying pattern.
The calculation apparatus 20 can uniformly identify the combination method of the minor line points belonging the subdivided triangle using the combination information.
Because the combination number can be simple information having regularity based on the displacement amount, an information amount of the combination information can be reduced. As a result, generation when the calculation apparatus 20 generates the combination information is facilitated, and memory capacity when the calculation apparatus 20 stores the combination information in advance can be reduced.
The calculation apparatus 20 corresponds to a triangle generation apparatus. The array vertices[ ] corresponds to a vertex coordinate group. The value of the first term in expression (2) corresponds to the primary division number and the value of the first term in expression (10) corresponds to the secondary division number. The first major line corresponds to the first side. The second major line corresponds to the second side. The third major line corresponds to the third side. The first major line point corresponds to the primary division point and the minor line point corresponds to the secondary division point. maj_div_idx corresponds to the primary division point identification number and min_div_idx corresponds to the secondary division point identification number. maj_div_offset corresponds to the displacement amount of the primary division point identification number and min_div_offset corresponds to the displacement amount of the secondary division point identification number.
S1 corresponds to a process as an acquisition unit. S2 corresponds to a process as a triangle division unit. S11 corresponds to a process as a pre-shaping unit. S120 corresponds to a process as a target determining unit. S150 corresponds to a process as a pre-shaping execution unit. S155 corresponds to a process as an addition unit. S21 and S240 correspond to a process as a primary division number setting unit. S22 and S350 correspond to a process as a secondary division number setting unit. S23 corresponds to a process as an execution unit. S33 corresponds to a process as a primary identification setting unit. S545 corresponds to a process as a secondary identification setting unit.
A second embodiment of the present disclosure will be described below with reference to the drawings. Here, sections according to the second embodiment differing from those according to the first embodiment will be described. Common configurations are given the same reference numbers.
The calculation apparatus 20 according to the second embodiment differs from that according to the first embodiment in that a GPU 22 is included and various types of processes are performed in parallel using the GPU 22. For example, the GPU 22 serving as the calculation apparatus 20 may perform pre-shaping at S11 and multi-stage division at S12.
For example, the GPU 22 may perform the processes repeatedly performed for each basic triangle specified by the value stored in idx in parallel by parallel processing in pre-shaping performed at S11.
Specifically, S105 to S130 shown in
In addition, for example, in multi-stage division performed at S12, the GPU 22 may perform the processes repeatedly performed for each basic triangle specified by the value stored in idx or the processes repeatedly performed for each first major line point specified by the value stored in idx in parallel by parallel processing.
Specifically, because S200 to S260 shown in
In addition, the calculation apparatus 20 such as this sets the first major line points in parallel for each basic triangle in multi-stage division. Therefore, processing speed of multi-stage division and triangle division can be improved. Furthermore, the calculation apparatus 20 such as this calculates the coordinates of the vertices of the subdivided triangle in parallel for each first major line. Therefore, processing speed of multi-stage division and triangle division can be improved.
According to the second embodiment, the GPU 22 corresponds to the triangle processing apparatus. Here, instead of the GPU 22, the CPU 21 capable of performing parallel processing may perform the above-described parallel processing. In this case, the CPU 21 capable of performing parallel processing corresponds to the triangle generation apparatus.
A third embodiment of the present disclosure will be described below with reference to the drawings. Here, sections according to the third embodiment differing from those according to the second embodiment will be described. Common configurations are given the same reference numbers.
According to the above-described second embodiment, for example, an aspect in which parallel processing by the GPU 22 may not be performed in the processes for calculating the cumulative sum such as S135, S270, and S390 is described. However, for example, the GPU 22 may perform parallel processing in the processes for calculating the cumulative sum as well by performing cumulative sum parallel processing described hereafter.
The cumulative sum parallel processing will be described with reference to a flowchart in
In the present process, an array input[idx] is the input array. The array input[idx] is an array that stores values for which the cumulative sum is to be calculated.
When the cumulative sum parallel processing is ended, the cumulative sum of the array input[idx] is stored in the array input[idx]. For example, regarding array input[0] to input[S−1], in a case in which an S number of cumulative sums are calculated, when the cumulative sum parallel processing is ended, the element input[0] of the array specified by idx=0 may be stored in the array input[0]. A 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]. In addition, a total sum of each of the element input[0] of the array to the element input[S−1] of the array is stored in the array input[S−1].
First, at S600, the GPU 22 acquires the array input[idx] of which the number of elements is S. The range of idx is 0≤idx≤S−1.
Next, at S610, the GPU 22 stores 1 in a variable stride.
At subsequent S620, the GPU 22 stores 0 in idx.
Next, at S630, the GPU 22 determines whether idx-stride≥0. Here, when idx-stride<0, the GPU 22 transitions the process to S650. Meanwhile, when idx−stride≥0, the GPU 22 transitions the process to S640.
At S640, the sum of the element input[idx] of the array and the element input[idx-stride] of the array is stored as the new element input[idx] of the array.
At S650, the GPU 22 increments idx. That is, the GPU 22 stores, in idx, a value obtained by adding 1 to the value stored in idx.
At S670, the GPU 22 determines whether the value stored in idx is equal to or greater than S. Here, when determined that the value is equal to or greater than S, the GPU 22 transitions the process to S670. Meanwhile, when determined that the value is less than S, the GPU 22 transitions the process to S630 and repeats the processes at S630 to S660.
At S670, stride*2 is stored as a new value of stride.
At S680, stride is incremented. That is, the GPU 22 stores, in stride, a value obtained by adding 1 to the value stored in stride i.
At S690, the GPU 22 determines whether the value stored in stride is equal to or greater than S. Here, when determined that the value is less than S, the GPU 22 transitions the process to S620 and repeats the processes at S620 to S690. Meanwhile, when determined that the value is equal to or greater than S, the calculation apparatus 20 thereby ends the present cumulative sum parallel processing.
As a result of the cumulative sum parallel processing being performed, as shown in
For example, at S135, the above-described array input[ ] may be replaced with array flag[ ]. As a result of the above-described cumulative sum parallel processing being performed, the total sum (that is, the cumulative sum) of the element flag[idx] of the array is stored in the element flag[L−1] of the array.
In addition, for example, at S270, the above-described array input[ ] may be replaced with array maj_vert_num[ ]. As a result of the above-described cumulative sum parallel processing being performed, the cumulative sum Q is stored in the element maj_vert_num[P−1] of the array.
Furthermore, for example, at S390, the above-described array input[ ] may be replaced with array prim_num_per_edge[ ]. As a result of the above-described cumulative sum parallel processing being performed, the cumulative sum R is stored in the element maj_vert_num[Q−1] of the array.
In this manner, as a result of the calculation apparatus 20 performing parallel processing for each idx in cumulative sum as well, the processing speed can be further improved. In addition, the calculation apparatus 20 can set a thread for each first major line point and perform the triangle division in parallel for each first major line point. Therefore, processing speed can be further improved.
According to the third embodiment, the GPU 22 corresponds to the triangle processing apparatus. Here, instead of the GPU 22, the CPU 21 capable of performing parallel processing may perform the above-described parallel processing. In this case, the CPU 21 capable of performing parallel processing corresponds to the triangle generation apparatus.
Embodiments of the present disclosure are described above. However, the present disclosure is not limited to the above-described embodiments and can be modified in various ways.
A triangle generation apparatus including: an acquisition unit (S1) that is configured to acquire a vertex coordinate group including coordinates of each vertex of one or a plurality of basic triangles; and a triangle division unit (S2) that is configured to divide each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles, in which the triangle division unit includes a target determining unit (S120) that is configured to determine whether each basic triangle defined by the vertex coordinate group is a target triangle that has a shape having a relatively high degree of similarity to an equilateral triangle, a pre-shaping execution unit (S150) that is configured to divide the basic triangle determined to not be the target triangle into a plurality of triangles to have the shape having a relatively high degree of similarity to an equilateral triangle, and an addition unit (S155) that is configured to generate the new vertex coordinate group including the vertex coordinates of the triangles after division, and for each basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group generated by the addition unit, the triangle division unit calculates the coordinates of the vertices of a plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle.
The triangle generation apparatus according to item 1, in which: the target determining unit determines whether a maximum value of an interior angle is less than an allowable angle for each basic triangle, and determines that the basic triangle is the target triangle when the maximum value of the interior angle is less than the allowable angle and determines that the basic triangle is not the target triangle when the maximum value of the interior angle is equal to or greater than the allowable angle.
The triangle generation apparatus according to item 1 or 2, in which: the pre-shaping execution unit divides the basic triangle into two by a bisector that bisects an interior angle having a maximum value in the basic triangle when the target determining unit determines that the basic triangle is not the target triangle.
The triangle generation apparatus according to any one of items 1 to 3, in which: the triangle division unit further includes a primary division number setting unit (S21, S240) that is configured to set a primary division number (M) when a first side of the basic triangle is equally divided based on a division length prescribed in advance, a secondary division number setting unit (S22, S350) that is configured to set a secondary division number (N) when a minor line is equally divided based on the division length, the minor line being set for each of a plurality of primary division points set on the first side, and an execution unit (S23) that is configured to acquire combination information, the combination information being information specifying a combination method of secondary division points belonging to the subdivided triangle for each minor line pair set for each primary division point, the subdivided triangle being one or more triangles dividing an area of the basic triangle sandwiched between the minor line pair without overlapping each other and with the secondary division points on the two minor lines belonging to the minor line pair as vertices, and calculate the coordinates of the vertices of the subdivided triangle for each minor line pair set for each primary division point using the vertex coordinate group, the primary division number, and the combination information, and the primary division points are a plurality (M+1) of points including both end points of the first side and in positions equally dividing the first side by the primary division number, the minor line is a line segment that passes through the primary division point and runs from the first side to a second side along a third side, the secondary division points are a plurality (N+1) of points including both end points of the minor line and equally dividing the minor line by the secondary division number, and the minor line pair is a combination of two arbitrary adjacent minor lines among the minor lines, and the triangle division unit sets the primary division number by the primary division number setting unit and the secondary division number by the secondary division number setting unit for each basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group generated by the addition unit and calculates, by the execution unit, the coordinates of the vertices of the plurality of subdivided triangles that divide the area of the basic triangle into parts smaller than the basic triangle.
The triangle generation apparatus according to item 4, in which: in the basic triangle, the first side is an opposing side of an interior angle having a largest angle, the second side is an opposing side of an interior angle having a second largest angle to the largest angle, and the third side is an opposing side of an interior angle having a smallest angle.
The triangle generation apparatus according to item 4 or 5, in which: the combination information alternately specifies a secondary division point on a minor line set for each primary division point and a secondary division point on an adjacent minor line, for each minor line pair set for each primary division point when specifying the secondary division points belonging to a single subdivided triangle.
The triangle generation apparatus according to any one of items 4 to 6, further including: a primary division point identification setting unit (S330) that is configured to set a primary division point identification number identifying each primary division point for each primary division point; and
The triangle generation apparatus according to any one of items 4 to 7, in which: the execution unit calculates the coordinates of the vertices of the subdivided triangles in parallel for each primary division point.
A triangle generation method that is configured to acquire a vertex coordinate group including coordinates of each vertex of one or a plurality of basic triangles and divide each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles, the triangle generation method including: determining whether each basic triangle defined by the vertex coordinate group is a target triangle that has a shape having a relatively high degree of similarity to an equilateral triangle (S120); dividing the basic triangle determined to not be the target triangle into a plurality of triangles to have the shape having a relatively high degree of similarity to an equilateral triangle (S150); generating the new vertex coordinate group including the vertex coordinates of the triangles after division (S155); and for each basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group, calculating the coordinates of the vertices of a plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle.
A non-transitory computer-readable storage medium storing a triangle generation program that causes a computer to function as a triangle generation apparatus, the triangle generation program including: an acquiring step (S1) that is configured to acquire a vertex coordinate group including coordinates of each vertex of one or a plurality of basic triangles; and a triangle dividing step (S2, S12) that is configured to divide each basic triangle defined by the coordinates of the vertices included in the vertex coordinate group into a plurality of subdivided triangles, in which the triangle dividing step includes a target determining step (S120) that is configured to determine whether each basic triangle defined by the vertex coordinate group is a target triangle that has a shape having a relatively high degree of similarity to an equilateral triangle, a pre-shaping executing step (S150) that is configured to divide the basic triangle determined to not be the target triangle into a plurality of triangles to have the shape having a relatively high degree of similarity to an equilateral triangle, and an adding step (S155) that is configured to generate the new vertex coordinate group including the vertex coordinates of the triangles after division, and for each basic triangle defined by the coordinates of the vertices included in the new vertex coordinate group generated at the adding step, the coordinates of the vertices of a plurality of subdivided triangles dividing an area of the basic triangle into parts smaller than the basic triangle are calculated.
Number | Date | Country | Kind |
---|---|---|---|
2022-102150 | Jun 2022 | JP | national |
The present application is a continuation application of International Application No. PCT/JP2023/023360, filed on Jun. 23, 2023, which claims priority to Japanese Patent Application No. 2022-102151, filed on Jun. 24, 2022. The contents of these applications are incorporated herein by reference in their entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2023/023354 | Jun 2023 | WO |
Child | 18990421 | US |