CN116029004A - Modeling method and device and electronic equipment - Google Patents
Modeling method and device and electronic equipment Download PDFInfo
- Publication number
- CN116029004A CN116029004A CN202111258142.4A CN202111258142A CN116029004A CN 116029004 A CN116029004 A CN 116029004A CN 202111258142 A CN202111258142 A CN 202111258142A CN 116029004 A CN116029004 A CN 116029004A
- Authority
- CN
- China
- Prior art keywords
- constraint
- constraints
- dependency relationship
- feature
- features
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the technical field of computer aided design, in particular to a modeling method, a modeling device and electronic equipment, wherein the method comprises the steps of obtaining characteristics and constraints in a target model document and obtaining a dependency relationship among the characteristics, wherein the characteristics are geometric bodies participating in constraint calculation in the target model; establishing a dependency relationship directed graph between the features based on the dependency relationship between the features; grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints; and sequentially carrying out constraint solving and determining a solving result according to the sequence of the feature sequence with the constraint so as to establish the target model. The dependency relationship directed graph is established through the dependency relationship among the features, the constraint is grouped, the mixed solution of the two-dimensional constraint and the three-dimensional constraint is realized, and the two-dimensional sketch constraint and the three-dimensional rigid constraint are supported in the process of establishing the target model, so that the two environments are prevented from being switched back and forth in the modeling process, and the modeling efficiency is improved.
Description
Technical Field
The invention relates to the technical field of computer aided design, in particular to a modeling method, a modeling device and electronic equipment.
Background
Parametric modeling and constraint solution are important features of modern Computer-Aided Design (Computer-Aided Design) software. Constraints can be divided into two classes according to the spatial dimension in which the participating constraint objects are located: two-dimensional constraints and three-dimensional constraints. The two-dimensional constraint refers to constraint among two-dimensional curves in the sketch, and all the two-dimensional curves and the constraint are in the same plane. Three-dimensional constraints refer to constraints that involve three-dimensional geometry outside of the sketch, and objects involved in constraints and constraints may not be in the same plane. Three-dimensional constraints contain two layers of meaning: firstly, the constraint object is not only limited to a two-dimensional curve in a sketch, but also supports three-dimensional geometry to participate in constraint. For example: distance constraint of the two-dimensional straight line segment in the sketch and the three-dimensional solid surface outside the sketch. And secondly, constraints can be applied between the three-dimensional geometric bodies to drive the three-dimensional geometric bodies to perform rigid transformation, so that the assembly of the three-dimensional entities can be realized. For example: door assembly may be accomplished by adding alignment constraints between physical surfaces, etc.
In particular, in mechanical class modeling software, it is common to distinguish part environments from assembly environments. Two-dimensional constraints are used in the part environment for sketch modeling, and parameterization of the part is achieved through parameterization of the sketch. Three-dimensional constraints are used in the assembly environment for assembly between parts.
In the building modeling software Revit, two-dimensional constraints are used between the sketch and each of the shapes (drawing body, rotating body, lofting body, fusion body, lofting fusion body, assembly body). In the context of nested families, three-dimensional constraints are used between family instances.
In the modeling software, the scenes used by the two-dimensional constraint and the three-dimensional constraint are obviously distinguished, and when the model is expected to be deformable, the scene is required to be switched to the scene solved by using the two-dimensional sketch constraint; when a rigid body transformation of the model is desired, a switch is required to a scene using three-dimensional rigid body constraint solution. In the modeling process of a complex product, switching back and forth between two scenes is a complicated matter, so that the modeling efficiency is low.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a modeling method, a device and an electronic device, so as to solve the problem of low modeling efficiency caused by switching of two constraint resolving scenes.
According to a first aspect, an embodiment of the present invention provides a modeling method, including:
acquiring characteristics, constraints and dependency relations among the characteristics in a target model document, wherein the characteristics are geometrical bodies participating in constraint calculation in the target model;
establishing a dependency relationship directed graph between the features based on the dependency relationship between the features;
grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints;
and sequentially carrying out constraint solving and determining a solving result according to the sequence of the feature sequence with the constraint so as to establish the target model.
According to the modeling method provided by the embodiment of the invention, the dependency relationship directed graph is built through the dependency relationship among the features, the constraint is grouped, namely, the constraint is divided into the feature groups, so that the mixed solution of the two-dimensional constraint and the three-dimensional constraint is realized, the two-dimensional sketch constraint and the three-dimensional rigid body constraint are supported in the process of building the target model, the two-dimensional sketch constraint and the three-dimensional rigid body constraint are avoided, and the modeling efficiency is improved.
With reference to the first aspect, in a first implementation manner of the first aspect, the grouping the constraints based on the dependency graph, determining a feature sequence with constraints includes:
performing topological sorting on the dependency relationship directed graph to determine a feature sequence;
and adding the constraint into the corresponding group of the feature sequences based on constraint objects corresponding to the constraints, and determining the feature sequences with the constraint.
According to the modeling method provided by the embodiment of the invention, the directed graph is of a complex network structure, and after topological sorting, the directed graph can be converted into a simple sequence structure, so that the subsequent efficient and accurate determination of a resolving result can be ensured.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the adding the constraint to the corresponding group of feature sequences based on constraint objects corresponding to each constraint, determining a feature sequence with the constraint includes:
judging whether the corresponding constraint objects respectively belong to target constraints with different characteristics in the constraints;
when the target constraint exists, adding the target constraint to a corresponding group of constraint objects ordered later to determine the feature sequence with the constraint.
According to the modeling method provided by the embodiment of the invention, if constraint objects corresponding to the constraints respectively belong to different features, the constraints are put into the groups corresponding to the downstream features, so that the upstream features can drive the downstream features through the constraints, and the accuracy of calculation is ensured.
With reference to the first implementation manner of the first aspect, in a third implementation manner of the first aspect, the topologically ordering the dependency graph, determining a feature sequence includes:
when the topological ordering is unsuccessful, prompting that a cyclic dependency relationship exists and cannot be solved;
and when the topological sorting is successful, determining the characteristic sequence.
According to the modeling method provided by the embodiment of the invention, before resolving, by carrying out topological sorting analysis on the modeling method, whether the situation that the cyclic dependency relationship exists and the modeling method cannot be resolved can be determined, and the reason of resolving failure can be determined before resolving without resolving processing, so that the modeling efficiency is improved.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the sequentially performing constraint solving to determine a solution result according to an order of the feature sequence with constraint, so as to build the target model, includes:
setting constraint objects belonging to other groups referenced by the constraint of the current group to be fixed based on the sequence of the feature sequence with the constraint;
and carrying out constraint resolving on the current group to obtain a resolving result of the current group so as to establish the target model.
According to the modeling method provided by the embodiment of the invention, when constraint solution is carried out on the current group, constraint objects of other groups are considered to be fixed and cannot be changed. That is, when constraint solving is performed on each group, only the objects within the group are considered to be changeable, and all the objects outside the group are considered to be fixed, simplifying the solving problem. That is, the upstream feature determines the set of features, so the upstream feature cannot change; the downstream feature does not need to be changed, and the downstream feature group is calculated and then changed.
With reference to the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the sequentially performing constraint solving according to the order of the feature sequence with constraint to determine a solution result, so as to establish the target model, further includes:
based on the resolving result of the current group, carrying out association updating on other groups;
and carrying out constraint resolving on the next group based on the result after the association updating.
According to the modeling method provided by the embodiment of the invention, due to the fact that the dependency relationship exists among the features, the other groups are associated and updated after the current group is decomposed, so that the accuracy of the features of the other groups can be ensured, and the reliability of the calculation result is improved.
With reference to the first aspect, in a sixth implementation manner of the first aspect, acquiring a dependency relationship between features includes:
acquiring an intrinsic dependency relationship among features and a dependency relationship brought by the constraint;
and determining the dependency relationship among the features based on the intrinsic dependency relationship among the features and the dependency relationship brought by the constraint.
The modeling method provided by the embodiment of the invention comprises two aspects of the dependency relationship among the features, namely the internal dependency relationship among the features and the dependency relationship caused by the constraint, and the accuracy of the modeling result can be ensured by combining the two dependency relationships.
According to a second aspect, an embodiment of the present invention further provides a modeling apparatus, including:
the acquisition module is used for acquiring characteristics, constraints and dependency relations among the acquired characteristics in the target model document, wherein the characteristics are geometric bodies participating in constraint calculation in the target model;
the building module is used for building a dependency relationship directed graph among the features based on the dependency relationship among the features;
the determining module is used for grouping the constraints based on the dependency relationship directed graph and determining a feature sequence with the constraints;
and the resolving module is used for sequentially carrying out constraint resolving according to the sequence of the feature sequence with the constraint to determine a resolving result so as to establish the target model.
According to the modeling device provided by the embodiment of the invention, the dependency relationship directed graph is built through the dependency relationship among the features, the constraints are grouped, namely, the constraints are divided into the feature groups, so that the mixed solution of the two-dimensional and three-dimensional constraints is realized, and in the process of building the target model, the two-dimensional sketch constraints and the three-dimensional rigid body constraints are supported, so that the two environments are prevented from being switched back and forth in the modeling process, and the modeling efficiency is improved.
According to a third aspect, an embodiment of the present invention provides an electronic device, including: the modeling method comprises the steps of storing computer instructions in a memory and a processor, wherein the memory and the processor are in communication connection, and the processor executes the computer instructions, so that the modeling method in the first aspect or any implementation manner of the first aspect is executed.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to perform the modeling method of the first aspect or any implementation manner of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a modeling method according to an embodiment of the invention;
FIG. 2 is a flow chart of a modeling method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a directed graph of dependencies between features according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a constrained feature sequence according to an embodiment of the invention;
FIG. 5 is a flow chart of a modeling method according to an embodiment of the invention;
FIG. 6 is a block diagram of a modeling apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The modeling method provided by the embodiment of the invention can be applied to mechanical modeling, building modeling or modeling under other scenes, and the application field is not limited in any way. In the modeling method, a feature sequence with constraint is established based on the dependency relationship among features, and the features of each group are sequentially resolved based on the sequence of the feature sequence, so that a resolving result can be obtained, and the modeling of the geometric body is realized. By sorting the features and grouping the constraints, the complex feature dependency relationship and the constraint relationship can be divided into two, so that the problem which can not be solved is changed into a problem which can be solved.
Based on the method, the modeling method enables two-dimensional constraint and three-dimensional constraint to be simultaneously considered in the modeling process, namely, two-dimensional sketch constraint and three-dimensional rigid body constraint are supported in the same environment, switching is not needed in two scenes, and modeling efficiency is improved.
According to an embodiment of the present invention, a modeling method embodiment is provided, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
In this embodiment, a modeling method is provided, which may be used in an electronic device, such as a computer, a mobile phone, a tablet computer, etc., fig. 1 is a flowchart of a modeling method according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
s11, acquiring the characteristics, the constraint and the dependency relationship among the characteristics in the target model document.
Wherein the feature is a geometry in the target model that participates in constraint solving;
specifically, a geometric body or a set of geometric bodies capable of participating in constraint solving as a whole is referred to as a feature, which mainly includes: reference planes, reference lines, sketches, entities, family instances, etc. Modeling software running on an electronic device typically provides an interface based on which all reference planes, reference lines, etc. in a target model document can be obtained without the need for reverse recognition.
Constraints are also an object defined in modeling software, where interfaces are typically provided, all constraints in the target model document being available. Wherein the constraint is used to constrain the relationship between features, or may constrain only a single feature.
The dependency relationship between features may be defined when defining features, or may be caused by the introduction of constraints. For example, the tensile body depends on the contour sketch and the end sketch, and the rotating body depends on the contour sketch and the end sketch; the sketch inner curve has constraint with the sketch outer plane, and the sketch depends on the characteristics of the plane; etc. The specific dependency relationship is set according to the actual requirement of the target model, and is not limited in any way.
For the electronic equipment, the dependency relationship among the features can be determined by analyzing the target model document; the characteristics and the constraint can be analyzed, and the dependency relationship among the characteristics can be determined; or, the dependency relationship among the features is stored in the electronic equipment, and the dependency relationship among the features can be determined by directly reading the dependency relationship by the electronic equipment.
This step will be described in detail later in detail.
S12, building a dependency relationship directed graph between features based on the dependency relationship between the features.
After the electronic equipment determines the dependency relationship among the features, each feature is analyzed in turn, and each feature is connected in a directed graph mode, so that a dependency relationship directed graph among the features is formed. For example, if feature B depends on feature a (i.e., feature a determines feature B), a directed edge is added to the directed graph from feature a to feature B.
S13, grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints.
The dependency graph may characterize inter-feature relationships, where each node in the dependency graph includes at least one feature, which may be referred to herein as a group. Wherein if the features are juxtaposed, then at least two features are juxtaposed at the node.
The electronic device fills the respective constraints into respective groups such that features and their corresponding constraints are included in each group. Wherein the constraint comprises at least one of a two-dimensional constraint and a three-dimensional constraint.
After grouping the constraints, a sequence of features with constraints may be determined. The feature sequence with the constraint comprises a plurality of feature groups, wherein each feature group comprises features and constraints, and the constraints are used for constraining the features in the group.
This step will be described in detail later in detail.
S14, sequentially carrying out constraint solving according to the sequence of the feature sequence with the constraint to determine a solving result so as to establish a target model.
Because the constrained feature sequence is determined based on the dependency directed graph, which is directional, there is a sequential relationship between the feature sets in the resulting constrained feature sequence. And sequentially carrying out constraint calculation on the feature sequences to be constrained according to the sequence from top to bottom, and determining a corresponding calculation result. Since the downstream feature is dependent on the upstream feature, constraint solving is performed on the downstream feature after the determination of the result of the solving of the upstream feature.
After all feature groups in the feature sequence with constraint are completely resolved, the success of the overall resolving can be determined, and a corresponding target model can be established. For example, modeling of a door depends on modeling of a door frame, while modeling of a door frame has modeling that depends on a wall, and so on. Then, in the modeling process, the model of the wall body can be determined by constraint solution, then the model of the door frame is determined by constraint solution on the basis, and finally the model of the door is determined by constraint solution.
This step will be described in detail later in detail.
According to the modeling method provided by the embodiment, the dependency relationship directed graph is built through the dependency relationship among the features, the constraints are grouped, namely, the constraints are divided into the feature groups, the mixed solution of the two-dimensional constraints and the three-dimensional constraints is realized, and in the process of building the target model, the two-dimensional sketch constraints and the three-dimensional rigid body constraints are supported, so that the two environments are prevented from being switched back and forth in the modeling process, and the modeling efficiency is improved.
In this embodiment, a modeling method is provided, which may be used in an electronic device, such as a computer, a mobile phone, a tablet computer, etc., fig. 2 is a flowchart of the modeling method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
s21, acquiring the characteristics, the constraint and the dependency relationship among the characteristics in the target model document.
Wherein the feature is a geometry in the target model that participates in constraint solving;
please refer to S11 in the embodiment shown in fig. 1 in detail, which is not described herein.
S22, building a dependency relationship directed graph between features based on the dependency relationship between the features.
Please refer to the embodiment S12 shown in fig. 1 in detail, which is not described herein.
S23, grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints.
Specifically, the step S23 includes:
s231, topological ordering is carried out on the dependency relationship directed graph, and the feature sequence is determined.
The electronic device converts the dependency graph into a feature sequence, and a sequence is determined after topological sorting processing. Since the parallel features have no dependency relationship with each other, who can go before and after the feature can be done, and the accuracy of the calculation result is not affected. In the sequence of features, a feature on which a feature depends must be arranged before the feature.
Fig. 3 shows an example of a dependency graph, based on which the determined feature sequence is shown in fig. 4. For example, feature FamExtrusion280 depends on feature famsktech 282 and feature famsktech 279, and thus feature famsktech 282 and feature famsktech 279 are arranged before feature FamExtrusion280 in the feature sequence.
In some optional implementations of this embodiment, the step S231 may include:
(1) And when the topological ordering is unsuccessful, prompting that the cyclic dependency relationship exists and cannot be solved.
(2) And when the topological sorting is successful, determining the characteristic sequence.
The dependency graph is a complex network structure, the electronic device does not know from which feature to start calculation, does not know whether the dependency graph has circular dependency, which can not be solved, and does not know whether the upstream feature on which the dependency graph depends is calculated when a feature is calculated. After topology ordering, the directed graph can be converted into a simple sequence structure, and as described above, "when topology ordering is unsuccessful, the existence of a cyclic dependency relationship is prompted to be incapable of being resolved; when the sorting is successful, an ordered feature sequence is obtained.
By carrying out topological sorting analysis on the solution before the solution, whether the situation that the solution cannot be carried out due to the cyclic dependency relationship exists can be determined, the reason of the solution failure can be determined before the solution, the solution processing is not needed, and the modeling efficiency is improved.
S232, adding the constraint into a corresponding group of the feature sequences based on constraint objects corresponding to the respective constraints, and determining the feature sequences with the constraint.
And the electronic equipment adds the constraints into the corresponding groups according to the characteristics of the constraint objects corresponding to the constraints, namely grouping the constraints. Based on this, constraint solving can be sequentially performed according to the dependency relationship between groups.
In some optional implementations of this embodiment, the step S232 may include:
(1) Judging whether the corresponding constraint objects respectively belong to target constraints with different characteristics in the constraints;
when the target constraint exists, performing step (2); otherwise, the constraint is directly added to the corresponding group of constraint objects.
(2) The target constraints are added to the corresponding set of constraint objects ordered later to determine a feature sequence with constraints.
Specifically, in putting each constraint into a group corresponding to the belonging feature, if constraint objects of a certain constraint respectively belong to different features, this constraint is put into a group corresponding to the downstream feature, so that the upstream feature can drive the downstream feature by the constraint. If the target constraint has two constraint objects, after topological sorting, the feature to which the two constraint objects belong is ranked behind, and the feature to which the two constraint objects belong is the downstream feature. Who is in front and who is the upstream feature.
If constraint objects corresponding to the constraints respectively belong to different features, the constraints are put into a group corresponding to the downstream features, so that the upstream features can drive the downstream features through the constraints, and the accuracy of calculation is ensured.
S24, sequentially carrying out constraint solving according to the sequence of the feature sequence with the constraint to determine a solving result so as to establish a target model.
Please refer to the embodiment S14 in fig. 1 in detail, which is not described herein.
According to the modeling method provided by the embodiment, the directed graph is of a complex network structure, and after topological sorting, the directed graph can be converted into a simple sequence structure, so that the subsequent efficient and accurate determination of a resolving result can be ensured.
In this embodiment, a modeling method is provided, which may be used in an electronic device, such as a computer, a mobile phone, a tablet computer, etc., and fig. 5 is a flowchart of the modeling method according to an embodiment of the present invention, as shown in fig. 5, where the flowchart includes the following steps:
s31, acquiring the characteristics, the constraint and the dependency relationship among the characteristics in the target model document.
Wherein the feature is a geometry in the target model that participates in constraint solving;
specifically, the step S31 includes:
s311, obtaining the characteristics and the constraints in the target model document.
An interface is typically provided in modeling software running on the electronic device through which all reference planes, reference lines, constraints, etc. in the target model document can be obtained without the need for reverse recognition.
S312, acquiring the intrinsic dependency relationship among the features and the dependency relationship brought by the constraint.
S313, determining the dependency relationship among the features based on the intrinsic dependency relationship among the features and the dependency relationship brought by the constraint.
The dependency relationship is well defined in modeling software, and can be directly used later when a dependency relationship directed graph is created. The downstream feature is always dependent on the upstream feature, i.e. the downstream feature can be driven after the upstream feature changes, but the upstream feature cannot be driven after the downstream feature changes. Specifically, the dependency relationship between features mainly includes the following two types:
1) Inter-feature intrinsic dependencies
The stretching body depends on the outline sketch and the end sketch
The rotary body being dependent on contour sketches and end sketches
The loft body depends on a contour sketch, and the contour sketch depends on a path sketch
Picking up the created layout path, the layout path sketch depends on the entity to which the picked edge belongs
Fusion relies on top, bottom and end sketches
The combination being dependent on the individual sub-bodies
The family instance and the imported entity have no intrinsic dependency
2) Dependency from constraint
The sketch inner curve is constrained with the sketch outer plane (the plane of reference or entity), and the sketch depends on the characteristics (the plane of reference or entity) of the plane;
the two surfaces outside the sketch (reference planes or solid surfaces) are constrained, and the feature to which the second surface belongs depends on the feature to which the first surface belongs.
S32, building a dependency relationship directed graph between features based on the dependency relationship between the features.
Please refer to the embodiment S22 shown in fig. 2 in detail, which is not described herein.
S33, grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints.
Please refer to the embodiment S23 shown in fig. 2 in detail, which is not described herein.
S34, sequentially carrying out constraint solving according to the sequence of the feature sequence with the constraint to determine a solving result so as to establish a target model.
Specifically, the step S34 includes:
and S341, carrying out association update on other groups based on the resolving result of the current group.
And the electronic equipment sequentially performs constraint solving on each feature group according to the sequence of each feature group in the feature sequence with the constraint. And carrying out constraint resolving on the current group according to the sequence of each feature group, and carrying out association updating on other groups after a resolving result is obtained to obtain an updating result.
S342, based on the result after the association update, constraint calculation is performed on the next group.
After each feature group is resolved, the association update is executed first, and then the constraint resolving of the next feature group is carried out. Only if all feature sets are successfully resolved is the overall solution considered successful. After the overall solution, a model is obtained after adding constraints or modifying constraint values, and the shape and position of the geometric object in the model can be changed.
Taking the assembly process of a door as an example: originally, the door frame and the wall have no constraint relation, the door frame and the wall are placed at will, and when alignment constraint is added to three groups of surfaces of the door frame and the wall respectively, the door frame is arranged on the wall, and when the wall moves, the door frame moves along with the wall.
In some optional implementations of this embodiment, the step S34 may further include:
(1) Constraint objects belonging to other groups referenced by the current group constraint are set to be fixed based on the order of the feature sequence with the constraint.
(2) And carrying out constraint resolving on the current group to obtain a resolving result of the current group so as to establish a target model.
When constraint solutions are performed on the current group, constraint objects of other groups are considered to be fixed and cannot be changed. That is, when constraint solving is performed on each group, only the objects within the group are considered to be changeable, and all the objects outside the group are considered to be fixed, simplifying the solving problem. That is, the upstream feature determines the set of features, so the upstream feature cannot change; the downstream feature does not need to be changed, and the downstream feature group is calculated and then changed.
The modeling method provided by the embodiment includes two aspects, namely, the internal dependency relationship among the features and the dependency relationship brought by the constraint, for the dependency relationship among the features, and the accuracy of the modeling result can be ensured by combining the two dependency relationships. Because the features have a dependency relationship, the other groups are associated and updated after the calculation of the current group is completed, so that the accuracy of the features of the other groups can be ensured, and the reliability of the calculation result is improved.
The modeling method provided by the embodiment of the invention describes how to use two-dimensional constraint and three-dimensional constraint simultaneously in the same environment in upper layer application, can realize that the part modeling and assembly environments are not distinguished any more, avoids switching in the two environments, and improves the modeling efficiency.
In this embodiment, a modeling apparatus is further provided, and the modeling apparatus is used to implement the foregoing embodiments and preferred implementations, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a modeling apparatus, as shown in fig. 6, including:
the obtaining module 41 is configured to obtain features, constraints, and obtain a dependency relationship between features in a target model document, where the features are geometric bodies in the target model that participate in constraint solution;
a building module 42, configured to build a dependency graph between the features based on the dependency between the features;
a determining module 43, configured to group the constraints based on the dependency graph, and determine a feature sequence with constraints;
and a resolving module 44, configured to sequentially perform constraint resolving according to the order of the feature sequences with constraints, so as to determine a resolving result, so as to establish the target model.
According to the modeling device provided by the embodiment, the dependency relationship directed graph is built through the dependency relationship among the features, the constraints are grouped, namely, the constraints are divided into the feature groups, the mixed solution of the two-dimensional constraints and the three-dimensional constraints is realized, and in the process of building the target model, the two-dimensional sketch constraints and the three-dimensional rigid body constraints are supported, so that the two environments are prevented from being switched back and forth in the modeling process, and the modeling efficiency is improved.
The modeling means in this embodiment are presented in the form of functional units, where units refer to ASIC circuits, processors and memories executing one or more software or firmware programs, and/or other devices that can provide the functionality described above.
Further functional descriptions of the above respective modules are the same as those of the above corresponding embodiments, and are not repeated here.
The embodiment of the invention also provides electronic equipment, which is provided with the modeling device shown in the figure 6.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, and as shown in fig. 7, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit ), at least one communication interface 53, a memory 54, at least one communication bus 52. Wherein the communication bus 52 is used to enable connected communication between these components. The communication interface 53 may include a Display screen (Display) and a Keyboard (Keyboard), and the selectable communication interface 53 may further include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 54 may alternatively be at least one memory device located remotely from the aforementioned processor 51. Wherein the processor 51 may be in conjunction with the apparatus described in fig. 6, the memory 54 stores an application program, and the processor 51 invokes the program code stored in the memory 54 for performing any of the method steps described above.
The communication bus 52 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The communication bus 52 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 7, but not only one bus or one type of bus.
Wherein the memory 54 may include volatile memory (english) such as random-access memory (RAM); the memory may also include a nonvolatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated as HDD) or a solid state disk (english: solid-state drive, abbreviated as SSD); memory 54 may also include a combination of the types of memory described above.
The processor 51 may be a central processor (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP.
The processor 51 may further include a hardware chip, among others. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof (English: programmable logic device). The PLD may be a complex programmable logic device (English: complex programmable logic device, abbreviated: CPLD), a field programmable gate array (English: field-programmable gate array, abbreviated: FPGA), a general-purpose array logic (English: generic array logic, abbreviated: GAL), or any combination thereof.
Optionally, the memory 54 is also used for storing program instructions. The processor 51 may invoke program instructions to implement the modeling method as shown in any of the embodiments of the present application.
The embodiments of the present invention also provide a non-transitory computer storage medium storing computer executable instructions that can perform the modeling method of any of the method embodiments described above. Wherein the storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.
Claims (10)
1. A modeling method, comprising:
acquiring characteristics, constraints and dependency relations among the characteristics in a target model document, wherein the characteristics are geometrical bodies participating in constraint calculation in the target model;
establishing a dependency relationship directed graph between the features based on the dependency relationship between the features;
grouping the constraints based on the dependency relationship directed graph, and determining a feature sequence with the constraints;
and sequentially carrying out constraint solving and determining a solving result according to the sequence of the feature sequence with the constraint so as to establish the target model.
2. The method of claim 1, wherein the grouping the constraints based on the dependency graph, determining a sequence of constrained features, comprises:
performing topological sorting on the dependency relationship directed graph to determine a feature sequence;
and adding the constraint into the corresponding group of the feature sequences based on constraint objects corresponding to the constraints, and determining the feature sequences with the constraint.
3. The method of claim 2, wherein the determining a feature sequence with constraints based on the constraint objects to which each of the constraints corresponds adding the constraints to the corresponding set of feature sequences comprises:
judging whether the corresponding constraint objects respectively belong to target constraints with different characteristics in the constraints;
when the target constraint exists, adding the target constraint to a corresponding group of constraint objects ordered later to determine the feature sequence with the constraint.
4. The method of claim 2, wherein the topologically ordering the dependency graph to determine a feature sequence comprises:
when the topological ordering is unsuccessful, prompting that a cyclic dependency relationship exists and cannot be solved;
and when the topological sorting is successful, determining the characteristic sequence.
5. The method according to claim 1, wherein sequentially performing constraint solving to determine a solution result according to the order of the feature sequence with constraint to build the object model includes:
setting constraint objects belonging to other groups referenced by the constraint of the current group to be fixed based on the sequence of the feature sequence with the constraint;
and carrying out constraint resolving on the current group to obtain a resolving result of the current group so as to establish the target model.
6. The method of claim 5, wherein sequentially performing constraint solving to determine a solution result according to the order of the constrained feature sequence to build the object model, further comprises:
based on the resolving result of the current group, carrying out association updating on other groups;
and carrying out constraint resolving on the next group based on the result after the association updating.
7. The method of claim 1, wherein obtaining the dependency between features comprises:
acquiring an intrinsic dependency relationship among features and a dependency relationship brought by the constraint;
and determining the dependency relationship among the features based on the intrinsic dependency relationship among the features and the dependency relationship brought by the constraint.
8. A modeling apparatus, comprising:
the acquisition module is used for acquiring characteristics, constraints and dependency relations among the acquired characteristics in the target model document, wherein the characteristics are geometric bodies participating in constraint calculation in the target model;
the building module is used for building a dependency relationship directed graph among the features based on the dependency relationship among the features;
the determining module is used for grouping the constraints based on the dependency relationship directed graph and determining a feature sequence with the constraints;
and the resolving module is used for sequentially carrying out constraint resolving according to the sequence of the feature sequence with the constraint to determine a resolving result so as to establish the target model.
9. An electronic device, comprising:
a memory and a processor in communication with each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the modeling method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions for causing a computer to execute the modeling method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111258142.4A CN116029004A (en) | 2021-10-27 | 2021-10-27 | Modeling method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111258142.4A CN116029004A (en) | 2021-10-27 | 2021-10-27 | Modeling method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116029004A true CN116029004A (en) | 2023-04-28 |
Family
ID=86071114
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111258142.4A Pending CN116029004A (en) | 2021-10-27 | 2021-10-27 | Modeling method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116029004A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116778080A (en) * | 2023-05-26 | 2023-09-19 | 广联达科技股份有限公司 | Three-dimensional modeling method, three-dimensional modeling device, computer equipment and storage medium |
CN116841536A (en) * | 2023-08-30 | 2023-10-03 | 成都摹客科技有限公司 | Component reference relation reconstruction method, device, system and storage medium |
-
2021
- 2021-10-27 CN CN202111258142.4A patent/CN116029004A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116778080A (en) * | 2023-05-26 | 2023-09-19 | 广联达科技股份有限公司 | Three-dimensional modeling method, three-dimensional modeling device, computer equipment and storage medium |
CN116841536A (en) * | 2023-08-30 | 2023-10-03 | 成都摹客科技有限公司 | Component reference relation reconstruction method, device, system and storage medium |
CN116841536B (en) * | 2023-08-30 | 2023-12-05 | 成都摹客科技有限公司 | Component reference relation reconstruction method, device, system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116029004A (en) | Modeling method and device and electronic equipment | |
CN110544255B (en) | Method and system for segmenting triangular mesh holes for 3D printing | |
EP3888091B1 (en) | Machine learning for protein binding sites | |
CN116822452B (en) | Chip layout optimization method and related equipment | |
CN116127908A (en) | Wiring method, device, equipment and storage medium of circuit layout | |
CN107895064B (en) | Component polarity detection method, system, computer readable storage medium and device | |
CN117422041A (en) | Training method for automatic wiring model of analog chip and automatic wiring method | |
CN107567641B (en) | System and method for identifying replicas | |
CN112347589B (en) | Space geometric expansion method and device and electronic equipment | |
US20170083651A1 (en) | Equivalence checking of analog models | |
CN117077599B (en) | Method and device for generating field programmable gate array view | |
CN110688704A (en) | Home decoration design method and system and electronic equipment | |
CN116090396A (en) | Method for displaying data stream of chip design and related equipment | |
CN109579765B (en) | Three-dimensional point cloud data matching method and system based on servo motor and controller | |
CN117744553B (en) | Method, device, equipment and storage medium for modeling field programmable gate array | |
CN111881947A (en) | Feature point set pair screening method, target matching method and device and electronic equipment | |
CN117787202B (en) | Cross-process-angle signature level time sequence prediction method and system | |
CN117521586B (en) | Layout planning method of chip design and related equipment | |
CN118314596A (en) | Primitive identification method and device, electronic equipment and storage medium | |
CN112883475B (en) | Model pairing method and device and electronic equipment | |
CN112966764B (en) | Pattern comparison method and device | |
CN113688454B (en) | Modeling method and device for protective housing, electronic equipment and readable storage medium | |
CN117010094B (en) | Single-machine batch modeling method and system for satellite structure finite element model | |
CN112711247B (en) | Interface display method, interface display device and electronic equipment | |
CN115082689B (en) | Cross-modal visual object retrieval method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |