Geometric constraint solving method, geometric constraint solver, equipment and medium

By generating an intermediate geometric constraint model and constructing the geometric model motion equation, the problem of dragging geometric changes that violate constraints in CAD software is solved, the success rate and accuracy of geometric constraint solving is improved, and the user experience is improved.

CN118627149APending Publication Date: 2024-09-10IND SOFTWARE DIGITAL INNOVATION (GUANGZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410723446.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In computer-aided design (CAD) software, the geometric constraint solver easily violates the constraints of the geometric model when the user drags the geometry to change, resulting in a reduced solution success rate and affecting the user experience.

Method used

By generating an intermediate geometric constraint model, the solution is performed based on the model. If the constraint information is not satisfied, the geometric model motion equation is constructed, the optimal position is obtained by solving, and the target geometric constraint model is updated to improve the success rate and accuracy of the solution.

Benefits of technology

It improves the success rate and accuracy of solving geometric constraints, improves CAD drawing efficiency and user experience, and can find the best position that meets the constraints when dragging geometric changes cannot be achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627149A
    Figure CN118627149A
Patent Text Reader

Abstract

The invention discloses a geometric constraint solving method, a geometric constraint solver, equipment and a medium. The method comprises the following steps: reading a target geometric constraint model; in response to an interactive operation of a user on target geometry in the target geometry constraint model, obtaining change information of the target geometry, and generating an intermediate geometry constraint model; solving the middle geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model; verifying whether the first geometric constraint new model meets the geometric constraint information, if yes, updating the target geometric constraint model through the first geometric constraint new model, and if not, constructing a geometric model motion equation, and solving the motion equation by taking the initial position of the target geometric constraint model as an initial value to obtain a second geometric constraint new model; and if the second geometric constraint new model meets the geometric constraint information, updating the target geometric constraint model through the second geometric constraint new model. According to the method, the solving success rate of the geometric constraint solver is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of geometric constraint solving, and in particular to a geometric constraint solving method, a geometric constraint solver, a device and a medium. Background Art

[0002] In computer-aided design (CAD) software, users are usually allowed to edit a geometric model or drag and move one or more geometric entities and automatically generate a new model. These geometries can be two-dimensional or three-dimensional and are subject to geometric constraints added by the user. For example, in common three-dimensional modeling software, users can create sketches to draw geometric figures and add geometric constraints, and quickly modify the shape and position of the sketch by directly editing the sketch or dragging geometric entities such as points and lines in the sketch.

[0003] The geometric constraint solver is a key subsystem for CAD software to automatically update geometric models. It can obtain geometric models that satisfy constraints through conventional solution calculations. Conventional solution methods solve the input geometric constraint model to generate a model that satisfies the constraints. They are mainly used to generate new models after users add constraints, modify constraint values, and other editing operations. However, when users drag and drop geometric changes, such subjective changes are likely to violate the constraints imposed on the geometric model, that is, the target position after dragging the geometry cannot satisfy the constraints of the geometric model, resulting in a lower success rate of the geometric constraint solver and a poor user experience. Summary of the invention

[0004] The present application provides a geometric constraint solving method, a geometric constraint solver, a device and a medium for improving the solving success rate of the geometric constraint solver, thereby improving the drawing efficiency of CAD and the user experience.

[0005] In view of this, the first aspect of the present application provides a geometric constraint solving method, which is applied to a geometric constraint solver, and the method comprises:

[0006] Reading a target geometric constraint model, wherein the target geometric constraint model includes geometric position information, geometric shape information, and geometric constraint information;

[0007] In response to a user's interactive operation on a target geometry in the target geometry constraint model, acquiring change information of the target geometry and generating an intermediate geometry constraint model; solving the intermediate geometry constraint model according to the change information of the target geometry to obtain a first geometry constraint new model;

[0008] Verify whether the first geometric constraint new model satisfies the geometric constraint information; if so, update the target geometric constraint model through the first geometric constraint new model; if not, construct a geometric model motion equation, and solve the geometric model motion equation with the initial position of the target geometric constraint model as the initial value to obtain a second geometric constraint new model;

[0009] If the second geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated using the second geometric constraint new model.

[0010] Optionally, generating an intermediate geometric constraint model includes:

[0011] A target constraint is set for the target geometry to generate a geometric constraint model, wherein the target constraint includes a fixed constraint or a radius constraint.

[0012] Optionally, solving the intermediate geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model includes:

[0013] constructing a numerical equation system according to the intermediate geometric constraint model;

[0014] Creating a bipartite graphical model based on the numerical equation system, and decomposing the numerical equation system into a plurality of sub-equation systems;

[0015] According to the change information of the target geometry, numerically solve each of the sub-equation systems in turn to obtain a solution result;

[0016] The intermediate geometric constraint model is updated according to the solution result to obtain a first geometric constraint new model.

[0017] Optionally, constructing the geometric model motion equation, and solving the geometric model motion equation with the initial position of the target geometric constraint model as the initial value to obtain the second geometric constraint new model includes:

[0018] Constructing an ordinary differential equation corresponding to the moving trajectory of the target geometry according to the change information of the target geometry to obtain a geometric model motion equation;

[0019] The motion equation of the geometric model is solved with the initial position of the target geometric constraint model as the initial value to determine the optimal position of the target geometry and obtain a second geometric constraint new model.

[0020] Optionally, the method further includes:

[0021] If the second geometric constraint new model does not satisfy the geometric constraint information, the position of the target geometry is restored to the initial position.

[0022] A second aspect of the present application provides a geometric constraint solver, comprising:

[0023] A data reading unit, used for reading a target geometric constraint model, wherein the target geometric constraint model includes geometric position information, geometric shape information and geometric constraint information;

[0024] An interactive unit, configured to obtain change information of the target geometry in the target geometry constraint model in response to an interactive operation of the user on the target geometry in the target geometry constraint model, and generate an intermediate geometry constraint model;

[0025] A calculation unit, configured to solve the intermediate geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model;

[0026] a verification unit, used for verifying whether the first geometric constraint new model satisfies the geometric constraint information; if so, updating the target geometric constraint model through the first geometric constraint new model; if not, constructing a geometric model motion equation, solving the geometric model motion equation with the initial position of the target geometric constraint model as the initial value, and obtaining a second geometric constraint new model;

[0027] An updating unit is configured to update the target geometric constraint model by using the second geometric constraint new model if the second geometric constraint new model satisfies the geometric constraint information.

[0028] Optionally, the interaction unit specifically includes:

[0029] A response subunit, configured to obtain change information of the target geometry in response to a user's interactive operation on the target geometry in the target geometry constraint model;

[0030] The generating subunit is used to set target constraints for the target geometry and generate a geometric constraint model, wherein the target constraints include fixed constraints or radius constraints.

[0031] Optionally, the computing unit is specifically used to:

[0032] constructing a numerical equation system according to the intermediate geometric constraint model;

[0033] Creating a bipartite graphical model based on the numerical equation system, and decomposing the numerical equation system into a plurality of sub-equation systems;

[0034] According to the change information of the target geometry, numerically solve each of the sub-equation systems in turn to obtain a solution result;

[0035] The intermediate geometric constraint model is updated according to the solution result to obtain a first geometric constraint new model.

[0036] A third aspect of the present application provides an electronic device, the device comprising a processor and a memory;

[0037] The memory is used to store program code and transmit the program code to the processor;

[0038] The processor is used to execute any one of the geometric constraint solving methods described in the first aspect according to the instructions in the program code.

[0039] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a processor, the method for solving geometric constraints described in any one of the first aspects is implemented.

[0040] It can be seen from the above technical solutions that this application has the following advantages:

[0041] In the present application, after the user drags the geometric changes in the target geometric constraint model, an intermediate geometric constraint model is generated, and a new model is obtained based on the intermediate geometric constraint model. When it is verified that the new model does not satisfy the geometric constraints, the geometric model motion equation is constructed and solved to obtain the optimal position. When the change of the dragged geometry cannot be achieved, an optimal position that meets the dragged geometric change can be found, thereby improving the success rate and accuracy of the geometric constraint solution, thereby improving the drawing efficiency of CAD and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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 or the description of the prior art 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.

[0043] Figure 1 A schematic diagram of a flow chart of a geometric constraint solving method provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a target geometric constraint model provided in an embodiment of the present application;

[0045] Figure 3 Provided in the embodiments of this application Figure 2 The target geometric constraint model is updated and the schematic diagram of the intermediate geometric constraint model after dragging the position of point P3;

[0046] Figure 4 Provided in the embodiments of this application Figure 3 Schematic diagram of the new model obtained by solving the intermediate geometric constraint model;

[0047] Figure 5 The target position P2 to which the user drags the point P2 provided in the embodiment of the present application * Schematic diagram of the optimal position point P2';

[0048] Figure 6 A schematic diagram of the structure of a geometric constraint solver provided in an embodiment of the present application;

[0049] Figure 7 A structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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.

[0051] For easier understanding, see Figure 1 The embodiment of the present application provides a geometric constraint solving method, which is applied to a geometric constraint solver, and the method includes:

[0052] Step 101: Read the target geometric constraint model.

[0053] The geometric constraint solver can read the target geometric constraint model from the storage device and obtain the initial position, shape information and geometric constraint information of all geometries in the target geometric constraint model. It should be noted that the target geometric constraint model includes geometric position information (such as the coordinates of a point), geometric shape information (such as the radius of a circle) and geometric constraint information. The geometric constraint information includes constraint type, constraint value and constrained geometry.

[0054] Step 102: In response to the user's interactive operation on the target geometry in the target geometry constraint model, obtain the target geometry change information and generate an intermediate geometry constraint model.

[0055] When the user interacts with the target geometric constraint model, such as controlling the mouse to drag the geometry in the target geometric constraint model, the geometric constraint solver responds to the user's dragging operation on the geometry in the target geometric constraint model, obtains the cursor position change, and obtains the change information of the dragged geometry, including position change information, shape change information, etc. It should be noted that the position change information can be represented by a transformation matrix. Apply target constraints, such as fixed constraints or radius constraints, to the target geometry to generate an intermediate geometric constraint model.

[0056] Step 103: Solve the intermediate geometric constraint model according to the target geometry change information to obtain a first geometric constraint new model.

[0057] A numerical equation system is constructed according to the intermediate geometric constraint model; a bipartite graph model is created according to the numerical equation system, and the numerical equation system is decomposed into a number of sub-equation systems; each sub-equation system is numerically solved in turn according to the change information of the target geometry to obtain a solution result; the intermediate geometric constraint model is updated according to the solution result to obtain a new first geometric constraint model.

[0058] The solution process can adopt existing conventional solution methods. There are many conventional solution methods for geometric constraint models, among which the geometric constraint model can be expressed as a numerical equation system:

[0059] C(x)=0

[0060] Wherein, C() represents the function corresponding to the geometric constraint, and x represents the position vector of the geometric constraint model. The numerical equation system can be further optimized by using a graph decomposition method, such as decomposing the numerical equation system into multiple sub-equation systems by using the Dulmage-Mendelsohn bipartite graph decomposition method, and finally solving it by a numerical iteration method, such as the Newton-Raphson iteration method.

[0061] For ease of understanding, this application provides an example to illustrate the above process. Figure 2 , Figure 2 A schematic diagram of a target geometric constraint model is provided, in which straight line L1 is parallel to straight line L3, straight line L2 is parallel to straight line L4, straight line L1 is subject to horizontal constraints, straight line L4 is subject to vertical constraints, and P1, P2, P3 and P4 are the intersection points of two of the straight lines. Figure 2 Drag the P3 point in the target geometric constraint model to obtain Figure 3 The model shown, Figure 3 for Figure 2 The target geometric constraint model updates the intermediate geometric constraint model after dragging the P3 point position. Figure 2 Compared with the target geometric constraint model in , the position of point P3 is updated according to the user's drag input, and a fixed constraint is imposed on point P3. Figure 4 for Figure 3 Schematic diagram of the new model obtained by solving the intermediate geometric constraint model. Since point P3 has coincident constraints with lines L2 and L3, and P3 remains in a fixed position, after solving the intermediate geometric constraint model, line L2 will translate to the right to coincide with P3, and line L3 will translate upward to coincide with P3, while driving point P2 to translate to the right and point P4 to translate upward.

[0062] Step 104, verify whether the first geometric constraint new model satisfies the geometric constraint information. If so, update the target geometric constraint model through the first geometric constraint new model. If not, construct the geometric model motion equation, and solve the geometric model motion equation with the initial position of the target geometric constraint model as the initial value to obtain the second geometric constraint new model.

[0063] After solving the intermediate geometric constraint model to obtain the first geometric constraint new model, verify whether the first geometric constraint new model satisfies the geometric constraint information in the target geometric constraint model. If the first geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated through the first geometric constraint new model. If the first geometric constraint new model does not satisfy the geometric constraint information, it is usually because the target position of the dragged geometry (i.e., the position of the dragged geometry after the dragging operation) cannot satisfy the geometric constraint information. At this time, it is necessary to find the best position that is close to the target position of the dragged geometry and can satisfy the geometric constraints.

[0064] This application transforms the optimal position solution problem into a Cauchy problem, constructs an ordinary differential equation to obtain the geometric model motion equation, and uses the initial position of the target geometric constraint model as the initial value to solve the motion trajectory of the geometric constraint model and the optimal position close to the drag target position. Specifically, it includes:

[0065] According to the change information of the target geometry, the ordinary differential equation corresponding to the moving trajectory of the target geometry is constructed to obtain the motion equation of the geometric model;

[0066] The motion equation of the geometric model is solved with the initial position of the target geometric constraint model as the initial value to determine the optimal position of the target geometry and obtain a new model of the second geometric constraint.

[0067] The target geometry motion trajectory is represented as x(t). Without loss of generality, t∈[0,1]. On this motion trajectory, the geometric constraint model is required to satisfy the constraint condition C(x)=0. Derivative the geometric constraint equation C(x)=0 with respect to the parameter t, and the expression is obtained:

[0068]

[0069] Where J is the Jacobian matrix. The ordinary differential equation with initial values ​​is established as:

[0070]

[0071] Among them, x0 represents the initial position vector of the target geometric constraint model, P(x) represents the motion acceleration term of the target geometric constraint model, and the ordinary differential equation satisfies the following constraints:

[0072] J(x)P(x)=0

[0073] C(x0)=0

[0074] Among them, the motion acceleration term P(x) determines the motion direction and final solution of the geometric constraint model, so P(x) can be constructed as:

[0075] P(x)=K(K T K) -1 K T (x * -x)+β

[0076] Where K is the core of the Jacobian matrix J, x * is the target position vector of the target geometry, and β is the correction vector. The correction vector β can be obtained by solving the following extreme value problem using the Lagrangian method:

[0077]

[0078] Where δ is a vector of size m, m is the number of variables corresponding to the target geometry, and the specific value of δ is (x * -x) and K(K T K) -1 K T (x * -x), A is an m×n feature matrix, where n is the size of vector x.

[0079] When solving the above ordinary differential equation, a numerical method such as the Dormand-Prince method can be used to solve the above ordinary differential equation and finally determine the optimal position of the target geometry. Figure 5 As shown in the figure, there are two points P1 and P2. It is known that there is a distance constraint of 10 between P1 and P2, where P1 is subject to a fixed constraint. The user drags P2 to P2. * The position of the point, and P2 * The point position cannot satisfy the geometric constraints, but through the dynamic solution method in the embodiment of the present application, the optimal position of point P2 can be solved to be P2', and then a new geometric constraint model at the optimal position P2' can be provided for user reference.

[0080] The user's dragging process is a highly interactive process, which has high requirements for the efficiency, correctness and success rate of dynamic solutions. When the method in the embodiment of the present application is used to dynamically solve the geometric changes dragged by the user cannot be realized, that is, the target position of the dragged geometry cannot meet the constraints of the target geometric constraint model, the geometric constraint solver can still find an optimal position that meets the dragged geometric changes and provide it to the user for reference, thereby improving the success rate of geometric model establishment and modification, thereby improving the user experience. The embodiment of the present application uses a conventional solution method to solve the intermediate geometric constraint model, ensuring that the solution under normal circumstances has a higher solution speed. The solution method based on ordinary differential equations can obtain an approximate solution close to the user's intention when the change of the dragged geometry cannot be realized, thereby improving the solution success rate and accuracy of the geometric constraint solver.

[0081] Step 105: If the second geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated by the second geometric constraint new model.

[0082] After dynamically solving the second geometric constraint new model, it is also necessary to verify whether the second geometric constraint new model satisfies the geometric constraint information of the target geometric constraint model. When the second geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated through the second geometric constraint new model.

[0083] It should be noted that if the second geometric constraint new model does not satisfy the geometric constraint information, the position of the target geometry is restored to the initial position, that is, the change of the target geometry is restricted.

[0084] The method of solving the approximate solution in step 104 solves the situation where the dragged geometry cannot reach the specified position, improves the application scope and success rate of dynamic solution, and the solution fails only in very rare cases, for example: the input dragged geometry changes are self-contradictory, such as dragging a straight line to rotate clockwise, and dragging a parallel line to rotate counterclockwise at the same time; the application mistakenly drags the geometry that has been fully constrained. In this case, the solution failure is correct, and the fully constrained geometry cannot be moved.

[0085] In the present application, after the user drags the geometric changes in the target geometric constraint model, an intermediate geometric constraint model is generated, and a new model is obtained based on the intermediate geometric constraint model. When it is verified that the new model does not satisfy the geometric constraints, the geometric model motion equation is constructed and solved to obtain the optimal position. When the change of the dragged geometry cannot be achieved, an optimal position that meets the dragged geometry change can be found, thereby improving the success rate and accuracy of the geometric constraint solution, thereby improving the user experience.

[0086] The above is an embodiment of a geometric constraint solving method provided by the present application, and the following is an embodiment of a geometric constraint solver provided by the present application.

[0087] Please refer to Figure 6 , a geometric constraint solver provided in an embodiment of the present application includes:

[0088] A data reading unit, used for reading a target geometric constraint model, wherein the target geometric constraint model includes geometric position information, geometric shape information and geometric constraint information;

[0089] An interactive unit, for obtaining target geometry change information in response to a user's interactive operation on the target geometry in the target geometry constraint model, and generating an intermediate geometry constraint model;

[0090] A calculation unit, used for solving the intermediate geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model;

[0091] A verification unit, used to verify whether the first geometric constraint new model satisfies the geometric constraint information. If so, the target geometric constraint model is updated through the first geometric constraint new model. If not, a geometric model motion equation is constructed and the geometric model motion equation is solved with the initial position of the target geometric constraint model as the initial value to obtain a second geometric constraint new model.

[0092] The updating unit is used to update the target geometric constraint model by using the second geometric constraint new model if the second geometric constraint new model satisfies the geometric constraint information.

[0093] As a further improvement, the interaction unit specifically includes:

[0094] A response subunit, used for obtaining target geometry change information in response to a user's interactive operation on the target geometry in the target geometry constraint model;

[0095] The generation subunit is used to set target constraints on the target geometry and generate a geometric constraint model. The target constraints include fixed constraints or radius constraints.

[0096] The geometric constraint solver can read the target geometric constraint model from the storage device and obtain the initial position, shape information and geometric constraint information of all geometries in the target geometric constraint model. It should be noted that the target geometric constraint model includes geometric position information (such as the coordinates of a point), geometric shape information (such as the radius of a circle) and geometric constraint information. The geometric constraint information includes constraint type, constraint value and constrained geometry.

[0097] When the user interacts with the target geometric constraint model, such as controlling the mouse to drag the geometry in the target geometric constraint model, the geometric constraint solver responds to the user's dragging operation on the geometry in the target geometric constraint model, obtains the cursor position change, and obtains the change information of the dragged geometry, including position change information, shape change information, etc. It should be noted that the position change information can be represented by a transformation matrix. The geometric constraint solver applies fixed constraints or radius constraints to the target geometry and generates an intermediate geometric constraint model.

[0098] As a further improvement, the computing unit is specifically used for:

[0099] constructing a numerical equation system based on an intermediate geometric constraint model;

[0100] A bipartite graph model is created according to the numerical equation system, and the numerical equation system is decomposed into several sub-equation systems;

[0101] According to the change information of the target geometry, numerically solve each sub-equation system in turn to obtain the solution result;

[0102] The intermediate geometric constraint model is updated according to the solution result to obtain a first geometric constraint new model.

[0103] After solving the intermediate geometric constraint model to obtain the first geometric constraint new model, the geometric constraint solver verifies whether the first geometric constraint new model satisfies the geometric constraint information in the target geometric constraint model. If the first geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated through the first geometric constraint new model. If the first geometric constraint new model does not satisfy the geometric constraint information, it is usually because the target position of the dragged geometry (i.e., the position of the dragged geometry after the drag operation) cannot satisfy the geometric constraint information. At this time, it is necessary to find the best position close to the target position of the dragged geometry and able to satisfy the geometric constraint. The geometric constraint solver constructs the ordinary differential equation corresponding to the moving trajectory of the target geometry according to the change information of the target geometry to obtain the geometric model motion equation; the geometric model motion equation is solved with the initial position of the target geometric constraint model as the initial value to determine the best position of the target geometry and obtain the second geometric constraint new model. If the second geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated through the second geometric constraint new model. If the second geometric constraint new model does not satisfy the geometric constraint information, the position of the target geometry is restored to the initial position, that is, the change of the target geometry is restricted.

[0104] The geometric constraint solver in the embodiment of the present application solves the problem that the dragged geometry cannot reach the specified position by solving an approximate solution, thereby improving the scope of application and the success rate of the geometric constraint solver; when the change of the dragged geometry cannot be achieved, the geometric constraint solver can still find an optimal position that meets the change of the dragged geometry, thereby improving the success rate and accuracy of the geometric constraint solving, and helping to improve the drawing efficiency of CAD and the user experience.

[0105] Please refer to Figure 7 , an embodiment of the present application further provides an electronic device, the device comprising a processor and a memory;

[0106] The memory is used to store the program code and transmit the program code to the processor;

[0107] The processor is used to execute the geometric constraint solving method in the aforementioned method embodiment according to the instructions in the program code.

[0108] An embodiment of the present application also provides a computer-readable storage medium, which is used to store program code. When the program code is executed by a processor, the geometric constraint solving method in the aforementioned method embodiment is implemented.

[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0110] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0111] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0112] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0115] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for executing all or part of the steps of the method described in each embodiment of the present application through a computer device (which can be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program codes.

[0116] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A geometric constraint solving method, characterized in that: Applied to a geometric constraint solver, the method comprises: Reading a target geometric constraint model, wherein the target geometric constraint model includes geometric position information, geometric shape information, and geometric constraint information; In response to a user's interactive operation on a target geometry in the target geometry constraint model, acquiring change information of the target geometry and generating an intermediate geometry constraint model; solving the intermediate geometry constraint model according to the change information of the target geometry to obtain a first geometry constraint new model; Verify whether the first geometric constraint new model satisfies the geometric constraint information; if so, update the target geometric constraint model through the first geometric constraint new model; if not, construct a geometric model motion equation, and solve the geometric model motion equation with the initial position of the target geometric constraint model as the initial value to obtain a second geometric constraint new model; If the second geometric constraint new model satisfies the geometric constraint information, the target geometric constraint model is updated using the second geometric constraint new model.

2. The geometric constraint solving method according to claim 1, characterized in that: The generating of the intermediate geometric constraint model comprises: A target constraint is set for the target geometry to generate a geometric constraint model, wherein the target constraint includes a fixed constraint or a radius constraint.

3. The geometric constraint solving method according to claim 1, characterized in that: The step of solving the intermediate geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model includes: constructing a numerical equation system according to the intermediate geometric constraint model; Creating a bipartite graphical model based on the numerical equation system, and decomposing the numerical equation system into a plurality of sub-equation systems; According to the change information of the target geometry, numerically solve each of the sub-equation systems in turn to obtain a solution result; The intermediate geometric constraint model is updated according to the solution result to obtain a first geometric constraint new model.

4. The geometric constraint solving method according to claim 1, characterized in that: The step of constructing the geometric model motion equation and solving the geometric model motion equation with the initial position of the target geometric constraint model as the initial value to obtain the second geometric constraint new model includes: Constructing an ordinary differential equation corresponding to the moving trajectory of the target geometry according to the change information of the target geometry to obtain a geometric model motion equation; The motion equation of the geometric model is solved with the initial position of the target geometric constraint model as the initial value to determine the optimal position of the target geometry and obtain a second geometric constraint new model.

5. The geometric constraint solving method according to claim 1, characterized in that: The method further comprises: If the second geometric constraint new model does not satisfy the geometric constraint information, the position of the target geometry is restored to the initial position.

6. A geometric constraint solver, characterized in that: include: A data reading unit, used for reading a target geometric constraint model, wherein the target geometric constraint model includes geometric position information, geometric shape information and geometric constraint information; An interactive unit, configured to obtain change information of the target geometry in the target geometry constraint model in response to an interactive operation of the user on the target geometry in the target geometry constraint model, and generate an intermediate geometry constraint model; A calculation unit, used for solving the intermediate geometric constraint model according to the change information of the target geometry to obtain a first geometric constraint new model; a verification unit, used for verifying whether the first geometric constraint new model satisfies the geometric constraint information; if so, updating the target geometric constraint model through the first geometric constraint new model; if not, constructing a geometric model motion equation, solving the geometric model motion equation with the initial position of the target geometric constraint model as the initial value, and obtaining a second geometric constraint new model; An updating unit is configured to update the target geometric constraint model by using the second geometric constraint new model if the second geometric constraint new model satisfies the geometric constraint information.

7. The geometric constraint solver according to claim 6, characterized in that: The interaction unit specifically includes: A response subunit, configured to obtain change information of the target geometry in response to a user's interactive operation on the target geometry in the target geometry constraint model; The generating subunit is used to set target constraints for the target geometry and generate a geometric constraint model, wherein the target constraints include fixed constraints or radius constraints.

8. The geometric constraint solver according to claim 6, characterized in that: The computing unit is specifically used for: constructing a numerical equation system according to the intermediate geometric constraint model; Creating a bipartite graphical model based on the numerical equation system, and decomposing the numerical equation system into a plurality of sub-equation systems; According to the change information of the target geometry, numerically solve each of the sub-equation systems in turn to obtain a solution result; The intermediate geometric constraint model is updated according to the solution result to obtain a first geometric constraint new model.

9. An electronic device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the geometric constraint solving method according to any one of claims 1 to 5 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and when the program codes are executed by a processor, the method for solving geometric constraints according to any one of claims 1 to 5 is implemented.