Chamfer surface identification method and device, electronic equipment and storage medium
By identifying the target quadrilateral in the 3D model and searching for the adjacent polygon set, the chamfered surface is identified using the average width and angle conditions. This solves the problem of low efficiency in chamfered surface recognition in the 3D model and achieves efficient and automatic recognition.
Patent Information
- Application Number
- CN202111070893.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-09-13
AI Technical Summary
In the prior art, the recognition efficiency of chamfered surfaces in three-dimensional models is low, especially when encountering irregular structures, it is difficult to recognize them efficiently.
The target quadrilateral is determined in the 3D model, and adjacent polygons are searched along the extension direction of its opposite sides to form a polygon set. The average width and angle conditions of the polygon set are used to identify the chamfered surface.
The recognition efficiency of chamfered surfaces in 3D models is improved, the complete recognition of irregular chamfered surfaces is ensured, manual intervention is reduced, and the efficiency of 3D model production is improved.
Smart Images

Figure CN114092932B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of pattern recognition, in particular to a chamfer surface recognition method and device, electronic equipment and storage medium. BACKGROUND
[0002] This section is intended to provide background information to facilitate a better understanding of embodiments of the present application as set forth in the claims. The description herein does not admit that what is included in this section is prior art.
[0003] The surface of an object, especially the surface of an industrial product, often has a joint line of spliced parts. In three-dimensional model making, it is often necessary to simulate such a joint line. The surface of the parts on both sides of the joint line at the joint line must have a wide or narrow chamfer. In a three-dimensional model, the chamfer area is usually simulated by a surface between two or more parallel continuous edges to transition between the narrow area between the outer surface and the gap surface. In three-dimensional model making, it is often necessary to concentrate the change of the normal on the area of the chamfer surface. Therefore, the chamfer surface needs to be identified separately for subsequent operations. SUMMARY
[0004] In view of the above technical problems, there is an urgent need for an improved method that can efficiently identify the chamfer surface of a three-dimensional model.
[0005] The exemplary embodiments of the present application provide a chamfer surface recognition method, comprising:
[0006] Determining that at least one target quadrilateral in a three-dimensional model to be processed has a pair of edges whose lengths are both not greater than a preset threshold value;
[0007] Searching for adjacent polygons in the three-dimensional model along the extension direction of the target pair of edges of the target quadrilateral to form a polygon set together with the target quadrilateral;
[0008] In response to determining that the average width of all polygons in the polygon set along a direction perpendicular to the extension direction is not greater than a preset threshold value, identifying all the polygons as chamfer surfaces.
[0009] In some exemplary embodiments, searching for adjacent polygons in the three-dimensional model along the extension direction of the target pair of edges; specifically comprising:
[0010] In the three-dimensional model, for each edge in the target pair of edges, searching along the extension direction of the edge to obtain at least one extended edge connected in sequence from the edge; wherein the included angle between the extended edge connected to the edge and the edge is not greater than a preset corner, and the included angle between any two connected extended edges is not greater than a preset corner;
[0011] Based on all the extended edges of the target pair of edges of the target quadrilateral and the intersection points between the extended edges, the adjacent polygons are obtained.
[0012] In some example embodiments, in response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces; specifically comprising:
[0013] All the edges of all the polygons in the polygon set are obtained, and all the edges of all the polygons except the target pair of edges and all the extended edges are determined;
[0014] The average length of the other all edges is taken as the average width;
[0015] In response to determining that the average width is not greater than a preset threshold, all the polygons are identified as chamfered surfaces.
[0016] In some example embodiments, in response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces, specifically comprising:
[0017] In response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, and the included angle between all the two adjacent surfaces with the target pair of edges and all the extended edges as edges is not less than a preset included angle, all the polygons are identified as chamfered surfaces.
[0018] In some example embodiments, the process of determining the target pair of edges of the target quadrilateral specifically comprises:
[0019] In response to determining that the distance between two edges of a pair of edges of the target quadrilateral is not greater than a preset threshold, the pair of edges is determined as the target pair of edges.
[0020] In some example embodiments, the process of determining the target pair of edges of the target quadrilateral specifically comprises:
[0021] In response to determining that the length of a pair of edges of the target quadrilateral is not greater than a preset threshold, another pair of edges of the target quadrilateral is determined as the target pair of edges.
[0022] In some example embodiments, after all the polygons are identified as chamfered surfaces, the method further comprises:
[0023] In response to determining that there is a quadrilateral in the three-dimensional model to be processed, which has at least one pair of edges whose length is not greater than a preset threshold and has not been identified, the target quadrilateral is re-determined; and,
[0024] In response to determining that there is no quadrilateral with at least one pair of sides whose length is not greater than the preset threshold in the three-dimensional model to be processed, the chamfer surface identification is ended.
[0025] Based on the same inventive concept, the example embodiments of the present application further provide a chamfer surface identification device, comprising:
[0026] A determination module is configured to determine a target quadrilateral with at least one pair of sides whose length is not greater than a preset threshold in a three-dimensional model to be processed.
[0027] An extension module is configured to search for adjacent polygons in the three-dimensional model along the extension direction of the target pair of sides of the target quadrilateral, and form a polygon set together with the target quadrilateral.
[0028] An identification module is configured to identify all the polygons in the polygon set as chamfer surfaces in response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold.
[0029] Based on the same inventive concept, the example embodiments of the present application further provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the chamfer surface identification method of any one of the above when executing the program.
[0030] Based on the same inventive concept, the example embodiments of the present application further provide a non-transitory computer readable storage medium, which stores computer instructions for causing a computer to execute the chamfer surface identification method of any one of the above.
[0031] As can be seen from the above, the chamfer surface identification method provided by the embodiments of the present application first determines a target quadrilateral with at least one pair of sides whose length is not greater than a preset threshold in a three-dimensional model to be processed; then searches for adjacent polygons in the three-dimensional model along the extension direction of the target pair of sides of the target quadrilateral, and forms a polygon set together with the target quadrilateral; and identifies all the polygons in the polygon set as chamfer surfaces when determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold. Thus, the chamfer surfaces in the three-dimensional model to be processed are automatically identified, the efficiency of chamfer surface identification of the three-dimensional model is improved, and the efficiency of selecting different surfaces in the optimization of three-dimensional model manufacturing is greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the present application or the related art, the accompanying drawings needed to be used in the embodiments or the description of the related art will be briefly introduced. Obviously, the accompanying drawings in the following description only intend to explain the embodiments of the present application, and for those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0033] Figure 1 A schematic diagram of a chamfer surface recognition result in an application scenario in the exemplary embodiments of the present application;
[0034] Figure 2 A flowchart of a chamfer surface recognition method in the exemplary embodiments of the present application;
[0035] Figure 3 A schematic diagram of a topology of a three-dimensional model in the exemplary embodiments of the present application;
[0036] Figure 4 A schematic diagram of a topology of all edges less than a preset threshold in a three-dimensional model in the exemplary embodiments of the present application;
[0037] Figure 5 A schematic diagram of a topology of all quadrilaterals having at least one pair of edges with a length less than a preset threshold in the exemplary embodiments of the present application;
[0038] Figure 6 A schematic diagram of a topology of a target quadrilateral in the exemplary embodiments of the present application;
[0039] Figure 7 A schematic diagram of a topology of a pair of edges of a target quadrilateral in the exemplary embodiments of the present application;
[0040] Figure 8 A schematic diagram of a topology of an extended edge searched along the extension direction of a pair of edges in the exemplary embodiments of the present application;
[0041] Figure 9 A schematic diagram of a topology of a polygon set searched along the extension direction of a pair of edges in the exemplary embodiments of the present application;
[0042] Figure 10 A schematic diagram of a topology of all quadrilaterals having at least one pair of edges with a length less than a preset threshold and not yet recognized in the exemplary embodiments of the present application;
[0043] Figure 11 A schematic diagram of a topology of all chamfer surfaces recognized in a three-dimensional model in the exemplary embodiments of the present application;
[0044] Figure 12FIG. 1 is a schematic diagram of a recognition result of a chamfer surface without a preset included angle according to an example embodiment of the present application;
[0045] Figure 13 FIG. 2 is a schematic diagram of a recognition result of a chamfer surface with a preset included angle according to an example embodiment of the present application;
[0046] Figure 14 FIG. 3 is a schematic diagram of a recognition device of a chamfer surface according to an example embodiment of the present application;
[0047] Figure 15 FIG. 4 is a schematic diagram of a specific electronic device according to an example embodiment of the present application. DETAILED DESCRIPTION
[0048] The principles and spirits of the present application will be described below with reference to several example embodiments. It should be understood that these embodiments are given only for better understanding of the present application and to enable a person skilled in the art to better implement the present application, and do not limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0049] According to the embodiments of the present application, a chamfer surface recognition method and device, an electronic device and a storage medium are provided.
[0050] In this document, it should be understood that any number of elements in the drawings are used for illustration only and not for limiting, and any naming is only for distinguishing and does not have any limiting meaning.
[0051] The principles and spirits of the present application will be described below with reference to several example embodiments. SUMMARY
[0053] In the prior art, for recognizing a chamfer surface on a three-dimensional model, a user generally needs to judge and recognize one by one, even if the user selects continuous quadrilaterals by using a built-in function of three-dimensional software, the user still needs to manually select each polygon needed when encountering a chamfer surface structure containing a triangle or a bifurcation.
[0054] The inventors of the present application find that the reason for the low efficiency of identifying the chamfered surface is that in the process of three-dimensional modeling, the three-dimensional model is generally modeled by simulating the actual object, and some complex structures that are not common inevitably exist in the simulated actual object, and these complex structures include some irregular chamfered surfaces. The three-dimensional model needs to be modeled according to the corresponding actual object to show these irregular chamfers, and at the same time, since the three-dimensional model is mainly used to show the effect of the product, the size of the effect diagram does not completely correspond to the simulated actual object, so it is easy to miss some irregular chamfered surfaces that do not completely correspond to the size of the actual object by only selecting the chamfered surface through the specific parameter range. In addition, in the prior art, the selection function built in the three-dimensional software can usually only select continuous quadrilaterals, and cannot quickly select other various topological structures. Even in the ideal state, all chamfers of a part are composed of quadrilaterals, the selection function built in the software can only select continuous quadrilaterals in one direction, and still needs to select continuous quadrilaterals in another direction after encountering a corner. Therefore, the prior art cannot realize efficient identification of the chamfered surface of the three-dimensional model.
[0055] In order to solve the above problems, the present application provides a processing scheme for automatically identifying chamfered surfaces, which specifically comprises: first, determining at least one target quadrilateral with a length of each pair of opposite sides being not greater than a preset threshold from a three-dimensional model to be processed, then searching for adjacent polygons in the three-dimensional model along the extension direction of the target pair of opposite sides of the target quadrilateral, and forming a polygon set according to the adjacent polygons and the target quadrilateral; the polygon set includes polygons other than the target quadrilateral, which may be chamfered surfaces, and then performing chamfered surface identification on all polygons in the polygon set as a whole. Thus, some irregular chamfered surfaces can be identified. At the same time, if all chamfered surfaces on part or the whole of the three-dimensional model are to be identified, a plurality of target quadrilaterals with a length of each pair of opposite sides being not greater than a preset threshold can be determined from all un-identified quadrilaterals in the three-dimensional model, and then all target quadrilaterals are subjected to chamfered surface identification according to the method of the present application, and finally all identification results are output, so that all chamfered surfaces on part or the whole of the three-dimensional model can be automatically identified.
[0056] After introducing the basic principle of the present application, various non-limiting embodiments of the present application will be specifically introduced below.
[0057] Overview of application scenarios
[0058] Reference Figure 1Fig. 1 is a schematic diagram of the identification result of the chamfer surface in one application scenario of the exemplary embodiments of the present application. The figure represents a part of a three-dimensional model of a sphere, wherein there is a square in the center position of the part, indicating that the sphere is cut inwardly by a cuboid. It can be seen that there are some chamfer surfaces at the place where the sphere and the cuboid meet, and at the place where the two surfaces inside the cuboid meet. The light gray part is the chamfer surface identified by the method of the present application. If all the chamfer surfaces are manually selected by the user, the working time will undoubtedly be increased, the overall efficiency will not be high, and some chamfer surfaces may be missed due to negligence.
[0059] In some specific application scenarios, the chamfer surface identification method of the present application can be directly applied in some three-dimensional software. When used by the user, only the three-dimensional model to be processed needs to be selected. Optionally, the selected three-dimensional model to be processed can be a whole or a part of the three-dimensional model. After selecting the three-dimensional model to be processed, the chamfer surface identification can be completed by one key through the chamfer surface identification button or switch.
[0060] In some specific application scenarios, the chamfer surface identification method of the present application can also be applied in a separate application software. When used by the user, only the three-dimensional model to be processed needs to be added to the separate application software, or the three-dimensional model to be processed is opened in the application software, and then the chamfer surface identification can be completed by one key through the chamfer surface identification button or switch.
[0061] In some specific application scenarios, the chamfer surface identification method of the present application can be directly applied locally or run in a cloud server. When running in the cloud server, the obtained data to be processed is sent to the cloud server through the network, the server identifies the data to be processed through the chamfer surface identification method of the present application, and the identification result is sent to the local through the network.
[0062] The processing method of the chamfer surface identification according to the exemplary embodiments of the present application will be described below in combination with specific application scenarios. It should be noted that the above application scenarios are only shown for the purpose of facilitating the understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
[0063] Exemplary method
[0064] Reference Figure 2 The embodiments of the present application provide a method for identifying the chamfer surface of a three-dimensional model, comprising the following steps:
[0065] Step S11, determining that at least one target quadrilateral with the length of opposite sides being not greater than a preset threshold value in the three-dimensional model to be processed.
[0066] During specific implementation, the three-dimensional model to be processed can be a complete model or a part of a complete model, which is not limited here. The specific acquisition result can be determined according to the user's selection. That is, when the user selects the entire three-dimensional model, this step obtains the entire three-dimensional model, and when the user selects a part of the complete three-dimensional model, this step obtains a part of the three-dimensional model. Optionally, the three-dimensional model includes multiple polygons, each of which represents a face. After determining the three-dimensional model to be processed, a target quadrilateral with at least one set of opposite sides whose lengths are not greater than a preset threshold is determined from the three-dimensional model to be processed. The preset threshold can be set as needed and is not limited here.
[0067] In specific implementation, after obtaining the 3D model to be processed, all quadrilaterals in the 3D model can be filtered out first, referring to Figure 3 , is a schematic diagram of the topological structure of a three-dimensional model in an exemplary embodiment of the present application, which includes various polygons, from which all quadrilaterals are screened. Then, target quadrilaterals are further screened for those quadrilaterals in which the lengths of at least two non-adjacent sides are no greater than a preset threshold. In other words, the target quadrilaterals include at least one pair of opposite sides whose lengths are less than or equal to the preset threshold. Optionally, there can be multiple or one target quadrilateral, which is not limited here.
[0068] In some exemplary embodiments, reference Figure 4 , we can first find all the edges of the current 3D model to be processed that are less than or equal to the preset threshold and record them as a set ES, that is, Figure 4 Then, from all the quadrilaterals, we filter out candidate quadrilaterals that have at least one pair of opposite sides belonging to the set ES. Figure 5 Among them, the dark gray quadrilaterals are all the quadrilaterals that have been screened out and have at least one set of opposite sides whose lengths are not greater than the preset threshold. These quadrilaterals can be used as target quadrilaterals. Figure 6 , where the dark grey quadrilateral represents a target quadrilateral. It should be noted that, Figure 5 All the opposite sides of a quadrilateral that have at least one pair of opposite sides that are not greater than the preset threshold are not equal to the preset threshold. Figure 4 All edges that are less than or equal to the preset threshold are completely overlapped, for example, Figure 5 The triangle in the dotted circle has three sides that belong to the set ES, but since it does not belong to a quadrilateral, the triangle does not belong to the target quadrilateral.
[0069] Step S12: searching for adjacent polygons along the extension direction of the target group opposite sides of the target quadrilateral in the three-dimensional model, and forming a polygon set together with the target quadrilateral.
[0070] In implementation, since the chamfer surface recognition is directly performed on all target quadrilaterals, some irregular chamfer surfaces may be missed, for example, Figure 5 The triangle in the dashed circle is actually a chamfer surface in the model. In this case, the chamfer surface recognition is performed only on all target quadrilaterals, and the triangle is inevitably missed. Therefore, in the present application, the target quadrilateral is only used as an initial sample for subsequent judgment, and then the adjacent polygons are searched along the extension direction of the target group of opposite sides of the target quadrilateral in the three-dimensional model, and the adjacent polygons searched are combined with the target quadrilateral to form a polygon set. Then the polygon set is recognized as a whole. Since the polygon set includes some irregular chamfer surfaces, such as triangles and other chamfer surfaces, some special chamfer surfaces can be avoided from being missed through this step, and the recognition efficiency of the chamfer surface can be improved by recognizing multiple chamfer surfaces as a whole.
[0071] In some example embodiments, after all the polygons are recognized as chamfer surfaces, the method further includes:
[0072] In response to determining that there is at least one group of quadrilaterals with opposite sides each having a length not greater than a preset threshold in the three-dimensional model to be processed and not being recognized, the target quadrilateral is re-determined; and
[0073] In response to determining that there is no at least one group of quadrilaterals with opposite sides each having a length not greater than a preset threshold in the three-dimensional model to be processed and not being recognized, the chamfer surface recognition is ended.
[0074] In implementation, if all chamfer surfaces of a three-dimensional model are to be recognized, the chamfer surface recognition can be performed multiple times in a loop. After one chamfer surface recognition is performed, it is further determined whether there is at least one group of quadrilaterals with opposite sides each having a length not greater than a preset threshold in the three-dimensional model to be processed and not being recognized. If there is, the target quadrilateral is re-determined, and the subsequent recognition process is performed. The chamfer surface recognition is ended until there is no at least one group of quadrilaterals with opposite sides each having a length not greater than a preset threshold in the three-dimensional model to be processed and not being recognized. Reference Figure 11 In the figure, the dark gray polygon represents all the chamfer surfaces recognized in a three-dimensional model, and the light gray polygon represents a target quadrilateral. Figure 11 The chamfer surfaces recognized in the figure include multiple triangles in addition to quadrilaterals, which further illustrates that the method of the present application can recognize various complex chamfer surfaces in a three-dimensional model.
[0075] In some example embodiments, when all the chamfered surfaces of a three-dimensional model are to be identified, in order to avoid repeated identification, a target quadrilateral can be determined first, and then the subsequent identification steps are performed through the target quadrilateral. Optionally, the process of determining a target quadrilateral can be determined randomly or by other means, which is not limited here. In order to facilitate computer program operation, all target quadrilaterals can be sorted in a default order, and each target quadrilateral can be sequentially labeled with a serial number, and then the target quadrilaterals can be sequentially identified according to the size of the serial number.
[0076] In some example embodiments, in the three-dimensional model to be processed, whether there is at least one group of quadrilaterals whose length of opposite sides is not greater than a preset threshold value and has not been identified, specifically includes:
[0077] Based on the polygon set, it is determined whether there is at least one group of quadrilaterals whose length of opposite sides is not greater than a preset threshold value and has not been identified.
[0078] In specific implementation, since all the polygons in the polygon set searched through a group of target quadrilaterals are identified as a whole, the polygon set for chamfered surface identification at this time includes at least one group of quadrilaterals whose length of opposite sides is not greater than a preset threshold value and other than the current target quadrilateral. In order to avoid repeated identification, a part of the at least one group of quadrilaterals whose length of opposite sides is not greater than a preset threshold value can be excluded from the polygon set.
[0079] Reference Figure 9 The topological structure of the polygon set searched along the extension direction of a group of opposite sides in the example embodiments of the present application is shown in the figure, where the dark gray part is the polygon set searched along the extension direction of a group of opposite sides. It can be seen that the polygon set includes a plurality of quadrilaterals whose length of opposite sides is not greater than a preset threshold value. If the polygon set has completed chamfered surface identification, these quadrilaterals need to be excluded from all the quadrilaterals that have not been identified. The result is shown in Figure 10 , Figure 10 Compared with Figure 5 , the dark gray part in Figure 9 is obviously less.
[0080] In some example embodiments, adjacent polygons in the three-dimensional model along the extension direction of the target group of opposite sides are searched; specifically includes:
[0081] In the three-dimensional model, for each edge in the target group of edges, a search is performed along the extension direction of the edge to obtain at least one extended edge sequentially connected to the edge; wherein the angle between the extended edge connected to the edge and the edge is not greater than a preset angle, and the angle between any two connected extended edges is not greater than the preset angle;
[0082] The adjacent polygons are determined based on all the extended edges of the target group of edges and intersections between the extended edges.
[0083] When implementing it, refer to Figure 7 , where the two dark black lines are the target set of opposite edges. Then, for each edge in the target set of opposite edges, search along the extension direction of the edge to obtain at least one extended edge sequentially connected to the edge. Figure 8 ,in, Figure 8 The dark black edge includes all edges Figure 7 The target group in the search is the extension direction of the edge, and the extended edge is obtained.
[0084] After obtaining at least one extended edge, first obtain the intersection points between all extended edges, and based on all the extended edges of the target set of edges and the intersection points between the extended edges, determine the adjacent polygons from the three-dimensional model to be processed. Optionally, a polygon whose vertices are completely composed of the intersection points between all extended edges and between extended edges and target set of edges is determined as a polygon in the polygon set. Figure 9 , Figure 9 All vertices of the dark gray polygons are intersections between the extended edges or between the extended edges and the opposite edges of the target group, while those polygons with only some vertices being intersections between the extended edges or between the extended edges and the opposite edges of the target group are excluded.
[0085] During specific implementation, for each edge in the target group of pairs of edges, searching along the extension direction of the edge is a repetitive process. After searching along the extension direction of one edge in the target group of pairs of edges and obtaining an extended edge, the search will continue along the extension direction of the extended edge until no new edges can be found. Each search along the extension direction of an edge specifically includes: determining the target endpoint of the edge, and determining the edge with the smallest angle with the edge among all edges with the target endpoint as a common endpoint; in response to determining that the angle is less than a preset angle, determining the edge with the smallest angle with the edge as the extended edge. Optionally, the preset angle can be set as needed and is not limited here.
[0086] It should be noted that, since each edge has two end points, when searching for the first time, the search needs to be conducted along the two end points respectively, i.e. the target end point is two at this time, and when continuing to search for the extended edge, it is not necessary to search back, so the search needs to be conducted along the new end point of the extended edge at this time, i.e. the target end point is one at this time. The included angle between two edges mentioned in the present application refers to the included angle formed by the extension line of one edge and the other edge.
[0087] In some example embodiments, the process of determining the target pair of edges of the target quadrilateral specifically comprises:
[0088] In response to determining that the distance between the two edges of a pair of edges of the target quadrilateral is not greater than a preset threshold, the pair of edges is determined as the target pair of edges.
[0089] In actual implementation, since each quadrilateral has two pairs of edges, if the adjacent polygons are searched along the extension direction of each pair of edges, and the chamfer surface recognition is conducted on the two polygon sets obtained respectively, if the quadrilaterals in the polygon sets obtained do not belong to the chamfer surface, the workload will undoubtedly be increased. Therefore, the target quadrilateral can be preliminarily judged, and only the adjacent polygons are searched along the extension direction of the target pair of edges screened out. Since the distance between each pair of edges determines the width of the adjacent polygon obtained after the extension search in the direction perpendicular to the extension direction, when it is determined that the distance between the two edges of a pair of edges of the target quadrilateral is not greater than a preset threshold, the pair of edges is determined as the target pair of edges. When it is determined that the distance between the two edges of a pair of edges of the target quadrilateral is greater than a preset threshold, the pair of edges is not determined as the target pair of edges.
[0090] In order to further improve the speed of determining the target pair of edges, in some example embodiments, the process of determining the target pair of edges of the target quadrilateral specifically comprises:
[0091] In response to determining that the length of a pair of edges of the target quadrilateral is not greater than a preset threshold, another pair of edges of the target quadrilateral is determined as the target pair of edges.
[0092] In a specific implementation, the lengths of a set of opposite sides of the target quadrilateral can be used as the distances between two sides of another set of opposite sides of the target quadrilateral. Thus, the process of measuring the distance between two sides is saved, and the efficiency of determining the target set of opposite sides is further improved. Alternatively, the four sides of the target quadrilateral can be obtained first, and one side is selected from the four sides and recorded in set Pa. The two endpoints of the selected side are obtained, and all sides of the target quadrilateral that have the two endpoints as common endpoints are determined. The determined sides are removed from the four sides of the target quadrilateral, and the remaining side is added to set Pa. The two sides in set Pa are a set of opposite sides. The two sides in set Pa are removed from the four sides of the target quadrilateral, and another set of opposite sides is obtained and recorded in set Pb. In determining the target set of opposite sides, it is determined whether the two sides in set Pa are both smaller than a preset threshold. If yes, the two sides in set Pb are determined as the target set of opposite sides. If no, the two sides in set Pb are not determined as the target set of opposite sides. Similarly, it is determined whether the two sides in set Pb are both smaller than the preset threshold. If yes, the two sides in set Pa are determined as the target set of opposite sides. If no, the two sides in set Pa are not determined as the target set of opposite sides.
[0093] In step S13, in response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces.
[0094] In a specific implementation, when it is determined that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces.
[0095] It should be noted that since the main purpose of a three-dimensional model is generally to show the effect of a product or a real object, the size of the three-dimensional model cannot be guaranteed to strictly correspond to the size of the product or the real object in proportion, so if a single fixed parameter is used for screening to identify chamfered surfaces, most of the chamfered surfaces may not be identified. Therefore, in this step, the average width of all polygons in the polygon set is used for chamfered surface identification. If a wide parameter is blindly used to identify all polygons, the identification accuracy will undoubtedly be reduced. The inventors of the present application have found that there is a close relationship between adjacent chamfered surfaces, for example, many chamfered surfaces are extended from a chamfered surface. Therefore, in the embodiment of the present application, the target quadrilateral is used for extension search first, and the polygon set obtained has a close relationship with the target quadrilateral. Then, the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is used for chamfered surface identification, which ensures the accuracy while improving the identification efficiency.
[0096] In some example embodiments, in response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces; specifically including:
[0097] All edges of all the polygons in the polygon set are obtained, and all the edges of all the polygons except the target pair of edges and all the extended edges are determined;
[0098] The average length of all the edges is taken as the average width;
[0099] In response to determining that the average width is not greater than a preset threshold, all the polygons are identified as chamfered surfaces.
[0100] In specific implementation, all the edges along the extension direction are first excluded from all the edges of all the polygons in the polygon set, and then the average length of the remaining edges is taken as the average width of all the polygons along the direction perpendicular to the extension direction.
[0101] In some example embodiments, the width of each polygon along the direction perpendicular to the extension direction can also be measured first, and then the average width can be obtained by summing and averaging the width of all the polygons. Optionally, when the polygon is a quadrilateral, the distance between two edges along the extension direction can be measured as the width of the quadrilateral along the direction perpendicular to the extension direction. When the polygon is a triangle, the height of the edge along the extension direction can be measured as the width of the triangle along the direction perpendicular to the extension direction.
[0102] In some example embodiments, in response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, all the polygons are identified as chamfered surfaces; specifically including:
[0103] In response to determining that the average width of all the polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, and all the angles between two adjacent surfaces with the target pair of edges and all the extended edges as edges are not less than a preset angle, all the polygons are identified as chamfered surfaces.
[0104] In implementation, the inventor of the present application finds that if only the average width of all quadrilaterals in the polygon set is used to identify the chamfer surface, the average width of some smooth surfaces may also meet the requirements of chamfer surface identification on the three-dimensional model, thereby causing some smooth surfaces to be identified as chamfer surfaces. Therefore, after determining that the average width of all polygons in the polygon set along the extension direction is not greater than the preset threshold, the chamfer surface identification is further performed by using the included angle between the two adjacent surfaces on both sides of each edge, and when the included angle is greater than or equal to the preset included angle, the extended polygon set corresponding to the target pair of edges is identified as the chamfer surface. It should be noted that the included angle between the two surfaces mentioned in the present application refers to the supplementary angle of the included angle between the projections of the two surfaces on a virtual plane perpendicular to the edge line, that is, the supplementary angle of the included angle formed by the projections of the two surfaces on the virtual plane perpendicular to the edge line.
[0105] Reference Figure 12 and Figure 13 wherein, Arng represents the range of the preset included angle, when Arng∈[0, 180], it means that the preset included angle is set to 0 degree, that is, no chamfer surface is identified by the preset included angle, and when Arng∈[5, 180], it means that the preset included angle is currently set to 5 degrees. Wherein, Figure 12 and Figure 13 The light gray part in the dashed box in FIG. 5 is the identified chamfer surface, and it can be seen from the figure that at this time, Figure 12 the identified chamfer surface is obviously more than that in FIG. 4. Figure 13 that is, Figure 12 the smooth curved surface in FIG. 4 is identified as a chamfer surface.
[0106] The method for identifying the chamfer surface of the three-dimensional model provided in the embodiments of the present application first determines at least one target quadrilateral with a length of the target pair of edges being not greater than a preset threshold from the three-dimensional model to be processed; then searches for adjacent polygons in the three-dimensional model along the extension direction of the target pair of edges of the target quadrilateral, and forms a polygon set according to the adjacent polygons and the target quadrilateral; when it is determined that the average width of all polygons in the polygon set along the extension direction is not greater than the preset threshold, all the polygons are identified as chamfer surfaces. Therefore, the chamfer surface in the three-dimensional model to be processed is automatically identified, the efficiency of the chamfer surface identification of the three-dimensional model is improved, and the efficiency of the operation of selecting different surfaces in the optimization of the three-dimensional model is greatly improved.
[0107] It is to be understood that the foregoing description is directed to embodiments of the application. Various embodiments are described herein, including the best mode embodiments. However, various modifications and changes can be made without departing from the scope and spirit of the application as set forth in the claims below. It is intended that the application be construed as including all such modifications and changes.
[0108] Exemplary device
[0109] Based on the same inventive concept, the application also provides a chamfer surface identification device corresponding to any of the above-mentioned embodiment methods.
[0110] Reference Figure 14 The chamfer surface identification device comprises:
[0111] An acquisition module 21, a determination module, determines at least one target quadrilateral in a three-dimensional model to be processed, the length of each pair of sides of which is not greater than a preset threshold value;
[0112] An extension module 22, searches for adjacent polygons in the three-dimensional model along the extension direction of the target group of pairs of sides of the target quadrilateral, and forms a polygon set together with the target quadrilateral;
[0113] An identification module 23, in response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold value, identifies all the polygons as chamfer surfaces.
[0114] In some example embodiments, the extension module 22 is specifically configured to:
[0115] In the three-dimensional model, for each side in the target group of pairs of sides, search along the extension direction of the side to obtain at least one extended side connected in sequence from the side; wherein the angle between the extended side connected to the side and the side is not greater than a preset corner, and the angle between any two connected extended sides is not greater than a preset corner;
[0116] Determine the adjacent polygons based on all the extended sides of the target group of pairs of sides and the intersection points between the extended sides.
[0117] In some example embodiments, the extension module 22 is specifically configured to:
[0118] Acquire all sides of all polygons in the polygon set, and determine all other sides of all polygons in addition to the target group of pairs of sides and all the extended sides;
[0119] the average length of all the other sides as the average width;
[0120] in response to determining that the average width is not greater than a preset threshold, identifying all the polygons as chamfered surfaces.
[0121] In some example embodiments, the identifying module 23 is specifically configured to:
[0122] in response to determining that the average width of all the polygons in the polygon set along the extension direction is not greater than a preset threshold, and the included angle between all two adjacent surfaces with the target pair of edges and all the extended edges as edges is not less than a preset included angle, identifying all the polygons as chamfered surfaces.
[0123] In some example embodiments, the device for identifying chamfered surfaces of a three-dimensional model further comprises:
[0124] in response to determining that the distance between two edges of a target pair of edges of the target quadrilateral is not greater than a preset threshold, determining the target pair of edges as the target pair of edges.
[0125] In some example embodiments, the device for identifying chamfered surfaces of a three-dimensional model further comprises:
[0126] in response to determining that the length of each of a target pair of edges of the target quadrilateral is not greater than a preset threshold, determining another target pair of edges of the target quadrilateral as the target pair of edges.
[0127] In some example embodiments, the device for identifying chamfered surfaces of a three-dimensional model further comprises:
[0128] in response to determining that there is at least one quadrilateral with a length of each of a pair of edges not greater than a preset threshold in the three-dimensional model to be processed, re-determining the target quadrilateral; and,
[0129] in response to determining that there is no quadrilateral with a length of each of a pair of edges not greater than a preset threshold in the three-dimensional model to be processed, ending the chamfered surface identification.
[0130] The device of the above embodiments is used to implement the corresponding chamfered surface identification method in any of the above example method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0131] Based on the same inventive concept, corresponding to any of the above method embodiments, the present application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the three-dimensional chamfered surface identification method of any of the above embodiments when executing the program.
[0132] Figure 15 A more specific electronic device hardware structure diagram provided by the embodiment is shown, which can include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 for internal communication.
[0133] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the embodiments of the present specification.
[0134] The memory 1020 can be implemented by a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the related program codes are stored in the memory 1020 and called and executed by the processor 1010.
[0135] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0136] The communication interface 1040 is used to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication through a wired manner (such as USB, network cable, etc.) or through a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0137] The bus 1050 includes multiple channels to transmit information between various components (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040) of the device.
[0138] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary to implement the embodiments of the present application, and does not necessarily contain all the components shown in the figure.
[0139] The electronic device of the above embodiment is used to implement the identification method of the corresponding chamfer surface in any of the above-mentioned example method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0140] Exemplary program product
[0141] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer readable storage medium, which stores computer instructions for causing the computer to execute the identification method of the chamfer surface as described in any of the above embodiments.
[0142] The above-mentioned non-transitory computer readable storage medium can be any available medium or data storage device accessible by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO) and the like), optical storage (such as CDs, DVDs, BDs, HVDs and the like), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (SSD)) and the like.
[0143] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the identification method of the chamfer surface as described in any of the above example method embodiments, and have the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0144] Those skilled in the art know that the embodiments of the present application can be implemented as a system, a method or a computer program product. Therefore, the present application can be specifically implemented as follows: a complete hardware, a complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, which are generally referred to as "circuit", "module" or "system" in this paper. In addition, in some example embodiments, the present application can also be implemented as a computer program product in one or more computer readable media, which contains computer readable program code.
[0145] Any combination of one or more computer readable medium can be utilized. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0146] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
[0147] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0148] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In an embodiment of the application, the remote computer can be a server or another desktop computer.
[0149] It should be understood that each of the elements of the flow diagrams and / or block diagrams, and combinations of elements in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flow diagrams and / or block diagrams.
[0150] These computer program instructions can also be stored in a computer- readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the functions / acts specified in the flow diagrams and / or block diagrams.
[0151] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flow diagrams and / or block diagrams.
[0152] Further, although the operations of the method of the present application are described in a particular, sequential order, this order is not meant to be a limitation and is not intended to imply that there is an absolute requirement to perform the operations in the particular sequence presented, nor that all illustrated operations be performed to achieve desired results. Rather, the steps depicted in the flowcharts can be changed, performed concurrently, performed in different order, omitted, combined, and / or divided into multiple steps.
[0153] The use of the verbs "comprise", "include", "contain", and variations thereof, in the specification and claims, do not exclude additional elements or steps. The use of the articles "a" and "an" do not exclude a plurality of such elements or steps.
[0154] While the principles and spirit of the application have been described with reference to several specific embodiments, it is to be understood that the application is not limited to the specific embodiments disclosed and that the division of aspects is not meant to imply that features from one aspect cannot be combined with features from another aspect to benefit, but is merely for ease of discussion. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims covers all such modifications and arrangements.
Claims
1. A method for identifying a chamfered surface, characterized in that: include: Determine a target quadrilateral in the three-dimensional model to be processed, wherein the lengths of at least one pair of opposite sides are not greater than a preset threshold; Searching for adjacent polygons in the three-dimensional model along the extension direction of the target group opposite sides of the target quadrilateral, and forming a polygon set together with the target quadrilateral; In response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, identifying all polygons as chamfered surfaces; The process of determining the target group opposite sides of the target quadrilateral specifically includes: In response to determining that a distance between two sides of a group of opposite sides of the target quadrilateral is not greater than a preset threshold, the group of opposite sides is determined as the target group of opposite sides.
2. The method according to claim 1, characterized in that Searching for adjacent polygons along the extension direction of opposite sides of the target group in the three-dimensional model; specifically comprising: In the three-dimensional model, for each edge in the target group of edges, a search is performed along the extension direction of the edge to obtain at least one extended edge sequentially connected to the edge; wherein the angle between the extended edge connected to the edge and the edge is not greater than a preset angle, and the angle between any two connected extended edges is not greater than the preset angle; The adjacent polygons are determined based on all the extended edges of the target group of edges and intersections between the extended edges.
3. The method according to claim 2, characterized in that In response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension is not greater than a preset threshold, identifying all polygons as chamfered surfaces; specifically comprising: Acquire all edges of all polygons in the polygon set, and determine all edges among all edges of all polygons except the target group edge and all the extended edges; Taking the average length of all other sides as the average width; In response to determining that the average width is not greater than a preset threshold, all the polygons are identified as chamfered surfaces.
4. The method according to claim 2, characterized in that In response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, identifying all polygons as chamfered surfaces specifically includes: In response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension direction is not greater than a preset threshold, and that the angles between two adjacent faces with the opposite sides of the target group and all the extended edges as edges are not less than a preset angle, all the polygons are identified as chamfered faces.
5. The method according to claim 1, wherein The process of determining the target group opposite sides of the target quadrilateral specifically includes: In response to determining that the lengths of a group of opposite sides of the target quadrilateral are not greater than a preset threshold, another group of opposite sides of the target quadrilateral is determined as the target group of opposite sides.
6. The method according to claim 1, characterized in that After identifying all the polygons as chamfered surfaces, the method further includes: In response to determining that there is an unrecognized quadrilateral in the three-dimensional model to be processed, wherein the lengths of at least one set of opposite sides are not greater than a preset threshold, re-determining the target quadrilateral; and In response to determining that there is no unrecognized quadrilateral in the three-dimensional model to be processed, in which the lengths of at least one set of opposite sides are not greater than a preset threshold, the chamfer surface recognition is terminated.
7. A device for identifying chamfered surfaces, characterized in that: include: A determination module is configured to determine a target quadrilateral in a three-dimensional model to be processed, wherein the lengths of at least one pair of opposite sides are not greater than a preset threshold value; an extension module, searching for adjacent polygons along the extension direction of the target group opposite sides of the target quadrilateral in the three-dimensional model, and forming a polygon set together with the target quadrilateral; an identification module, in response to determining that the average width of all polygons in the polygon set along the direction perpendicular to the extension is not greater than a preset threshold, identifying all polygons as chamfered surfaces; The device further comprises: The target group of opposite sides determining module determines the group of opposite sides of the target quadrilateral as the target group of opposite sides in response to determining that the distance between two sides of the group of opposite sides of the target quadrilateral is not greater than a preset threshold.
8. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Point cloud reconstruction method and system based on three-dimensional point cloud data feature lightweight
CN111696210A