CN-121999171-A - Flow chart generation method, device, electronic equipment, storage medium and program product
Abstract
The flow chart generation method comprises the steps of firstly analyzing a geometric grid of a target model, determining two vertexes which are farthest from each other on the geometric grid and serve as target position point pairs, then identifying the target position point pairs according to preset judging rules to distinguish a starting point and an ending point, then calculating and generating a guide path extending from the starting point to the ending point on the surface of the geometric grid, and finally calculating and generating a flow chart corresponding to the geometric grid based on the guide path. The flow direction path attached to the surface of the model can be automatically constructed by utilizing the geometric topological features of the geometric grid, so that the flow direction data and the geometric structure of the model are effectively matched while the manufacturing efficiency of the flow direction diagram is improved.
Inventors
- LI KEFAN
Assignees
- 网易(杭州)网络有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251212
Claims (12)
- 1. A flow chart generation method, the method comprising: Determining a target position point pair on a geometric grid of a target model, wherein the target position point pair is two vertexes which are farthest from each other on the geometric grid; Identifying a starting point and an ending point from the target position point pair based on a preset judging rule; generating a guide path extending from the start point to the end point on the surface of the geometric grid; Based on the guiding path, a flow graph of the geometric grid is generated.
- 2. The method of claim 1, wherein said determining target location point pairs on said geometric grid comprises: determining a bounding box of the geometric grid; Obtaining a plurality of vertexes intersecting with the boundary of the bounding box on the geometric grid to obtain a candidate vertex set; And calculating Euclidean distance between any two vertexes in the candidate vertex set, and determining the two vertexes with the largest Euclidean distance as the target position point pair.
- 3. The method according to claim 1 or 2, wherein identifying a start point and an end point from the target location point pair based on a preset decision rule comprises: Acquiring coordinate information of two vertexes of the target position point pair under a world coordinate system; Calculating the distance difference between the two vertexes in the directions of a first coordinate axis, a second coordinate axis and a third coordinate axis, and determining the coordinate axis with the largest distance difference as a target judgment axis; And identifying a starting point and an ending point from the target position point pair according to the target determination axis.
- 4. A method according to claim 3, wherein said identifying a start point and an end point from said target location point pair based on said target determination axis comprises: If the target judging axis is the second coordinate axis, recognizing a vertex with a larger coordinate value of the second coordinate axis of the two vertexes as a starting point; If the target judging axis is the first coordinate axis, recognizing a vertex with a smaller absolute value of the first coordinate axis coordinate in the two vertexes as a starting point; If the target judging axis is the third coordinate axis, recognizing a vertex with a larger coordinate value of the third coordinate axis of the two vertexes as a starting point; And identifying the other vertex of the target position point pair, which is not identified as the starting point, as the ending point.
- 5. The method of claim 1, wherein the generating a guide path extending from the start point to the end point at the surface of the geometric grid comprises: And calculating the shortest path from the starting point to the ending point on the surface of the geometric grid by adopting a shortest path searching mode, and obtaining the guiding path.
- 6. The method of claim 1, wherein the generating a flow graph of the geometric mesh based on the guide path comprises: Calculating the flow direction vector of the geometric grid surface according to the extending direction of the guide path on the geometric grid surface to obtain initial flow direction data of the geometric grid surface; Performing attribute fuzzy smoothing on the initial flow direction data to obtain flow direction data of the geometric grid; And generating a flow chart of the geometric grid according to the flow data.
- 7. The method of claim 6, wherein generating a flow graph of the geometric mesh from the flow data comprises: Calculating the volume data of the geometric grid, and mapping the volume data to a preset numerical range; and writing the flow direction data into a first color channel and a second color channel of the target texture, and writing the mapped volume data into a third color channel of the target texture to obtain the flow direction diagram.
- 8. The method of claim 1, wherein prior to the step of determining the target location point pairs on the geometric grid, further comprising: And performing connectivity analysis on the target model, and separating the target model into a plurality of independent geometric grids.
- 9. A flow chart generating apparatus, the apparatus comprising: The target point pair confirming module is used for confirming a target position point pair on a geometric grid of a target model, wherein the target position point pair is two vertexes which are farthest from each other on the geometric grid; The judging module is used for identifying a starting point and an ending point from the target position point pair based on a preset judging rule; A guide path generation module for generating a guide path extending from the start point to the end point on the surface of the geometric grid; And the flow chart generating module is used for generating the flow chart of the geometric grid based on the guide path.
- 10. An electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the flow graph generation method of any of claims 1 to 8.
- 11. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the flow graph generation method of any one of claims 1 to 8.
- 12. A computer program product comprising computer instructions for causing a computer to perform the flow graph generation method of any one of claims 1 to 8.
Description
Flow chart generation method, device, electronic equipment, storage medium and program product Technical Field The present disclosure relates to the field of computer graphics, and in particular, to a flow chart generating method, apparatus, electronic device, storage medium, and program product. Background In three-dimensional digital content authoring, in order to represent dynamic visual effects (e.g., streamer, pneumatic, etc.) of a character or object surface, it is often necessary to make a flow chart to define the flow direction of the texture. For complex three-dimensional models containing a large number of geometric structures (such as feathers in a wing), existing flow chart creation typically relies on the manual drawing of artwork personnel in three-dimensional software or mapping software, or the use of semi-automated tools that require manual specification of guidewires. However, the manner of relying on manual operation is low in manufacturing efficiency, and is difficult to meet the production requirement of large-scale assets, and because of being limited by subjective experience of artistic staff, the drawn flow direction is difficult to precisely attach to the actual growth direction or extension direction of the slender geometric grid, so that the final rendering effect is not natural and real enough. Therefore, a method for generating a flow chart is needed to solve the problems of low flow chart manufacturing efficiency and difficult precise fitting of the flow direction to the model geometry in the related art. Disclosure of Invention The disclosure provides a flow chart generation method, a flow chart generation device, electronic equipment, a storage medium and a program product, which are used for solving the problems that in the related art, the flow chart manufacturing efficiency is low, and the flow direction is difficult to accurately attach to a model geometry structure. In a first aspect, the present disclosure provides a flow chart generating method, including: Determining a target position point pair on a geometric grid of the target model, wherein the target position point pair is two vertexes which are farthest from each other on the geometric grid; Identifying a start point and an end point from a target position point pair based on a preset judging rule; Generating a guide path extending from a start point to an end point on the surface of the geometric grid; based on the guide path, a flow graph of the geometric mesh is generated. According to the flow chart generation method, two vertexes farthest from each other are directly determined on the geometric grid, two ends of a geometric body can be objectively and accurately locked, subjective errors of manual judgment are avoided, a starting point and an ending point are automatically identified by combining a preset judgment rule without manual one-by-one marking, a guide path connecting the starting point and the ending point is further generated along the surface of the grid, and the generated guide line is guaranteed to be strictly attached to topological structure and geometric fluctuation of a three-dimensional model instead of simple space straight line connection. In conclusion, the method changes the production of the flow chart from traditional manual subjective drawing to geometric objective extraction, not only remarkably improves the automation degree and the production efficiency of flow chart generation, but also solves the problem that flow data cannot be accurately matched with the surface bending change of the three-dimensional model due to two-dimensional drawing in the related technology, and ensures that the finally generated flow chart is highly attached to the real geometric structure of the model in visual performance. In an alternative embodiment, determining pairs of target location points on a geometric grid includes: determining a bounding box of the geometric grid; obtaining a plurality of vertexes intersecting with the boundary of the bounding box on the geometric grid to obtain a candidate vertex set; And calculating Euclidean distance between any two vertexes in the candidate vertex set, and determining the two vertexes with the largest Euclidean distance as target position point pairs. The present disclosure also calculates distances by bounding box techniques, which only acquire vertices that intersect bounding box boundaries as candidate sets, rather than traversing the distances between all vertices on the computational grid. The scale of distance calculation is reduced from full quantity of vertexes to a minimum number of edge vertexes, so that the complexity of calculation is greatly reduced. In an alternative embodiment, identifying a start point and an end point from a target location point pair based on a preset decision rule includes: Acquiring coordinate information of two vertexes of a target position point pair under a world coordinate system; Calculating the distance differe