A 3D CAD model dimensioning method, system, device and medium
Through the method of point constraint and constraint gradient table, the size of the three-dimensional CAD model is automatically marked, which solves the problems of cumbersome dimension marking and poor automatic marking effects in the existing technology, and realizes efficient and accurate dimension marking of the three-dimensional CAD model.
Patent Information
- Application Number
- CN202411253538.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The dimension labeling process of existing three-dimensional CAD models is cumbersome and the automatic labeling effect is poor, resulting in the problem of missing dimension labeling and redundancy.
The concepts of point constraint and point constraint gradient table are adopted, and the dimensions of the three-dimensional CAD model are automatically marked by defining point constraints and constraint addition rules to ensure the completeness and accuracy of the marking.
Automatic dimensioning of three-dimensional CAD model is realized, reducing the cumbersomeness and error rate of manual labeling, and ensuring the completeness and accuracy of labeling results.
Smart Images

Figure CN118761116B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer-aided design, and in particular relates to a three-dimensional CAD model dimensioning method, system, equipment and medium. Background Art
[0002] With the development of computer-aided technology, full 3D manufacturing is replacing the 2D drawings used in traditional manufacturing, and direct dimensioning on 3D CAD models is rapidly being promoted in the industry. Directly marking dimensions on the 3D geometric model of the product will make the structural expression of the product more intuitive and clear. Designers and manufacturers can view the annotation information directly in the 3D CAD model without having to flip through cumbersome 2D drawings. Moreover, since the dimension annotation in the 3D CAD model is directly associated with the geometric features, it can reduce misunderstandings and errors caused by unclear or ambiguous annotation positions in the 2D drawings. At present, for the dimension annotation of 3D CAD models, the current engineering mainly adopts the interactive manual annotation method using CAD system software. Since all dimensions of the product must be marked in the 3D CAD model, when the product structure is complex, a large number of interactive operations are required, which is very cumbersome and time-consuming, and it is very easy to miss the dimension. Automatic 3D dimension annotation has always been a technology that engineering and technical personnel are eager to achieve.
[0003] At present, mainstream 3D CAD software all provide their own 3D dimensioning modules, such as the PMI module of computer-aided design software NX, the FT&A module of computer-aided design software CATIA, the 3D annotation module of computer-aided design software Creo, and the DimExpert module of SolidWorks. The PMI module of NX can perform manual dimensioning; the FT&A module of CATIA can realize manual interactive dimensioning and automatic generation of feature dimensions, but it cannot perform complete 3D dimensioning of the model; the 3D annotation module of Creo can realize manual selection of scale elements for dimensioning; the DimExpert module can select the datum through manual interaction and automatically annotate some scale elements that have a linear dimension relationship with the datum.
[0004] Although the above-mentioned 3D dimensioning modules can perform dimensioning, their automatic dimensioning effects cannot meet engineering needs: CATIA can only automatically dimension some features; SolidWorks's dimensioning logic is too simple, and the automatic dimensioning results are redundant and missing. The 3D dimensioning of CAD models in the engineering community still mainly relies on manual interaction by users, and manual 3D dimensioning brings the following two major problems: (1) The dimensioning process becomes extremely cumbersome when the model tends to be complex; (2) It is difficult to determine the integrity of the dimensioning results after dimensioning. Summary of the invention
[0005] In order to overcome the shortcomings of cumbersome manual three-dimensional dimensioning process and incomplete dimensioning, the present invention provides a three-dimensional CAD model dimensioning method, comprising the following steps: defining a point constraint degree and a point constraint degree gradient table, wherein the point constraint degree describes the constraint state of the vertices in the three-dimensional CAD model in three reference directions, when the vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when the vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of the three-dimensional CAD model gradually change from 0 to 1 during the dimensioning process;
[0006] Formulate rules for adding constraints to 3D CAD models during dimensioning;
[0007] Determine three reference planes of the 3D CAD model, and determine a reference parallel plane, a reference vertical plane and a general position plane according to the relative positions of each plane in the 3D CAD model and the three reference planes; the reference parallel plane is a plane parallel to a certain reference plane and perpendicular to the other two reference planes; the reference vertical plane is a plane perpendicular to a certain reference plane and inclined to the other two reference planes; the general position plane is a plane inclined to any reference plane;
[0008] Initialize the point constraint of each vertex in the 3D CAD model to obtain the initial state of the point constraint gradient table; update the point constraint value of each vertex in the initial state in the point constraint gradient table according to the position of the reference plane, and then dimension all reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. Each time a dimension is marked, the point constraint values of all vertices in the point constraint gradient table are updated until the point constraint values of all vertices in the 3D CAD model are 1.
[0009] Preferably, the constraint adding rule is specifically:
[0010] Rule 1: The point constraint value of a point on the reference plane in the normal direction of the reference plane is 1;
[0011] Rule 2: For a plane that is parallel to the reference plane and has a unique dimension in the normal direction of the reference plane, the point constraint value of the point on the plane in the normal direction of the reference plane is 1;
[0012] Rule 3: For a point on a reference vertical plane, if the equation of the reference vertical plane is known, when the point constraint value of the point in the normal direction of the reference plane perpendicular to the plane is 1, and the point constraint value of the point in any direction of the normal direction of the other two reference planes is 1, then the point constraint value of the point in the remaining reference directions is 1;
[0013] Rule 4: For a point on a general position plane, if the point constraint value of the point in two reference directions is 1, and the equation of the plane to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1;
[0014] Rule 5: If the point constraint value of a point in at least one reference direction is 1, and the equation of the line to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1;
[0015] Rule 6: If a plane has a normal dimension to a fixed plane, the equation of the plane is known;
[0016] Rule 7: If there are 3 or more points on a plane that are not on the same line and are completely constrained, then the equation of the plane is known and the plane is fixed;
[0017] Rule 8: If the equations of the two planes forming the intersection are known, the position of the intersection is fixed;
[0018] Rule 9: If there is an angular dimension between a plane and a plane whose position is known, then the position of the plane is also fixed;
[0019] Rule 10: The priority of selecting elements is in the following order: surface > line > point, where elements are the geometric elements of points, lines and surfaces used to define and represent dimensions on the 3D CAD model.
[0020] Preferably, the step of dimensioning the reference parallel surface comprises the following steps:
[0021] Traverse all the datum parallel surfaces, and for each datum parallel surface, mark the dimensions along the normal direction of the corresponding datum surface;
[0022] Each time a dimension is marked, a column of values is added to the point constraint degree gradient table, and the point constraint states of all vertices in the point constraint degree gradient table are updated using the above-mentioned rules 1 to 10.
[0023] Preferably, the dimensioning of the reference vertical surface is specifically as follows:
[0024] Traverse all the reference vertical planes, and for each reference vertical plane, traverse each straight line on each reference vertical plane. If the point constraint values of the points on the straight line in the same reference direction are all 0, and the straight line is parallel to the reference plane, then add a dimension between the straight line and the reference plane; update the point constraint status of all vertices in the point constraint gradient table according to Rules 1 to 10.
[0025] Preferably, the dimensioning of the general position surface is specifically as follows:
[0026] Traverse the 3D CAD model and perform the following processing on each general position surface:
[0027] If the point constraint degree of a topological point on a general position plane is unconstrained in only one reference direction, a linear dimension is added between the reference plane and the point in the direction of the unconstrained degree of freedom, and the point constraint status in the point constraint degree gradient table is added and updated according to rules 1 to 10;
[0028] If the point constraint of a topological point is not constrained in two reference directions, select the topological points on the topological surface whose spatial position is fixed, add a linear dimension between the reference surface in any unconstrained direction and the point, and add and update the point constraint state in the point constraint degree gradient table according to rules 1 to 10; add a linear dimension between the reference surface in another unconstrained direction and the point, and add and update the point constraint state in the point constraint degree gradient table according to rules 1 to 10; the topological surface is a surface involved in the modeling of a three-dimensional CAD model;
[0029] If the point constraint degree of a topological point in the three reference directions is 0, add a linear dimension between the reference plane and the point in any direction, and add and update the point constraint status in the point constraint degree gradient table according to rules 1 to 10.
[0030] The present invention also provides a 3D CAD model dimensioning system, comprising:
[0031] A point constraint degree gradient table definition module is used to define point constraint degrees and point constraint degree gradient tables, wherein the point constraint degrees describe the constraint states of vertices in three reference directions in a three-dimensional CAD model. When a vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when a vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of a three-dimensional CAD model gradually change from 0 to 1 during the dimensioning process;
[0032] A constraint adding rule determination module is used to formulate constraint adding rules for 3D CAD models during dimensioning;
[0033] A plane type determination module is used to determine three reference planes of a three-dimensional CAD model, and determine a reference parallel plane, a reference vertical plane, and a general position plane according to the relative positions of each plane in the three-dimensional CAD model and the three reference planes; the reference parallel plane is a plane parallel to a certain reference plane and perpendicular to the other two reference planes; the reference vertical plane is a plane perpendicular to a certain reference plane and inclined to the other two reference planes; the general position plane is a plane inclined to any reference plane;
[0034] The dimensioning module is used to initialize the point constraint degree of each vertex in the 3D CAD model and obtain the initial state of the point constraint degree gradient table; update the point constraint degree value of each vertex in the point constraint degree gradient table in the initial state according to the position of the reference plane, and then dimension all the reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. After each dimension is marked, the point constraint degree values of all vertices in the point constraint degree gradient table are updated until the point constraint degree values of all vertices in the 3D CAD model are 1.
[0035] The present invention also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the three-dimensional CAD model dimensioning method described in the claims.
[0036] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the three-dimensional CAD model dimensioning method.
[0037] The 3D CAD model dimensioning method, system, device and medium provided by the present invention have the following beneficial effects:
[0038] The present invention proposes the concept of "point constraint degree" and designs a "point constraint degree gradient table". Based on the point constraint degree gradient table, the automatic dimensioning function of the three-dimensional CAD model is realized. The method monitors the changes of the point constraint degree state on the model as the dimensioning changes, judges the dimensions that need to be marked, and checks the integrity of the dimensioning of the model at any time, so as to successfully realize the automatic dimensioning function of the three-dimensional CAD model. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A flow chart of a 3D CAD model dimensioning method according to an embodiment of the present invention;
[0041] Figure 2 The planes are in three positions; Figure 2 (a) is the reference parallel plane. Figure 2 (b) is the reference vertical plane. Figure 2 (c) in the figure is the general position surface;
[0042] Figure 3It is a process diagram of the vertices of the 3D CAD model changing with the annotation of the 3D dimensions;
[0043] Figure 4 Provide a change diagram for the dimensioning of the datum parallel surface;
[0044] Figure 5 Provide a change diagram for the reference vertical surface dimension;
[0045] Figure 6 Provide dimension change diagram for general position surface. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.
[0047] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the technical solutions of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0048] In addition, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In the description of the present invention, it should be noted that, unless otherwise clearly specified or limited, the terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. In the description of the present invention, unless otherwise specified, "plurality" means two or more, which will not be described in detail here.
[0049] Example
[0050] The present invention provides a 3D CAD model dimensioning method, such as Figure 1 As shown, the following steps are included:
[0051] Step 1: Define the point constraint degree and the point constraint degree gradient table, where the point constraint degree describes the constraint status of the vertices in the 3D CAD model in the three reference directions. When the vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when the vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of the 3D CAD model gradually change from 0 to 1 during the dimensioning process.
[0052] Before dimensioning, it is necessary to define the relevant terms, as follows:
[0053] Definition 1: Scale element
[0054] In engineering applications, dimensions are generally marked with points, lines, and surfaces of three-dimensional CAD models. These geometric elements that define and represent dimensions are called dimensions elements.
[0055] Definition 2: Reference plane
[0056] The surface that serves as the common starting point for dimensioning can be a symmetry surface, a bottom surface, or an important end surface. For a three-dimensional CAD model, there are generally at least three reference surfaces in three directions, and the three reference surfaces are perpendicular to each other.
[0057] Definition 3: Reference parallel plane
[0058] A plane parallel to a datum plane and perpendicular to two other datum planes, such as Figure 2 As shown in (a).
[0059] Definition 4: Reference vertical plane
[0060] A plane that is perpendicular to a reference plane and inclined to the other two reference planes, such as Figure 2 as shown in (b).
[0061] Definition 5: General Position Surface
[0062] A plane that is inclined with respect to any reference plane, such as Figure 2 as shown in (c).
[0063] Definition 6: Constraint
[0064] In physics, constraint refers to the geometric or kinematic restrictions imposed on the motion of a non-free particle system. The concept of constraint in the present invention is the restriction on the parallel motion of points on a three-dimensional CAD model in a reference direction or the rotation around a linear axis.
[0065] Definition 7: Point Constraint Degree
[0066] Point constraint degree: The constraint of a point in a 3D CAD model is expressed as: Vertex ( x , y, z ),in Vertex is the name of the point, x , y and z They represent the degree of point constraint in three reference directions respectively. When a point is constrained in a certain reference direction, the value is 1, and when it is not constrained, the value is 0.
[0067] Definition 8: Point Constraint Gradient Table
[0068] The point constraint degree gradient table refers to the gradual change of the constraint state of the key points on the 3D CAD model as the annotation size increases in the annotated 3D CAD model. Vertex ( x , y , z )of x , y and z A sequence table whose value gradually changes from 0 to 1.
[0069] like Figure 3 As shown, Figure 3 The figure shows the process of the vertices of the 3D CAD model changing with the 3D dimension annotation. In the initial state, the point constraint value of each vertex in the 3D CAD model is 0, and the dimension annotation reference direction is established, which is x direction, y Direction and z After the three-direction datum is established, the point constraint degree of each vertex will change. D 1, since this size is constrained x direction, E , F , G and H Four points x The point constraint values of the reference direction are all changed to 1. D 2. Since this size is constrained z direction, therefore, the vertices in the 3D CAD model z The point constraint value of the reference direction may change, which is marked D After 3 dimensions, since the size is y Direction, the vertices in the 3D CAD model y The point constraint value of the reference direction may change. The point constraint value of each vertex changes as follows: Figure 3 And as shown in Table 1.
[0070]
[0071] Step 2: Establish constraint adding rules for the 3D CAD model during the automatic dimensioning process.
[0072] The point constraint degree changes gradually with the dimensioning, and the following rules apply when changing:
[0073] Rule 1: The point constraint value of a point on the reference plane in the normal direction of the reference plane is 1;
[0074] Rule 2: For a plane that is parallel to the reference plane and has a unique dimension in the normal direction of the reference plane, the point constraint value of the point on the plane in the normal direction of the reference plane is 1;
[0075] Rule 3: For a point on a reference vertical plane, if the equation of the reference vertical plane is known, when the point constraint value of the point in the normal direction of the reference plane perpendicular to the plane is 1, and the point constraint value of the point in any direction of the normal direction of the other two reference planes is 1, then the point constraint value of the point in the remaining reference directions is 1;
[0076] Rule 4: For a point on a general position plane, if the point constraint value of the point in two reference directions is 1, and the equation of the plane to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1;
[0077] Rule 5: If the point constraint value of a point in at least one reference direction is 1, and the equation of the line to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1;
[0078] Rule 6: If a plane has a dimension in the normal direction to a fixed plane, then the equation of the plane is known (points, lines, and planes can all be expressed by equations. If the equations and some known conditions are known, some unknown quantities can be calculated);
[0079] Rule 7: If there are 3 or more points on a plane that are not on the same line and are completely constrained, then the equation of the plane is known and the plane is fixed;
[0080] Rule 8: If the equations of the two planes forming the intersection are known, then the position of the intersection is fixed (the intersection of two planes will produce an intersection line. If the equations of the two planes are known, then the position of the intersection between them is fixed);
[0081] Rule 9: If there is an angular dimension between a plane and a plane whose position is known, then the position of the plane is also fixed;
[0082] Rule 10: The priority of selecting elements is in the following order: surface > line > point, where elements are the geometric elements of points, lines and surfaces used to define and represent dimensions on the 3D CAD model.
[0083] The constraint adding rules can be generally divided into two categories: one is direct adding constraint rules (rule 1 and rule 2), and the other is indirect adding constraint rules (rule 3, rule 4 and rule 5). Direct adding constraint rules are applied to the scale elements parallel to the reference plane. The indirect adding constraint rules cannot directly change the point constraint degree of the topological point by adding dimensions. They mainly rely on the judgment of the fixed situation of the geometric information of the topological structure (rule 6 to rule 9) to indirectly constrain the point constraint degree of the topological point. Usually, the point constraint degree value of the topological point is updated in real time in the order of rule 3, rule 4, rule 5 and rule 6. In the dimensioning process, the order of selecting scale elements is based on rule 10.
[0084] Step 3: Initialize the point constraint degree of each vertex in the 3D CAD model to obtain the initial state of the point constraint degree gradient table; update the point constraint degree value of each vertex in the point constraint degree gradient table in the initial state according to the position of the reference plane, and then dimension all reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. After each dimension is marked, the point constraint degree values of all vertices in the point constraint degree gradient table are updated until the point constraint degree values of all vertices in the 3D CAD model are 1.
[0085] In order to more clearly express the dimensioning process, after describing the implementation steps, the present invention illustrates the specific implementation method through a dimensioning example.
[0086] Step 1: Parsing and processing of B-Rep model.
[0087] B-Rep model, or Boundary Representation, is an accurate method for representing three-dimensional geometric bodies. It is a commonly used model type in CAD and is also the three-dimensional CAD model processed by the present invention. When performing the automatic dimensioning function on the B-Rep model, the three-dimensional CAD model is first processed in the following order:
[0088] (1) Interactively determine the three main annotation reference planes, requiring the reference planes in the three directions to be perpendicular to each other;
[0089] (2) Align the annotation reference plane with the coordinate system to ensure that the reference coordinate system is consistent with the three reference planes of the 3D CAD model, so as to calculate the value of the annotation dimension when automatically annotating the dimension. The alignment method adopts a general method and will not be described in detail. When the annotation reference plane and the coordinate system are aligned, the annotation reference plane is equivalent to the coordinate system.
[0090] (3) Traverse all faces in the model, determine the plane type according to the relative position between the plane and the reference plane, and store them in three sets: reference parallel plane set P 1={…}, reference vertical plane setP 2={…}, general position surface set P 3={…}.
[0091] Assume that the normal vectors of the three reference planes are: , , , the normal to the dimensioned plane is ,but:
[0092] (a) Determination of reference parallel surface:
[0093] or or (The cross product of two vectors here is the vector product).
[0094] (b) Determination of the reference vertical plane:
[0095] The plane being dimensioned is perpendicular to noodle:
[0096] and and (The dot product of two vectors here is the scalar product).
[0097] The plane being dimensioned is perpendicular to noodle:
[0098] and and .
[0099] The plane being dimensioned is perpendicular to noodle:
[0100] and and .
[0101] (c) Determination of general position surface:
[0102] and and .
[0103] Step 2: Initialize the point constraints of the 3D CAD model.
[0104] Traverse all vertices in the 3D CAD model, with each vertex as a row and the dimensions marked in sequence as columns (as shown in Table 1). The initial table columns are divided into "initial states" and the point constraint degree of each vertex is defined as Vertex (0, 0, 0).
[0105] After the reference plane is aligned with the coordinate system of the 3D CAD model, the constraint status of each vertex in the table is updated, such as the "fixed reference plane" column in Table 1, and updated according to Rule 1.
[0106] Step 3: Dimension the datum parallel surface.
[0107] Traverse the base parallel face set P For all the datum parallel surfaces in 1={…}, for each datum parallel surface, dimension is marked along the normal direction of the corresponding datum surface; for each dimension, a column of values is added to the point constraint degree gradient table, and the point constraint status of all vertices is updated using rules 1-10.
[0108] like Figure 4 As shown, the size D 1 is marked as a fixed dimension first, and then the dimension between the reference parallel plane and the reference plane (the reference plane is the reference plane parallel to the reference parallel plane) is marked, such as Figure 4 Size in D 2 to D 8. The change of point constraint degree of each vertex after marking is as follows Figure 4 shown.
[0109] Step 4: Dimension the reference vertical surface.
[0110] The priority of selecting the ruler element in the marking process of the present invention is in the following order: surface > line > point (rule 10). The specific implementation process is as follows:
[0111] Traverse the reference vertical surface set P 2 = all the reference vertical planes in {…}, for each plane in the reference vertical plane, traverse each line (topological line) on each plane, if the point constraint value of the points on the topological line in the same reference direction is 0, and the topological line is parallel to the reference plane (referred to as "condition A ”), then do the following:
[0112] (1) Add a dimension between the straight line as a ruler and the reference plane in the direction where the constraint state is 0;
[0113] (2) Add a column to the point constraint degree gradient table and update the point constraint degree value in the point constraint degree gradient table according to rule 2;
[0114] (3) Apply Rule 7, Rule 3, Rule 4, Rule 8 and Rule 5 in sequence to further update the point constraint value on the topological surface associated with the topological line;
[0115] (4) Determine whether the conditions are still met A If there is a straight line, execute (1)-(3). If there is no straight line that satisfies the condition AThe process returns to (1) and processes the next face until all faces have been processed.
[0116] The present invention Figure 5 Demonstrate the automatic marking process of the reference vertical surface, as follows:
[0117] exist Figure 5 In the face F 1 knead the noodles F 2 is the reference vertical plane. According to the point constraint of the current topological point, the line is selected. E 1. E 2. E 3 and E 4 Add dimensions as ruler D 9 to D 12. After labeling is completed, the point constraint degree of each topological point is updated according to rules 2 to 10, such as Figure 5 As shown, at this time F Point on 1 V 1 、V 2 、V The point constraint values of 4 are all 1, so the surface F 1 is fixed (rule 7); face F Point on 2 V 1 、V 4 、V The point constraint values of 6 are all 1, so the surface F 2 is fixed (rule 7).
[0118] Step 5: Mark the general location surface.
[0119] The specific implementation process is as follows:
[0120] Traverse the general location face set P 3 = all faces in {…}; for each face, check the topological points on the face and perform the following corresponding processing according to different conditions:
[0121] (1) If the point constraint degree of a topological point is not constrained in any of the three reference directions (referred to as “condition B 1”) is executed as follows:
[0122] ① Select a reference plane in any direction, take the topological point as the ruler, and add a dimension between the reference plane and the point;
[0123] ② Update the point constraint values of all points according to rule 2;
[0124] ③ Use rules 8, 4 and 5 in turn to further update the point constraint values on the associated topological surface;
[0125] ④ Determine whether there are other conditions that meet the requirements on this surfaceB If there is a point 1, execute ①-③.
[0126] (2) If the conditions are not met B 1, and if the point constraint degree of the topological point is not constrained in the two reference directions (referred to as "condition B 2”) is executed as follows:
[0127] ① Select a reference plane in any direction, take the topological point as the ruler, and add a dimension between the reference plane and the point;
[0128] ② Update the point constraint values of all points according to rule 2;
[0129] ③ Use rules 7, 4, 8, 5, etc. in sequence to further update the point constraint status on the associated topological surface;
[0130] ④ Determine whether the topological surface still meets the conditions B If there is point 2, execute ①-③.
[0131] (3) If the conditions are not met B 2, and if the point constraint degree of the topological point is unconstrained in only one reference direction (referred to as "condition B 3”) is executed as follows:
[0132] ①Using the topological point as the ruler, add a linear dimension between the reference plane and the point in the direction of the unconstrained degree of freedom;
[0133] ② Update the point constraint values of all points according to rule 2;
[0134] ③ Use rules 7, 4, 8, 5, etc. in sequence to further update the point constraint status on the associated topological surface;
[0135] ④ Determine whether there are other conditions that meet the requirements on this surface B If the condition 3 is met, execute ①-③; if the condition is not met, execute ①-③. B 3, the next face is processed until all faces are processed.
[0136] like Figure 6 As shown in the figure, point V 3 By dimensioning D After 14, the point constraint values all become 1. V 7 Only one direction is not constrained, and a dimension is generated between the missing direction and the corresponding reference plane D 13. At this time V 7 The constraints in the three reference directions are all "1"; point V 9. V10 is unconstrained in both directions, by dimension D 16, making V The two constraints at 9 are known, and since V 9 points belong to the reference vertical plane F 1, while F 1 is fixed, according to rule 3, point V The point constraint values in the three directions of 9 are all 1. So far, the general position surface F 3 points V 3. V 7. V The point constraint values of 9 are all 1. F 3Fixed; by adding size D 17. D 18, making F Point on 3 V 10 and V 11 are the known constraints of two points, and since the general position surface F 3 fixed, therefore, V 10 and V 11The point constraint values in all three directions are 1.
[0137] It can be seen from the above description that the present invention has the following advantages:
[0138] (1) By adopting the concept of point constraint, the idea of checking while labeling runs through the entire labeling process, so that automatic 3D dimensioning can be realized under the guidance of the point constraint gradient table;
[0139] (2) The point constraint degree gradient table displays the dimensioning status of the 3D CAD model in real time, ensuring that the dimensioning is complete without generating dimension redundancy.
[0140] The present invention also provides a 3D CAD model dimensioning system, comprising:
[0141] A point constraint degree gradient table definition module is used to define point constraint degrees and point constraint degree gradient tables, wherein the point constraint degrees describe the constraint states of vertices in three reference directions in a three-dimensional CAD model. When a vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when a vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of a three-dimensional CAD model gradually change from 0 to 1 during the dimensioning process;
[0142] A constraint adding rule determination module is used to formulate constraint adding rules for 3D CAD models during dimensioning;
[0143] A plane type determination module is used to determine three reference planes of a three-dimensional CAD model, and determine a reference parallel plane, a reference vertical plane, and a general position plane according to the relative positions of each plane in the three-dimensional CAD model and the three reference planes; the reference parallel plane is a plane parallel to a certain reference plane and perpendicular to the other two reference planes; the reference vertical plane is a plane perpendicular to a certain reference plane and inclined to the other two reference planes; the general position plane is a plane inclined to any reference plane;
[0144] The dimensioning module is used to initialize the point constraint degree of each vertex in the 3D CAD model and obtain the initial state of the point constraint degree gradient table; update the point constraint degree value of each vertex in the point constraint degree gradient table in the initial state according to the position of the reference plane, and then dimension all the reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. After each dimension is marked, the point constraint degree values of all vertices in the point constraint degree gradient table are updated until the point constraint degree values of all vertices in the 3D CAD model are 1.
[0145] The present invention also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute a three-dimensional CAD model dimensioning method.
[0146] The present invention also provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded by a processor to execute a three-dimensional CAD model dimensioning method.
[0147] The embodiments described above are only preferred specific implementation modes of the present invention, and the protection scope of the present invention is not limited thereto. Any simple changes or equivalent replacements of the technical solutions that can be obviously obtained by any technician familiar with the field within the technical scope disclosed in the present invention belong to the protection scope of the present invention.
Claims
1. A 3D CAD model dimensioning method, characterized in that: The steps include: Define point constraint degree and point constraint degree gradient table, wherein the point constraint degree describes the constraint state of the vertex in the three-dimensional CAD model in three reference directions. When the vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when the vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of the three-dimensional CAD model gradually change from 0 to 1 during the dimensioning process; Formulate rules for adding constraints to 3D CAD models during dimensioning; Determine three reference planes of the 3D CAD model, and determine a reference parallel plane, a reference vertical plane and a general position plane according to the relative positions of each plane in the 3D CAD model and the three reference planes; the reference parallel plane is a plane parallel to a certain reference plane and perpendicular to the other two reference planes; the reference vertical plane is a plane perpendicular to a certain reference plane and inclined to the other two reference planes; the general position plane is a plane inclined to any reference plane; Initialize the point constraint degree of each vertex in the 3D CAD model to obtain the initial state of the point constraint degree gradient table; update the point constraint degree value of each vertex in the point constraint degree gradient table in the initial state according to the position of the reference plane, and then mark the dimensions of all reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. After each dimension is marked, the point constraint degree values of all vertices in the point constraint degree gradient table are updated until the point constraint degree values of all vertices in the 3D CAD model are 1; The constraint adding rules are specifically as follows: Rule 1: The point constraint value of a point on the reference plane in the normal direction of the reference plane is 1; Rule 2: For a plane that is parallel to the reference plane and has a unique dimension in the normal direction of the reference plane, the point constraint value of the point on the plane in the normal direction of the reference plane is 1; Rule 3: For a point on a reference vertical plane, if the equation of the reference vertical plane is known, when the point constraint value of the point in the normal direction of the reference plane perpendicular to the plane is 1, and the point constraint value of the point in any direction of the normal direction of the other two reference planes is 1, then the point constraint value of the point in the remaining reference directions is 1; Rule 4: For a point on a general position plane, if the point constraint value of the point in two reference directions is 1, and the equation of the plane to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1; Rule 5: If the point constraint value of a point in at least one reference direction is 1, and the equation of the line to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1; Rule 6: If a plane has a normal dimension to a fixed plane, the equation of the plane is known; Rule 7: If there are 3 or more points on a plane that are not on the same straight line and are completely constrained, then the plane is fixed and the equation of the plane is known; Rule 8: If the equations of the two planes forming the intersection are known, the position of the intersection is fixed; Rule 9: If there is an angular dimension between a plane and a plane whose position is known, then the position of the plane is also fixed; Rule 10: The priority of selecting elements is in the following order: surface > line > point, where elements are the geometric elements of points, lines and surfaces used to define and represent dimensions on the 3D CAD model.
2. The 3D CAD model dimensioning method according to claim 1, characterized in that: The step of dimensioning the reference parallel surface comprises the following steps: Traverse all the datum parallel surfaces, and for each datum parallel surface, mark the dimensions along the normal direction of the corresponding datum surface; Each time a dimension is marked, a column of values is added to the point constraint degree gradient table, and the point constraint states of all vertices in the point constraint degree gradient table are updated using the above-mentioned rules 1 to 10.
3. The 3D CAD model dimensioning method according to claim 1, characterized in that: The dimensioning of the reference vertical surface is specifically as follows: Traverse all the reference vertical planes. For each reference vertical plane, traverse each straight line on each reference vertical plane. If the point constraint values of the points on the straight line in the same reference direction are all 0, and the straight line is parallel to the reference plane, then add a dimension between the straight line and the reference plane. Update the point constraint status of all vertices in the point constraint degree gradient table according to the rules 1 to 10.
4. The 3D CAD model dimensioning method according to claim 1, characterized in that: The dimensioning of the general position surface is specifically as follows: Traverse the 3D CAD model and perform the following processing on each general position surface: If the point constraint degree of a topological point on a general position plane is unconstrained in only one reference direction, a linear dimension is added between the reference plane and the point in the direction of the unconstrained degree of freedom, and the point constraint status in the point constraint degree gradient table is added and updated according to rules 1 to 10; If the point constraint of a topological point is not constrained in two reference directions, select the topological points on the topological plane whose spatial position is fixed, add a linear dimension between the reference plane in any unconstrained direction and the point, and add and update the point constraint status in the point constraint degree gradient table according to rules 1 to 10; add a linear dimension between the reference plane in another unconstrained direction and the point, and add and update the point constraint status in the point constraint degree gradient table according to rules 1 to 10; The topological surface is a surface involved in the modeling of the three-dimensional CAD model; If the point constraint degree of a topological point in the three reference directions is 0, add a linear dimension between the reference plane and the point in any direction, and add and update the point constraint status in the point constraint degree gradient table according to rules 1 to 10.
5. A 3D CAD model automatic dimensioning system, characterized in that: include: A point constraint degree gradient table definition module is used to define point constraint degrees and point constraint degree gradient tables, wherein the point constraint degrees describe the constraint states of vertices in three reference directions in a three-dimensional CAD model. When a vertex is constrained in a certain reference direction, the point constraint degree value is 1, and when a vertex is not constrained in a certain reference direction, the point constraint degree value is 0; the point constraint degree gradient table is a sequence table in which the point constraint degree values of each vertex of a three-dimensional CAD model gradually change from 0 to 1 during the dimensioning process; A constraint adding rule determination module is used to formulate constraint adding rules for 3D CAD models during dimensioning; A plane type determination module is used to determine three reference planes of a three-dimensional CAD model, and determine a reference parallel plane, a reference vertical plane, and a general position plane according to the relative positions of each plane in the three-dimensional CAD model and the three reference planes; the reference parallel plane is a plane parallel to a certain reference plane and perpendicular to the other two reference planes; the reference vertical plane is a plane perpendicular to a certain reference plane and inclined to the other two reference planes; the general position plane is a plane inclined to any reference plane; The dimensioning module is used to initialize the point constraint of each vertex in the 3D CAD model and obtain the initial state of the point constraint gradient table; update the point constraint value of each vertex in the initial state in the point constraint gradient table according to the position of the reference plane, and then dimension all the reference parallel planes, reference vertical planes and general position planes in turn according to the constraint adding rules. After each dimension is marked, the point constraint values of all vertices in the point constraint gradient table are updated until the point constraint values of all vertices in the 3D CAD model are 1; The constraint adding rules are specifically as follows: Rule 1: The point constraint value of a point on the reference plane in the normal direction of the reference plane is 1; Rule 2: For a plane that is parallel to the reference plane and has a unique dimension in the normal direction of the reference plane, the point constraint value of the point on the plane in the normal direction of the reference plane is 1; Rule 3: For a point on a reference vertical plane, if the equation of the reference vertical plane is known, when the point constraint value of the point in the normal direction of the reference plane perpendicular to the plane is 1, and the point constraint value of the point in any direction of the normal direction of the other two reference planes is 1, then the point constraint value of the point in the remaining reference directions is 1; Rule 4: For a point on a general position plane, if the point constraint value of the point in two reference directions is 1, and the equation of the plane to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1; Rule 5: If the point constraint value of a point in at least one reference direction is 1, and the equation of the line to which the point belongs is known, then the point constraint value of the point in the remaining reference directions is 1; Rule 6: If a plane has a normal dimension to a fixed plane, the equation of the plane is known; Rule 7: If there are 3 or more points on a plane that are not on the same straight line and are completely constrained, then the plane is fixed and the equation of the plane is known; Rule 8: If the equations of the two planes forming the intersection are known, the position of the intersection is fixed; Rule 9: If there is an angular dimension between a plane and a plane whose position is known, then the position of the plane is also fixed; Rule 10: The priority of selecting elements is in the following order: surface > line > point, where elements are the geometric elements of points, lines and surfaces used to define and represent dimensions on the 3D CAD model.
6. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the three-dimensional CAD model dimensioning method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the three-dimensional CAD model dimensioning method according to any one of claims 1-4.
