A method for quickly solving ordered edge chain of manifold curved surface model
By quickly solving the edge chain of manifold surface models, the problems of wasted computing resources and inflexible construction in traditional methods are solved, and efficient and cross-language edge chain acquisition is achieved, which is suitable for applications such as model flattening, mapping and rendering.
Patent Information
- Application Number
- CN202310550114.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-05-16
AI Technical Summary
Existing technologies for obtaining edge chains of manifold surface models have problems such as cumbersome traditional methods, waste of computing power, information redundancy, and inflexible construction of pointer-free programming languages, which are particularly evident in programming languages such as JavaScript and TypeScript.
A fast solution method for ordered edge chains of manifold surface models is adopted. By importing model data, parsing vertex and facet sets, and combining the extreme endpoints in the ±X, ±Y, and ±Z directions to determine edge points, the multi-array structure is used to replace the half-edge data structure to directly determine the order of the edge chain, avoiding complete traversal and waste of computing power.
It improves the edge chain solution speed, reduces computing resource consumption, expands the applicability of the model range, and provides a basis for cross-language deployment. The edge chain has its own logical order and does not require additional organization. It is suitable for applications such as model flattening, mapping and rendering.
Smart Images

Figure CN116630574B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of three-dimensional graphics, and particularly relates to a fast solution method of an ordered edge chain of a manifold surface model. BACKGROUND
[0002] With higher computing power provided by hardware, computer graphics technology has been greatly developed, which has given birth to a series of model processing methods.
[0003] Since a manifold surface composed of a sufficient number of triangular facets can approximate any complex surface, the data structure is simplified, and therefore the manifold surface is widely used in model representation, and model flattening, mapping, rendering and other technologies are derived.
[0004] Among them, the model flattening technology is applied in the fields of medical observation, model appearance drawing and computer-aided design, and obtaining the model edge to identify the inner and outer vertices is a necessary step before the model flattening operation.
[0005] Obtaining the model edge chain needs to access the adjacent relationship between the model points, lines and facets, and the general method is to convert the model into a half-edge data structure, which stores the above relationship in the form of a pointer variable and can be directly accessed through the pointer variable, but for computer languages without the concept of pointers, such as JavaScript, TypeScript and the like, it is not flexible to build and access the half-edge data structure, that is, this method has limitations.
[0006] At the same time, the process of converting the model into a half-edge data structure will waste computing power; for the task of obtaining the edge chain, the half-edge information in the half-edge data structure will not be used, so the storage is wasted. In addition, the general method is to first identify all the edge vertices through traversal, and then sort and arrange the edge vertices, which is obviously tedious and wastes computing resources; therefore, a general and efficient model edge obtaining method is needed. SUMMARY
[0007] In order to solve the problem of extracting the edge chain of the model represented by the triangular facet of the format such as.stl,.obj,.babylon and the like, the traditional method only completely traverses and analyzes all points, the obtained edge points lack the order, the programming language without pointer concept such as JavaScript, TypeScript and the like is not flexible in constructing the half edge data structure, the information redundancy problem caused by the half edge data structure, the waste of computing power caused by the construction of the half edge data structure, the problem that the ordered edge chain cannot be obtained under the non-half edge data structure and the like, the present application provides a kind of ordered edge chain fast solution method of manifold curved surface model.The present application provides the basis of cross-language programming, is efficient, fast, and the obtained edge chain has order, and does not need to be sorted.
[0008] To solve the above technical problems, the technical scheme adopted by the present application is:
[0009] The present application provides a kind of ordered edge chain fast solution method of manifold curved surface model, comprising the following steps:
[0010] Step S01: import manifold curved surface model data;
[0011] Step S02: respectively analyze the vertex and facet data set of the model, and store as vertex array P and facet array F;
[0012] Step S03: analyze and form all vertex connecting facet set, and store as array Wheel;
[0013] Step S04: respectively analyze the maximum and minimum endpoints corresponding to ±X, ±Y and ±Z six directions, judge whether there is an edge point, if yes, store the first discovered edge point as the first element predge (1,1) of array predge, and execute step S06; if not, execute step S05;
[0014] Step S05: at this time, the points in step S04 are judged as internal vertices, the internal vertices are the points in the area surrounded by the edge chain on the manifold curved surface, the internal points and the edge points are in opposite relationship; analyze each point in order of odd number first and even number second until the first edge point is analyzed, and store as the first element predge (1,1) of array predge;
[0015] Step S06: analyze the two adjacent edge points of the first edge point, and take one of them as the next analysis point, and store as the second element predge (1,2) of array predge;
[0016] Step S07: two other adjacent edge points of the next edge point predge(1,2) are analyzed, a non-up point is selected as a new analysis point, and all edge points are obtained by analogy, and the array predge is completed;
[0017] Step S08: all edge points are stored to form an edge chain.
[0018] The beneficial effects of the present application are:
[0019] The present application innovates the edge chain solving idea, quickly solves the first edge point by preferentially judging the maximum end point of the manifold surface model in six directions of ±X, ±Y and ±Z in combination with odd and even traversal modes, and effectively improves the solving speed;
[0020] The present application proposes a precise edge point criterion, recursively determines the edge chain in combination with the adjacent relationship between the first edge point and other edge points, avoids the time and algorithm waste problem of complete traversal, improves the solving speed, and the edge chain obtained has a sequence without additional sequence arrangement;
[0021] The present application proposes an edge chain acquisition method under a non-half-edge data structure, replaces the half-edge data structure with a plurality of arrays, completely solves the information redundancy and algorithm waste problem caused by the half-edge data structure, widens the solvable model range, and provides a prerequisite for algorithm cross-language deployment.
[0022] The present application has more obvious acceleration effect for the manifold surface model with more number of patches, and is helpful to improve the real-time performance of applications such as UV expansion and mapping.
[0023] The edge chain obtained by the present application is complete and has a logical sequence, and can improve the quality of any application that needs to edit the edge chain. DETAILED DESCRIPTION
[0024] Figure 1 is the overall step schematic diagram of the ordered edge chain fast solving method of the manifold surface model of the present application;
[0025] Figure 2 is a schematic diagram of a simple manifold surface model.
[0026] Figure 3 is a structure schematic diagram of the array P and F;
[0027] Figure 4 is a schematic diagram of an algorithm for searching the maximum value of a vector;
[0028] Figure 5 is a method flowchart for judging edge points.
[0029] Figure 6 is a schematic diagram of three experimental manifold surface models.
[0030] Figure 7 is a schematic diagram of a result of one experiment.
[0031] Figure 8 is a schematic diagram of a curve plotted according to results of multiple experiments. DETAILED DESCRIPTION
[0032] The present application will be further described and illustrated by specific embodiments. The embodiments are only exemplary and do not circumscribe the scope of the present disclosure. The technical features of various embodiments of the present application can be combined in a corresponding manner without conflict, provided that there is no conflict.
[0033] As shown in Figure 1 , the flowchart of the ordered edge chain fast solving method of the manifold surface model is as follows: the manifold surface model is a manifold surface model composed of triangular surface elements, and the data includes vertex number, vertex three-dimensional coordinate set, surface element number, and vertex number set of each surface element;
[0034] Step S01: import the manifold surface model data;
[0035] Step S02: analyze the vertex and surface element data set of the model respectively, and store them as vertex array P and surface element array F;
[0036] Step S03: analyze and form the relationship set of all vertex adjacent surface elements, and store them as array Wheel;
[0037] Step S04: analyze the maximum and minimum endpoints corresponding to the ±X, ±Y, and ±Z six directions respectively, determine whether there are edge points, if there are, store the first discovered edge point as the first element predge(1,1) of array predge, and execute step S06; if not, execute step S05;
[0038] Step S05: if all points in step S04 are determined to be internal vertices, the internal vertices are points in the area surrounded by the edge chain on the manifold surface, the internal points and the edge points are in an opposite relationship, as shown in Figure 2 the vertices 1-10 in the manifold surface model are internal vertices, and the vertices 11-14 are edge vertices. Then analyze each point in order of odd number first and even number second until the first edge point is analyzed, and store it as the first element predge(1,1) of array predge;
[0039] Step S06: analyze the two adjacent edge points of the first edge point, and take one of them as the next analysis point, and store it as the second element predge(1,2) of array predge;
[0040] Step S07: Analyzing the other two adjacent edge points of the next edge point predge(1,2), selecting a non-up point as a new analysis point, and so on, to obtain all edge points and complete the array predge;
[0041] Step S08: Storing all edge points to form an edge chain.
[0042] In one embodiment of the present application, the step S02 comprises the following steps:
[0043] 2.1 Creating a vertex array P with a dimension of n p x 3; and a face array F with a dimension of n f x 3; wherein n p is the total number of vertices in the model, and n f is the total number of faces in the model.
[0044] 2.2 Searching for the three-dimensional coordinates x, y, and z of each vertex in the original data of the three-dimensional model, and assigning them to the rows of the array P in sequence, i.e., the three elements of any row of the array P store the three-dimensional coordinate values of a vertex in the order of x, y, and z, and the row index number of the array P corresponds to the number of the vertex; for example, Figure 3 Left.
[0045] 2.3 Searching for the three vertices of each face in the original data of the three-dimensional model, and assigning the index numbers of the three vertices to the rows of the array F in sequence, i.e., the three elements of any row of the array F store the numbers of the three vertices of a triangular face in the order of the original data of the model, and the row index number of the array F corresponds to the number of the face; for example, Figure 3 Right.
[0046] In one embodiment of the present application, the step S03 comprises the following steps:
[0047] 3.1 Creating an array Wheel with a dimension of n p x 30, and initializing all values to 0.
[0048] 3.2 Searching for the adjacent face (a triangular face in which any one vertex is the vertex numbered 1 is called the adjacent face of the vertex numbered 1) of the vertex numbered 1, i.e., traversing the array F to search for the first row in which the vertex numbered 1 is located (i.e., finding the first adjacent face of the vertex numbered 1, and the three vertex data of the face are in a row of the array F), and assigning the three vertex data in the row to Wheel(1,1)~Wheel(1,3) in sequence,
[0049] 3.3 Again traverse the array F, search the second row where the vertex with number value 1 is located, keep the 3 vertex data of this row in order, and assign them to the array Wheel(1,4)~Wheel(1,6);
[0050] 3.4 Repeat steps 3.2 and 3.3 until all the 3 data in each row where the vertex with number value 1 is located in the array F are stored in the first row of Wheel;
[0051] 3.5 In order, search the adjacent facet elements of the vertices with numbers 2~n p , that is, change the search number, repeat steps
[0052] 3.2-3.4, complete the 2~n p rows of Wheel, each row representing the vertex set of all the adjacent facet elements corresponding to each vertex.
[0053] In one specific embodiment of the present application, the step S04 comprises the following steps:
[0054] 4.1 Create an array Maxmin with a dimension of 1x 6, and an array predge with a dimension of 1x n p , with elements initialized to 0.
[0055] 4.2 According to the algorithm of "compare one by one and select the larger one" (for example, Figure 4 ), find the array index row numbers of the corresponding points of the maximum values x max , y max , z max of each column in the array P, each row number corresponding to a vertex, and find the array index numbers (row numbers) of the corresponding points of the minimum values x min , y min , z min according to the algorithm of "compare one by one and select the smaller one", and assign each row number to the array Maxmin.
[0056] 4.3 Determine whether the points corresponding to the 6 index numbers in the array Maxmin are edge points (the determination basis is given in 4.4-4.6 below), if there is an edge point, stop determining the following points, and assign this edge point to the array predge(1,1).
[0057] The above step 4.3 is specifically:
[0058] 4.3.1 In the model of a manifold surface, because a side is shared by at most two facet elements, there are only two sharing states of the side, that is, shared by 1 facet element or 2 facet elements, and the side shared by two facet elements must be an internal side, and the side shared by a single facet element must be an edge side.
[0059] 4.3.2 Based on the expression of 4.3.1, in combination with the array Wheel, the judgment basis is summarized and given as follows: the data in one row of the array Wheel corresponds to the index number of all adjacent vertices on all adjacent triangles of a vertex (the row index number of the array P), if all values in the Wheel row corresponding to a vertex all appear in pairs, then the vertex is an internal vertex, if there is a single value appearing in the Wheel row, then the point is necessarily an edge vertex.
[0060] 4.3.3 As Figure 5 , the specific steps of judging whether the values described in 4.3.2 appear in pairs are as follows: a new intermediate variable vector Judge is created, with a dimension of 2x1, all elements are initialized to 0, an int integer variable IsaEdPoint is created to assist logical judgment, the initial value is assigned to 0, Maxmin is taken as the row number of the array Wheel in turn, all elements in the row are traversed, it is judged whether other elements are equal to the value of the element traversed at present, if equal, the logical variable IsaEdPoint is incremented by 1, if not equal, IsaEdPoint remains 0; after each element is compared and traversed, IsaEdPoint is analyzed, if IsaEdPoint is greater than 1, it indicates that the element appears twice or more, the point corresponding to the current row number is an internal vertex, if IsaEdPoint is 1, it indicates that the element appears once, the point corresponding to the current row number is an edge vertex; if IsaEdPoint is 1, the value of the element traversed at this time is assigned to the vector Judge(1,1), and the traversal is continued, the value of the element with IsaEdPoint being 1 is assigned to the vector Judge(2,1), during this period, if the element with IsaEdPoint being 1 is equal to the value of the Maxmin element traversed at present, no operation is performed, and the analysis is continued. Until Judge(2) is not 0, the analysis is completed.
[0061] In one specific embodiment of the present application, the step S05 comprises the following steps:
[0062] 5.1 Create a new int integer variable IsaEdPoint to assist in logical judgment. The initial value is assigned to 1. It traverses each row of the array Wheel in turn, traverses all elements in the row, and judges whether other elements are equal to the value of the element currently traversed. If they are equal, the logical variable IsaEdPoint is incremented by 1. If they are not equal, IsaEdPoint remains 0. After each traversal and comparison of an element, IsaEdPoint is analyzed. If IsaEdPoint is greater than 1, it means that the element appears 2 or more times, and the point corresponding to the current row number is an internal vertex. If IsaEdPoint is 1, it means that the element appears once, and the point corresponding to the current row number is an edge vertex. If IsaEdPoint is 1, the value of the element traversed at this time is assigned to the vector Judge(1,1), and the traversal continues, and the value of the element with IsaEdPoint of 1 is assigned to the vector Judge(2,1). During this period, if the element with IsaEdPoint of 1 is equal to the value of the Maxmin element currently traversed, no operation is performed and the analysis continues. The analysis is completed until Judge(2) is not 0.
[0063] 5.2 After identifying the first edge vertex, stop traversing the following rows of Wheel and assign the corresponding row number at this time to the array predge(1,1).
[0064] In a specific embodiment of the present invention, in step S06, two adjacent edge points of the first edge point are parsed and one of them is randomly selected as the next analysis point. The steps are as follows:
[0065] 6.1 Considering that any edge point must be adjacent to two other different edge points, the value of Judge(1,1) described in 4 or 5 is taken as the row index of array P by default. As the next analysis point, declare an int variable LastPoint and set it equal to Judge(2,1).
[0066] 6.2 Assign Judge(1) to the array predge(1,2) as the second edge point.
[0067] In a specific embodiment of the present invention, in step S07, the other two adjacent edge points of the next edge point predge(1,2) are parsed, and a non-previous point is selected as a new analysis point. Similarly, all edge points are obtained and the array predge is completed. The specific steps are as follows:
[0068] 7.1 According to the method in 5.1, parse the new Judge(1,1) and Judge(2,1);
[0069] 7.2 In the new Judge (1,1), Judge (2,1), there must be one value equal to predge (1,1) in value, and the other element is taken as the next analysis point
[0070] 7.3 Assign the Judge element obtained in step 7.2 to the array predge (1,3) as the third edge point
[0071] 7.4 According to the rules of 7.1, 7.2, 7.3, analyze until the latest Judge has an element value equal to the LastPoint declared in 6.1, assign the index number of the analysis point to the array predge, and then assign the LastPoint to predge as the last edge point.
[0072] 7.5 The edge chain extraction is complete.
[0073] In one specific embodiment of the present application, all edge points are stored in step S08 to form an edge chain, and the specific steps are as follows:
[0074] 8.1 The non-zero elements in the array predge are the edge points on the edge chain, arranged in clockwise or counterclockwise order.
[0075] 8.2 Declare an integer variable numofedge to count the number of non-zero elements in the array predge and assign it to the variable numofedge, and create a new array edge with a dimension of 1x numofedge.
[0076] 8.3 Assign elements 1 to numofedge of the array predge to the array edge in order.
[0077] 8.4 The array edge is the edge vertex set arranged in a clockwise or counterclockwise order into the edge chain of the model, and the user can obtain the reverse edge chain by performing a reverse order operation on the array edge according to the output result.
[0078] 8.5 The edge chain storage is complete.
[0079] Experimental verification:
[0080] Figure 6-Figure 8 The specific simulation test models and related results for the three experimental manifold surface models are as follows. Figure 7 is a schematic diagram of one experimental result. Figure 8 is a curve diagram drawn according to multiple experimental results. Figure 6The following table shows the experimental results of the three manifold surface models using the method of the present invention to quickly solve the ordered edge chain. The timing results are from the return value of the built-in tic~toc timing function of Matlab2019a. It can be seen that the solution speed of the present invention is faster than the traditional full traversal analysis method, and the timing results are from the return value of the built-in tic~toc timing function of Matlab2019a. Figure 7 The experimental results show that the edge chain sought by the present invention has a logical order and can be used directly without being sorted. Figure 8 It can be seen from the curve that as the number of bins increases, the acceleration effect of the present invention becomes more obvious.
[0081]
[0082] The contents not described in detail in the present invention adopt the well-known technology in the art.
[0083] The array in the present invention is for illustrative purposes only. Data structures such as arrays that do not have the same name but have the same properties and uses are all protected.
[0084] Although the above describes the illustrative specific embodiments of the present invention to facilitate understanding of the present invention by those skilled in the art, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concepts of the present invention are protected.
Claims
1. A method for quickly solving ordered edge chains of manifold surface models, characterized by: The method comprises the following steps: Step S01: importing manifold surface model data; Step S02: parse the vertex and face data sets of the model respectively and store them as vertex array P and face array F; Step S03: Analyze and form a set of all vertex-connected facets, and store them in an array Wheel; Step S04: parse the extreme endpoints corresponding to the six directions of ±X, ±Y, and ±Z respectively, and determine whether there is an edge point. If so, store the first edge point found as the first element predge(1,1) of the array predge, and execute step S06; if not, execute step S05; Described step S04 comprises the following steps: 4.1 Create an array Maxmin with dimensions of 1 x 6 and initialize the elements to 0. Create an array predge with dimensions of 1 x n p , the elements are initialized to 0; where n p is the total number of vertices in the model; 4.2 Find the maximum value x of each coordinate in each column of the vertex array P max 、y max 、z max The array index row number of the corresponding point, each row number corresponds to a vertex, and each row number is assigned to the array Maxmin; in each column of the vertex array P, find the minimum value x of each coordinate min 、y min 、z min The array index number of the corresponding point, and assign each row number to the array Maxmin; 4.3 Check in turn whether the points corresponding to the 6 index numbers in the array Maxmin are edge points. If an edge point exists, stop analyzing the subsequent element values in Maxmin and assign this edge point to the array predge(1,1); The step 4.3 is specifically as follows: 4.3.1 In the manifold surface model, since an edge is shared by at most two facets, there are only two sharing states of the edge, namely, shared by one facet or two facets. The edges shared by two panels must be internal edges, and the edges used by a single panel must be edge edges; 4.3.2 Based on the statement in 4.3.1 and in combination with the Wheel array, the judgment criteria are as follows: a row of data in the Wheel array corresponds to the index numbers of the adjacent vertices on all adjacent triangles of a vertex. If all the values in the Wheel row corresponding to a vertex appear in pairs, then this vertex is an internal vertex. If there is a single value in the Wheel row, then this vertex must be an edge vertex. in, The specific steps to determine whether the values described in 4.3.2 appear in pairs are as follows: create a new intermediate variable vector Judge with a dimension of 2 x 1, initialize all elements of the intermediate variable vector Judge to 0, create a new int integer variable IsaEdPoint to assist in logical judgment, assign the initial value to 0, take the values in Maxmin as the row number of the array Wheel in turn, traverse all elements of the row, and determine whether other elements are equal to the value of the currently traversed element. If they are equal, the logical variable IsaEdPoint is incremented by 1. If not, IsaEdPoint remains 0; after each traversal and comparison of an element, analyze IsaEdPoint. If IsaEdPoint is greater than 1, it means that the element appears 2 or more times. , the point corresponding to the current row number is an internal vertex, and IsaEdPoint is 1, which means that the element appears once. The point corresponding to the current row number is an edge vertex. If IsaEdPoint is 1, the value of the element traversed at this time is assigned to the vector Judge(1,1), and the traversal continues. The value of the element with IsaEdPoint of 1 is assigned to the vector Judge(2,1). During this period, if the element with IsaEdPoint of 1 is equal to the Maxmin element value currently traversed, no operation is performed, and the analysis continues until Judge(2) is not 0, and the analysis is completed. Step S05: traverse and analyze each point in order of odd numbers first and then even numbers until the first edge point is parsed and stored as the first element predge(1,1) of the array predge; Step S06: parse out the two adjacent edge points of the first edge point, select one of them as the next analysis point, and store it as the second element predge(1,2) of the array predge; Step S07: parse out the other two adjacent edge points of the next edge point predge(1,2), select a non-previous point as a new analysis point, and so on, to obtain all edge points and complete the array predge; Step S08: Store all edge points to form an edge chain.
2. The method for rapidly solving ordered edge chains of manifold surface models according to claim 1, characterized in that: The manifold surface model in step S01 is a manifold surface model composed of triangular facets, and the data includes vertex numbers constituting the surface, a set of three-dimensional coordinates of the vertices, facet numbers, and a set of vertex numbers constituting each facet.
3. The method for quickly solving ordered edge chains of manifold surface models according to claim 2, wherein step S02 comprises the following steps: 2.1 Create a vertex array P with dimension n p x 3; create a facet array F with dimension n f x 3; n f is the total number of facets in the model; 2.2 Searching for the 3D coordinates of each vertex in the original data of the 3D model x, y, z , and assign them to the rows of array P in sequence, that is, the three elements of any row of array P respectively store the three-dimensional coordinate values of a vertex, in the following order: x, y, z , the row index number of array P corresponds to the vertex number; 2.3 Search for the three vertices of each face in the original data of the 3D model, and assign the index numbers of the three vertices to the rows of array F in sequence. That is, the three elements of any row of array F respectively store the numbers of the three vertices of a triangular face. The order obeys the original data of the model, and the row index number of array F corresponds to the face number.
4. The method for quickly solving ordered edge chains of manifold surface models according to claim 3, wherein step S03 comprises the following steps: 3.1 Create an array Wheel with dimension n p x 30, all values are initialized to 0; 3.2 Search for the adjacent face of the vertex numbered 1. Traverse the array F and search for the first row where the vertex numbered 1 is located. Keep the three vertex data in this row in order and assign them to the arrays Wheel(1,1) to Wheel(1,3). 3.3 Traverse array F again, search for the second row where the vertex numbered 1 is located, keep the three vertex data in that row in order, and assign them to the arrays Wheel(1,4) to Wheel(1,6); 3.4 Repeat steps 3.2 and 3.3 until all three data in each row of the vertex numbered 1 in array F are stored in the first row of Wheel; 3.5Search numbers 2~n in sequence p The connected face element of the vertex of Wheel 2~n, that is, change the search number, repeat steps 3.2-3.4, p The rows are completed, and each row represents the vertex set of all connected face elements corresponding to each vertex.
5. The method for quickly solving ordered edge chains of manifold surface models according to claim 4, wherein step S05 comprises the following steps: 5.1 Create a new int integer variable IsaEdPoint to assist in logical judgment. The initial value is 1. First, traverse the odd rows of the Wheel array, then traverse the even rows, traverse all the elements in the row, and judge whether the other elements are equal to the value of the element currently traversed. If they are equal, the logical variable IsaEdPoint is incremented by 1. If not, IsaEdPoint remains 0. After each traversal and comparison of an element, analyze IsaEdPoint. If IsaEdPoint is greater than 1, it means that the element appears twice or more times. The current row number corresponds to The point is an internal vertex. If IsaEdPoint is 1, it means that the element appears once. The point corresponding to the current row number is an edge vertex. If IsaEdPoint is 1, the value of the element traversed at this time is assigned to the vector Judge(1,1). Continue to traverse and assign the value of the element with IsaEdPoint of 1 to the vector Judge(2,1). During this period, if the element with IsaEdPoint of 1 is equal to the value of the element currently traversed, no operation is performed and the analysis continues. The analysis is completed until Judge(2) is not 0. 5.2 After identifying the first edge vertex, stop traversing the following rows of Wheel and assign the corresponding row number at this time to the array predge(1,1).
6. The method for rapidly solving ordered edge chains of manifold surface models according to claim 5, wherein, in step S06, two adjacent edge points of the first edge point are analyzed, and one of them is randomly selected as the next analysis point, and the following steps are performed: 6.1 Considering that any edge point must be adjacent to two other different edge points, the value of Judge(1,1) mentioned in the step is taken as the row index number of the vertex array P by default. As the next analysis point, declare an int integer variable LastPoint and set it equal to Judge(2,1); 6.2 Assign Judge(1) to the array predge(1,2) as the second edge point.
7. The method for quickly solving ordered edge chains of manifold surface models according to claim 6, characterized in that: In step S07, the other two adjacent edge points of the next edge point are parsed, and a non-previous point is selected as a new analysis point. This is repeated to obtain all edge points and complete the array predge. The steps are: 7.1 Follow the steps in step 5.1 to parse out the new Judge(1,1) and Judge(2,1); 7.2 Among the new Judge(1,1) and Judge(2,1), one must be numerically equal to predge(1,1). Take the other element as the next analysis point. 7.3 Assign the Judge element obtained in step 7.2 to the array predge(1,3) as the third edge point; 7.4 Repeat steps 7.1 to 7.3 until the latest Judge contains an element with a value equal to the LastPoint declared in step 8.
1. Assign the index of the analysis point at that time to the array predge. Then, assign LastPoint to predge as the last edge point. 7.5 Edge chain extraction is completed.
8. The method for quickly solving ordered edge chains of manifold surface models according to claim 7, characterized in that: In step S08, all edge points are stored to form an edge chain. The steps are: 8.1 The non-zero elements in the predge array are the edge points on the edge chain, arranged in clockwise or counterclockwise order; 8.2 Declare an integer variable numofedge, count the number of non-zero elements in the array predge, assign the value to the variable numofedge, and create a new array edge with a dimension of 1 x numofedge; 8.3 Assign elements 1 to numofedge of the array predge to the array edge, preserving the order; 8.4 The edge array is a set of edge vertices, which are arranged clockwise or counterclockwise to form the edge chain of the model. The reverse edge chain can be obtained by reversing the order of the edge array according to the output result. 8.5 Edge chain storage is complete.
Citation Information
Patent Citations
Edge detection method and device based on grid data, medium and equipment
CN111932570A
Process for creating from a mesh an isotopologic set of parameterized surfaces
US20070030267A1