An element recording method for parametric modeling system
By applying boundary representation in the parameterized modeling system to dynamically track elements during the CAD design process, the problem of difficulty in identifying elements due to changes in the model topology structure is solved, and accurate recording of topological element naming during the entity modeling process is achieved and Support for element identification.
Patent Information
- Application Number
- CN202210410634.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-04-19
AI Technical Summary
The problem of elements being difficult to identify when the topological structure changes in the model in the parametric modeling system.
By applying boundary representation in geometric shapes, the elements during the CAD design process are dynamically tracked to solve the naming problems of various topological elements in the construction of solid model, including the naming of constant elements, changing elements and new elements.
Accurately record the naming information of various topological elements during entity modeling and feature editing, providing support for element identification when the model changes its topological structure.
Smart Images

Figure CN114818022B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of feature-based parametric modeling, and in particular relates to an element recording method for a parametric modeling system. Background Art
[0002] The problem of permanent naming of topological elements can be divided into three sub-problems, namely, element basic name naming, ambiguous element naming and element naming matching. Among them, element basic name naming and ambiguous element naming belong to the research of element recording technology, and element naming matching belongs to the research of element identification technology. The present invention preliminarily conceives and implements an element naming recording method.
[0003] Element naming is the name given to the corresponding topological element from the beginning of the sketch in the entity modeling process. It is passed step by step to the final entity in the entire modeling process. At the same time, there will be new and modified elements that need to be named throughout the modeling process. For the entity, as long as the topological structure does not change during the model editing and modification, the basic name of its element will not change. If the topological structure of the entity changes, the basic name of some elements that have changed will need to be updated and adjusted.
[0004] Mainstream commercial parametric modeling systems, such as CATIA, SolidWorks, Pro / Engineer, etc., all have independently developed element recording technologies, but they are not public. Most of the publicly published papers focus on the research of element identification technology, which is generally based on the secondary development interface provided by a commercial platform (such as ACIS), or the prototype system built by researchers independently. Element recording technology has been integrated into commercial platforms, and users do not need to pay attention to it. As for the prototype system built by researchers independently, its element recording method has not been made public.
[0005] The platform that can directly obtain and know the internal element recording method is the open source parametric modeling system FreeCAD. Figure 7 As shown, FreeCAD only uses the serial number of each entity generation as the name. Once the topological structure of the entity changes, the serial number will be completely reconstructed, and the entity elements before and after the transformation will be completely mismatched. Figure 7 (a) is an example of the element numbering in front of the FreeCAD chamfer; Figure 7 (b) is an example diagram of the element numbering after chamfering. Figure 7 It is only used to describe the problem of disordered element numbers in the current open source parametric modeling system FreeCAD. The text content other than the cube and the cube element number is not the focus of the present invention.
[0006] The invention with patent number CN110502476A discloses a method for searching and renaming parts based on a CAD system, which can automatically identify the changed parts in the assembly and save them as new paths and names, thereby improving the work efficiency of technicians. The method in this invention does not destroy the product design template, is easy to operate, and can well assist technicians in completing the design work. However, this invention does not involve the technical problem of difficult identification of elements due to topological changes in the model in the parametric modeling system.
[0007] The invention with patent number CN112528353A discloses a method and device for reconstructing a three-dimensional scene based on a CAD drawing, which can detect the file format and the format of the architectural element in advance before reading the CAD drawing or before reading each type of architectural element, thereby improving the efficiency of data processing and the accuracy of the architectural elements read. Similarly, the invention does not involve the technical problem that the elements in the parametric modeling system are difficult to identify due to the topological structure change of the model. Summary of the invention
[0008] Technical problem solved: In order to solve the technical problem that elements are difficult to identify due to topological structure changes of the model in the parametric modeling system, the present invention applies the boundary representation method in geometric modeling. By dynamically tracking the elements in the CAD design process, it solves the naming of various topological elements in the process of solid model construction, especially the naming and transfer processing of unchanged elements, the naming processing of changed and modified elements, and the naming processing of newly added elements in the solid model construction. It accurately records the naming information of various topological elements in the process of solid modeling and feature editing, so as to provide support for element identification when the model undergoes topological structure changes.
[0009] Technical solution:.
[0010] An element recording method for a parametric modeling system, the element naming processing method comprises the following steps:
[0011] Step A1, analyzing the imported CAD design sketch, obtaining the basic geometric primitives in the current sketch, constructing the corresponding topological edge for each basic geometric primitive, generating the index name of the topological edge and the index name of the topological point, and naming the index name of the topological edge and the index name of the topological point according to the element access order of the topological edge; naming the topological edges and the endpoints of the topological edges corresponding to all basic geometric primitives, generating the topological name of the topological edge and the topological name of the topological point; naming the topological entity corresponding to the topological edge according to the comprehensive element type, the topological name of the topological edge, the topological name of the topological point, the index name of the topological edge and the index name of the topological point;
[0012] Step A2: construct a topological line based on the outline of the CAD design sketch, generate an index name of the topological line, and name the index name of the topological line according to the order of element access to the topological line; add all topological edges to the topological line, and name the topological line based on the element type and the naming result of each topological edge; transfer the topological names of the points and edges in all topological edges to the topological line as the topological names of the corresponding points and edges in the topological line;
[0013] Step A3: construct a topological surface according to the topological line, generate an index name of the topological surface, and name the index name of the topological surface according to the element access order of the topological surface; generate a topological name of the topological surface for the topological surface; transfer the topological names of the points and edges of all topological lines to the topological surface as the topological names of the corresponding points and edges in the topological surface;
[0014] Step A4, obtaining a construction surface, constructing a corresponding construction body through modeling features, generating an index name of the construction body, and naming the construction body according to the element access order of the construction body; naming the construction body based on the element type and the naming result of each topological surface; transferring the topological names of the points, edges, and faces on the construction surface to the construction body as the topological names of the corresponding points, edges, and faces in the construction body;
[0015] Step A5, obtaining a structure, generating a corresponding modified body through the modified features, generating an index name of the modified body, and naming the index name of the modified body according to the element access order of the modified body; classifying all elements contained in the modified body into unchanged elements, variable elements and newly added elements and naming them respectively;
[0016] Step A6: bind all topological entities involved in steps A1 to A5 to a set map<topological name, index name>, and output it as the entity topological element naming result.
[0017] Furthermore, the element access order refers to the order of accessing all points, edges, and faces each time an entity is generated during the geometric modeling process, and the access order is determined by the geometric modeling engine used in the parametric modeling system.
[0018] Furthermore, in step A1, the process of naming the topological entity corresponding to the topological edge by comprehensively considering the element type, the topological name of the topological edge, the topological name of the topological point, the index name of the topological edge and the index name of the topological point includes the following steps:
[0019] A11, obtains basic geometric primitives in the current sketch and constructs topological edges; wherein the basic geometric primitives include primitive types such as line segments, circles, ellipses, and free curves;
[0020] A12, naming the topological edge TopoDS_Edge and the point TopoDS_Vertice, generating the corresponding topological name of the topological edge and the index name of the topological point;
[0021] The naming rule of topological edges is: topological edge element type + topological edge index name + topological edge topological name; the naming rule of topological points is: topological point element type + topological point index name + topological point topological name;
[0022] For the edge line of a topological edge, the naming rule of the index name of the topological edge is Edge+e_index; the naming rule of the topological name of the topological edge is GeomType+GeomId:SKT+SktId; for the endpoint of a topological edge, the naming rule of the index name of the topological point is Vertice+v_index; the naming rule of the topological name of the topological point is Pnt+PosId:GeomType+GeomId:SKT+SktId;
[0023] In the formula, Vertice represents a point, v_index is the point index number for accessing the current topological edge; Edge represents an edge, e_index is the edge index number for accessing the current topological edge; GeomType represents the primitive type of the basic geometric primitive Geom, including line segment GeomLineSegment, circle GeomCircle, ellipse GeomEllipse, and free curve GeomBSplineCurve; SKT represents a sketch, SktId represents the number of the current sketch; Pnt represents a geometric point primitive GeomPoint, and PosId is the starting point number.
[0024] Furthermore, in step A2, the process of naming the topological line based on the element type and the naming result of each topological edge includes the following steps:
[0025] A21, let the naming rule of topological line be: element type of topological line + index name of topological edge / topological point + topological name of topological edge / topological point; the element type of topological line is represented as TopoDS_Wire;
[0026] A22, traverse the points and edge elements of the topological edge, extract the corresponding elements according to the index order of each element of the topological edge, find the corresponding element index in the topological line according to the element, and correspond the topological name of the element on the topological edge with the index name of the element on the topological line until the traversal of all the points and edge elements of the topological edge is completed.
[0027] Furthermore, in step A3, a topological name of the topological surface is generated for the topological surface; and the topological names of the points and edges of all topological lines are transferred to the topological surface as the topological names of the corresponding points and edges in the topological surface. The process includes the following steps:
[0028] A31, traverse the point and edge elements of the topological line, extract the corresponding element according to the index sequence of each element of the topological line; find the corresponding element index in the topological surface according to the element, and correspond the topological name of the element on the topological line with the index name of the element on the topological surface until the traversal of the point and edge elements of the topological line is completed;
[0029] A32, let the naming rule of the topological surface be: element type of the topological surface + index name of the topological surface + topological name of the topological surface; the element type of the topological surface is expressed as TopoDS_Face; the index name of the topological surface is expressed as Face+f_index; the naming rule of the topological name of the topological surface is: FBase+ProfID:SKT+SktId; Face represents the topological surface, f_index represents the number of the current topological surface; FBase represents the closed state of the obtained topological line, and ProfID represents the number of the topological surface corresponding to the obtained topological line.
[0030] Further, in step A32, when the acquired contour is a single closed contour line, there is only one corresponding topological surface constructed, and its topological name ProfID=0; when the acquired contour is N closed contour lines, there are N corresponding topological surfaces constructed, and each of their topological names is named FBase+ProfID, and ProfID takes a value from 1 to N; N is a positive integer greater than 1.
[0031] Furthermore, in step A4, the modeling features include three first-category feature operations based on sketches: stretching, rotating, and sweeping.
[0032] Furthermore, in step A4, the structure is named based on the naming results of the element type and each topological surface; the topological names of the points, edges, and surfaces on the structure surface are transferred to the structure as the topological names of the corresponding points, edges, and surfaces in the structure, and the process includes the following steps:
[0033] A41, traverse the point, edge, and surface elements of the topological surface, extract the corresponding element according to the index sequence of each element of the topological surface, find the corresponding element index in the topological body according to the element, and correspond the topological name of the element on the topological surface with the element index name on the topological body until the traversal of the point, edge, and surface elements of the topological surface is completed;
[0034] A42. Traverse the points, edges, and surface elements of the structure; search for unnamed points, edges, and surface elements and name them; until the traversal of the points, edges, and surface elements of the structure is completed;
[0035] A43. Let the naming rule of the structure be: element type of the structure + index name of topological surface / topological edge / topological point + topological name of topological surface / topological edge / topological point + first-class feature operation type + first-class feature operation type number. The element type of the structure is represented as TopoDS_Shape; the first-class feature operation type is represented as FirstFeatType, and the first-class feature operation type number is represented as FFeatID.
[0036] Furthermore, in step A5, a structure is obtained, a corresponding modified body is generated through the modified features, an index name of the modified body is generated, and the index name of the modified body is named according to the element access order of the modified body; and all elements contained in the modified body are classified into unchanged elements, variable elements and newly added elements and named respectively, and the process includes the following steps:
[0037] Step A51, obtaining a structure, and generating a modified body through modification features; the modification features include the second type of feature operations including chamfering, rounding, slots, and holes;
[0038] Step A52, invariant element naming transfer: traverse the point, edge, and surface elements of the structure; extract the element according to the index order of each element of the structure; find the corresponding element index in the modifier according to the element, and correspond the topological name of the element on the structure with the element index name on the modifier;
[0039] Step A53, naming of variable elements: traverse the edge and face elements of the structure; extract the element according to the index sequence of each element of the structure, and find the variable element index set formed by the element being modified in the modification according to the element; traverse the variable element index set corresponding to the element; correct the topological name of the element on the structure and make it correspond one-to-one with the variable element index name on the modification;
[0040] Step A54, naming of new elements: traverse all elements of the modifier, name the unnamed points, edges, and faces, including topological names and index names. The index names are named according to the order of access to the elements of the modifier.
[0041] The topological names of the changed elements and the newly added elements are added with the suffix SecondFeatType+SFeatID-Modified, where SecondFeatType indicates the second type of feature operation type, and SFeatID indicates the number of the second type of feature operation type.
[0042] Furthermore, in step A6, all topological entities involved in steps A1 to A5 are bound to a set map<topological name, index name>, and the process of outputting the set as the entity topological element naming result includes the following steps:
[0043] A61. Based on the abstract data structure TopoDS_Shape supported by the boundary representation, an abstract data structure TpShape is further encapsulated; a member variable mapTopoName of the map<topology name, index name> type is attached to the structure;
[0044] A62. Traverse the record information in the output map collection to view the topological element naming record information during the entity construction process.
[0045] Beneficial effects:
[0046] The present invention solves the problems of unchanged element naming and transmission, modified element naming and naming, and newly added element naming in solid model construction by dynamically tracking elements in the CAD design process, thereby accurately recording the naming information of various topological elements in the solid modeling and feature editing process, and providing support for element identification when the model's topological structure changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a schematic diagram of a processing process of an element recording method for a parametric modeling system according to an embodiment of the present invention;
[0048] Figure 2 This is an example diagram of construction edge naming based on sketch primitives according to an embodiment of the present invention;
[0049] Figure 3 is an example diagram of construction line naming based on construction edges according to an embodiment of the present invention;
[0050] Figure 4 This is an example diagram of naming construction surfaces based on construction lines according to an embodiment of the present invention;
[0051] Figure 5 is an example diagram of a structural body naming based on a structural surface according to an embodiment of the present invention;
[0052] Figure 6 This is an example diagram of naming modified bodies based on structures according to an embodiment of the present invention.
[0053] Figure 7 This is an example of the disordered correspondence of elements before and after chamfering in the open source parametric modeling system FreeCAD; Figure 7 (a) is an example of the element numbering in front of the FreeCAD chamfer; Figure 7 (b) is an example diagram of the element numbering after chamfering. DETAILED DESCRIPTION
[0054] The following examples will enable those skilled in the art to more fully understand the present invention, but are not intended to limit the present invention in any way.
[0055] like Figure 1As shown, the element recording method for the parametric modeling system of this embodiment includes the following steps:
[0056] Step 1: The method for naming the construction edges based on the sketch entities is as follows:
[0057] 1-1, obtain basic geometric primitives and construct corresponding topological edges.
[0058] 1-2, name the topological edges and points, including the topological name and index name.
[0059] 1-3, repeat the above steps until the corresponding topological edges of all basic geometric entities in the sketch are named.
[0060] Step 2: The method for naming construction lines based on construction edges is as follows:
[0061] 2-1. Construct a topological line and add all topological edges to the topological line.
[0062] 2-2, traverse all topological edges and pass the points and topological names of the edges on the topological edges to the corresponding points and topological names of the edges in the topological lines.
[0063] Step 3: The method for naming the construction surface based on the construction line is as follows:
[0064] 3-1, obtain the topological line and construct the corresponding topological surface.
[0065] 3-2, transfer the topological names of the points and edges on the topological line to the corresponding topological names of the points and edges in the topological surface.
[0066] 3-3. Name the topological surface, including the topological name and index name.
[0067] Step 4: The method of constructing a body based on a construction surface is as follows:
[0068] 4-1, obtain the construction surface, and construct the corresponding topological body through modeling features.
[0069] 4-2, transfer the topological names of the points, edges and faces on the construction surface to the corresponding topological names of the points, edges and faces in the construction body.
[0070] 4-3. Name the newly generated topological elements in the structure, including the topological name and index name.
[0071] Step 5: The method for naming the modified body based on the construct is as follows:
[0072] 5-1, obtain a structure (called a base body), and construct a new generated body by modifying its features.
[0073] 5-2, element naming is passed unchanged.
[0074] 5-3, change element naming.
[0075] 5-4, added element naming (point, edge, surface).
[0076] Step 6: Output the entity topology element naming information.
[0077] This embodiment dynamically tracks the elements in the CAD design process, accurately records the naming information of various topological elements in the solid modeling and feature editing process, and provides support for element identification when the model undergoes topological structure changes.
[0078] The specific principles of each step of the element recording method of this embodiment are explained below in conjunction with the accompanying drawings.
[0079] Step A1, analyze the imported CAD design sketch, obtain the basic geometric primitives in the current sketch, construct the corresponding topological edge for each basic geometric primitive, generate the index name of the topological edge and the index name of the topological point, and the index name of the topological edge and the index name of the topological point are named according to the element access order of the topological edge; name the topological edges and the endpoints of the topological edges corresponding to all basic geometric primitives, and generate the topological name of the topological edge and the topological name of the topological point; name the topological entity corresponding to the topological edge based on the comprehensive element type, the topological name of the topological edge, the topological name of the topological point, the index name of the topological edge and the index name of the topological point.
[0080] See also Figure 2 , step A1 further comprises the following steps:
[0081] Step A11, obtain the basic geometric primitives (Geom) in the current sketch (Sketch), and construct topological edges. The basic geometric primitives Geom include line segments GeomLineSegment, circles GeomCircle, ellipses GeomEllipse, free curves GeomBSplineCurve and other primitive types, and the primitive type is represented by GeomType.
[0082] Step A12: Name the topological edge (TopoDS_Edge) and the vertex (TopoDS_Vertice), including the topological name and index name. The index name is named according to the order of accessing the elements of the topological edge.
[0083] Element Type Index Name Topology naming conventions TopoDS_Edge Edge+e_index GeomType+GeomId:SKT+SktId TopoDS_Vertice Vertice+v_index Pnt+PosId:GeomType+GeomId:SKT+SktId
[0084] e_index is the edge index number for accessing the current topological edge. When all geometric primitives are constructed into a topological edge TopoDS_Edge for the first time, e_index=1; v_index is the point index number for accessing the current topological edge. The value of v_index is 1 or 2.
[0085] SKT means sketch, SktId means the number of the current sketch, such as SktId = 1 means sketch Figure 1 ; GeomId represents the number of the geometric entity in the current sketch, such as GeomId=1 represents entity 1; GeomType represents the current geometric entity type; Pnt represents the geometric point entity GeomPoint, PosId is the starting point number, PosId=1 represents the starting point, and PosId=2 represents the end point.
[0086] Taking GeomType = GeomLineSegment as an example, its naming semantics is explained as follows:
[0087] Index Name Topology Name Semantic interpretation Edge1 GeomLineSegment1:SKT1 Current Grass Figure 1 Line segment 1 in Vertice1 Pnt1:GeomLineSegment1:SKT1 Current Grass Figure 1 The starting point of line segment 1 in Vertice2 Pnt2:GeomLineSegment1:SKT1 Current Grass Figure 1 The end point of line segment 1 in
[0088] Step A13: Repeat A11-A12 until the corresponding topological edges constructed by all basic geometric primitives are named.
[0089] The topological edges and topological points described in step A12, as well as the concepts of topological lines, topological surfaces, etc. described below in this embodiment all refer to topological entities in the boundary representation method. The boundary representation method is a data structure used to express geometric entities in a feature-based parametric modeling system. The element access order described in step A12 refers to the order of access to all points, edges, and surfaces each time an entity is generated during the geometric modeling process. The access order is determined by the geometric modeling engine used in the modeling system, and the access order remains unchanged as long as the topological structure of the geometric entity does not change. The concept of element access order described below in the present invention is consistent with that herein.
[0090] Step A2, construct a topological line based on the outline of the CAD design sketch, generate an index name for the topological line, and name the index name of the topological line according to the order of element access to the topological line; add all topological edges to the topological line, name the topological line based on the element type and the naming result of each topological edge; pass the topological names of the points and edges in all topological edges to the topological line as the topological names of the corresponding points and edges in the topological line.
[0091] See also Figure 3 , step A2 further comprises the following steps:
[0092] Step A21: construct a topology line (TopoDS_Wire) and add all topology edges to the topology line;
[0093] Step A22: traverse all topological edges, and pass the points and topological names of the edges on the topological edges to the corresponding points and topological names of the edges in the topological line. The index names are named according to the order of accessing the elements of the topological line.
[0094] Implementation process: traverse the points and edge elements of the topological edge; extract the element according to the index order of a certain element of the topological edge; find the corresponding element index in the topological line according to the element; correspond the topological name of the element on the topological edge with the index name of the element on the topological line; until the traversal of the points and edge elements of the topological edge is completed.
[0095] Element Type Index Name Topology naming conventions TopoDS_Wire Edge+e_index Construct the topological name of the edge on the edge TopoDS_Wire Vertice+v_index Construct the topological name of the edge point
[0096] Step A3, construct a topological surface according to the topological line, generate an index name of the topological surface, and the index name of the topological surface is named according to the element access order of the topological surface; generate a topological name of the topological surface for the topological surface; pass the topological names of the points and edges of all topological lines to the topological surface as the topological names of the corresponding points and edges in the topological surface.
[0097] See also Figure 4 , step A3 further comprises the following steps:
[0098] Step A31, obtain the topological line, which is the sketch outline, and construct the corresponding topological surface (TopoDS_Face).
[0099] Step A32: The topological names of the points and edges on the topological line are transferred to the topological names of the corresponding points and edges in the topological surface. The index name is named according to the order of accessing the elements of the topological surface.
[0100] Implementation process: traverse the points and edge elements of the topological line; extract the element according to the index order of a certain element of the topological line; find the corresponding element index in the topological surface according to the element; correspond the topological name of the element on the topological line with the index name of the element on the topological surface; until the traversal of the points and edge elements of the topological line is completed.
[0101] Element Type Index Name Topology naming conventions TopoDS_Face Edge+e_index Topological name of the edge of the construction line TopoDS_Face Vertice+v_index Topological name of the point on the construction line
[0102] Step A33: Name the topological surface, including the topological name and the index name. The index name is named according to the order of accessing the elements of the topological surface.
[0103] Element Type Index Name Topology naming conventions TopoDS_Face Face+f_index FBase+ProfID:SKT+SktId
[0104] Taking GeomType = GeomLineSegment, SktId = 1 as an example, the naming semantics are explained as follows:
[0105] Index Name Topology Name Semantic interpretation Face1 FBase0:SKT1 Grass Figure 1 The base surface constructed by a single closed contour 0
[0106] Step A31 includes the following cases:
[0107] ① If the obtained contour is a single closed contour line, there is only one corresponding topological surface constructed, and ProfID=0 in its topological name;
[0108] ② If the obtained contour is N closed contour lines, there may be N corresponding topological surfaces constructed, and each topological surface is named FBase+ProfID, where ProfID takes a value from 1 to N;
[0109] ③The obtained contour line is not closed, this situation will not be considered.
[0110] Step A4, obtain the construction surface, construct the corresponding construction body through modeling features, generate the index name of the construction body, and name the index name of the construction body according to the element access order of the construction body; name the construction body based on the element type and the naming result of each topological surface; pass the topological names of the points, edges, and faces on the construction surface to the construction body as the topological names of the corresponding points, edges, and faces in the construction body.
[0111] See also Figure 5 , step A4 further comprises the following steps:
[0112] Step A41, obtain the construction surface, and construct the corresponding construction body (TopoDS_Shape) through modeling features. Modeling features refer to the three first-class feature operations (FirstFeatType) based on sketches: stretch (ETU), rotation (RVL) and sweep (SWT);
[0113] Step A42: The topological names of the points, edges and faces on the construction surface are transferred to the topological names of the corresponding points, edges and faces in the construction body. The index name is named according to the order of accessing the elements of the construction body.
[0114] Implementation process: traverse the point, edge, and surface elements of the topological surface; extract the element according to the index order of a certain element of the topological surface; find the corresponding element index in the topological body according to the element; correspond the topological name of the element on the topological surface with the element index name on the topological body; until the traversal of the point, edge, and surface elements of the topological surface is completed.
[0115] Element Type Index Name Topology naming conventions TopoDS_Shape Edge+e_index The topological name of the edge of the construction surface TopoDS_Shape Vertice+v_index Topological names of points on the constructed surface TopoDS_Shape Face+f_index Topological name on the construction surface
[0116] Step A43: Name the newly generated topological elements in the structure, including the topological name and the index name. The index name is named according to the order of accessing the elements of the topological body.
[0117] Implementation process: traverse the point, edge, and surface elements of the structure; find unnamed point, edge, and surface elements and name them; until the traversal of the point, edge, and surface elements of the structure is completed.
[0118] Element Type Index Name Topology naming conventions TopoDS_Shape Edge+e_index Edge+e_index:FirstFeatType+FFeatID TopoDS_Shape Vertice+v_index Vertex+v_index:FirstFeatType+FFeatID TopoDS_Shape Face+f_index Face+f_index:FirstFeatType+FFeatID
[0119] FirstFeatType indicates the first type of feature operation, and can be ETU, RVL, or SWT. FFeatID indicates the number of the current feature operation of this type, such as ETU1 for stretch feature 1.
[0120] Taking FirstFeatType = ETU, FFeatID = 1 as an example, the naming semantics are explained as follows:
[0121] Index Name Topology Name Semantic interpretation Face1 Face1:ETU1 Face 1 generated by Extrusion Feature 1 Edge1 Edge1:ETU1 Edge 1 generated by Extrusion Feature 1 Vertice1 Vertice1:ETU1 Point 1 generated by extrude feature 1
[0122] Step A5, obtain the structure, generate the corresponding modification body through the modification feature, generate the index name of the modification body, and name the index name of the modification body according to the element access order of the modification body; classify all elements contained in the modification body into unchanged elements, variable elements and newly added elements and name them separately.
[0123] See also Figure 6 , step A5 further comprises the following steps:
[0124] Step A51, obtain the structure (also called base), and generate the modified body (TopoDS_Shape) through the modified features. The modified features refer to the second type of feature operations (SecondFeatType) such as chamfer (CHM), rounded corners (FLT), slots (PKT), holes (HLE), etc.;
[0125] Step A52: Transfer the unchanged element names. Map the topological names of the unchanged points, edges, and faces in the base to the corresponding points, edges, and faces in the modified body. The index names are named according to the order of access to the elements of the modified body.
[0126] Implementation process: traverse the points, edges, and surface elements of the matrix; extract the element according to the index order of a certain element of the matrix; find the corresponding element index in the modifier according to the element; correspond the topological name of the element on the matrix with the index name of the element on the modifier; until the traversal of the points, edges, and surface elements of the matrix is completed.
[0127] Element Type Index Name Topology naming conventions TopoDS_Shape Edge+e_index The topological name of the edge on the base TopoDS_Shape Vertice+v_index Topological name of the point on the base TopoDS_Shape Face+f_index Topological name on the base
[0128] Step A53, naming the variable elements. Find all edge and surface variable elements in the modified body that are modified from the base body elements, and name the variable elements in these modified bodies. The index name is named according to the order of access to the elements of the modified body.
[0129] Implementation process: traverse the edge and face elements of the matrix; extract the element according to the index sequence of a certain element of the matrix; find the variable element index set formed by the modification of the element in the modifier according to the element; traverse the variable element index set corresponding to the element; correct the topological name of the element on the matrix and make it correspond one by one with the variable element index name on the modifier; until the traversal of the edge and face elements of the matrix is completed.
[0130]
[0131] SecondFeatType indicates the second type of feature operation, and can be CHM, FLT, PKT, or HLE. SFeatID indicates the number of the current feature operation of this type, such as FLT 1 for rounded corner feature 1.
[0132] Taking FirstFeatType=ETU, FFeatID=1, SecondFeatType=FLT, SFeatID=1 as an example, the naming semantics are explained as follows:
[0133]
[0134] Step A54, naming the newly added elements. Traverse all elements of the modified body and name the unnamed points, edges, and faces, including topological names and index names. The index names are named according to the order of access to the elements of the modified body.
[0135] Element Type Index Name Topology naming conventions TopoDS_Shape Edge+e_index Edge+e_index:SecondFeatType+SFeatID TopoDS_Shape Vertice+v_index Vertex+v_index:SecondFeatType+SFeatID TopoDS_Shape Face+f_index Face+f_index:SecondFeatType+SFeatID
[0136] Taking SecondFeatType = FLT, SFeatID = 1 as an example, the naming semantics are explained as follows:
[0137] Index Name Topology Name Semantic interpretation Face1 Face1:FLT1 Face 1 in Chamfer Feature 1 Edge1 Edge1:FLT1 Edge 1 in Chamfer Feature 1 Vertice1 Vertice1:FLT1 Edge 1 in Chamfer Feature 1
[0138] There are two points to note in step A53:
[0139] ① During the modification feature operation, only four situations are considered: edges split into edges, edges merged into edges, faces split into faces, and faces merged into faces. The disappearance of other elements such as edges degenerating into points, edges generating faces, and faces degenerating into edges are not considered.
[0140] ② Different modeling systems have different ways of obtaining changed elements. In the geometric modeling engine OpenCASCAD, the Modified virtual function that can be used in step A43 directly obtains the list of changed elements. The function prototype is as follows:
[0141] Standard_EXPORT virtual const TopTools_ListOfShape&Modified(constTopoDS_Shape&S).
[0142] Step A6: bind all topological entities involved in steps A1 to A5 to a set map<topological name, index name>, and output it as the entity topological element naming result.
[0143] Step A6 further comprises the following steps:
[0144] Step A61: bind a set map <topology name, index name> to the topology entity involved in steps A1 to A5, which is used to save the naming result of the current instance when the topology entity is instantiated.
[0145] Implementation process: Based on the abstract data structure TopoDS_Shape supported by the boundary representation method, an abstract data structure TpShape is further encapsulated; a member variable mapTopoName of the map<topology name, index name> type is attached to the structure.
[0146] Step A62: traverse the record information in the output map set to view the topological element naming record information in the entity construction process.
Claims
1. An element recording method for a parametric modeling system, characterized in that: The element recording method comprises the following steps: Step A1, analyzing the imported CAD design sketch, obtaining the basic geometric primitives in the current sketch, constructing the corresponding topological edge for each basic geometric primitive, generating the index name of the topological edge and the index name of the topological point, and naming the index name of the topological edge and the index name of the topological point according to the element access order of the topological edge; naming the topological edges and the endpoints of the topological edges corresponding to all basic geometric primitives, generating the topological name of the topological edge and the topological name of the topological point; naming the topological entity corresponding to the topological edge according to the comprehensive element type, the topological name of the topological edge, the topological name of the topological point, the index name of the topological edge and the index name of the topological point; Step A2: construct a topological line based on the outline of the CAD design sketch, generate an index name of the topological line, and name the index name of the topological line according to the order of element access to the topological line; add all topological edges to the topological line, and name the topological line based on the element type and the naming result of each topological edge; transfer the topological names of the points and edges in all topological edges to the topological line as the topological names of the corresponding points and edges in the topological line; Step A3: construct a topological surface according to the topological line, generate an index name of the topological surface, and name the index name of the topological surface according to the element access order of the topological surface; generate a topological name of the topological surface for the topological surface; transfer the topological names of the points and edges of all topological lines to the topological surface as the topological names of the corresponding points and edges in the topological surface; Step A4, obtaining a construction surface, constructing a corresponding construction body through modeling features, generating an index name of the construction body, and naming the construction body according to the element access order of the construction body; naming the construction body based on the element type and the naming result of each topological surface; transferring the topological names of the points, edges, and faces on the construction surface to the construction body as the topological names of the corresponding points, edges, and faces in the construction body; Step A5, obtaining a structure, generating a corresponding modified body through the modified features, generating an index name of the modified body, and naming the index name of the modified body according to the element access order of the modified body; classifying all elements contained in the modified body into unchanged elements, variable elements and newly added elements and naming them respectively; Step A6: bind all topological entities involved in steps A1 to A5 to a set map<topological name, index name>, and output it as the entity topological element naming result; In step A1, the process of naming the topological entity corresponding to the topological edge by comprehensively considering the element type, the topological name of the topological edge, the topological name of the topological point, the index name of the topological edge and the index name of the topological point includes the following steps: A11, obtains basic geometric primitives in the current sketch and constructs topological edges; wherein the basic geometric primitives include primitive types such as line segments, circles, ellipses, and free curves; A12, naming the topological edge TopoDS_Edge and the point TopoDS_Vertice, generating the corresponding topological name of the topological edge and the index name of the topological point; The naming rule of topological edges is: topological edge element type + topological edge index name + topological edge topological name; the naming rule of topological points is: topological point element type + topological point index name + topological point topological name; For the edge line of a topological edge, the naming rule of the index name of the topological edge is Edge+e_index; the naming rule of the topological name of the topological edge is GeomType+GeomId:SKT+SktId; for the endpoint of a topological edge, the naming rule of the index name of the topological point is Vertice+v_index; the naming rule of the topological name of the topological point is Pnt+PosId:GeomType+GeomId:SKT+SktId; In the formula, Vertice represents a point, v_index is the point index number for accessing the current topological edge; Edge represents an edge, e_index is the edge index number for accessing the current topological edge; GeomType represents the primitive type of the basic geometric primitive Geom, including line segment GeomLineSegment, circle GeomCircle, ellipse GeomEllipse, and free curve GeomBSplineCurve; SKT represents a sketch, SktId represents the number of the current sketch; Pnt represents a geometric point primitive GeomPoint, and PosId is the starting point number; In step A2, the process of naming the topological line based on the element type and the naming result of each topological edge includes the following steps: A21, let the naming rule of topological line be: element type of topological line + index name of topological edge / topological point + topological name of topological edge / topological point; the element type of topological line is represented as TopoDS_Wire; A22, traverse the points and edge elements of the topological edge, extract the corresponding element according to the index sequence of each element of the topological edge, find the corresponding element index in the topological line according to the element, and correspond the topological name of the element on the topological edge with the index name of the element on the topological line until the traversal of all the points and edge elements of the topological edge is completed; In step A4, the structure is named based on the naming results of the element type and each topological surface; the topological names of the points, edges, and surfaces on the structure surface are transferred to the structure as the topological names of the corresponding points, edges, and surfaces in the structure, and the process includes the following steps: A41, traverse the point, edge, and surface elements of the topological surface, extract the corresponding element according to the index sequence of each element of the topological surface, find the corresponding element index in the topological body according to the element, and correspond the topological name of the element on the topological surface with the element index name on the topological body until the traversal of the point, edge, and surface elements of the topological surface is completed; A42. Traverse the points, edges, and surface elements of the structure; search for unnamed points, edges, and surface elements and name them; until the traversal of the points, edges, and surface elements of the structure is completed; A43. Let the naming rule of the structure be: the element type of the structure + the index name of the topological surface / topological edge / topological point + the topological name of the topological surface / topological edge / topological point + the first type of feature operation type + the first type of feature operation type number. The element type of the structure is represented as TopoDS_Shape; the first type of feature operation type is represented as FirstFeatType, and the first type of feature operation type number is represented as FFeatID; In step A5, a structure is obtained, a corresponding modified body is generated through the modified features, an index name of the modified body is generated, and the index name of the modified body is named according to the element access order of the modified body; all elements contained in the modified body are classified into unchanged elements, variable elements and newly added elements and named respectively, and the process includes the following steps: Step A51, obtaining a structure, and generating a modified body through modification features; the modification features include the second type of feature operations including chamfering, rounding, slots, and holes; Step A52, invariant element naming transfer: traverse the point, edge, and surface elements of the structure; extract the element according to the index order of each element of the structure; find the corresponding element index in the modifier according to the element, and correspond the topological name of the element on the structure with the element index name on the modifier; Step A53, naming of variable elements: traverse the edge and face elements of the structure; extract the element according to the index sequence of each element of the structure, and find the variable element index set formed by the element being modified in the modification according to the element; traverse the variable element index set corresponding to the element; correct the topological name of the element on the structure and make it correspond one-to-one with the variable element index name on the modification; Step A54, naming of new elements: traverse all elements of the modifier, name the unnamed points, edges, and faces, including topological names and index names. The index names are named according to the order of access to the elements of the modifier; The topological names of the modified and newly added elements are added with the suffix SecondFeatType+SFeatID-Modified, where SecondFeatType indicates the second type of feature operation type, and SFeatID indicates the number of the second type of feature operation type. In step A6, all topological entities involved in steps A1 to A5 are bound to a set map <topological name, index name>, and the process of outputting the set as the entity topological element naming result includes the following steps: A61. Based on the abstract data structure TopoDS_Shape supported by the boundary representation, an abstract data structure TpShape is further encapsulated; a member variable mapTopoName of the map<topology name, index name> type is attached to the structure; A62. Traverse the record information in the output map collection to view the topological element naming record information during the entity construction process.
2. The element recording method for a parametric modeling system according to claim 1, characterized in that: The element access order refers to the order of accessing all points, edges, and faces each time an entity is generated during the geometric modeling process. The access order is determined by the geometric modeling engine used in the parametric modeling system.
3. The element recording method for a parametric modeling system according to claim 1, characterized in that: In step A3, a topological name of the topological surface is generated for the topological surface; the topological names of the points and edges of all topological lines are transferred to the topological surface as the topological names of the corresponding points and edges in the topological surface. The process includes the following steps: A31, traverse the point and edge elements of the topological line, extract the corresponding element according to the index sequence of each element of the topological line; find the corresponding element index in the topological surface according to the element, and correspond the topological name of the element on the topological line with the index name of the element on the topological surface until the traversal of the point and edge elements of the topological line is completed; A32, let the naming rule of the topological surface be: element type of the topological surface + index name of the topological surface + topological name of the topological surface; the element type of the topological surface is expressed as TopoDS_Face; the index name of the topological surface is expressed as Face+f_index; the naming rule of the topological name of the topological surface is: FBase+ProfID:SKT+SktId; Face represents the topological surface, f_index represents the number of the current topological surface; FBase represents the closed state of the obtained topological line, and ProfID represents the number of the topological surface corresponding to the obtained topological line.
4. The element recording method for a parametric modeling system according to claim 1, characterized in that: In step A32, when the acquired contour is a single closed contour line, there is only one corresponding topological surface constructed, and its topological name ProfID=0; when the acquired contour is N closed contour lines, there are N corresponding topological surfaces constructed, and each of their topological names is named FBase+ProfID, and ProfID takes a value from 1 to N; N is a positive integer greater than 1.
5. The element recording method for a parametric modeling system according to claim 1, characterized in that: In step A4, the modeling features include three first-category feature operations based on sketches: stretching, rotating, and sweeping.
Citation Information
Patent Citations
Component retrieval and renaming method based on CAD system
CN110502476A
Method and device for reconstructing three-dimensional scene based on CAD drawing
CN112528353A
Matching method for topological elements in heterogeneous CAD (computer-aided design) integration
CN102567588A
CAD method, CAD system and program storage medium storing CAD program thereof
CN1873647A