Modeling method, apparatus, and electronic device
By establishing a directed graph of dependencies between features and grouping constraints, the inefficiency caused by frequent switching between two-dimensional and three-dimensional constraints in complex product modeling is solved, and efficient two-dimensional and three-dimensional constraint solving is achieved in the same environment.
Patent Information
- Application Number
- CN202111258142.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the process of modeling complex products, the frequent switching between two-dimensional and three-dimensional constraints leads to low modeling efficiency.
By establishing a directed graph of dependencies between features, constraints are grouped based on dependencies to determine the constrained feature sequence, and then constraint solving is performed sequentially to achieve hybrid solution of two-dimensional and three-dimensional constraints.
It supports both 2D sketch constraints and 3D rigid body constraints in the same modeling environment, avoiding scene switching and improving modeling efficiency and accuracy.
Smart Images

Figure CN116029004B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer-aided design technology, specifically to modeling methods, devices, and electronic equipment. Background Technology
[0002] Parametric modeling and constraint solving are key features of modern computer-aided design (CAD) software. Constraints can be categorized into two types based on the spatial dimension of the objects involved: two-dimensional constraints and three-dimensional constraints. Two-dimensional constraints refer to constraints between two-dimensional curves within the sketch; all two-dimensional curves and constraints lie in the same plane. Three-dimensional constraints involve three-dimensional geometry outside the sketch; the objects involved and the constraints may not lie in the same plane. Three-dimensional constraints have two meanings: First, the constraint objects are not limited to two-dimensional curves within the sketch but also support three-dimensional geometry. For example, the distance constraint between a two-dimensional line segment within the sketch and the surface of a three-dimensional solid outside the sketch. Second, constraints can be applied between three-dimensional geometric objects to drive rigid body transformations, thereby enabling the assembly of three-dimensional solids. For example, assembling doors can be achieved by adding alignment constraints between solid surfaces.
[0003] Specifically, in mechanical modeling software, a distinction is typically made between part environments and assembly environments. Two-dimensional constraints are used in the part environment for sketch modeling, and the parameterization of the sketches is used to parameterize the parts. Three-dimensional constraints are used in the assembly environment for assembling parts.
[0004] In Revit, a building modeling software, two-dimensional constraints are used between sketches and various shapes (extrudes, revolves, lofts, blends, loft-blended, and composites). In nested family scenarios, three-dimensional constraints are used between family instances.
[0005] In the aforementioned modeling software, there is a clear distinction between the scenarios in which 2D constraints and 3D constraints are used. When a deformable model is desired, it is necessary to switch to the scenario using 2D sketch constraints; when a rigid body transformation is desired, it is necessary to switch to the scenario using 3D rigid body constraints. Switching back and forth between these two scenarios during the modeling of complex products is tedious and leads to low modeling efficiency. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a modeling method, apparatus, and electronic device to solve the problem of low modeling efficiency caused by switching between two constraint solution scenarios.
[0007] According to a first aspect, embodiments of the present invention provide a modeling method, including:
[0008] Obtain the features, constraints, and dependencies between features in the target model document, where the features are the geometric bodies in the target model that participate in constraint solving;
[0009] A directed graph of dependencies between the features is established based on the dependencies between the features;
[0010] The constraints are grouped based on the directed graph of the dependencies to determine the constrained feature sequence;
[0011] The constraint solution is performed sequentially according to the order of the constrained feature sequence to determine the solution result, so as to establish the target model.
[0012] The modeling method provided in this invention establishes a directed graph of dependencies between features and groups constraints, that is, divides constraints into the feature groups, and realizes the hybrid solution of two-dimensional and three-dimensional constraints. In the process of building the target model, it supports both two-dimensional sketch constraints and three-dimensional rigid body constraints, thereby avoiding switching between the two environments during the modeling process and improving modeling efficiency.
[0013] In conjunction with the first aspect, in the first embodiment of the first aspect, the step of grouping the constraints based on the directed graph of the dependency relationship to determine the constrained feature sequence includes:
[0014] Perform topological sorting on the directed graph of the dependencies to determine the feature sequence;
[0015] Based on the constraint objects corresponding to each constraint, the constraints are added to the corresponding groups of the feature sequence to determine the constrained feature sequence.
[0016] The modeling method provided in this embodiment of the invention can transform a directed graph into a simple sequential structure after topological sorting, since a directed graph is a complex network structure, thus ensuring that the solution result can be determined efficiently and accurately in the future.
[0017] In conjunction with the first embodiment of the first aspect, in the second embodiment of the first aspect, the step of adding the constraints to the corresponding group of the feature sequence based on the constraint objects corresponding to each constraint, and determining the constrained feature sequence, includes:
[0018] Determine whether there are target constraints in the constraints that correspond to different feature-specific objects;
[0019] When the target constraint exists, the target constraint is added to the corresponding group of the sorted constraint objects to determine the constrained feature sequence.
[0020] The modeling method provided in this embodiment of the invention, if the constraint objects corresponding to the constraint belong to different features, then the constraint is placed into the group corresponding to the downstream feature. This enables the upstream feature to drive the downstream feature through the constraint, ensuring the accuracy of the solution.
[0021] In conjunction with the first embodiment of the first aspect, in the third embodiment of the first aspect, the step of performing topological sorting on the directed graph of the dependency relationship to determine the feature sequence includes:
[0022] When the topological sorting fails, a message indicates that a circular dependency exists and cannot be resolved.
[0023] When the topological sorting is successful, the feature sequence is determined.
[0024] The modeling method provided in this embodiment of the invention can determine whether there are circular dependencies that prevent solution by performing topological sorting analysis before solution, thus improving modeling efficiency.
[0025] In conjunction with the first aspect, in the fourth embodiment of the first aspect, the step of sequentially performing constraint calculations according to the order of the constrained feature sequence to determine the solution results in order to establish the target model includes:
[0026] Based on the order of the constrained feature sequence, the constraint objects belonging to other groups referenced by the current group constraint are set to fixed;
[0027] Constraints are solved on the current group to obtain the solution results for the current group, thereby establishing the target model.
[0028] The modeling method provided in this invention considers the constraint objects of other groups as fixed and unchangeable when performing constraint calculations on the current group. That is, when performing constraint calculations on each group, only objects within the group are considered changeable, while all objects outside the group are considered fixed, simplifying the calculation problem. Specifically, upstream features determine the characteristics of this group, so upstream features cannot change; downstream features do not need to change and can change only when the downstream feature group is calculated.
[0029] In conjunction with the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, the step of sequentially performing constraint calculations according to the order of the constrained feature sequence to determine the solution results in order to establish the target model further includes:
[0030] Based on the solution results of the current group, the other groups are updated accordingly.
[0031] Based on the updated results, constraint solving is performed on the next set.
[0032] The modeling method provided in this embodiment of the invention, due to the dependencies between features, updates other groups after the current group is dissolved, which can ensure the accuracy of features of other groups and improve the reliability of the solution results.
[0033] In conjunction with the first aspect, in the sixth embodiment of the first aspect, obtaining the dependencies between features includes:
[0034] Obtain the inherent dependencies between features and the dependencies caused by the constraints;
[0035] The dependencies between features are determined based on the inherent dependencies between the features and the dependencies caused by the constraints.
[0036] The modeling method provided in this embodiment of the invention includes two aspects regarding the dependencies between features: the intrinsic dependencies between features and the dependencies caused by constraints. Combining these two types of dependencies can ensure the accuracy of the modeling results.
[0037] According to a second aspect, embodiments of the present invention also provide a modeling apparatus, comprising:
[0038] The acquisition module is used to acquire features, constraints, and dependencies between features in the target model document, wherein the features are geometric objects in the target model that participate in constraint solving.
[0039] A module is established to build a directed graph of dependencies between the features based on the dependencies between the features;
[0040] The determination module is used to group the constraints based on the directed graph of the dependency relationship and determine the constrained feature sequence;
[0041] The solution module is used to perform constraint solution sequentially according to the order of the constrained feature sequence to determine the solution result, so as to establish the target model.
[0042] The modeling apparatus provided in this embodiment of the invention establishes a directed graph of dependencies between features and groups constraints, that is, divides constraints into the feature groups, and realizes the hybrid solution of two-dimensional and three-dimensional constraints. In the process of building the target model, it supports both two-dimensional sketch constraints and three-dimensional rigid body constraints, thereby avoiding switching between the two environments during the modeling process and improving modeling efficiency.
[0043] According to a third aspect, embodiments of the present invention provide an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the modeling method described in the first aspect or any embodiment of the first aspect.
[0044] According to a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing the computer to perform the modeling method described in the first aspect or any embodiment of the first aspect. Attached Figure Description
[0045] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0046] Figure 1 This is a flowchart of a modeling method according to an embodiment of the present invention;
[0047] Figure 2 This is a flowchart of a modeling method according to an embodiment of the present invention;
[0048] Figure 3 This is a schematic diagram of a directed graph showing the dependencies between features according to an embodiment of the present invention;
[0049] Figure 4 This is a schematic diagram of a constrained feature sequence according to an embodiment of the present invention;
[0050] Figure 5 This is a flowchart of a modeling method according to an embodiment of the present invention;
[0051] Figure 6 This is a structural block diagram of a modeling apparatus according to an embodiment of the present invention;
[0052] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] The modeling method provided in this invention can be applied to mechanical modeling, architectural modeling, or modeling in other scenarios, and its application field is not limited herein. In this modeling method, a constrained feature sequence is established based on the dependencies between features, and each group of features is solved sequentially based on the order of this feature sequence to obtain the solution result, thereby realizing the modeling of the geometric object. By sorting features and grouping constraints, complex feature dependencies and constraints can be divided and conquered, thus transforming an unsolvable problem into a solvable one.
[0055] Based on this, the modeling method can simultaneously take into account both two-dimensional and three-dimensional constraints during the modeling process. That is, it supports both two-dimensional sketch constraints and three-dimensional rigid body constraints in the same environment without the need to switch between the two scenarios, thus improving modeling efficiency.
[0056] According to an embodiment of the present invention, a modeling method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0057] This embodiment provides a modeling method that can be used in electronic devices such as computers, mobile phones, and tablets. Figure 1 This is a flowchart of a modeling method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0058] S11, obtain the features, constraints and dependencies between features in the target model document.
[0059] The features are the geometric bodies in the target model that participate in the constraint solution;
[0060] Specifically, a geometric object or set of geometric objects that can participate in constraint solving as a whole is called a feature, which mainly includes: reference planes, reference lines, sketches, solids, family instances, etc. For modeling software running on electronic devices, it usually provides an interface based on which all reference planes, reference lines, etc. in the target model document can be obtained without reverse identification.
[0061] Constraints are also objects defined in modeling software. Modeling software typically provides interfaces to obtain all constraints in the target model document. These constraints are used to constrain relationships between features, or they can constrain only a single feature.
[0062] Dependencies between features can be defined when defining the features or introduced due to constraints. For example, an extruded body depends on both the profile sketch and the end face sketch; a body of revolution depends on both the profile sketch and the end face sketch; if a curve within a sketch is constrained by a plane outside the sketch, then the sketch depends on the features described by the plane; and so on. The specific dependencies are set according to the actual needs of the target model, and no restrictions are placed on them here.
[0063] For electronic devices, the dependencies between features can be determined by analyzing the target model document; the dependencies between features can also be determined by analyzing the features and constraints; or the dependencies between features can be stored in the electronic device and the electronic device can directly read them to determine the dependencies between features.
[0064] The specifics of this step will be described in detail below.
[0065] S12, Establish a directed graph of dependencies between features based on the dependencies between features.
[0066] After determining the dependencies between features, the electronic device analyzes each feature sequentially and connects them using a directed graph to form a directed graph of the dependencies between features. For example, if feature B depends on feature A (i.e., feature A determines feature B), then a directed edge from feature A to feature B is added to the directed graph.
[0067] S13, group constraints based on the directed graph of dependency relationships to determine the constrained feature sequence.
[0068] A directed dependency graph can represent the relationships between features. Each node in a directed dependency graph includes at least one feature, and each node can be referred to as a group. Specifically, if features are parallel, then that node includes at least two parallel features.
[0069] The electronic device fills each constraint into the corresponding group, so that each group includes a feature and its corresponding constraint. The constraint includes at least one of two-dimensional and three-dimensional constraints.
[0070] After grouping the constraints, a constrained feature sequence can be determined. This constrained feature sequence comprises multiple feature groups, each containing features and constraints that apply to the features within the group.
[0071] The specifics of this step will be described in detail below.
[0072] S14. Constraints are solved sequentially according to the order of the constrained feature sequence to determine the solution results and establish the target model.
[0073] Since the constrained feature sequence is determined based on a directed graph of dependencies, and this graph is directional, there is an order relationship between the feature groups in the resulting constrained feature sequence. Constraints are solved sequentially from top to bottom, determining the corresponding solution results. Because downstream features depend on upstream features, constraint solutions are performed on downstream features only after the solution results for the upstream features are determined.
[0074] Once all feature groups in the constrained feature sequence have been solved, the overall solution can be considered successful, and the corresponding target model can be established. For example, modeling a door depends on modeling the door frame, which in turn depends on modeling the walls, and so on. Therefore, in the modeling process, we can first determine the wall model through constraint solving, then determine the door frame model through constraint solving, and finally determine the door model through constraint solving.
[0075] The specifics of this step will be described in detail below.
[0076] The modeling method provided in this embodiment establishes a directed graph of dependencies between features and groups constraints, that is, divides constraints into the feature groups, and realizes the hybrid solution of two-dimensional and three-dimensional constraints. During the process of building the target model, it supports both two-dimensional sketch constraints and three-dimensional rigid body constraints, thereby avoiding switching between the two environments during the modeling process and improving modeling efficiency.
[0077] This embodiment provides a modeling method that can be used in electronic devices such as computers, mobile phones, and tablets. Figure 2 This is a flowchart of a modeling method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0078] S21, obtain the features, constraints, and dependencies between features in the target model document.
[0079] The features are the geometric bodies in the target model that participate in the constraint solution;
[0080] Please see details Figure 1 S11 of the illustrated embodiment will not be described again here.
[0081] S22, Establish a directed graph of dependencies between features based on the dependencies between features.
[0082] Please see details Figure 1 S12 of the illustrated embodiment will not be described again here.
[0083] S23. Group constraints based on the directed graph of dependency relationships to determine the constrained feature sequence.
[0084] Specifically, S23 above includes:
[0085] S231, Perform topological sorting on the directed graph of dependencies to determine the feature sequence.
[0086] Electronic devices convert a directed graph of dependencies into a sequence of features, which is then topologically sorted to determine an order. Since parallel features have no dependencies on each other, their order doesn't matter and doesn't affect the accuracy of the calculation results. In this feature sequence, features that a particular feature depends on must be listed before that feature.
[0087] Figure 3 An example of a directed graph of dependencies is shown, based on which the determined feature sequence is as follows: Figure 4 As shown. For example, feature FamExtrusion280 depends on features FamSketch282 and FamSketch279. Therefore, in the feature sequence, features FamSketch282 and FamSketch279 are listed before feature FamExtrusion280.
[0088] In some optional embodiments of this example, S231 may include:
[0089] (1) When the topological sorting fails, a circular dependency relationship is indicated that it cannot be solved.
[0090] (2) When the topological sorting is successful, the feature sequence is determined.
[0091] A directed graph of dependencies is a complex network structure. Electronic devices don't know which feature to start computing from, whether there are cyclic dependencies in the directed graph that prevent solving the problem, or whether all upstream features it depends on have been computed when computing a certain feature. After topological sorting, the directed graph can be transformed into a simple sequential structure. As mentioned above, "if the topological sorting fails, it indicates the existence of cyclic dependencies that cannot be solved; if the sorting succeeds, an ordered sequence of features will be obtained."
[0092] By performing topological sorting analysis before solving, it is possible to determine whether there are circular dependencies that prevent solving. The reason for the failure can be determined before solving, without having to go through the solving process, thus improving modeling efficiency.
[0093] S232, Based on the constraint objects corresponding to each constraint, add the constraints to the corresponding groups of the feature sequence to determine the constrained feature sequence.
[0094] The electronic device adds constraints to corresponding groups based on the characteristics described in the constraint objects corresponding to each constraint; that is, it groups the constraints. Based on this, subsequent constraint solving can be performed sequentially according to the dependencies between groups.
[0095] In some optional implementations of this embodiment, S232 may include:
[0096] (1) Determine whether there are target constraints in the constraints that correspond to different features;
[0097] If the target constraint exists, proceed to step (2); otherwise, add the constraint directly to the corresponding group of the constraint object.
[0098] (2) Add the target constraint to the corresponding group of the sorted constraint objects to determine the constrained feature sequence.
[0099] Specifically, when placing each constraint into the group corresponding to its respective feature, if the constraint objects belong to different features, then this constraint is placed into the group corresponding to the downstream feature. This allows the upstream feature to drive the downstream feature through constraints. If the target constraint has two constraint objects, after topological sorting, the feature whose constraint object belongs to later is the downstream feature, and the one whose constraint object belongs to earlier is the upstream feature.
[0100] If the constraint objects belong to different features, then the constraint is placed into the group corresponding to the downstream feature. This allows the upstream feature to drive the downstream feature through the constraint, ensuring the accuracy of the solution.
[0101] S24. Constraints are solved sequentially according to the order of the constrained feature sequence to determine the solution results and establish the target model.
[0102] Please see details Figure 1 S14 of the illustrated embodiment will not be described again here.
[0103] The modeling method provided in this embodiment, since a directed graph is a complex network structure, can be transformed into a simple sequential structure after topological sorting, which can ensure that the solution result can be determined efficiently and accurately in the future.
[0104] This embodiment provides a modeling method that can be used in electronic devices such as computers, mobile phones, and tablets. Figure 5 This is a flowchart of a modeling method according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps:
[0105] S31, obtain the features, constraints and dependencies between features in the target model document.
[0106] The features are the geometric bodies in the target model that participate in the constraint solution;
[0107] Specifically, S31 includes:
[0108] S311, Obtain the features and constraints from the target model document.
[0109] Modeling software running on electronic devices typically provides an interface through which all reference planes, reference lines, and constraints in the target model document can be obtained without reverse identification.
[0110] S312, obtain the inherent dependencies between features and the dependencies caused by constraints.
[0111] S313. Determine the dependencies between features based on the inherent dependencies between features and the dependencies caused by constraints.
[0112] Dependencies are predefined within the modeling software and can be directly used when creating directed graphs of dependencies. Downstream features always depend on upstream features; that is, changes in upstream features can drive changes in downstream features, but changes in downstream features cannot drive changes in upstream features. Specifically, there are two main types of dependencies between features:
[0113] 1) Intrinsic dependencies between features
[0114] Extruded bodies depend on the profile sketch and the end face sketch.
[0115] Solids of revolution depend on profile sketches and end face sketches.
[0116] Lofted bodies depend on profile sketches, and profile sketches depend on path sketches.
[0117] If you pick the created lofted body path, the lofted body path sketch depends on the entity to which the picked edge belongs.
[0118] The merged body depends on the top outline sketch, bottom outline sketch, and end face sketch.
[0119] The composite depends on its individual components.
[0120] There is no inherent dependency between the family instance and the imported entity.
[0121] 2) Dependencies arising from constraints
[0122] If a curve inside a sketch is constrained by an outer plane (reference plane or face of a solid), then the sketch depends on the feature (reference plane or solid) to which the plane belongs.
[0123] If two faces outside the sketch (referencing a plane or solid face) are constrained, then the feature to which the second face belongs depends on the feature to which the first face belongs.
[0124] S32, establish a directed graph of dependencies between features based on the dependencies between features.
[0125] Please see details Figure 2 S22 of the illustrated embodiment will not be described again here.
[0126] S33. Group constraints based on the directed graph of dependency relationships to determine the constrained feature sequence.
[0127] Please see details Figure 2 S23 of the illustrated embodiment will not be described again here.
[0128] S34. Constraints are solved sequentially according to the order of the constrained feature sequence to determine the solution results and establish the target model.
[0129] Specifically, S34 includes:
[0130] S341, based on the solution results of the current group, perform correlation updates on other groups.
[0131] The electronic device performs constraint calculations on each feature group sequentially according to the order of the constrained feature sequence. After calculating the constraint of the current group according to the order of the feature groups and obtaining the calculation result, it updates the other groups accordingly to obtain the updated result.
[0132] S342, based on the updated results, perform constraint solving on the next set.
[0133] After each feature group is solved, an association update is performed first, and then the constraint solution for the next feature group is performed. The overall solution is considered successful only when all feature groups are successfully solved. After the overall solution, the model with added constraints or modified constraint values is obtained, and the shape and position of geometric objects in the model will change.
[0134] Take the door assembly process as an example: Originally, there was no constraint relationship between the door frame and the wall, and the two were placed arbitrarily. After adding alignment constraints to the three sets of faces of the door frame and the wall respectively, the door frame is installed on the wall, and when the wall moves, the door frame will move with the wall.
[0135] In some optional embodiments of this example, S34 may further include:
[0136] (1) Based on the order of the constrained feature sequence, set the constraint objects of other groups referenced by the current group constraint to be fixed.
[0137] (2) Perform constraint calculations on the current group to obtain the calculation results of the current group in order to establish the target model.
[0138] When solving constraints for the current group, the constraint objects of other groups are considered fixed and cannot be changed. That is, when solving constraints for each group, only objects within the group are considered changeable, while all objects outside the group are considered fixed, simplifying the problem. In other words, upstream features determine the characteristics of this group, so upstream features cannot change; downstream features do not need to change and can change only when solving for the downstream feature group.
[0139] The modeling method provided in this embodiment addresses the dependencies between features in two ways: intrinsic dependencies and dependencies arising from constraints. Combining these two types of dependencies ensures the accuracy of the modeling results. Because features are dependent on each other, updating other groups after the current group is solved ensures the accuracy of features in other groups and improves the reliability of the solution results.
[0140] The modeling method provided in this invention describes how to use two-dimensional constraints and three-dimensional constraints simultaneously in the same environment in upper-level applications. This eliminates the need to distinguish between part modeling and assembly environments, avoids switching between the two environments, and improves modeling efficiency.
[0141] This embodiment also provides a modeling apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0142] This embodiment provides a modeling device, such as Figure 6 As shown, it includes:
[0143] The acquisition module 41 is used to acquire features, constraints and dependencies between features in the target model document, wherein the features are geometric bodies in the target model that participate in constraint solving.
[0144] Module 42 is used to establish a directed graph of dependencies between the features based on the dependencies between the features;
[0145] The determination module 43 is used to group the constraints based on the directed graph of the dependency relationship and determine the constrained feature sequence;
[0146] The solution module 44 is used to perform constraint solution sequentially according to the order of the constrained feature sequence to determine the solution result, so as to establish the target model.
[0147] The modeling device provided in this embodiment establishes a directed graph of dependencies between features and groups constraints, that is, divides constraints into the feature groups, and realizes the hybrid solution of two-dimensional and three-dimensional constraints. During the process of building the target model, it supports both two-dimensional sketch constraints and three-dimensional rigid body constraints, thereby avoiding switching between the two environments during the modeling process and improving modeling efficiency.
[0148] In this embodiment, the modeling device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0149] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0150] This invention also provides an electronic device having the above-described features. Figure 6 The modeling apparatus shown.
[0151] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 7 As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, and at least one communication bus 52. The communication bus 52 is used to enable communication between these components. The communication interface 53 may include a display screen or a keyboard; optionally, the communication interface 53 may also include a standard wired interface or a wireless interface. The memory 54 may be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 54 may also be at least one storage device located remotely from the aforementioned processor 51. The processor 51 may be combined with... Figure 6 The described apparatus has an application program stored in memory 54, and the processor 51 calls the program code stored in memory 54 to perform any of the above method steps.
[0152] The communication bus 52 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0153] The memory 54 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 54 may also include a combination of the above types of memory.
[0154] The processor 51 can be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
[0155] The processor 51 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0156] Optionally, memory 54 is also used to store program instructions. Processor 51 can invoke program instructions to implement the modeling method as shown in any embodiment of this application.
[0157] This invention also provides a non-transitory computer storage medium storing computer-executable instructions that can execute the modeling methods in any of the above-described method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0158] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A modeling method, characterized in that, Applied in modeling software, including: Obtain the features, constraints, and dependencies between features in the target model document, where the features are the geometric bodies in the target model that participate in constraint solving; A directed graph of dependencies between the features is established based on the dependencies between the features; The constraints are grouped based on the directed graph of the dependencies to determine the constrained feature sequence; The constraint solution is performed sequentially according to the order of the constrained feature sequence to determine the solution result, so as to establish the target model; The step of grouping the constraints based on the directed graph of the dependency relationship to determine the constrained feature sequence includes: Perform topological sorting on the directed graph of the dependencies to determine the feature sequence; Based on the constraint objects corresponding to each constraint, the constraints are added to the corresponding groups of the feature sequence to determine the constrained feature sequence.
2. The method according to claim 1, characterized in that, The step of adding the constraints to the corresponding group of the feature sequence based on the constraint objects corresponding to each constraint, and determining the constrained feature sequence, includes: Determine whether there are target constraints in the constraints that correspond to different feature-specific objects; When the target constraint exists, the target constraint is added to the corresponding group of the sorted constraint objects to determine the constrained feature sequence.
3. The method according to claim 1, characterized in that, The topological sorting of the directed graph of dependencies to determine the feature sequence includes: When the topological sorting fails, a message indicates that a circular dependency exists and cannot be resolved. When the topological sorting is successful, the feature sequence is determined.
4. The method according to claim 1, characterized in that, The step of sequentially solving the constraints according to the order of the constrained feature sequence to determine the solution result, in order to establish the target model, includes: Based on the order of the constrained feature sequence, the constraint objects belonging to other groups referenced by the current group constraint are set to fixed; Constraints are solved on the current group to obtain the solution results for the current group, thereby establishing the target model.
5. The method according to claim 4, characterized in that, The step of sequentially solving the constraints according to the order of the constrained feature sequence to determine the solution result and establish the target model further includes: Based on the solution results of the current group, the other groups are updated accordingly. Based on the updated results, constraint solving is performed on the next set.
6. The method according to claim 1, characterized in that, To obtain the dependencies between features, including: Obtain the inherent dependencies between features and the dependencies caused by the constraints; The dependencies between features are determined based on the inherent dependencies between the features and the dependencies caused by the constraints.
7. A modeling apparatus, characterized in that, Applied in modeling software, including: The acquisition module is used to acquire features, constraints, and dependencies between features in the target model document, wherein the features are geometric objects in the target model that participate in constraint solving. A module is established to build a directed graph of dependencies between the features based on the dependencies between the features; The determination module is used to group the constraints based on the directed graph of the dependency relationship and determine the constrained feature sequence; The solution module is used to perform constraint solution sequentially according to the order of the constrained feature sequence to determine the solution result, so as to establish the target model; The step of grouping the constraints based on the directed graph of the dependency relationship to determine the constrained feature sequence includes: Perform topological sorting on the directed graph of the dependencies to determine the feature sequence; Based on the constraint objects corresponding to each constraint, the constraints are added to the corresponding groups of the feature sequence to determine the constrained feature sequence.
8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the modeling method of any one of claims 1-6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the modeling method according to any one of claims 1-6.
Citation Information
Patent Citations
Designing industrial products by using geometries connected by geometrical constraints
CA2885032A1