Chamfering function optimization method, device, equipment, medium and product

By obtaining the external constraint information of the pending drawing in the sketch environment, replacing the constraints between the target object and the target edge as the constraints between the reference point and the target object, and correcting the dimension annotation, the constraint state changes and labeling is solved after chamfering processing. Reasonable issues improve design quality and user experience.

CN119397619APending Publication Date: 2025-02-07NEW DIMENSION SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483228.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

After the prior art chamfers the geometric objects, the constraint state changes and dimension labeling of the geometric objects are unreasonable, which in turn affects the design quality and user experience.

Method used

By obtaining the two target edges to be chamfered in the drawing to be processed in the sketch environment, determining the reference point, and determining the target object based on the external constraint information, replacing the constraint between the target object and the target edge with the reference point and the target object. and correct the original dimension marking information to the target dimension marking information.

Benefits of technology

Ensure that the to-process graphics are still in a completely constrained state after chamfering, improve design quality and efficiency, make the effect of the chamfer function more in line with user drawing habits, and thus improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0005098025530000011
    Figure HDA0005098025530000011
  • Figure HDA0005098025530000012
    Figure HDA0005098025530000012
  • Figure HDA0005098025530000021
    Figure HDA0005098025530000021
Patent Text Reader

Abstract

The invention discloses a chamfering function optimization method and device, equipment, a medium and a product, and the method comprises the steps: obtaining two to-be-chamfered target edges in a to-be-processed graph in a sketch environment, and determining a reference point according to the two target edges; for each target edge, obtaining constraint information that the target edge is subjected to all external constraints at each end point; determining a target object in the to-be-processed graph; the target object is a geometric object except a target edge before chamfering treatment; replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object; and after the chamfering operation on the two target edges is completed, correcting the original size marking information of each target edge into target size marking information. According to the scheme, the externally lost constraint can be accurately found, the corresponding equivalent constraint is automatically created according to the existing constraint, and the original size marking information is timely corrected into the target size marking information, so that the design quality and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the field of computer-aided design technology, and specifically relates to a chamfer function optimization method, device, equipment, medium and product. Background Art

[0002] With the continuous development of computer technology, computer-aided design has been increasingly used in daily graphic design. Sketches are an important part of the design process, especially in the field of mechanical design. Sketches contain geometric elements and constraints that define the relationship between these elements. The geometric elements can include straight lines and arcs, etc. Constraints can include dimensional constraints, parallelism, verticality, etc. Among them, chamfering is a basic function in the sketch environment, which is used to create a smooth transition or inclined surface between two intersecting edges, which can improve the edge characteristics of the graphics. For chamfered products, in order to ensure that the products meet standard requirements, it is particularly important to add the chamfering function in the sketch environment.

[0003] At present, in the related technology, after the chamfering of the geometric object, the constraint state of the geometric object changes and the dimensioning of the geometric object is unreasonable, which makes the diagram wrong, resulting in poor design quality of the geometric object, and further affects the user experience. Summary of the invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a chamfer function optimization method, device, equipment, medium and product.

[0005] In a first aspect, the present invention provides a chamfer function optimization method, the method comprising:

[0006] Obtain two target edges to be chamfered in the graphics to be processed in the sketch environment, and determine reference points based on the two target edges;

[0007] For each of the target edges, obtaining constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories;

[0008] Determine a target object in the to-be-processed graphic according to the constraint information; the target object is a geometric object other than the target edge before chamfering;

[0009] replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object;

[0010] After the chamfering operation is performed on the two target edges, the original dimensioning information of each target edge is corrected to be the target dimensioning information.

[0011] In one embodiment, determining the target object in the to-be-processed graph according to the constraint information includes:

[0012] Determining whether the external constraint belongs to a preset constraint category according to the constraint category, the preset constraint category including at least one of the following: a coincidence constraint, a point-on-line constraint, a horizontal alignment constraint, a vertical alignment constraint, and an intersection constraint;

[0013] When it belongs to the preset constraint category, obtaining a geometric object related to the constraint category;

[0014] Comparing the geometric object with the target edge to obtain a comparison result; the comparison result is used to indicate whether the geometric object is consistent with the target edge;

[0015] When the comparison result indicates that the geometric object is inconsistent with the target edge, the geometric object at the time of the inconsistent comparison is determined as the target object.

[0016] In one embodiment, replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object comprises:

[0017] Find the location where the constraint corresponding to the target object occurs;

[0018] Determine whether the position where the constraint corresponding to the target object occurs coincides with the chamfer position in the graphic to be processed;

[0019] If they coincide, the constraint between the target object and the target edge is replaced by the constraint between the reference point and the target object.

[0020] In one embodiment, the original dimensioning information of each target edge is corrected to target dimensioning information, including:

[0021] Creating an intersection constraint between the two target edges and the reference point;

[0022] For each of the target edges, determining whether there is original dimensioning information;

[0023] When the original dimension annotation information exists, the original dimension annotation information is deleted and a target endpoint of the target edge is determined; the target endpoint is an endpoint of the target edge where no clipping operation occurs;

[0024] Target dimensioning information is created according to the target endpoint and the reference point.

[0025] In one embodiment, determining the target endpoint of the target edge includes:

[0026] Obtaining the endpoint coordinates corresponding to each endpoint in the target edge;

[0027] Comparing the endpoint coordinates with the reference point coordinates;

[0028] The endpoint corresponding to the endpoint coordinates that match the alignment is determined as the endpoint where the clipping operation occurs;

[0029] The endpoints among the endpoints except the endpoint where the clipping operation occurs are determined as the target endpoints.

[0030] In one embodiment, determining a reference point according to the two target edges includes:

[0031] Calculate the intersection of two target edges according to the endpoint coordinates and the original dimensioning information;

[0032] The intersection point is used as the reference point.

[0033] In a second aspect, an embodiment of the present application provides a chamfering function optimization device, the device comprising:

[0034] A reference point determination module is used to obtain two target edges to be chamfered in the graphics to be processed in the sketch environment, and determine the reference point according to the two target edges;

[0035] An information acquisition module, for acquiring, for each target edge, constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories;

[0036] An object determination module, used to determine a target object in the to-be-processed graphic according to the constraint information; the target object is a geometric object other than the target edge before rounding;

[0037] A constraint replacement module, used to replace the constraint between the target object and the target edge with the constraint between the reference point and the target object;

[0038] The annotation correction module is used to correct the original dimension annotation information of each target edge into target dimension annotation information after the chamfering operation is completed on the two target edges.

[0039] In a third aspect, an embodiment of the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the chamfering function optimization method provided in the above embodiment.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the chamfering function optimization method provided in the above embodiment is implemented.

[0041] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned chamfering function optimization methods.

[0042] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0043] The chamfering function optimization method, device, equipment, medium and product provided by the embodiments of the present application include: obtaining two target edges to be chamfered in a graphics to be processed in a sketch environment, and determining a reference point based on the two target edges, and for each target edge, obtaining constraint information of all external constraints imposed on the target edge at each endpoint, and then determining a target object in the graphics to be processed based on the constraint information, replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object, and then, after the chamfering operation is completed on the two target edges, correcting the original dimension annotation information of each target edge to the target dimension annotation information. Compared with the prior art, this technical solution determines the reference point through two target edges, provides data reference information for subsequent constraint replacement operations, and obtains constraint information subject to all external constraints, thereby more accurately determining the target object other than the target edge in the graphics to be processed before chamfering, so as to quickly find the missing constraints outside the chamfer, and then replace the constraint between the target object and the target edge with the constraint between the reference point and the target object, thereby automatically creating equivalent constraints corresponding to the target object according to the existing constraints, ensuring that the graphics to be processed are still in a fully constrained state after chamfering, and when the chamfering is completed, the original dimension annotation information is promptly corrected to the target dimension annotation information, so as to obtain the correct annotation, thereby improving the design quality and efficiency, and making the effect presented by the chamfering function more in line with the user's drawing habits, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 This is a schematic diagram of the structure after chamfering in the prior art in one embodiment of the present application;

[0046] Figure 2This is an application environment diagram of the chamfering function optimization method provided in one embodiment of the present application;

[0047] Figure 3 A schematic diagram of a flow chart of a chamfering function optimization method provided in one embodiment of the present application;

[0048] Figure 4 A schematic diagram of a structure for creating a reference point provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of a flow chart of a method for determining a target object provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of a flow chart of a method for correcting original dimensioning information into target dimensioning information provided by an embodiment of the present application;

[0051] Figure 7 A schematic diagram of the structure of the rounded corner processing provided in one embodiment of the present application;

[0052] Figure 8 A schematic diagram of a structure of a chamfering process provided in an embodiment of the present application;

[0053] Fig. 9 A schematic diagram of functional modules of a chamfering function optimization device provided in another embodiment of the present application.

[0054] Fig.10 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0055] 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.

[0056] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0057] As mentioned in the background technology, see Figure 1As shown, taking the geometric object as a rectangle and the chamfer operation as a rounding operation as an example, in the related technology, after the rectangle is rounded, the two edges related to the rounding are clipped, so that the constraints based on the two edges are lost, causing the rectangle to change from a fully constrained state to an under-constrained state, that is, the constraint state of the geometric object is changed, and at the same time, the two ends of the dimension marking also move with the clipping of the edges, from 98.15 to 84.23, which makes the dimension marking of the rectangle unreasonable, and the diagram is wrong, resulting in poor design quality of the geometric object, which in turn affects the user experience.

[0058] Based on the above-mentioned defects, the present application provides a chamfer function optimization method, which determines the reference point through two target edges, provides data benchmark information for subsequent constraint replacement operations, and obtains constraint information subject to all external constraints, so as to more accurately determine the target object other than the target edge in the graphics to be processed before chamfering, so as to quickly find the missing constraints outside the chamfer, and then replace the constraints between the target object and the target edge with the constraints between the reference point and the target object, thereby automatically creating equivalent constraints corresponding to the target object according to the existing constraints, ensuring that the graphics to be processed are still in a fully constrained state after chamfering, and when the chamfering is completed, the original dimension annotation information is promptly corrected to the target dimension annotation information, so as to obtain the correct annotation, thereby improving the design quality and efficiency, and making the effect presented by the chamfering function more in line with the user's drawing habits, thereby improving the user experience.

[0059] The chamfering function optimization method provided in the embodiment of the present application can be applied to Figure 2In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, or it can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can send the graphics to be processed in the sketch environment to the server 104. After the server 104 receives the graphics to be processed, for the graphics to be processed, two target edges to be chamfered are obtained, and the reference point is determined based on the two target edges. Then, for each target edge, the constraint information of all external constraints on the target edge at each endpoint is obtained, and the target object in the graphics to be processed is determined based on the constraint information, and then the constraint between the target object and the target edge is replaced with the constraint between the reference point and the target object. Then, when the chamfering operation is completed on the target edge, the original dimension annotation information of the target edge is corrected and processed into the target dimension annotation information, thereby providing feedback to the terminal 102. In addition, in some embodiments, the chamfer function optimization method can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly perform chamfer function optimization processing on the graphics to be processed, or the server 104 can obtain the graphics to be processed from the data storage system and perform chamfer function optimization processing on the graphics to be processed.

[0060] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0061] In an exemplary embodiment, Figure 3 As shown, a chamfer function optimization method is provided, which is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 2 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S201 to S205. Among them:

[0062] Step S201, obtaining two target edges to be chamfered in the graphics to be processed in a sketch environment, and determining reference points based on the two target edges.

[0063] It should be noted that the graphics to be processed are graphics that need to be chamfered, and the target edges are two edges in the graphics to be processed that need to be chamfered. The chamfering may include rounding and beveling. The sketch environment refers to an environment for creating and editing graphics, such as a CAD environment or a SolidWorks environment.

[0064] Specifically, the computer device may first obtain the graphics to be processed in the sketch environment, and determine two target edges to be chamfered in the graphics to be processed. For example, when the graphics to be processed is a rectangle, the two target edges may be a long edge and an adjacent short edge. After determining the two target edges to be chamfered, a reference point may be determined based on the two target edges. The reference point is a data reference point for subsequent constraint supplementation.

[0065] In this embodiment, in the process of determining the reference point based on the two target edges, the endpoint coordinates and original size information of the two target edges can be first obtained, and the intersection of the two target edges can be calculated based on the endpoint coordinates and the original size annotation information, and then the intersection is used as the reference point.

[0066] For example, taking the figure to be processed as a rectangle as an example, see Figure 4 As shown, Figure 4 The schematic diagram of the structure for creating a reference point shows that the two target edges to be chamfered in the figure to be processed are A and B. The figure above is a diagram of the figure to be processed before chamfering, and the figure below is a diagram of the figure to be processed after chamfering. By obtaining the coordinates of the two endpoints of the target edge A and the target edge B and their respective original dimensioning information, the intersection of the two target edges is calculated and a real point C is created at the intersection, which is used as the reference point.

[0067] In this embodiment, two target edges to be chamfered in the graphics to be processed in the sketch environment are obtained, and reference points are determined based on the two target edges, so as to accurately determine the reference points for subsequent constraints, thereby facilitating subsequent constraint replacement operations.

[0068] Step S202: for each target edge, obtain constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories.

[0069] Specifically, after obtaining two target edges, constraint supplementation may be performed on each target edge, and constraint information may be obtained for each target edge, for example, constraint information of all external constraints imposed on the target edge at each endpoint may be obtained.

[0070] It should be noted that the above number of constraints refers to the total number of constraints directly associated with the target edge. For example, if there is a vertical constraint and a horizontal constraint at each end of the target edge, the number of constraints for this line segment is 2. The constraint object may be a line segment, a point, etc. The constraint category refers to the specific type of constraint. Common constraint categories include but are not limited to: geometric constraints, dimensional constraints, and position constraints. Geometric constraints can include parallel, vertical, concentric, and collinear, etc.; dimensional constraints can include fixed length, fixed angle, fixed radius, etc.; position constraints include fixed points, symmetry, etc.

[0071] As an optional implementation, in the process of obtaining constraint information, the user can click a preset control in the sketch environment, and display it through the status bar, property window or pop-up information box, so as to obtain the constraint information of all external constraints on the target edge at each endpoint. As another optional implementation, the constraint information can be imported from an external device or obtained by real-time detection.

[0072] For example, taking the two target edges as straight line A and straight line B, for the first target edge straight line A, the two endpoints of the first target edge straight line A can be determined first, and then by calling the preset interface, the input of the preset interface is set as the two endpoints of the first target edge A, and the output is the number of constraints, constraint objects and constraint list of the two endpoints of the first target edge straight line A.

[0073] Step S203, determining the target object in the to-be-processed graphic according to the constraint information; the target object is the geometric object except the target edge before the chamfering process.

[0074] It is understandable that the target object is a geometric object other than the target edge in the graphics to be processed before chamfering. After obtaining the constraint information of the target edge, the graphics to be processed can be analyzed according to the constraint type, constraint object and constraint number, so as to determine the target object in the graphics to be processed.

[0075] Alternatively, if Figure 5 As shown, the above step S203 is replaced by the following steps S301 to S304:

[0076] Step S301, judging whether the external constraint belongs to a preset constraint category according to the constraint category, the preset constraint category includes at least one of the following: coincidence constraint, point-on-line constraint, horizontal alignment constraint, vertical alignment constraint, intersection constraint.

[0077] Step S302: when it belongs to a preset constraint category, obtain a geometric object related to the constraint category.

[0078] Step S303, comparing the geometric object with the target edge to obtain a comparison result; the comparison result is used to indicate whether the geometric object is consistent with the target edge.

[0079] Step S304: when the comparison result indicates that the geometric object is inconsistent with the target edge, the geometric object with inconsistent comparison is determined as the target object.

[0080] Specifically, for each target edge, after obtaining the constraint category, it can be determined whether the external constraint belongs to one of the coincidence constraint, point-on-line constraint, horizontal alignment constraint, vertical alignment constraint or intersection constraint according to the constraint category. When it belongs to the preset constraint category, the geometric object related to the constraint category is obtained.

[0081] It can be understood that the point-on-line constraint, horizontal alignment constraint, vertical alignment constraint, and intersection constraint are additional constraints parallel to the coincidence constraint. Among them, each constraint category corresponds to an application scenario. For the coincidence constraint, for example, a coincidence constraint is created between the starting point of line A and the starting point of line B. Then, no matter how lines A and B are dragged in the software view interface, the starting point of line A and the starting point of line B always remain coincident; for the horizontal alignment constraint, for example, a horizontal alignment constraint is created between the starting point of line A and the starting point of line B. Then, no matter how lines A and B are dragged in the software view interface, the starting point of line A and the starting point of line B always remain horizontally aligned. For the vertical alignment constraint, for example, a vertical alignment constraint is created between the starting point of line A and the starting point of line B. Then, no matter how lines A and B are dragged in the software view interface, the starting point of line A and the starting point of line B always remain vertically aligned. For the point-up constraint, for example, a point-on-line constraint is created between the starting point C of line A and line B. Then, no matter how lines A and B are dragged in the software view interface, the starting point C of line A always moves on line B.

[0082] Exemplarily, when the external constraint belongs to a preset constraint category, a geometric object related to the constraint category is obtained, where the geometric object refers to the object constrained by the constraint object. Assuming that there is a coincidence constraint of a preset constraint category between the starting point of straight line A and the end point of another straight line B, the constraint object of the coincidence constraint to which straight line A is subject can be obtained through the interface, and the two geometric objects of this constraint can be determined from the constraint object of the coincidence constraint as the starting point of straight line A and the end point of straight line B.

[0083] It is understandable that because the premise of constraint supplementation is that the constraints outside the chamfer are lost, it is necessary to determine the geometric objects other than the target edges in the graphics to be processed, which may include one or more geometric objects. After obtaining the geometric objects related to the constraint category, it is necessary to exclude the geometric objects themselves, that is, the two target edges related to the chamfering process. The first geometric object can be used as the current geometric object, and then the obtained current geometric object is compared with the target edges related to the chamfering process. If the current geometric object is consistent with any one of the two target edges, the current geometric object is skipped, and the next geometric object is judged, and it is further compared with the target edge to obtain the comparison result. The geometric object with inconsistent comparison is determined as the target object, thereby traversing all geometric objects, and then determining all target objects from the geometric objects.

[0084] In this embodiment, it is determined whether the external constraint belongs to the preset constraint category based on the constraint category. When it belongs to the preset constraint category, the relevant geometric object is obtained, and the geometric object is compared with the target edge, so as to quickly and accurately find the target object outside the chamfer's own target edge, which is convenient for subsequent corresponding constraint replacement.

[0085] Step S204: Replace the constraint between the target object and the target edge with the constraint between the reference point and the target object.

[0086] Specifically, after obtaining the target object, the location where the constraint corresponding to the target object occurs can be found, and it can be determined whether the location where the constraint corresponding to the target object occurs coincides with the chamfer position in the graphics to be processed. If they coincide, the constraint between the target object and the target edge is replaced with the constraint between the reference point and the target object. If they do not coincide, it is marked that the current endpoint of the current target edge does not have a chamfer operation, that is, the current endpoint is not a point of interest and can be ignored.

[0087] It should be noted that in the software system environment, there is no separate point object. A point is represented by a structure of a straight line + index. For example, straight line A + index0 represents the starting point of straight line A, and straight line A + index1 represents the end point of straight line A. In the above steps, the target object other than the two chamfer-related edges in the graphics to be processed has been found. The target object can be understood as a structure. Through this structure, not only the geometric object straight line A can be obtained, but also which specific endpoint of straight line A is subject to the constraint, and the coordinate position of the endpoint of the constrained straight line A can be obtained. Then, the coordinates of the endpoint of this straight line A and the coordinates of the reference points of the two target edges related to the chamfer are compared. When the comparison is consistent, it indicates that a chamfer operation has occurred on this endpoint of the current straight line A; when the comparison is inconsistent, it indicates that no chamfer operation has occurred on this endpoint of the current straight line A.

[0088] The geometric object may include multiple endpoints. The first endpoint is determined and used as the current endpoint. When the coordinates of the current endpoint and the reference point are compared and consistent, it indicates that the current endpoint coincides with the reference point and a chamfering operation has occurred. When the comparison is inconsistent, it indicates that the current endpoint does not coincide with the reference point and no chamfering operation has occurred. Then, the next endpoint is compared, so that when the position where the corresponding constraint of the target object occurs coincides with the chamfering position in the graphics to be processed, the constraint between the target object and the target edge is replaced with the constraint between the reference point and the target object.

[0089] Exemplarily, taking the case where two target edges are straight line A and straight line B, the intersection point between the two target edges is reference point C, and the target object is D, when it is determined that the position where the constraint corresponding to straight line A occurs coincides with the chamfer position in the graphics to be processed, the constraint between straight line A and target object D is replaced with the constraint between straight line A and reference point C. By replacing the constraint between straight line A and target object D with the constraint between straight line A and reference point C, even if straight line A is clipped after the chamfering process, resulting in the disappearance of the original constraint between target object D and straight line A, since a new constraint between straight line A and reference point C is created, it is possible to ensure that the graphics to be processed after the chamfering process is still in a fully constrained state.

[0090] In this embodiment, by replacing the constraint between the target object and the target edge with the reference point and the target object, a new constraint relationship can be created to equivalently replace the constraint relationship before the chamfering process, so that the constraint relationship of the processed graphics before and after the chamfering process remains unchanged and is still in a fully constrained state.

[0091] Step S205: After the chamfering operation is completed on the two target edges, the original dimensioning information of each target edge is corrected and processed into the target dimensioning information.

[0092] It should be noted that the original dimensioning information refers to the dimensioning information corresponding to the two target edges in the graphics to be processed when it is in an under-constrained state after chamfering, and the target dimensioning information refers to the dimensioning information corresponding to the two target edges in the graphics to be processed after chamfering.

[0093] After performing the chamfering operation on the two target edges, it can be checked whether there is original dimensioning information on each target edge. When the original dimensioning information exists, the original dimensioning information can be corrected to obtain the target dimensioning information; when the original dimensioning information does not exist, it is not processed.

[0094] The chamfering function optimization method provided in the embodiment of the present application obtains two target edges to be chamfered in the graphics to be processed in a sketch environment, and determines the reference point based on the two target edges. For each target edge, the constraint information of all external constraints imposed on the target edge at each endpoint is obtained, and then the target object in the graphics to be processed is determined based on the constraint information, and the constraint between the target object and the target edge is replaced with the constraint between the reference point and the target object. After the chamfering operation is completed on the two target edges, the original dimension annotation information of each target edge is corrected and processed into the target dimension annotation information. Compared with the prior art, this technical solution determines the reference point through two target edges, provides data reference information for subsequent constraint replacement operations, and obtains constraint information subject to all external constraints, thereby more accurately determining the target object other than the target edge in the graphics to be processed before chamfering, so as to find the missing constraints outside the chamfer, and then replace the constraint between the target object and the target edge with the constraint between the reference point and the target object, thereby automatically creating equivalent constraints corresponding to the target object according to the existing constraints, ensuring that the graphics to be processed are still in a fully constrained state after chamfering, and when the chamfering is completed, the original dimension annotation information is promptly corrected to the target dimension annotation information, so as to obtain correct annotation, thereby improving the design quality and efficiency, and making the effect presented by the chamfering function more in line with the user's drawing habits, thereby improving the user experience.

[0095] In another exemplary embodiment of the present application, in order to accurately annotate the graphics to be processed and improve the design quality and efficiency, the original dimension annotation information of each target edge can be corrected and processed into the target dimension annotation information, such as Figure 6 As shown, the above step S205 is replaced by the following steps S401 to S404:

[0096] Step S401: Create an intersection constraint between two target edges and a reference point.

[0097] Step S402: for each target edge, determine whether there is original dimensioning information.

[0098] Step S403, when the original dimensioning information exists, the original dimensioning information is deleted and the target endpoint of the target edge is determined; the target endpoint is the endpoint of the target edge where no clipping operation occurs.

[0099] Step S404: Create target dimensioning information according to the target endpoint and the reference point.

[0100] Specifically, after replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object, and performing a chamfering operation on the two target edges, when the chamfering operation is completed, you can find "constraint" or "relationship" related tools in the drawing software, and then select the two target edges to which the constraint needs to be applied, and select the point as the reference point. Then, in the interface of the drawing software, a context menu may appear on the interface, which may include various options of the constraint category that needs to be selected, and select the "intersect" option from the menu to add it between the two target edges and the reference point, thereby completing the creation of the intersection constraint.

[0101] After the intersection constraint between the two target edges and the reference point is created, it can be determined for each target edge whether there is original dimension annotation information. When the original dimension annotation information does not exist, it is not processed; when the original dimension annotation information exists, the original dimension annotation information is deleted and the target endpoint of the target edge is determined. By obtaining the endpoint coordinates of each endpoint of the target edge and comparing the endpoint coordinates with the reference point coordinates, the endpoint corresponding to the endpoint coordinates that are consistent with the comparison is determined as the endpoint where the clipping operation occurs, and the endpoint other than the endpoint where the clipping operation occurs is determined as the target endpoint.

[0102] For example, see Figure 7 and Figure 8 As shown, Figure 7 The schematic diagram of the rounding process is shown in Figure 2. Figure 8 Schematic diagram of the structure of the chamfer processing process. Take the two target edges including straight line A and straight line B, and the reference point C as an example. For the first target edge straight line A, first determine whether straight line A has original dimensioning information, which can be 98.12. When straight line A does not have original dimensioning information, it is not processed; when straight line A has original dimensioning information, the target endpoint of the clipping operation of straight line A is determined, by first calculating the starting point coordinates and the end point coordinates of straight line A, and then comparing the starting point coordinates and the end point coordinates of straight line A with the reference point coordinates of reference point C respectively. If the starting point coordinates of straight line A are the same as the reference point coordinates, it indicates that the starting point coordinates of straight line A have undergone a chamfer clipping operation; if the end point coordinates of straight line A are the same as the reference point coordinates, it indicates that the end point coordinates of straight line A have undergone a chamfer clipping operation.

[0103] Optionally, when the starting point coordinates of straight line A have undergone a chamfering operation, the end point coordinates of straight line A that do not undergo a chamfering operation can be used to determine the end point corresponding to the end point coordinates of straight line A as the target endpoint of straight line A; when the end point coordinates of straight line A have undergone a chamfering operation, the starting point coordinates of straight line A that do not undergo a chamfering operation can be used to determine the end point corresponding to the starting point coordinates of straight line A as the target endpoint.

[0104] When the target endpoint is determined, the target endpoint coordinates corresponding to the target endpoint and the reference point coordinates corresponding to the reference point C are determined, and the first distance between the two is calculated based on the target endpoint coordinates and the reference point coordinates. The first distance is used as the target dimension annotation information of the straight line A, and the target dimension annotation information can be 121.24.

[0105] Similarly, for the second target edge straight line B, first determine whether there is original dimension annotation information for straight line B. When there is original dimension annotation information for straight line B, delete the original dimension annotation information and determine the target endpoint of straight line B in the same way as the above straight line A. Then, based on the target endpoint coordinates of the target endpoint of straight line B and the reference point coordinates of reference point C, calculate the second distance between the two, and use the second distance as the target dimension annotation information for straight line B.

[0106] In this embodiment, an intersection constraint is created between two target edges and a reference point, and for each target edge, it is determined whether there is original dimension annotation information, so as to determine whether correction processing is required based on the result, and then the target endpoint of the target edge is determined, and then the target dimension annotation information is accurately created based on the target endpoint and the reference point, thereby improving the design quality and efficiency, making the effect presented by the chamfering function more in line with the user's drawing habits, and thus improving the user experience.

[0107] The present application also provides an application scenario, which applies the above-mentioned chamfering function optimization method. Specifically: The chamfering function optimization method provided in this embodiment can be applied in a picture drawing scene in a sketch environment. The computer device obtains two target edges to be chamfered in the graphics to be processed in a color image environment, and determines the reference point based on the two target edges, and then obtains the constraint information of the target edge at each endpoint, and determines the target object in the graphics to be processed according to the constraint information, and replaces the constraint between the target object and the target edge with the constraint between the reference point and the target object, and then after the chamfering operation is completed on the two target edges, the original dimension annotation information of each target edge is corrected and processed into the target dimension annotation information. The chamfering function optimization method provided in this embodiment may include a chamfering processing link or a chamfering processing link for the graphics, and can automatically calculate the appropriate fillet radius and bevel parameters according to the existing constraints, thereby reducing user participation and improving design quality and efficiency.

[0108] Based on the same inventive concept, the embodiment of the present application also provides a chamfering function optimization device for implementing the chamfering function optimization method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more chamfering function optimization device embodiments provided below can refer to the limitations of the chamfering function optimization method above, and will not be repeated here.

[0109] In an exemplary embodiment, Fig. 9 As shown, a chamfering function optimization device is provided, comprising:

[0110] A reference point determination module 710 is used to obtain two target edges to be chamfered in the graphics to be processed in the sketch environment, and determine a reference point based on the two target edges;

[0111] The information acquisition module 720 is used to acquire, for each target edge, constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories;

[0112] The object determination module 730 is used to determine the target object in the graphics to be processed according to the constraint information; the target object is the geometric object other than the target edge before the fillet processing;

[0113] A constraint replacement module 740, for replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object;

[0114] The annotation correction module 750 is used to correct the original dimension annotation information of each target edge into the target dimension annotation information after the chamfering operation is completed on the two target edges.

[0115] As an optional implementation, the object determination module 730 is specifically configured to:

[0116] Determining whether the external constraint belongs to a preset constraint category according to the constraint category, where the preset constraint category includes at least one of the following: coincidence constraint, point-on-line constraint, horizontal alignment constraint, vertical alignment constraint, and intersection constraint;

[0117] When it belongs to the preset constraint category, obtain the geometric object related to the constraint category;

[0118] Compare the geometric object with the target edge to obtain a comparison result; the comparison result is used to indicate whether the geometric object is consistent with the target edge;

[0119] When the comparison result represents that the geometric object is inconsistent with the target edge, the geometric object with inconsistent comparison is determined as the target object.

[0120] As an optional implementation, the constraint replacement module 740 is specifically configured to:

[0121] Find the location where the corresponding constraint of the target object occurs;

[0122] Determine whether the position where the corresponding constraint of the target object occurs coincides with the chamfer position in the graphics to be processed;

[0123] If they are coincident, the constraint between the target object and the target edge is replaced by the constraint between the reference point and the target object.

[0124] As an optional implementation, the annotation correction module 750 is specifically configured to:

[0125] Create an intersection constraint between the two target edges and the reference point;

[0126] For each target edge, determine whether there is original dimensioning information;

[0127] When the original dimensioning information exists, the original dimensioning information is deleted and the target endpoint of the target edge is determined; the target endpoint is the endpoint of the target edge where no clipping operation occurs;

[0128] Create target dimensioning information based on the target endpoint and reference point.

[0129] As an optional implementation, the annotation correction module 750 is further configured to:

[0130] Get the endpoint coordinates corresponding to each endpoint in the target edge;

[0131] Compare the endpoint coordinates with the reference point coordinates;

[0132] The endpoint corresponding to the endpoint coordinates that match the alignment is determined as the endpoint where the clipping operation occurs;

[0133] The endpoints other than the endpoint where the clipping operation occurs among the two endpoints are determined as target endpoints.

[0134] As an optional implementation manner, the reference point determination module 710 is specifically configured to:

[0135] Calculate the intersection of two target edges based on the endpoint coordinates and original dimensioning information;

[0136] Use the intersection as a reference point.

[0137] Among them, by implementing this implementation method, the chamfering function optimization device determines the reference point through two target edges, provides data reference information for subsequent constraint replacement operations, and obtains constraint information subject to all external constraints, thereby more accurately determining the target object other than the target edge in the graphics to be processed before chamfering, so as to find the missing constraints outside the chamfer, and then replace the constraint between the target object and the target edge with the constraint between the reference point and the target object, thereby automatically creating equivalent constraints corresponding to the target object according to the existing constraints, ensuring that the graphics to be processed are still in a fully constrained state after chamfering, and when the chamfering is completed, timely correcting the original dimension annotation information to the target dimension annotation information, thereby obtaining correct annotation, improving design quality and efficiency, and making the effect presented by the chamfering function more in line with the user's drawing habits, thereby improving user experience.

[0138] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video tag processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a chamfering function optimization method is implemented.

[0139] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0140] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0141] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0142] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0144] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0145] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0146] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0147] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A chamfering function optimization method, characterized in that: The chamfering function optimization method comprises: Obtain two target edges to be chamfered in the graphics to be processed in the sketch environment, and determine reference points based on the two target edges; For each of the target edges, obtaining constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories; Determine a target object in the to-be-processed graphic according to the constraint information; the target object is a geometric object other than the target edge before chamfering; replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object; After the chamfering operation is performed on the two target edges, the original dimensioning information of each target edge is corrected to be the target dimensioning information.

2. The chamfering function optimization method according to claim 1, characterized in that: Determining the target object in the to-be-processed graph according to the constraint information includes: Determining whether the external constraint belongs to a preset constraint category according to the constraint category, the preset constraint category including at least one of the following: a coincidence constraint, a point-on-line constraint, a horizontal alignment constraint, a vertical alignment constraint, and an intersection constraint; When it belongs to the preset constraint category, obtaining a geometric object related to the constraint category; Comparing the geometric object with the target edge to obtain a comparison result; the comparison result is used to indicate whether the geometric object is consistent with the target edge; When the comparison result indicates that the geometric object is inconsistent with the target edge, the geometric object at the time of the inconsistent comparison is determined as the target object.

3. The chamfering function optimization method according to claim 1, characterized in that: Replacing the constraint between the target object and the target edge with the constraint between the reference point and the target object, comprising: Find the location where the constraint corresponding to the target object occurs; Determine whether the position where the constraint corresponding to the target object occurs coincides with the chamfer position in the graphic to be processed; If they coincide, the constraint between the target object and the target edge is replaced by the constraint between the reference point and the target object.

4. The chamfering function optimization method according to claim 1, characterized in that: Correcting the original dimensioning information of each target edge into target dimensioning information includes: Creating an intersection constraint between the two target edges and the reference point; For each of the target edges, determining whether there is original dimensioning information; When the original dimension annotation information exists, the original dimension annotation information is deleted and a target endpoint of the target edge is determined; the target endpoint is an endpoint of the target edge where no clipping operation occurs; Target dimensioning information is created according to the target endpoint and the reference point.

5. The chamfering function optimization method according to claim 4, characterized in that: Determining a target endpoint of the target edge includes: Obtaining the endpoint coordinates corresponding to each endpoint in the target edge; Comparing the endpoint coordinates with the reference point coordinates; The endpoint corresponding to the endpoint coordinates that match the alignment is determined as the endpoint where the clipping operation occurs; The endpoints among the endpoints except the endpoint where the clipping operation occurs are determined as the target endpoints.

6. The chamfering function optimization method according to claim 5, characterized in that: Determining a reference point according to the two target edges includes: Calculate the intersection of two target edges according to the endpoint coordinates and the original dimensioning information; The intersection point is used as the reference point.

7. A chamfering function optimization device, characterized in that: The chamfering function optimization device comprises: A reference point determination module is used to obtain two target edges to be chamfered in the graphics to be processed in the sketch environment, and determine the reference point according to the two target edges; An information acquisition module, for acquiring, for each target edge, constraint information of all external constraints on the target edge at each endpoint; the constraint information includes: the number of constraints, constraint objects, and constraint categories; An object determination module, used to determine a target object in the to-be-processed graphic according to the constraint information; the target object is a geometric object other than the target edge before rounding; A constraint replacement module, used to replace the constraint between the target object and the target edge with the constraint between the reference point and the target object; The annotation correction module is used to correct the original dimension annotation information of each target edge into target dimension annotation information after the chamfering operation is completed on the two target edges.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the chamfer function optimization method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the chamfering function optimization method described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the chamfer function optimization method described in any one of claims 1 to 6 are implemented.