Contour mapping method and device, equipment and storage medium
By disconnecting and mapping three-dimensional closed contours, the closed areas on their planes are eliminated, and the problems of incomplete geometric model and high deformation rate caused by direct projection are solved, and more accurate geometric model processing and repair are achieved.
Patent Information
- Application Number
- CN202410731057.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-06-06
AI Technical Summary
When the hole opening is supplemented directly by two-dimensional projection of the three-dimensional contour, the obtained geometric model is incomplete and inaccurate, and the two-dimensional contour has high deformation rate and self-intersection, making it difficult to accurately reflect the true shape of the three-dimensional contour.
By obtaining the three-dimensional closed contour, selecting the initial vertex to break to form an open contour, and mapping the vertices on the plane, performing closing processing and intersection elimination, determining and eliminating the closed region until a closed contour without the closed region is obtained as the target mapping contour.
The accuracy and deformation rate of the two-dimensional contour is improved, and the self-intersection phenomenon is eliminated, making the resulting two-dimensional contour closer to the true shape of the three-dimensional contour, which is suitable for more accurate geometric model processing and repair.
Smart Images

Figure CN118918296A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of contour mapping, and in particular to a contour mapping method, device, equipment and storage medium. Background Art
[0002] A geometric model is a low-dimensional manifold embedded in three-dimensional space. It does not have a regular parameter domain and its shape is more complex than that of two-dimensional graphics. Industry technicians will encounter many difficulties in processing, applying, and repairing geometric models. Therefore, the geometric model is usually expressed parametrically during the processing. For example, in a scene, there is a hole on the surface of the geometric model, and this hole needs to be supplemented to obtain a complete geometric model. Then, the three-dimensional contour corresponding to the hole can be obtained, and the three-dimensional contour can be projected to obtain a two-dimensional contour, and then the two-dimensional contour can be used to supplement the hole.
[0003] However, the three-dimensional contour is often complex. The two-dimensional contour obtained by ordinary projection method is quite different from the real plane contour corresponding to the three-dimensional contour. If the two-dimensional contour is directly used to supplement the hole, the obtained geometric model will be incomplete and inaccurate. Summary of the invention
[0004] In view of this, the present application provides a contour mapping method, device, equipment and storage medium for solving the problem that if the two-dimensional contour is directly used to supplement the hole, the resulting geometric model will be incomplete and inaccurate.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a contour mapping method comprises:
[0007] Obtaining a three-dimensional closed contour including a plurality of first vertices;
[0008] Selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transforming the initial vertex into two first vertices;
[0009] Mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and composing each second vertex into a first open contour on the plane;
[0010] Performing closing processing on the first open contour to obtain a first closed contour;
[0011] Determining whether the first closed contour contains at least two closed areas;
[0012] If yes, determine the target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas;
[0013] If not, the first closed contour is used as the target mapping contour.
[0014] In a second aspect, a contour mapping device includes:
[0015] A three-dimensional closed contour acquisition module, used to acquire a three-dimensional closed contour including a plurality of first vertices;
[0016] An initial open contour acquisition module, used for selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, converting the initial vertex into two first vertices;
[0017] A first open contour forming module, used for mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and forming each second vertex into a first open contour on the plane;
[0018] A closing processing module, used for performing closing processing on the first open contour to obtain a first closed contour;
[0019] A judging module, used for judging whether the first closed contour contains at least two closed areas;
[0020] an intersection elimination processing module, configured to, if yes, determine a target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas;
[0021] The target mapping contour determining module is used for, if not, taking the first closed contour as the target mapping contour.
[0022] In a third aspect, a contour mapping device includes a memory and a processor;
[0023] The memory is used to store programs;
[0024] The processor is used to execute the program to implement the various steps of the contour mapping method as described in the first aspect.
[0025] In a fourth aspect, a storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the contour mapping method described in the first aspect are implemented.
[0026] It can be seen from the above technical scheme that the present application obtains a three-dimensional closed contour containing multiple first vertices; selects an initial vertex from each of the first vertices, and disconnects the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, the initial vertex is converted into two first vertices; maps each first vertex of the initial open contour on a plane to obtain each second vertex, and composes each of the second vertices into a first open contour on the plane; closes the first open contour to obtain a first closed contour; determines whether the first closed contour contains at least two closed areas; if so, determines the target area from each of the closed areas, and performs intersection elimination processing on the target area to obtain a new first closed contour, and returns to execute the step of determining whether the first closed contour contains at least two closed areas; if not, uses the first closed contour as the target mapping contour. In the above scheme, the present application first obtains a three-dimensional closed contour containing multiple first vertices, and then selects an initial vertex, and disconnects the three-dimensional closed contour at this initial vertex, and then maps each second vertex after disconnection, and then connects them after mapping, and at the same time, the two first vertices transformed from the initial vertex are not connected to the two second vertices corresponding to them after mapping, so that in the process of forming the first open contour, each second vertex will not be constrained by the original closed contour, so the accuracy of the obtained first open contour is relatively high, then the first closed contour obtained after the closing processing of the first open contour will be more similar to the three-dimensional closed contour as a whole, because the three-dimensional closed contour belongs to a spatial geometric figure with a complex shape and involves more plane domains, so there may be intersections in the first closed contour. Therefore, it is necessary to judge the first closed contour. If it contains at least two closed areas, it can be said that the first closed contour has an intersection phenomenon, and then it is processed for intersection elimination. Considering that there may be more than one intersecting area range in the first closed contour, it is necessary to perform intersection elimination processing in sequence. In the process of intersection elimination processing for a closed area, other closed areas will disappear with the elimination of this closed area. Therefore, after eliminating a closed area (i.e., the target area), it is possible to re-judge whether the first closed contour contains at least two closed areas, until the first closed contour does not contain a closed area. Then the first closed contour finally obtained is the target mapping contour. It can be understood that the first closed contour itself does not belong to the closed area defined in this application.
[0027] Therefore, the target mapping contour obtained by the contour mapping method provided by this solution is more accurate than the two-dimensional contour obtained by the ordinary projection method or direct mapping. Compared with the true two-dimensional contour of the three-dimensional closed contour, it has a lower deformation rate and no intersection phenomenon, and is closer to the true shape of the three-dimensional closed contour. Then, applying the target mapping contour to the geometric model corresponding to the three-dimensional closed contour will be more conducive to the staff to process and repair the geometric model, and can also improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0029] Figure 1 An optional flow chart of a contour mapping method provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a geometric model provided for an embodiment of the present application;
[0031] Figure 3 A schematic diagram of a first open profile structure provided in an embodiment of the present application;
[0032] Figures 4 to 6 All of them are structural schematic diagrams of a first closed contour provided in embodiments of the present application;
[0033] Figure 7 A schematic diagram of a two-dimensional profile structure provided in an embodiment of the present application;
[0034] Figure 8 A schematic diagram of the structure of a target mapping profile provided in an embodiment of the present application;
[0035] Fig. 9 A schematic diagram of the structure of a complete geometric model provided in an embodiment of the present application;
[0036] Figure 10 to Figure 14 All of them are structural schematic diagrams of a first closed contour provided in embodiments of the present application;
[0037] Fig.15 A schematic diagram of the structure of a contour mapping device provided in an embodiment of the present application;
[0038] Fig.16 A schematic structural diagram of a contour mapping device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] The embodiment of the present invention provides a contour mapping method, which can be applied to various computer terminals or intelligent terminals. The execution subject can be a processor or server of the computer terminal or intelligent terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0041] S1: Obtain a three-dimensional closed contour including a plurality of first vertices.
[0042] The three-dimensional closed contour in this application is not a plane contour, it can be any three-dimensional space geometric figure, such as a ball with a hole on its surface. The contour of the hole on the surface of the ball is a three-dimensional closed contour, such as a swimming ring. An irregular piece of the surface of the swimming ring is cut off, such as Figure 2 As shown, the contour of the missing part of the incomplete swimming ring on the surface of the swimming ring is a three-dimensional closed contour.
[0043] It is understandable that the three-dimensional closed contour has different shapes and the overall contour is relatively complex. In order to better map the three-dimensional closed contour, the three-dimensional closed contour to be mapped in this application contains multiple vertices as each first vertex. After obtaining the spatial contour, the vertices can be marked and divided. For example, vertices are set at positions where angles are generated in the spatial contour, thereby setting multiple vertices. Therefore, the spatial contour with multiple first vertices can be used as the three-dimensional closed contour obtained by this application.
[0044] The present application sets vertices at positions where angles are generated in order to better describe the three-dimensional closed contour. At the same time, the two-dimensional contour obtained after mapping can also correspond more accurately to the three-dimensional closed contour through vertices, and will not affect the subsequent processing of the two-dimensional contour due to the complexity of the three-dimensional closed contour itself.
[0045] S2: selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transforming the initial vertex into two first vertices.
[0046] Among the first vertices in the three-dimensional closed contour, an initial vertex is selected, and this initial vertex can be any first vertex, which is not limited in this embodiment. At the position of this initial vertex, the three-dimensional closed contour is disconnected, and the three-dimensional closed contour will become an open three-dimensional contour that is not closed, that is, an initial open contour, which can also be described as a three-dimensional line segment, which has a starting point and an end point. At the same time, the initial starting point also becomes two first vertices, and these two first vertices are the starting point and the end point of the initial open contour.
[0047] S3: Mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and grouping each second vertex into a first open contour on the plane; wherein, in the first open contour, two second vertices mapped after the initial vertex is transformed are not connected.
[0048] You can first set up a blank plane and map each first vertex of the initial open contour onto the plane to obtain each second vertex. In this process, one first vertex corresponds to one second vertex. Due to the complex shape of the initial open contour, if two or more second vertices mapped from the first vertices overlap, then these multiple second vertices will not become one second vertex. In other words, the number of second vertices is equal to the number of first vertices and corresponds one to one.
[0049] The present application disconnects the three-dimensional closed contour so that the first vertices contained in the three-dimensional closed contour will not be constrained by the contour closure during subsequent processing. In this way, the mapped second vertex can be more accurately matched to the first vertex, and the first open contour formed by the more accurate second vertex will naturally be more accurate.
[0050] After mapping the second vertices, the second vertices need to be combined to form a first open contour. During the combination process, a reasonable connection order can be set for each second vertex. According to this connection order, the second vertices are connected with straight lines, and the two second vertices corresponding to the starting point and the end point mentioned in the above step S2 are not connected after mapping, so that a contour with an opening can be obtained.
[0051] In one example, if Figure 3 As shown, Figure 3The contour in is the first open contour, which contains 7 second vertices, namely second vertex 1, second vertex 2, second vertex 3, second vertex 4, second vertex 5, second vertex 6 and second vertex 7. Among them, second vertex 1 and second vertex 7 can be understood as the starting point and end point of the first open contour. Before the first open contour is formed, there is no connection between the second vertices. In the combination process, second vertex 1 can be used as the starting point to connect second vertex 2, second vertex 3, second vertex 4, second vertex 5, second vertex 6 and second vertex 7 in sequence. The connection order is second vertex 1 to second vertex 7. At the same time, second vertex 1 and second vertex 7 are not connected, thus forming Figure 3 The first open profile is shown.
[0052] S4: performing closing processing on the first open contour to obtain a first closed contour.
[0053] Since the present application ultimately needs to obtain a closed two-dimensional contour to fill a geometric model or perform other applications, after obtaining the first open contour in step S3, the first open contour also needs to be closed.
[0054] Optionally, the starting point and the end point mentioned in step S2 can be merged into one vertex. In the process of merging the starting point and the end point, other second vertices will also move accordingly, and their original positions may change. The positions of the edges between the second vertices may also change, so that the first open contour can be transformed into a closed contour. Using the above example, Figure 3 After the first open contour shown is closed, the following is obtained: Figure 4 The first closed contour shown in Figure 4 In the figure, the original second vertex 1 and the second vertex 7 are merged into a new merge point. Since the process of merging the second vertex 1 and the second vertex 7 drives the movement of other second vertices, it can be seen that the positions of the second vertex 2, the second vertex 3, the second vertex 4, the second vertex 5 and the second vertex 6 have all changed. However, overall, Figure 3 The first open contour of Figure 4 The first closed contour is still very similar.
[0055] S5: Determine whether the first closed contour contains at least two closed areas.
[0056] This step is used to determine whether there is any intersection (self-intersection) in the first closed contour. It can be understood that if the final target mapping contour is to be more accurate, have a lower deformation rate, and be more matched with the geometric model corresponding to the three-dimensional closed contour, there is no intersection in the target mapping contour. In other words, the target closed area has no other closed areas inside except itself.
[0057] like Figure 5 As shown, in Figure 5 In , A is the first closed contour, b and c are the closed areas of the first closed contour, and at the same time, it is defined that the first closed contour itself does not belong to a closed area, so the number of closed areas contained in the first closed contour is 2; please refer to Figure 6 ,exist Figure 6 In the figure, D is the first closed contour, e, f and g are all closed areas of the first closed contour. In this application, only the area without other closed areas inside is regarded as a closed area. For example, the area composed of e and f is not a closed area of the first closed contour. Therefore, the number of closed areas contained in the first closed contour is 3. Figure 4 The first closed contour shown does not contain a closed area inside.
[0058] S6: If yes, determine the target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas.
[0059] S7: If not, taking the first closed contour as the target mapping contour.
[0060] Among them, the target mapping contour obtained in this application is a closed contour.
[0061] If the first closed contour contains at least two closed areas, then the closed areas need to be eliminated. After elimination, the intersection of the first closed contour disappears. The elimination process needs to be carried out in sequence. Therefore, a target area is first determined from each closed area, and the intersection elimination process is performed on this target area. After the process is completed, the number of closed areas contained in the new first closed contour needs to be determined again. At the same time, in the process of processing this target area, it is possible that other closed areas will disappear with the elimination of the target area. Therefore, after obtaining the new first closed contour, it is necessary to loop through steps S5 to S7, that is, return to step S5, until the loop process can jump directly from step S5 to step S7, that is, the first closed contour finally obtained no longer contains a closed area, then the first closed contour finally obtained can be used as the target mapping contour.
[0062] In the above scheme, the present application will first obtain a three-dimensional closed contour containing multiple first vertices, and then select an initial vertex, and disconnect the three-dimensional closed contour at this initial vertex, so that after disconnection, each second vertex is mapped, and then connected after mapping, and at the same time, the two first vertices transformed from the initial vertex are not connected to the two second vertices corresponding to the mapping after the mapping, so that in the process of forming the first open contour, each second vertex will not be constrained by the original closed contour, so the accuracy of the obtained first open contour is relatively high, then the first closed contour obtained after the closing processing of the first open contour will be more similar to the three-dimensional closed contour as a whole, because the three-dimensional closed contour belongs to a spatial geometric figure with a complex shape and involves more plane domains, there may be intersections in the first closed contour. This requires judging the first closed contour. If it contains at least two closed areas, it can be said that the first closed contour has an intersection phenomenon, and then it is processed for intersection elimination. Considering that there may be more than one intersecting area range in the first closed contour, it is necessary to perform intersection elimination processing in sequence. In the process of intersection elimination processing for a closed area, other closed areas may disappear with the elimination of this closed area. Therefore, after eliminating a closed area (ie, the target area), the process of judging whether the first closed contour contains at least two closed areas can be returned to, until the first closed contour does not contain a closed area. Then the first closed contour finally obtained is the target mapping contour. It can be understood that the first closed contour itself does not belong to the closed area defined in this application.
[0063] Therefore, the target mapping contour obtained by the contour mapping method provided by this solution is more accurate than the two-dimensional contour obtained by the ordinary projection method or direct mapping. Compared with the true two-dimensional contour of the three-dimensional closed contour, it has a lower deformation rate and no intersection phenomenon, and is closer to the true shape of the three-dimensional closed contour. Then, applying the target mapping contour to the geometric model corresponding to the three-dimensional closed contour will be more conducive to the staff to process and repair the geometric model, and can also improve work efficiency.
[0064] Continue to use Figure 2 The three-dimensional closed contour in the example is directly mapped to a two-dimensional contour such as Figure 7 As shown, it can be seen that its shape is distorted, and it is quite different from the real two-dimensional contour corresponding to the three-dimensional closed contour, and it is also quite different from the three-dimensional closed contour itself, and there is a self-intersection phenomenon, which causes the mapping to lose the one-to-one correspondence property. The target mapping contour obtained by the contour mapping method provided by the present application is as follows Figure 8As shown in the figure, it can be seen that the target mapping contour has a clear shape, high accuracy, is very similar to a three-dimensional closed contour, and has no self-intersection. After adding it to the partially missing swimming ring, it is perfectly combined with the missing content of the swimming ring to obtain a complete and correct swimming ring, as shown in the figure. Fig. 9 shown.
[0065] In addition, the contour mapping method provided in the present application can also be applied to surface reparameterization processes, surface fitting processes, etc.
[0066] In the method provided by the embodiment of the present invention, the process of forming a first open contour on the plane by each of the second vertices is specifically described as follows:
[0067] Determine a first angle value at each first vertex in the three-dimensional closed contour;
[0068] Determine the distance between every two first vertices in the three-dimensional closed contour;
[0069] A second vertex mapped from one of the first vertices transformed from the initial vertex is used as a starting vertex, and a second vertex mapped from another first vertex is used as an ending vertex;
[0070] According to the positional relationship between the first vertices in the three-dimensional closed contour, the starting vertex, the other second vertices, and the ending vertex are sequentially connected with straight lines to form a contour line;
[0071] The contour line is modified based on a first angle value at each first vertex in the three-dimensional closed contour and a distance between every two first vertices to obtain a first open contour.
[0072] Specifically, the distance between the two first vertices refers to the straight-line distance between the two first vertices, not the length of the contour between the two first vertices.
[0073] In the above process, each second vertex can be first connected to form a contour line. In order to improve the similarity between the contour line and the three-dimensional closed contour, the positions of each first vertex in the three-dimensional closed contour and the positional relationship between each two first vertices need to be referred to during the connection process, so that each second vertex can be correctly connected. However, the contour line formed at this time is only a preliminary contour shape, which still has a certain gap with the three-dimensional closed contour. Therefore, it is also necessary to consider the first angle value at each first vertex in the three-dimensional closed contour and the distance between each two first vertices to correct and adjust the contour line, so that the accuracy of the first open contour can be higher.
[0074] Optionally, the contour line is corrected based on the first angle value at each first vertex in the three-dimensional closed contour and the distance between every two first vertices to obtain an operation process of the first open contour, which is specifically as follows:
[0075] Determine a second angle value at each second vertex in the contour line, and a distance between every two second vertices;
[0076] One-to-one correspondence between each second vertex in the contour line and each first vertex in the three-dimensional closed contour;
[0077] Based on the first angle value at each first vertex, the second angle value at each corresponding second vertex is corrected, and at the same time, the distance between each two second vertices in the contour line is corrected to the distance between the two corresponding first vertices to form a first open contour.
[0078] Specifically, the present application corrects the contour line by making the second angle value at the second vertex similar to the first angle value at the corresponding first vertex, and making the distance between the two second vertices the same as the distance between the corresponding two first vertices, thereby ensuring the similarity. In this way, not only the position of the second vertex can be guaranteed, but also the position relationship and angle relationship between every two second vertices can be guaranteed.
[0079] It should be noted that the three-dimensional closed contour is a closed spatial contour, and the two-dimensional contour that the present application ultimately obtains is also closed. Therefore, the subsequent process also needs to close the first open contour obtained in the above step. Considering that the closed contour is a planar polygon, it is necessary to follow the property of the sum of the interior angles of the planar polygon, that is, the sum of the interior angles of an n-gon is equal to (n-2)·π. In order to ensure that the final target mapped contour can be more realistic and accurate, this step prepares for the closing process in advance. It is understandable that for a three-dimensional closed contour with a particularly complex spatial shape, it cannot be completely required that the second angle value of the mapped contour line be equal to its corresponding first angle value, because if each angle value in the three-dimensional closed contour is required to be equal to each corresponding angle value in the contour line, then the subsequently obtained closed contour will be incomplete in the round. The angle values at the starting point and the end point of the contour deviate too much from the angle values of the corresponding first vertices in the three-dimensional closed contour, and their shapes are unreasonable compared to the real two-dimensional contour of the three-dimensional closed contour. Therefore, in the process of correcting the second angle, the properties of the sum of the interior angles of the plane polygon should be applied in advance, that is, the properties of the sum of the interior angles should be used as constraints, and the first angle value at each first vertex should be used to correct the second angle value at each corresponding second vertex, so that the first open contour obtained after the correction is reasonable as a whole and the second vertex can be corresponded to the corresponding first vertex, and the difference between each second angle value of the first open contour and each corresponding first angle value of the three-dimensional closed contour is relatively balanced, so that when the subsequent closure is performed, the angle values and distances of the first open contour will not change too much.
[0080] In the above process, an angle value transformation function is defined, which is a monotonically increasing function. The transformation range of the angle transformation function is: [0, 2π]→[0, 2π], which means that the first angle value at each first vertex in the three-dimensional closed contour belongs to [0, 2π], and the second angle value at each second vertex mapped by the three-dimensional closed contour belongs to [0, 2π]. The second angle value at the second vertex can be represented by the angle value transformation function. Let f(θ i )=θ i '; where θ i represents the first angle value at the first vertex, i represents the first vertex, θ' i It represents the second angle value at the second vertex after mapping. At the same time, the second angle values at the second vertex need to satisfy the above-mentioned internal angle and properties. Therefore: Where n is the number of first vertices in the three-dimensional closed contour.
[0081] The following is a detailed description of the process of closing the first open contour to obtain the first closed contour in the present application.
[0082] Determine a contour start point and a contour end point at each second vertex of the first open contour;
[0083] Calculating a position deviation between the starting point of the contour and the end point of the contour;
[0084] Calculating the position parameters to be moved of each second vertex except the start point and the end point of the contour according to the position deviation;
[0085] The contour vertices are fixed, and the second vertices other than the contour starting point and the contour end point are moved according to their respective position parameters to be moved, and the contour end point is overlapped with the contour starting point to obtain a first closed contour.
[0086] Specifically, in the closing process, to be precise, the main thing is to move the end point of the contour, but because the end point of the contour and the other second vertices are connected in sequence, if the end point of the contour moves, then the other second vertices may also move with it, and the distance and direction of movement are uncertain.
[0087] The above process can also be understood as calculating the position change parameters of the other second vertices under the preset first moving rule according to the position deviation. This position change parameter is the above position parameter to be moved. Then the first moving rule is: fix the starting point of the contour, aiming to make the end point of the contour coincide with the starting point of the contour, and move the end point of the contour and the other second vertices. Optionally, the end point of the contour can also be fixed, and the starting point of the contour and the other second vertices can be moved until the starting point of the contour is moved to the end point of the contour. The purpose of fixing the starting point of the contour is to quantify the movement data of the end point of the contour, that is, the position deviation, which can be accurately obtained. Then, based on this position deviation, the movement data of each other second vertex, that is, the position parameter to be moved, can be accurately obtained.
[0088] The specific process of calculating the position parameters to be moved of each second vertex other than the contour start point and the contour end point according to the position deviation includes:
[0089] Determine the position of each second vertex in the first open contour, and divide the first open contour into sub-contours according to the position of each second vertex;
[0090] Converting each of the sub-contours into a local matrix respectively;
[0091] Aggregating the local matrices into a global matrix corresponding to the first open contour;
[0092] Establishing a one-dimensional array according to the position deviation;
[0093] Calculating a target displacement vector based on the global matrix and the one-dimensional array;
[0094] The position parameters to be moved of each second vertex except the contour start point and the contour end point are determined by the target displacement vector.
[0095] Specifically, the first open contour can be converted into a beam unit model. The beam unit model is a physical model used to simulate beam structures. It is generally used in finite element analysis. It is usually composed of linear or nonlinear materials and can simulate stress behaviors such as bending, torsion, tension, and compression of beams. The converted beam unit model is solved by finite element method using the position deviation between the contour start point and the contour end point, wherein the converted beam unit model is divided into a plurality of plane beam units, which are divided according to the number of second vertices. That is, in the first open contour, the part composed of each two second vertices and the contour between the two second vertices is a plane beam unit, so the number of plane beam units is equal to the number of second vertices minus 1. A plane beam unit has two endpoints, and each endpoint is set to have three degrees of freedom, which can also be understood as three variables, namely, axial deformation, vertical offset, and rotation angle around the plane normal. Then a plane beam unit has six variables. The position parameters of each second vertex to be moved can be represented by these three variables, and the position deviation between the contour start point and the contour end point is also represented by three variables.
[0096] Then the local matrix can be expressed by the stiffness matrix, and the stiffness matrix can be expressed by the following formula:
[0097]
[0098] Among them, K e represents the stiffness matrix, E is the elastic modulus, E = 2 × 10 5 , I Z is the section moment of inertia, A is the cross-sectional area of the first open contour, and a is half the length of the sub-contour.
[0099] After obtaining each local matrix, each local matrix can be aggregated into a large matrix, namely, the global matrix. The aggregation method is to sort each sub-contour according to the position of each second vertex in the first open contour. For example, the sub-contour composed of the second vertex connected to the starting point of the contour and the starting point of the contour is ranked first, and so on. The sub-contour composed of the second vertex connected to the end point of the contour and the end point of the contour is ranked last; then for each sub-contour, according to the position and angle of the sub-contour in the first open contour, a transformation matrix P corresponding to the sub-contour is constructed, and the transposed matrix P of the transformation matrix is calculated. T , the local matrix K corresponding to the sub-contour e With the transformation matrix P and the transposed matrix P TMultiply, that is, K e '=P T K e P, get a new matrix K e '; Then create a large blank matrix K with multiple rows and columns m , and then the new matrix K corresponding to each sub-contour is e 'Fill in the blank large matrix, each new matrix K e The order of filling in ' is the sorting order of the above sub-contours. It should be noted that the new matrix K with the first sorting e 'When putting it in, it is put into the 1st to 6th row and 1st to 6th column of the matrix, and the new matrix K is sorted second e 'When putting it in, it is put into the 4th to 9th rows and the 4th to 9th columns of the large matrix. In other words, the first two new matrices K e 'After being placed in the large matrix, a 3×3 matrix range is overlapped. The reason for this placement is that two adjacent plane beam elements share an endpoint. The new matrix K e 'The same is true when putting it in, and finally a global matrix is obtained, that is, the global stiffness matrix; then the right-hand term V is set according to the position deviation, that is, the one-dimensional array, and finally K is calculated m X=V, the obtained X is the target displacement vector, which contains the position parameters to be moved of each second vertex except the starting point and the end point of the contour.
[0100] In one example, the edge between every two second vertices is taken as a contour edge. The number of contour edges of the first open contour is m, and the number of second vertices is m+1. Therefore, V and the obtained X are both vectors with a length of 3×(m+1). K m is a matrix with 3×(m+1) rows and 3×(m+1) columns. When the end point of the contour is moved, the mth second vertex adjacent to the end point of the contour will be affected through the overlapping 3×3 matrix range, and then this second vertex will move accordingly, and this second vertex will drive the m-1th second vertex adjacent to it to move, and so on.
[0101] Optionally, the process of determining the target area from each of the closed areas in the present application includes: determining the area of each of the closed areas; comparing the sizes of the areas of each of the closed areas, and taking the closed area with the smallest area as the target area.
[0102] Specifically, since there may be many possible numbers of closed areas included in the first closed contour, some closed areas may disappear as other closed areas are eliminated in the process of processing each closed area. However, in order to ensure the overall stability of the first closed contour, other closed areas should be eliminated as little as possible. Therefore, the present application limits the screening method of the target area, and takes the closed area with the smallest area as the target area, so as to perform intersection elimination processing.
[0103] Further, within the first closed contour, other ranges around the target area are closely related to the target area. If the target area is to be eliminated, it is believed that other ranges will be affected, so it is necessary to determine other closed areas related to the target area. To be precise, it is necessary to determine other closed areas that intersect with the target area. It should be noted that the closed area intersecting with the target area defined in this application refers to: a closed area with only one intersection point with the target area, that is, it can be considered that each closed area is composed of countless points (this point is not the first vertex or the second vertex mentioned in this application). If there is only one common point between the target area and a closed area (the two have only one intersection point), then it can be considered that the target area intersects with this closed area. In addition, the intersection of the target area and the closed area can also be referred to as the target area and the closed area are connected, or, the target area and the closed area are point-connected (point direct connection).
[0104] Since different three-dimensional closed contours have different shapes, the shapes of the first closed contours obtained from different three-dimensional closed contours are also very different, the number of closed areas is also different, and the number of closed areas intersecting with the target area is also different, so they are explained according to the following three situations respectively.
[0105] First, in each closed area of the first closed contour, the number of closed areas intersecting with the target area is determined:
[0106] (1) In each closed area of the first closed contour, if the number of closed areas intersecting with the target area is one, the edge between every two second vertices in the first closed contour is used as a contour edge, the intersection point between the target area and the intersecting closed area is determined, and the contour edge at the intersection point is used as the intersecting contour edge. According to the intersection point and the intersecting contour edge, the target area is subjected to intersection elimination processing to obtain a new first closed contour.
[0107] The process of performing intersection elimination processing on the target area according to the intersection point and the intersecting contour edge to obtain a new first closed contour may specifically include:
[0108] The second vertices at both ends of the intersecting contour edge are all used as the third vertex; from each of the third vertices, a third vertex is randomly selected as the target point, and another third vertex belonging to the same intersecting contour edge as the target point is used as the first corresponding point of the target point; another third vertex belonging to the same closed area as the target point is used as the second corresponding point of the target point; another third vertex other than the target point, the first corresponding point and the second corresponding point is used as the third corresponding point of the target point; each of the intersecting contour edges is deleted from the first closed area, and at the same time, the target point is connected to the third corresponding point, and the first corresponding point is connected to the second corresponding point to form a new first closed contour. Specifically, the intersecting contour edges actually include two, and the second vertices at both ends of each intersecting contour edge are respectively located in the target area and the closed area, so the four second vertices at both ends of the two intersecting contour edges are all used as third vertices.
[0109] In one example, if Fig.10 As shown, Fig.10 Represents a first closed contour, which contains 9 second vertices and 2 closed areas: closed area 1 and closed area 2, where closed area 1 is the target area. It can be seen from the figure that the closed area intersecting with the target area is closed area 2, and the intersecting contour edges are: contour edge L between the second vertex 11 and the second vertex 22, and contour edge M between the second vertex 12 and the second vertex 21. Then the second vertices at both ends of the contour edge L are the second vertex 11 and the second vertex 22, and the second vertices at both ends of the contour edge M are the second vertex 12 and the second vertex 21. These four second vertices are all used as the third vertex, and The machine selects a third vertex as the target point, for example, the second vertex 11, then the other third vertex that belongs to the same intersecting contour edge as the second vertex 11 is the second vertex 22 (the first corresponding point), and the other third vertex that belongs to the same closed area as the second vertex 11 is the second vertex 12 (the second corresponding point), then the remaining one of the four is the third corresponding point (the second vertex 21), so the two intersecting contour edges are deleted, and at the same time, the second vertex 11 is connected to the second vertex 21, and the second vertex 22 is connected to the second vertex 12, forming a new first closed contour. The new first closed contour is as follows Fig.11 As shown by Fig.11 It can be seen that the new first closed contour no longer contains a closed area, and the new first closed contour can be used as the target mapping contour.
[0110] (2) In each closed area of the first closed contour, if the number of closed areas intersecting with the target area is two, the area of the target area and the total area of the first closed contour are obtained, and the ratio of the area of the target area to the total area is calculated. The target area is eliminated based on the ratio to obtain a new first closed contour.
[0111] Specifically, if the ratio is less than a preset ratio threshold, two boundary lines between the two intersection points are determined on the contour boundary of the target area; one boundary line is arbitrarily selected and moved toward the other boundary line until the target area disappears, and the movement is stopped to obtain a new first closed contour; if the ratio is not less than the ratio threshold, the target area and the intersecting closed area are regarded as intersection areas, and for each intersection area, the target area and the intersection area are regarded as a new first closed contour, and the step of determining the number of closed areas intersecting with the target area in each closed area of the first closed contour is returned.
[0112] The ratio threshold may be set to 0.2, which is not limited in this embodiment. In the above scheme, two different intersection elimination methods are set for the size of the ratio, in order to minimize the impact on other areas of the first closed contour when eliminating the closed area.
[0113] If the ratio is less than the ratio threshold, it means that the target area occupies a very small range in the entire first closed contour. Therefore, the method of pulling the contour boundary of the first closed contour can be adopted to make the target area disappear. Although pulling the contour boundary will also cause other second vertices to move, the impact is small, and the overall change of the first closed contour is small.
[0114] If the ratio is not less than the ratio threshold, it means that the target area is not small in the entire first closed contour. If the pulling method is adopted, if the target area is to be eliminated, the other areas of the first closed contour will be greatly affected. For example, the angle value at each second vertex, the length between each two second vertices, etc. will change significantly. Therefore, the intersection elimination method adopted when there is only one intersection point can be selected to split the target area and its corresponding two closed areas into two first closed contours, and then eliminate them separately.
[0115] For an example, see Fig.12 , Fig.12The entire contour shown is a first closed contour, in which the ratio of the area of the target area to the total area is less than the ratio threshold. There are two closed areas intersecting with the target area, and they are used as two intersecting areas. The two intersecting areas are on both sides of the target area, and each has an intersection with the target area. There are two boundary lines between the two intersections: boundary line 1 and boundary line 2. Any boundary line is selected, such as boundary line 2, and boundary line 2 is moved toward boundary line 1. Specifically, a point can be randomly selected on boundary line 1, and a vertical line is drawn on the straight line where the point is located at the point, and then boundary line 2 is moved along the vertical line toward boundary line 1. The moving direction is shown by the arrow in the figure. It can be considered that a force is applied to boundary line 2, and during the movement, the first closed contour as a whole will also change slightly. The new first closed contour obtained after the movement is as follows Fig.13 shown.
[0116] In another example, see Fig.14 , Fig.14 The entire outline shown is also a first closed outline, where the ratio of the area of the target area to the total area is not less than the ratio threshold. In this case, the entirety of the target area and one of the intersecting areas is taken as a new first closed outline, and the entirety of the target area and the other intersecting area is also taken as a new first closed outline. For example, the outline in the dotted box in the figure is the new first closed outline.
[0117] (3) In each closed area of the first closed contour, if the number of closed areas intersecting with the target area is greater than two, the closed areas intersecting with the target area are regarded as intersection areas, and for each intersection area, the target area and the intersection area are regarded as a new first closed contour, and the step of determining the number of closed areas intersecting with the target area in each closed area of the first closed contour is returned.
[0118] If the number of closed areas intersecting with the target area is greater than two, it can be considered that the three-dimensional closed contour is of a relatively complex shape. The elimination process can refer to the method used when the number is two, and the target area and each intersecting area as a whole are taken as a new first closed contour, and then processed separately. No further details will be given here.
[0119] Furthermore, if the shape of the three-dimensional contour obtained at the beginning of this scheme is particularly complex and contains a large number of first vertices, in order to make the mapping process simpler, some of the first vertices can be appropriately selected to form a three-dimensional closed contour that is truly used for mapping, such as sampling, which can speed up the mapping process and improve efficiency. In addition, after the closed area is eliminated, the shape of the target mapping contour may not be smooth. In order to make its shape more reasonable and smooth, and more in line with the geometric model, the target mapping contour can be smoothed locally or globally.
[0120] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a contour mapping device for Fig.15 In the specific implementation of the method, the contour mapping device provided by the embodiment of the present invention can be used in a computer terminal or various mobile devices, combined with Figure 1 , the contour mapping device is introduced, such as Fig.15 As shown, the device may include:
[0121] A three-dimensional closed contour acquisition module 10, used to acquire a three-dimensional closed contour including a plurality of first vertices;
[0122] An initial open contour acquisition module 20, configured to select an initial vertex from each of the first vertices, and disconnect the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transform the initial vertex into two first vertices;
[0123] A first open contour forming module 30, for mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and forming each second vertex into a first open contour on the plane;
[0124] A closing processing module 40, configured to perform closing processing on the first open contour to obtain a first closed contour;
[0125] A judging module 50, configured to judge whether the first closed contour contains at least two closed areas;
[0126] an intersection elimination processing module 60, configured to, if yes, determine a target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas;
[0127] The target mapping contour determining module 70 is configured to, if not, use the first closed contour as the target mapping contour.
[0128] In the above scheme, the present application first obtains a three-dimensional closed contour containing multiple first vertices, and then selects an initial vertex, and disconnects the three-dimensional closed contour at this initial vertex, and then maps each second vertex after disconnection, and then connects them after mapping, and at the same time, the two first vertices transformed from the initial vertex are not connected to the two second vertices corresponding to them after mapping, so that in the process of forming the first open contour, each second vertex will not be constrained by the original closed contour, so the accuracy of the obtained first open contour is relatively high, then the first closed contour obtained after the closing processing of the first open contour will be more similar to the three-dimensional closed contour as a whole, because the three-dimensional closed contour belongs to a spatial geometric figure with a complex shape and involves more plane domains, so there may be intersections in the first closed contour. Therefore, it is necessary to judge the first closed contour. If it contains at least two closed areas, it can be said that the first closed contour has an intersection phenomenon, and then it is processed for intersection elimination. Considering that there may be more than one intersecting area range in the first closed contour, it is necessary to perform intersection elimination processing in sequence. In the process of intersection elimination processing for a closed area, other closed areas will disappear with the elimination of this closed area. Therefore, after eliminating a closed area (i.e., the target area), it is possible to re-judge whether the first closed contour contains at least two closed areas, until the first closed contour does not contain a closed area. Then the first closed contour finally obtained is the target mapping contour. It can be understood that the first closed contour itself does not belong to the closed area defined in this application.
[0129] Therefore, the target mapping contour obtained by the contour mapping method provided by this solution is more accurate than the two-dimensional contour obtained by the ordinary projection method or direct mapping. Compared with the true two-dimensional contour of the three-dimensional closed contour, it has a lower deformation rate and no intersection phenomenon, and is closer to the true shape of the three-dimensional closed contour. Then, applying the target mapping contour to the geometric model corresponding to the three-dimensional closed contour will be more conducive to the staff's processing and repair of the geometric model, and can also improve work efficiency.
[0130] Furthermore, the embodiment of the present application provides a contour mapping device. Optionally, Fig.16 The hardware structure diagram of the contour mapping device is shown in FIG. Fig.16 The hardware structure of the contour mapping device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0131] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0132] The processor 01 may be a central processing unit CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0133] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0134] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following contour mapping method, including:
[0135] Obtaining a three-dimensional closed contour including a plurality of first vertices;
[0136] Selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transforming the initial vertex into two first vertices;
[0137] Mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and composing each second vertex into a first open contour on the plane; wherein, in the first open contour, two second vertices obtained by mapping after the initial vertex is transformed are not connected;
[0138] Performing closing processing on the first open contour to obtain a first closed contour;
[0139] Determining whether the first closed contour contains at least two closed areas;
[0140] If yes, determine the target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas;
[0141] If not, the first closed contour is used as the target mapping contour.
[0142] Optionally, the refined functions and extended functions of the program may refer to the description of the contour mapping method in the method embodiment.
[0143] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is executed, controls the device where the storage medium is located to execute the following contour mapping method, including:
[0144] Obtaining a three-dimensional closed contour including a plurality of first vertices;
[0145] Selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transforming the initial vertex into two first vertices;
[0146] Mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and composing each second vertex into a first open contour on the plane; wherein, in the first open contour, two second vertices obtained by mapping after the initial vertex is transformed are not connected;
[0147] Performing closing processing on the first open contour to obtain a first closed contour;
[0148] Determining whether the first closed contour contains at least two closed areas;
[0149] If yes, determine the target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas;
[0150] If not, the first closed contour is used as the target mapping contour.
[0151] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0152] Optionally, the refined functions and extended functions of the program may refer to the description of the contour mapping method in the method embodiment.
[0153] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0155] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0156] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A contour mapping method, characterized in that: include: Obtaining a three-dimensional closed contour including a plurality of first vertices; Selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, transforming the initial vertex into two first vertices; Mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and composing each second vertex into a first open contour on the plane; wherein, in the first open contour, two second vertices obtained by mapping after the initial vertex is transformed are not connected; Performing closing processing on the first open contour to obtain a first closed contour; Determining whether the first closed contour contains at least two closed areas; If yes, determine the target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas; If not, the first closed contour is used as the target mapping contour.
2. The method according to claim 1, characterized in that The first open contour formed by each of the second vertices on the plane comprises: Determine a first angle value at each first vertex in the three-dimensional closed contour; Determine the distance between every two first vertices in the three-dimensional closed contour; A second vertex mapped from one of the first vertices transformed from the initial vertex is used as a starting vertex, and a second vertex mapped from another first vertex is used as an ending vertex; According to the positional relationship between the first vertices in the three-dimensional closed contour, the starting vertex, the other second vertices, and the ending vertex are sequentially connected with straight lines to form a contour line; The contour line is modified based on a first angle value at each first vertex in the three-dimensional closed contour and a distance between every two first vertices to obtain a first open contour.
3. The method according to claim 2, characterized in that The step of correcting the contour line based on the first angle value at each first vertex in the three-dimensional closed contour and the distance between every two first vertices to obtain a first open contour includes: Determine a second angle value at each second vertex in the contour line, and a distance between every two second vertices; One-to-one correspondence between each second vertex in the contour line and each first vertex in the three-dimensional closed contour; Based on the first angle value at each first vertex, the second angle value at each corresponding second vertex is corrected, and the distance between each two second vertices in the contour line is corrected to the distance between the two corresponding first vertices to form a first open contour.
4. The method according to claim 1, characterized in that: The step of performing closing processing on the first open contour to obtain a first closed contour includes: Determine a contour start point and a contour end point at each second vertex of the first open contour; Calculating a position deviation between the starting point of the contour and the end point of the contour; Calculating the position parameters to be moved of each second vertex except the start point and the end point of the contour according to the position deviation; The contour vertices are fixed, and the second vertices other than the contour starting point and the contour end point are moved according to their respective position parameters to be moved, and the contour end point is overlapped with the contour starting point to obtain a first closed contour.
5. The method according to claim 1, characterized in that The step of determining a target area from each of the closed areas comprises: determining the area of each of the enclosed areas; The sizes of the areas of the closed regions are compared, and the closed region with the smallest area is taken as the target region.
6. The method according to claim 1, characterized in that The performing intersection elimination processing on the target area to obtain a new first closed contour includes: In each closed area of the first closed contour, determining the number of closed areas intersecting with the target area; If the number is one, taking the edge between every two second vertices in the first closed contour as a contour edge, determining the intersection point between the target area and the intersecting closed area, taking the contour edge at the intersection point as the intersecting contour edge, and performing intersection elimination processing on the target area according to the intersection point and the intersecting contour edge to obtain a new first closed contour; If the number is two, obtaining the area of the target region and the total area of the first closed contour, calculating the ratio of the area of the target region to the total area, and performing elimination processing on the target region based on the ratio to obtain a new first closed contour; If the number is greater than two, the closed area intersecting with the target area is regarded as the intersection area. For each intersection area, the target area and the intersection area are regarded as a new first closed contour, and the step of determining the number of closed areas intersecting with the target area in each closed area of the first closed contour is returned.
7. The method according to claim 6, characterized in that The step of performing intersection elimination processing on the target area according to the intersection point and the intersecting contour edge to obtain a new first closed contour includes: The second vertices at both ends of the intersecting contour edge are used as the third vertex; Randomly select a third vertex from each of the third vertices as a target point, and select another third vertex on the same intersecting contour edge as the target point as a first corresponding point of the target point; Another third vertex belonging to the same closed area as the target point is used as the second corresponding point of the target point; Another third vertex other than the target point, the first corresponding point and the second corresponding point is used as the third corresponding point of the target point; Each of the intersecting contour edges is deleted from the first closed area, and at the same time, the target point is connected to the third corresponding point, and the first corresponding point is connected to the second corresponding point to form a new first closed contour.
8. The method according to claim 6, characterized in that The step of performing elimination processing on the target area based on the ratio to obtain a new first closed contour includes: If the ratio is less than a preset ratio threshold, two boundary lines between the two intersection points are determined on the contour boundary of the target area; Randomly select a boundary line, move the boundary line toward another boundary line, and stop moving until the target area disappears, so as to obtain a new first closed contour; If the ratio is not less than the ratio threshold, the target area and the intersecting closed area are regarded as the intersection area. For each intersection area, the target area and the intersection area are regarded as a new first closed contour, and the step of determining the number of closed areas intersecting with the target area in each closed area of the first closed contour is returned.
9. The method according to claim 4, characterized in that The step of calculating the position parameters to be moved of each second vertex except the contour starting point and the contour end point according to the position deviation includes: Determine the position of each second vertex in the first open contour, and divide the first open contour into sub-contours according to the position of each second vertex; Converting each of the sub-contours into a local matrix respectively; Aggregating the local matrices into a global matrix corresponding to the first open contour; Establishing a one-dimensional array according to the position deviation; Calculating a target displacement vector based on the global matrix and the one-dimensional array; The position parameters to be moved of each second vertex except the contour start point and the contour end point are determined by the target displacement vector.
10. A contour mapping device, characterized in that: include: A three-dimensional closed contour acquisition module, used to acquire a three-dimensional closed contour including a plurality of first vertices; An initial open contour acquisition module, used for selecting an initial vertex from each of the first vertices, and disconnecting the three-dimensional closed contour at the initial vertex to obtain an initial open contour, and at the same time, converting the initial vertex into two first vertices; A first open contour forming module, used for mapping each first vertex of the initial open contour on a plane to obtain each second vertex, and forming each second vertex into a first open contour on the plane; A closing processing module, used for performing closing processing on the first open contour to obtain a first closed contour; A judging module, used for judging whether the first closed contour contains at least two closed areas; an intersection elimination processing module, configured to, if yes, determine a target area from each of the closed areas, perform intersection elimination processing on the target area to obtain a new first closed contour, and return to execute the step of determining whether the first closed contour contains at least two closed areas; The target mapping contour determining module is used for, if not, taking the first closed contour as the target mapping contour.
11. A contour mapping device, characterized in that including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the contour mapping method as described in any one of claims 1-9.
12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the contour mapping method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Two-dimensional graph contour drawing method
CN105303588A
Display grid repairing method and device, equipment and storage medium
CN116740321A
Method for extracting outline from solid / surface model, and computer software program
JP2009122998A
Method for restoring 3-dimension image using silhouette information in 2-dimension image
KR100721536B1
