Graph modeling method and system for supporting geometric constraint solution of curved surface of curve

By using a ternary data structure and a unified geometric constraint graph representation method, the problem of low efficiency in solving geometric constraints of curves and surfaces is solved, achieving efficient and stable geometric constraint solving and improving the adaptability of the CAD system in complex design environments.

CN121118136APending Publication Date: 2025-12-12HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511103830.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing CAD systems suffer from low efficiency and poor accuracy in solving geometric constraints on curves and surfaces, making it difficult to meet the stability and efficiency requirements of complex design environments. Furthermore, the system structure is difficult to decouple different geometric element types and diverse constraint forms for unified processing.

Method used

A ternary data structure is adopted to represent geometric elements and constraints as vertices in a graph structure. Directed edges represent the direction of constraint propagation, thus constructing a unified geometric constraint graph. The intrinsic parameter domain of curves and surfaces is used for modeling and solving, and parameter degrees of freedom are managed in a unified manner.

Benefits of technology

It improves the efficiency and accuracy of geometric constraint solving, enhances the engineering practicality and scalability of the system, and achieves efficient and stable geometric constraint solving, which is suitable for complex curve and surface modeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121118136A_ABST
    Figure CN121118136A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer aided design and manufacturing, and particularly discloses a graph modeling method and system for supporting curve surface geometric constraint solving, and the method comprises the steps: generating a corresponding ternary body according to geometric elements in an engineering graph, and mapping the ternary body to a graph to form geometric vertexes, the ternary body comprising a cube, a sphere and a parameter body; for each engineering constraint, if a geometric element related to the engineering constraint has a curve / curved surface, correspondingly generating a parameter body by using the curve / curved surface, and mapping to form a geometric vertex; each engineering constraint is split into linear combinations of basic constraints, each basic constraint correspondingly generates a parameter body, and constraint vertexes are formed through mapping; preliminarily mapping a matching relationship between the basic constraint and the geometric element into a directed edge of a geometric vertex pointing to a constraint vertex; and adjusting the initial directed edge according to the residual degree of freedom of the geometric vertex to obtain a final geometric constraint graph. According to the method, the engineering practicability, the expandability and the solving efficiency in a complex design environment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of computer-aided design and manufacturing, and more particularly relates to a graph modeling method and system supporting solving of geometric constraints of curves and surfaces. BACKGROUND

[0002] The geometric constraint solving engine in the modern CAD system is a key technology for realizing two-dimensional sketch and three-dimensional assembly modeling, and is mainly used for analyzing geometric elements and constraint relationships therebetween input by a designer, so as to ensure geometric consistency of the model in the process of parameter change.

[0003] With continuous improvement of the complexity of product structures, the free modeling means of curves and surfaces are increasingly widely applied in the design process. However, the expression manner of curves and surfaces is highly flexible, which brings great challenges to geometric constraint modeling and solving. The current mainstream geometric constraint solvers have very limited support for curves and surfaces, and can usually only add constraints at special positions such as endpoints of curves or surfaces, or rely on general numerical solvers to process high-dimensional equation sets. The former cannot fully utilize the parametric characteristics of curves and surfaces, and seriously restricts its application in complex modeling tasks. The latter has high computational cost and obvious error accumulation in solving of large-scale nonlinear constraint systems, and is difficult to meet the dual requirements of stability and efficiency in industrial scenarios. At the same time, due to the close coupling between different geometric element types and diversified constraint forms, the system structure is difficult to decouple, and the existing methods still lack a unified processing mechanism for constraint relationships of curves and surfaces in terms of graph model construction and structure expression, which is difficult to meet the integrated modeling needs for multi-dimensional scenarios and multiple types of geometric bodies, and further reduces the solving efficiency and system expansion capability.

[0004] Therefore, there is an urgent need for a geometric constraint modeling method and system with unified expression capability, efficient solving structure and good scalability, to solve the above problems and improve the engineering adaptability of the system in complex design environments. SUMMARY

[0005] In view of the above defects or improvement needs of the prior art, the present application provides a graph modeling method and system supporting solving of geometric constraints of curves and surfaces, which aims to improve the efficiency and accuracy of geometric constraint solving.

[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a graph modeling method supporting solving of geometric constraints of curves and surfaces is provided, comprising the following steps:

[0007] Generating a corresponding trihedron according to a geometric element in an engineering drawing, and mapping the trihedron to a graph to form a geometric vertex; the trihedron includes a cubic body, a spherical body and a parameter body, which are respectively used to represent translation transformation, rotation transformation and characteristic and parameter transformation;

[0008] For each engineering constraint in the engineering drawing, if the geometry element related to the engineering constraint is a curve / surface, a parameter body corresponding to the curve / surface is generated, and the parameter body is mapped to the drawing to form a geometry vertex;

[0009] For each engineering constraint in the engineering drawing, each engineering constraint is split into a linear combination of basic constraints; each basic constraint represents a parameter transformation form, a corresponding parameter body is generated, and the parameter body is mapped to the drawing to form a constraint vertex;

[0010] The matching relationship between the basic constraints and the geometry elements is initially mapped as a directed edge from the geometry vertex to the constraint vertex;

[0011] All constraint vertices are traversed, and for each constraint vertex: the initial mapped directed edge is adjusted according to the remaining degrees of freedom of the geometry vertices related to the constraint vertex; thus obtaining the final geometric constraint graph.

[0012] As a further optimization, a corresponding three-element body is generated according to the geometry element in the engineering drawing, and the three-element body is mapped to the drawing to form a geometry vertex, including:

[0013] First, decouple the attitude angle variable of each geometry element, generate a sphere, and map it to a geometry vertex;

[0014] Then, decouple the position variable of each geometry element, generate a cube, and map it to a geometry vertex;

[0015] Finally, decouple other parameter variables of each geometry element, generate a corresponding number of parameter bodies, and map them to geometry vertices respectively.

[0016] As a further optimization, after mapping the three-element body to the drawing to form a geometry vertex, the common base relationship of the three-element body is stored as a virtual edge corresponding to the geometry vertex, and the virtual edge does not affect the degree of freedom. Specifically, for the same geometry element, a virtual edge is established between the geometry vertex corresponding to the cube and the geometry vertex corresponding to the other body.

[0017] As a further optimization, if the geometry element related to the engineering constraint is a curve / surface, a parameter body corresponding to the curve / surface is generated, specifically:

[0018] For a curve, for each engineering constraint related to the curve, a parameter is used to represent the position of an arbitrary point on the curve, and a parameter body corresponding to the curve is generated;

[0019] For a surface, for each engineering constraint related to the surface, two parameters are used to represent the position of an arbitrary point on the surface, and two parameter bodies corresponding to the surface are generated.

[0020] As a further preferred, the differential form of the basic constraint corresponding is constructed and stored in the parameter body, and a row of the Jacobian matrix of the differential form of the basic constraint corresponding is used to match the Jacobian matrix structure in the solving of the geometric constraint.

[0021] As a further preferred, the directed edge of the initial mapping is adjusted according to the remaining degrees of freedom of the geometric vertex related to the constraint vertex, including the following steps:

[0022] Calculating the remaining degrees of freedom of all geometric vertices related to the constraint vertex in the space of the spanning;

[0023] If the remaining degrees of freedom of the geometric vertex are greater than 0, the geometric vertex is taken as a matching vertex; the original directed edge is modified to a directed edge of the matching vertex pointed by the constraint vertex, and directed edges of the remaining related geometric vertices to the matching vertex are added;

[0024] If the remaining degrees of freedom of the geometric vertex are not greater than 0, the original directed edge is maintained.

[0025] As a further preferred, the remaining degrees of freedom refer to the number of graph vertices that can be matched, and each matching is a directed edge of a certain graph vertex to another graph vertex; the remaining degrees of freedom of the pointed graph vertex are reduced by one, and the remaining degrees of freedom of the pointed graph vertex are not changed; the constraint vertex and the geometric vertex are both graph vertices.

[0026] As a further preferred, the engineering drawing is a two-dimensional sketch, a three-dimensional sketch or a three-dimensional assembly drawing created by a user.

[0027] As a further preferred, in the three-element body:

[0028] The cubic body: representing a translation transformation, used to represent the position of the local coordinate origin of the geometric element;

[0029] The spherical body: representing a rotation transformation, used to represent the attitude of the local coordinate system of the geometric element;

[0030] The parameter body: representing a feature and a parameter transformation, used to represent the state change of the geometric element and the change of the geometric constraint component.

[0031] According to another aspect of the present application, a graph modeling system supporting solving of geometric constraints of curves and surfaces is provided, comprising a processor configured to execute the above-mentioned graph modeling method supporting solving of geometric constraints of curves and surfaces.

[0032] In general, compared with the prior art, the above technical solutions conceived by the present application mainly have the following technical advantages:

[0033] 1. This invention introduces a unified data structure and modeling mechanism, effectively reducing the complexity of problem modeling and solving while expanding the scope of constraint modeling, based on the unified expression of parametric geometry and constraints and traditional geometry and constraints. It also improves upon existing geometric constraint modeling and solving methods by addressing the poor support for curves and surfaces and the weak ability to represent geometric information graphs of curves and surfaces. This invention enhances the system's engineering practicality, scalability, and the efficiency and accuracy of large-scale solutions, and contributes to promoting the development of geometric constraint solving in the field of curve and surface modeling.

[0034] 2. This invention proposes the concept of a ternary body, which unifies the expression of geometric elements and constraints as vertices in a graph structure, transforming two-dimensional / three-dimensional geometric engineering drawings into geometric constraint graphs. By representing geometric elements and their constraint relationships through a consistent data structure, the loss of constraints or elements during operation is avoided, achieving unified, efficient expression and stable transmission of geometric elements and constraints.

[0035] 3. The ternary vertex proposed in this invention fully integrates the mapping relationship between parametric curves and surfaces, decouples the coordinates, orientation, and parameter information of geometric elements, comprehensively reflects the characteristics of the geometric elements themselves, facilitates the block-based solution process in the subsequent solution process, and transforms geometric elements and constraint information through simple mapping relationships, without the need for complex construction and management processes.

[0036] 4. This invention fully utilizes the geometric information within curves and surfaces, breaking through the traditional approach of treating curves and surfaces as "black box" entities. By mining the intrinsic parameter domain of curves and surfaces, it provides rich geometric features for modeling and constraint solving, enhancing the controllability and predictability of the model under parameter variations, and providing key support for high-performance, stable geometric constraint solvers.

[0037] 5. This invention proposes a unified degree-of-freedom management mechanism, integrating the parametric degrees of freedom of curves and surfaces with the translational and rotational degrees of freedom of traditional geometric solids into the same solution framework. This allows the degrees of freedom of the vertices of the parametric solid to participate in the construction of the Jacobian matrix and the solution using Newton's method, thus ensuring consistency and efficiency in modeling and solving. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of the overall structure of the geometric constraint solving engine in an embodiment of the present invention;

[0039] Figure 2 This is a ternary data structure diagram of an embodiment of the present invention;

[0040] Figure 3 This is a flowchart illustrating the geometric modeling process of an embodiment of the present invention;

[0041] Figure 4This is a flowchart illustrating the constraint modeling process in an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0043] This invention provides a graph modeling method that supports solving geometric constraints on curves and surfaces, which can be integrated into a geometric constraint solving engine system, such as... Figure 1 As shown, this approach fully utilizes the geometric and physical information within and between elements, and integrates the structural advantages of curves and surfaces during modeling to support their use in subsequent solution processes. This helps promote the better development of geometric constraint solving in the field of curve and surface modeling. The following is a detailed explanation.

[0044] 1. Ternary data structure design

[0045] (1) Based on the existing dual-body representation, a unified structure for expressing geometric elements and constraints, called the ternary body, is designed. The ternary body adds a parametric body to the dual-body representation. On the one hand, it introduces the degrees of freedom of the parametric body mapping curves and surfaces, realizing integrated constraint modeling and solving between parametric geometric elements and traditional geometric elements. On the other hand, it facilitates the unification of constraint expression and geometric expression. Specifically, as follows... Figure 2 As shown:

[0046] Body: The base class of ternary bodies. All geometric modifications in computer-aided design and manufacturing can be mapped to the superposition of several transformations. All geometric transformations can be represented as transformations of a body. Through the decoupling of geometric transformations, the modification action can be decomposed into multiple actions, which facilitates the step-by-step decomposition of the solution process and derives different transformation forms, corresponding to different types of ternary bodies.

[0047] BoxBody: Inherited from the Body base class, it represents translation transformations and is used to represent the local coordinate origin position of geometric elements;

[0048] Sphere (BallBody): Inherited from the Body base class, it represents rotational transformations and is used to represent the local coordinate system orientation of geometric elements;

[0049] ParaBody: Inherited from the Body base class, it represents feature transformations and parameter transformations, and is used to store and manage changes in the state of geometric elements and changes in geometric constraint components.

[0050] The translational degrees of freedom of all geometric elements are carried by cubes, the rotational degrees of freedom are carried by spheres, the state degrees of freedom of geometric elements such as the radius degrees of freedom of circles, spheres, cylinders, etc., and the intrinsic parameters (such as t, u, v) degrees of freedom of parametric curves and surfaces are carried by parametric bodies, so that the additional degrees of freedom of complex curves and surfaces can be explicitly managed.

[0051] (2) Based on the ternary body, a unified graph structure expression method is introduced to represent geometry and constraints in a graph model (geometric constraint graph), thereby improving modeling consistency and solution efficiency.

[0052] Unified graph structure: In a geometric constraint graph, ternaries are used as nodes of different types, and the direction of constraint propagation is represented by directed matching edges, forming a traversable constraint network.

[0053] Graph vertices: Graph vertices are mappings of ternary structures onto a graph. Vertex and edge matching operations are performed based on ternary graph vertices. Cube vertices are graph mappings of cube structures, sphere vertices are graph mappings of sphere structures, and parametric volume vertices are graph mappings of parametric volume structures.

[0054] Matching edges: Directed edges are used to represent matching and interaction relationships. The pointed vertex transmits the constraint information on the corresponding edge to the pointed vertex, forming a unified and traversable constraint network in the graph structure, which helps in the subsequent degree of freedom analysis and solution sequence generation.

[0055] The goal of a system model is to accurately record the user's design intent and provide a format that is easy for computers to understand and process. This unified specification facilitates subsequent operations such as system analysis, geometric constraint solving, and model adjustment. This modeling approach effectively transforms direct user interaction into actionable computer processing steps, optimizing the entire design and development process.

[0056] Specifically, the selection of local coordinate frames for geometric elements is modeled according to the type of geometric element. For local coordinate frames without special meaning, the default construction is the same as the initial coordinate frame to uniformly ensure the consistency of vertices mapped to the graph and the depth decoupling.

[0057] The graph modeling method based on the above ternary data structure includes geometric modeling and constraint modeling. For ease of understanding, the implementation of each step will be explained in detail by introducing the tangent constraints of curves and lines.

[0058] 2. Geometric Modeling

[0059] A ternary body modeling method that integrates two-dimensional and three-dimensional geometry of curves and surfaces is adopted to unify the representation of curves, surfaces, and basic geometry, such as... Figure 3 As shown, it includes the following steps:

[0060] S1. Obtain all geometric elements in the engineering drawing, identify the geometric type, and construct instances of the geometric elements under the corresponding class.

[0061] The geometric element class serves as a container to store information about the corresponding elements, which is uniformly passed into the system while retaining standardized interfaces to ensure that data transfer between external applications and the system is universal and scalable. Engineering drawings are user-created 2D sketches, 3D sketches, or 3D assembly drawings.

[0062] In this embodiment, the user creates a two-dimensional sketch, draws curves and straight lines, and inputs them into the system. The system obtains the curve, the start and end points of the curve, the straight line, and the start and end points of the straight line, and constructs the geometric elements curve1 under the paracurve class, straight line1 under the line class, and point1, point2, point3, and point4 under the point class.

[0063] S2. Generate corresponding ternaries based on geometric elements, and map the ternaries onto the graph to form geometric vertices; specifically including:

[0064] S21. Decouple the attitude angle variables of each geometric element to generate a corresponding number of sphere-like ternary bodies with 1 degree of freedom in the two-dimensional graph and 3 degrees of freedom in the three-dimensional graph. Map them to geometric vertices and set the number of matchable edges of the vertices to the number of remaining degrees of freedom of the sphere.

[0065] In designing interactions, the translation of a geometric entity's position does not affect its rotation, while rotational orientation does affect the geometric entity's position. Therefore, we prioritize decoupling the orientation angle variable, the direction cosine matrix A(α), and recording it in a sphere. The degree of freedom is dof = 1 in 2D and dof = 3 in 3D, which is mapped to geometric vertices. The number of matchable edges is 1 in 2D and 3 in 3D.

[0066] In this embodiment, the attitude angle variable of decoupled curve 1 is set as the attitude angle vector of the world coordinate system. Subsequent changes in the attitude angle variable value represent the rotation of curve 1 relative to the system. This is represented as the rotation of the curve on the interface, generating a sphere. The attitude angle variable value of the curve is stored in the variable value of the sphere and mapped to the geometric vertices on the graph. The attitude angle variable of decoupled line 1 is set as the direction vector of line 1. Subsequent changes in the attitude angle variable value represent the rotation of line 1 relative to the system. This is represented as the rotation of the line on the interface, generating a sphere. The attitude angle variable value of the line is stored in the variable value of the sphere and mapped to the geometric vertices on the graph. The attitude angle variables of points 1 to 4 are decoupled. For points, changes in angle do not affect their attitude, therefore, attitude angle values ​​are not involved, and the sphere is empty.

[0067] S22. Decouple the position variables of each geometric element to generate a corresponding number of cube-like ternary bodies with 2 degrees of freedom in the 2D graph and 3 degrees of freedom in the 3D graph. Map them to geometric vertices and set the number of matchable edges of the vertices to the number of remaining degrees of freedom of the cube.

[0068] The decoupling location is the local coordinate origin r, recorded in a cube. The degree of freedom is dof = 2 in 2D and dof = 3 in 3D. It is mapped to a geometric vertex, and the number of matching edges is 2 in 2D and 3 in 3D.

[0069] In this embodiment, the position variable of decoupling curve 1 is set as the origin position vector of the world coordinate system. Subsequent changes in the position variable value represent the translation of curve 1 relative to the system, which is represented as the translation of the curve on the interface. A cube is generated, and the position variable value of the curve is stored in the variable value of the cube, which is mapped to the geometric vertices on the graph. The position variable of decoupling line 1 is set as the polar distance point position of line 1. Subsequent changes in the position variable value represent the translation of line 1 relative to the system, which is represented as the translation of the line on the interface. A cube is generated, and the position variable value of the line is stored in the variable value of the cube, which is mapped to the geometric vertices on the graph. The position variables of points 1-4 are decoupling and set as the positions of the points. Subsequent changes in the position variable value represent the translation of points 1-4 relative to the system, which is represented as the movement of the points on the interface. A cube is generated for each point, and the position variable value of the point is stored in the variable value of the cube, which is mapped to the geometric vertices on the graph.

[0070] S23. Decouple other parameter variables for each geometric element, generating a corresponding number of parameter body ternary bodies. Each parameter body has 1 degree of freedom, is mapped to a geometric vertex, and the number of matchable edges of the vertex is set to the number of remaining degrees of freedom of the parameter body. Other parameter variables are decoupled and recorded in the parameter bodies. The system can flexibly adjust the size without affecting the position and shape of the geometric elements, meeting the requirements of parametric design. The degrees of freedom of the parameter body are determined by the parameter type stored in the parameter body. The number of matchable edges mapped to geometric vertices is equal to the remaining degrees of freedom of the parameter body.

[0071] An abstract representation of all curves, where the direction vector at any point on a curve is different. A parameter body stores the value of parameter t, with a degree of freedom dof = 1, representing the location of constraint points generated by interaction with the external environment. The number of curve parameter bodies is the same as the number of basic constraints; initially, the number of parameter bodies corresponding to a curve is 0.

[0072] An abstract representation of all surfaces is used, where the direction of any point on the surface can be represented by two tangent vectors. Two parameter bodies are set to store the values ​​of parameters u and v respectively, with dof = 1 for each parameter body. The two parameter bodies together represent the location of the constraint point generated by the interaction with the external environment. The relationship between the number of surface parameter bodies m and the number of basic constraints n is m = 2n. Initially, the number of parameter bodies corresponding to the surface is 0.

[0073] S3. Set the matching relationship corresponding to the ternary body feature structure, and store the matching relationship as the virtual edge corresponding to the geometric vertex.

[0074] After step S2, all geometric elements are decoupled into cubes, spheres, and parametric volumes. Geometric information is stored within the corresponding ternary bodies, and the ternary structure is mapped onto the graph to form geometric vertices. However, the geometric vertices corresponding to the ternary structures of geometric elements should not exist in isolation on the graph. Relationships should be added between all volumes belonging to the same geometric element, and relationships should also be added between the geometric element and its related volumes. In this invention system, virtual edges are constructed between geometric vertices to represent the common basis relationship between ternary bodies, i.e., belonging to the same geometric element. The meaning of a virtual edge is: a virtual edge is an undirected edge; there is a common basis relationship between the geometric vertices corresponding to the two ternary bodies connected by the virtual edge; the virtual edge does not change the degree of freedom of the vertex.

[0075] All geometric elements contain geometric vertices corresponding to cubes. Therefore, the body stored in the geometric elements is a cube, and virtual edges are established between the geometric vertices corresponding to the cubes and the geometric vertices corresponding to other bodies.

[0076] In this embodiment, the ternary vertex of curve 1 has 1 cube, 1 sphere, and n parameter bodies that may be added later. The cube is stored as the body in curve 1, and a linked list bodylist is constructed to store all related cubes, spheres, and parameter bodies. A virtual edge is established between the geometric vertex corresponding to the cube and the geometric vertices corresponding to all other bodies. The ternary vertex of line 1 has 1 cube and 1 sphere. The cube is stored as the body in line 1, and a linked list bodylist is constructed to store all related cubes and spheres. A virtual edge is established between the geometric vertex corresponding to the cube and the geometric vertices corresponding to all other bodies. The ternary vertex of points 1-4 each has 1 cube. The cube is stored as the body in points 1-4, and a linked list bodylist is constructed. For points, the linked list only stores cubes and there are no other bodies, so no virtual edge needs to be constructed.

[0077] The relationships between common 3D geometric elements such as cubes, spheres, and parametric volumes are matched and traversed according to Table 1 below:

[0078] Table 1. Matching Relationships of Ternary Bodies

[0079]

[0080] 3. Constraint Modeling

[0081] A ternary body modeling method that integrates two-dimensional and three-dimensional constraints of curves and surfaces is adopted to uniformly express the constraint relationships between curves, surfaces, and basic geometry, such as... Figure 4 As shown, it includes the following steps:

[0082] S4. Obtain the engineering constraints between all geometric elements in the engineering drawing, as well as the set of geometric elements associated with the engineering constraints, and input them into the system, retaining the interface. The set of geometric elements associated with the engineering constraints is stored in the engineering constraint class data structure.

[0083] In this embodiment, the user creates a 2D sketch, clicks to draw curves and lines, adds tangent constraints, and inputs them into the system. The system identifies the engineering constraint type as tangent constraint and obtains the set of geometric elements related to the tangent constraint as curves and lines. Simultaneously, the handle interfaces for the curves and lines are retained to ensure the subsequent transmission of geometric information and the return of solution results.

[0084] S5. When the geometric elements related to the structural features are curves or surfaces, add a parameter body with the corresponding number of engineering constraints to represent the specific location of the curve and surface structure to be solved. Map it to a geometric vertex and set the number of matchable edges of the vertex to the number of remaining degrees of freedom of the parameter body. Set the matching relationship corresponding to the ternary structure features and store the matching relationship as the virtual edge corresponding to the geometric vertex.

[0085] For each curve, a parameter body is generated for each engineering constraint associated with the curve, storing the value of the helper parameter t, where t represents the position of any point on the curve. The parameter body has 1 degree of freedom. When t is determined, it represents the point on the parameter curve corresponding to the solution result after the current basic constraint is solved. Through callback, the local coordinates, local vectors and other feature values ​​corresponding to the solution result can be obtained.

[0086] For a surface, for each engineering constraint associated with the surface, two parameter bodies are generated to store the values ​​of helper parameters u and v. u and v can represent the position of any point on the surface. The degree of freedom of the two parameter bodies is 1. When u and v are determined, it means that the point on the parameter surface is the result of the solution of the current basic constraint. Through callback, the local coordinates, local vectors and other feature values ​​corresponding to the solution result can be obtained.

[0087] In this embodiment, the engineering constraint of the tangency between the straight line and the curve involves a curve. After the system identifies the curve, a new parameter body is added. The parameter body is attached to the element of curve 1 and can be obtained through the curve cube. Then, through the interface callback reserved by S1, the current curve information can be obtained. A geometric vertex is generated and a matching relationship is established with the geometric vertex corresponding to the cube of the curve. The current parameter body is added to the linked list bodylist of curve 1, and a virtual edge is established between the cube of curve 1 and the current parameter body.

[0088] S6. Decompose the structural features to be processed, identify the engineering constraint relationships between geometric elements, and use a linear combination of basic constraints to represent each engineering constraint obtained in step S4.

[0089] Geometric constraints have geometric meaning, manifesting as geometric measures of basic geometric elements and related parameters. These measures are typically expressed as Euler invariants such as distance, angle, and length. Constraint construction begins with identifying a finite set of basic constraints. These basic constraints then span all engineering constraints, achieving unified constraint management. The basic constraint set unifies the management of two-dimensional and three-dimensional engineering constraints, achieving deep decoupling of engineering constraints. The basic constraint set serves as a bridge between the complex and diverse physical models of the constructed object and the graphical symbolic model structure; the differential forms corresponding to the basic constraints are compatible with the Jacobian matrix structure used in subsequent solutions, bridging the transformation between the graphical symbolic model structure and the mathematical algebraic equation solution structure.

[0090] Specifically, engineering constraints can be uniformly broken down into basic constraints between points and vectors, including:

[0091] Basic constraint DOT_1(a i a j θ): The dot product of two unit vectors in space is equal to a constant.

[0092] Basic constraints Dot_2(a i ,d ij ,kD): Vector d between spatial volumes ij Towards the unit volume vector a i The projection is equal to the constant kD;

[0093] Basic constraints DOT_3(p i p j ,D):The length of the vector between spatial volumes is D.

[0094] For information on basic constraints, please refer to patent CN117574644A.

[0095] The necessary and sufficient condition for redundancy in engineering constraints is that each basic constraint component is redundant. The basic constraints corresponding to each constraint component have the same geometric meaning as the parametric elements; that is, a basic constraint is a special type of parametric geometric element. Therefore, the basic constraints are treated as a parametric ternary body. Through the parametric geometric element j and its corresponding parametric body λ, the geometric elements and engineering constraints are decomposed to generate the same ternary body data structure.

[0096] In this embodiment, the engineering constraint relationship is identified as the tangent engineering constraint between a straight line and a curve, and then decomposed into two basic constraints:

[0097] The first constraint component is a ternary constraint, with the relevant volumes being the sphere of line 1, the sphere of curve 1, and the parameter volume of curve 1. The normal vector 'a' of the line in the sphere of line 1 is read. iRead the parameter t stored in the parameter body of curve 1, and retrieve the local vector a of the tangent direction at the corresponding point via callback. j (t); Read the rotation matrix A of the local vector of curve 1 stored in the sphere relative to the global reference frame, and multiply it with the local vector to obtain the global vector. Corresponding to the basic constraint dot product -1, the global normal vector of the line is perpendicular to the direction of the tangent global vector at the point of tangency of the parametric curve. This is expressed as:

[0098] Φ 1 (a i ,a j ,t j ):a i ·Aa j (t)-cos(θ)=0

[0099] Where θ is the angle between the two vectors, θ = 0.

[0100] The second constraint component is a five-element constraint, with the relevant volumes being the cube and sphere of line 1 and the cube, sphere, and parameter volume of curve 1. The global coordinates of the polar moment point in the cube of line 1 are read; the normal vector of the line in the sphere of line 1 is read; the parameter t stored in the parameter volume of curve 1 is read, and the local coordinates p′(t) of the corresponding point are retrieved via callback; the rotation matrix A of the curve's local vector relative to the global reference frame stored in the sphere of curve 1 is read; the coordinates r of the origin of the curve's local coordinates relative to the global reference frame stored in the cube of curve 1 are read; the global coordinates of the point on the parameter curve are obtained through coordinate transformation, as shown in the following expression:

[0101] p j =p(r,α,t)=r+Ap′(t)

[0102] Corresponding to the basic constraint dot product -2, the projection of the vector formed by the polar moment point of the line and the point on the parametric curve onto the normal vector of the polar moment point is equal to 0. This is expressed as:

[0103] Φ 2 (a i ,d ij ,kD)=Φ 2 (r i ,α i ,r j ,α j ,t j ) = a i ·d ij -kD=(A i a′ i (t i ))·d ij -kD

[0104] =0

[0105] Where, dij It is the vector formed by the polar distance point of the straight line and the point on the parametric curve.

[0106] d ij =p j -p i

[0107] The necessary and sufficient condition for the tangency constraint between a straight line and a curve to be satisfied is that both basic constraint components are satisfied simultaneously.

[0108] Furthermore, we construct the differential forms corresponding to the basic constraints, which are compatible with the Jacobian matrix structure used in solving subsequent geometric constraints.

[0109] The fundamental constraint set serves as a bridge between the complex and diverse physical models of constructed objects and the graphical symbolic model structure, while the differential of the fundamental constraints serves as a bridge between the graphical symbolic model structure and the mathematical algebraic equation solving structure. When a fundamental constraint participates in the solution, it corresponds to a row in the Jacobian matrix, and each position in the row stores the partial derivative of its corresponding variable. This invention constructs an algebraic expression and its differential of the fundamental constraints of integrated curves and surfaces, consistent with the data structure of ternary body theory.

[0110] In this embodiment, the differential form of the dot product -1 corresponding to the first fundamental constraint component is as follows:

[0111]

[0112] The differential form of the dot product -2 corresponding to the second fundamental constraint component is as follows:

[0113]

[0114] The differential form of the current constraint component corresponds to the iterative value of the Jacobian matrix in the subsequent numerical solution. The ternary volume involved in the constraint component is the mapping of the variables that need to be iteratively solved in the Jacobian matrix onto the graph. The one-to-one correspondence between the two ensures the compatibility between the graph structure and the subsequent numerical solution structure.

[0115] S7. Map the set of basic constraints of the linear combination onto the graph. Each basic constraint corresponds to a parameter body, and the parameter bodies form the constraint vertices. The matching relationship between the basic constraints and the geometric elements is initially mapped as directed edges from the geometric vertices to the constraint vertices.

[0116] The basic principle for calculating the degrees of freedom corresponding to the matching relationship of directed edges is that outgoing edges do not affect the degrees of freedom, while the degrees of freedom of the graph vertices corresponding to incoming edges are reduced by 1. For the same matching represented by multiple edges, changes in the degrees of freedom of incoming edges are only calculated once. After basic constraints are mapped to constraint vertices on the graph, the initial mapping matching edges are: all geometric vertices involved in the basic constraint point to that constraint vertex, representing a matching, and the remaining degrees of freedom of the constraint vertex are reduced by 1.

[0117] In this embodiment, the basic constraint set is {Φ 1 (a i ,a j ,t j ), Φ 2 (r i ,α i ,r j ,α j ,t j The first fundamental constraint Φ 1 The corresponding ternary bodies are {a i ,a j ,t j The edges between vertices in the graph point to each other, as defined by the basic constraint Φ. 1 The parameter body has 3 incoming edges, and each of the 3 triplets has an outgoing edge pointing to Φ. 1 Parameter body; second fundamental constraint Φ 2 The corresponding ternary bodies are {r j ,α i ,r j ,α j ,t j The edges between vertices in the graph point to each other, as defined by the basic constraint Φ. 2 The parameter body has 5 incoming edges, and each of the 5 triplets has one outgoing edge pointing to Φ. 2 Parameter body.

[0118] S8. Based on the matching relationship between the constraint vertices of the basic constraints and the geometric vertices of each geometric element, calculate the residual degrees of freedom of the relevant geometric vertices in the spanned space, and adjust the directed edges of the initial mapping based on the residual degrees of freedom.

[0119] The number of incoming edges that can be added to the current geometric vertex is equal to the number of remaining degrees of freedom of the corresponding ternary body, which is the number of basic constraints that can be matched. In step S7, the edges point from the geometric vertex to the constraint vertex, and the remaining degrees of freedom of the basic constraints are 0, meaning that the initial constraint setting is redundant. This indicates that the relationship between the basic constraints and the associated ternary body in step S7 is only a matching relationship. In the current step S8, if the matching relationship of the edges is changed through calculation, the current basic constraint is no longer redundant, meaning that the basic constraint can affect the system state and participate in the solution, specifically including:

[0120] Calculate the residual degrees of freedom of all geometric vertices related to the constrained vertex in the spanned space. If there is a geometric vertex with a residual degree of freedom greater than 0, then the geometric vertex is taken as the matching vertex; if there is no geometric vertex with a residual degree of freedom greater than 0, then the constrained vertex is taken as the matching vertex, which indicates that the constraint is redundant.

[0121] If the matching vertex is a constraint vertex, the current basic constraint is considered redundant, and the original directed edge matching relationship is maintained. The basic constraints do not affect the system solution, and the relevant values ​​of the basic constraints are obtained from the solution results of the matching vertex as the solution quantity.

[0122] If the matching vertex is a geometric vertex, then modify the directed edge matching relationship by changing the original directed edges to directed edges from constraint vertices to the matching vertex, and adding directed edges from the remaining geometric vertices to the matching vertex. Let the matching vertex be m1, and the set of remaining geometric vertices be {m2, m3...m...}. n If the constraint vertex of the basic constraint is p, then the edge matching relationship becomes: matching vertex m1 has n incoming edges (n = n-1+1), and the vertex set {m2, m3...m...} has n incoming edges. n Vertex} and vertex p each have an outgoing edge pointing to the matching vertex m1. In this case, the basic constraint is not redundant, which affects the solution of the system.

[0123] The entire design process is bottom-up, with constraints between geometric elements added sequentially and constraints satisfied sequentially. Therefore, the approach aligns with the design interaction concept: each newly added constraint is processed separately, evaluated, and the results are relayed back to the user in real time, thus providing more intelligent design assistance. Therefore, after each new constraint relationship is added, constraint information is immediately transmitted, and internal functionalities are implemented and solved.

[0124] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A graphical modeling method supporting the solution of geometric constraints on curves and surfaces, characterized in that, Includes the following steps: Generate corresponding ternary bodies based on the geometric elements in the engineering drawing, and map the ternary bodies onto the drawing to form geometric vertices; the ternary bodies include cubes, spheres and parametric bodies, which are used to represent translation transformations, rotation transformations and feature and parameter transformations, respectively. For each engineering constraint in the engineering drawing, if the geometric elements related to the engineering constraint have curves / surfaces, generate the corresponding parametric bodies of the curves / surfaces and map them onto the drawing to form geometric vertices. For each engineering constraint in the engineering drawing, each engineering constraint is decomposed into a linear combination of basic constraints; each basic constraint represents a parameter transformation form, generates a corresponding parameter body, and maps it onto the graph to form constraint vertices; The matching relationship between basic constraints and geometric elements is initially mapped as directed edges from geometric vertices to constraint vertices; Iterate through all constrained vertices. For each constrained vertex, adjust the directed edges of the initial mapping based on the remaining degrees of freedom of the geometric vertices related to that constrained vertex. This yields the final geometric constraint diagram.

2. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 1, characterized in that, Generate corresponding ternaries based on the geometric elements in the engineering drawing, and map the ternaries onto the drawing to form geometric vertices, including: First, decouple the attitude angle variables of each geometric element to generate a sphere and map it to a geometric vertex; Then, the position variables of each geometric element are decoupled to generate a cube and mapped to geometric vertices; Finally, the other parameter variables of each geometric element are decoupled to generate a corresponding number of parameter bodies, which are then mapped to geometric vertices.

3. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 2, characterized in that, After mapping the ternary body onto the graph to form geometric vertices, the common basis relation corresponding to the ternary body is stored as the virtual edge corresponding to the geometric vertex. The virtual edge does not affect the degree of freedom. Specifically, for the same geometric element, virtual edges are established between the geometric vertex corresponding to its cube and the geometric vertex corresponding to other bodies.

4. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 1, characterized in that, If the geometric elements related to engineering constraints include curves / surfaces, then generate a corresponding parametric body for the curves / surfaces, specifically as follows: For each curve, for every engineering constraint associated with the curve, a parameter is used to represent the position of any point on the curve, and a corresponding parameter body is generated for the curve. For a surface, for each engineering constraint associated with the surface, two parameters are used to represent the position of any point on the surface, and two parameter volumes are generated accordingly.

5. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 1, characterized in that, Construct the differential forms corresponding to the basic constraints and store them in the parameter body. When solving the geometric constraints later, the basic constraints in the differential forms correspond to a row of the Jacobian matrix to ensure compatibility with the Jacobian matrix structure when solving the geometric constraints.

6. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 1, characterized in that, Based on the remaining degrees of freedom of the geometric vertices related to the constrained vertex, the directed edges of the initial mapping are adjusted, including the following steps: Calculate the remaining degrees of freedom of all geometric vertices associated with the constrained vertex in the spanned space; If there is a geometric vertex with a residual degree of freedom greater than 0, then that geometric vertex is taken as the matching vertex. Modify the original directed edges to be directed edges from the constrained vertex to the matching vertex, and add directed edges from the remaining related geometric vertices to the matching vertex. If there are no geometric vertices with a remaining degree of freedom greater than 0, then the original directed edges are maintained.

7. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 6, characterized in that, The remaining degrees of freedom refer to the number of graph vertices that can be matched. Each match is when another graph vertex points to a certain graph vertex. The pointed-to graph vertex loses one remaining degree of freedom, and the remaining degree of freedom of the pointed-to graph vertex remains unchanged. Both the constraint vertex and the geometric vertex are graph vertices.

8. The graph modeling method supporting the solution of geometric constraints of curves and surfaces as described in claim 1, characterized in that, The engineering drawings are user-created two-dimensional sketches, three-dimensional sketches, or three-dimensional assembly drawings.

9. The graph modeling method for supporting the solution of geometric constraints of curves and surfaces as described in any one of claims 1-8, characterized in that, In the ternary body: A cube: represents a translation transformation and is used to indicate the local coordinate origin position of a geometric element; Sphere: Represents rotational transformations and is used to indicate the local coordinate system orientation of geometric elements; Parameter volume: Characterizes features and parameter transformations, used to represent changes in the state of geometric elements and changes in geometric constraint components.

10. A graph modeling system supporting the solution of geometric constraints on curves and surfaces, characterized in that, Includes a processor for executing the graph modeling method for supporting the solution of geometric constraints of curves and surfaces as described in any one of claims 1-9.