CN118427900A - Reverse reconstruction method and device for computer aided design model - Google Patents
Reverse reconstruction method and device for computer aided design model Download PDFInfo
- Publication number
- CN118427900A CN118427900A CN202410507927.8A CN202410507927A CN118427900A CN 118427900 A CN118427900 A CN 118427900A CN 202410507927 A CN202410507927 A CN 202410507927A CN 118427900 A CN118427900 A CN 118427900A
- Authority
- CN
- China
- Prior art keywords
- primitive
- cutting
- model
- reconstruction
- aided design
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011960 computer-aided design Methods 0.000 title claims abstract description 173
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000005520 cutting process Methods 0.000 claims abstract description 147
- 238000005516 engineering process Methods 0.000 claims abstract description 17
- 238000012545 processing Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 14
- 238000004422 calculation algorithm Methods 0.000 claims description 12
- 238000003860 storage Methods 0.000 claims description 8
- 238000010408 sweeping Methods 0.000 claims description 7
- 239000013598 vector Substances 0.000 claims description 5
- 230000006870 function Effects 0.000 claims description 3
- 238000005259 measurement Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 238000010276 construction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 241001394244 Planea Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000149 penetrating effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000007670 refining Methods 0.000 description 1
- 238000007789 sealing Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention provides a reverse reconstruction method and a device of a computer aided design model, wherein the method comprises the following steps: performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns; discretizing a plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model. The method simplifies CAD modeling operation, reduces interference of manual measurement errors, and improves reconstruction efficiency and accuracy of CAD models.
Description
Technical Field
The invention relates to the technical field of CAD modeling, in particular to a reverse reconstruction method and device of a computer aided design model.
Background
Reconstruction of a Computer-aided design (Computer-AIDED DESIGN, CAD) model is a key technology in the field of geometric modeling and processing, and is suitable for CAD model reconstruction scenes in which original design documents are missing or real objects cannot be obtained; CAD reconstruction plays a key role in reverse engineering, enabling users to recreate CAD models from alternative representations.
Reverse engineering is not just reconstructing a CAD model closely resembling the scan grid. The ability of reverse engineering to recover the original design intent, which supports a designer editing new variants of the original model to facilitate a wide range of manufacturing and engineering applications, may create wear defects from use, and may also create deviations from specific manufacturing paradigms (e.g., slip angles).
In the related art, the reconstruction of the CAD model is realized by accurately measuring the entity CAD model by using a special measuring tool, and then inputting the measured size into common CAD design software, so that the influence of measurement errors is easily caused in the entity measurement process, and the software fitting result is inaccurate; the model reconstruction method utilizing deep learning can automatically acquire cutting loop line data, but due to the lack of sharp features of the model, the cutting loop line fitting effect is poor, so that the reconstructed CAD model is inaccurate.
Disclosure of Invention
The invention provides a reverse reconstruction method and a reverse reconstruction device for a computer aided design model, which utilize CAD design software to reconstruct a CAD model, have large measurement error, and utilize a deep learning model reconstruction method to obtain a poor fitting effect of a cutting loop line, so that the reconstructed CAD model is inaccurate, and the reconstruction efficiency and accuracy of the CAD model are improved.
The invention provides a reverse reconstruction method of a computer aided design model, which comprises the following steps:
Performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns;
Discretizing the plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set;
Reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the body primitive reconstruction result is used for reconstructing a computer aided design CAD model; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
According to the reverse reconstruction of the computer aided design model provided by the invention, the plane cutting of the input grid model to obtain the cutting loop line comprises the following steps:
sweeping a surface of an input grid model by utilizing a lasso tool to obtain a closed ring surface, wherein the closed ring surface comprises a plurality of patches;
Searching from the plurality of patches according to a breadth-first algorithm to obtain a target patch set, and determining a cutting plane according to average normal direction, a center point and height parameters corresponding to each patch in the target patch set;
And cutting the input grid model according to the cutting plane to obtain the cutting loop.
According to the reverse reconstruction of the computer aided design model provided by the invention, the cutting line point columns comprise straight line point columns and arc point columns;
Before the discretizing the plurality of string point columns, the method further comprises:
And respectively carrying out sparsification processing on the straight-line point columns and the circular arc point columns to obtain a sparsification processing result.
According to the reverse reconstruction of the computer-aided design model provided by the invention, the target body primitive comprises a stretched body primitive of the CAD model;
Reconstructing target body primitives for performing Computer Aided Design (CAD) model according to the closed primitive ring set, wherein the obtaining of the reconstruction result of the body primitives comprises the following steps:
Optimizing the position information of the cutting plane corresponding to the cutting loop line according to the five-step binary search, and calculating the stretching parameters of the stretching body primitive according to the cutting plane after optimizing the position information and the farthest end of the cutting plane distance input grid model, wherein the stretching parameters comprise stretching length or stretching height;
Reconstructing the stretching body primitive according to the stretching parameters to obtain a stretching body primitive reconstruction result.
According to the reverse reconstruction of the computer-aided design model provided by the invention, the target body element comprises a swept body element of the CAD model;
reconstructing the target body primitives for performing the CAD model according to the closed primitive ring set, and obtaining the reconstruction result of the body primitives further comprises:
determining a scanning path and a profile curve according to a point set corresponding to an arc in the closed primitive ring set, and calculating a scanning form corresponding to a swept volume primitive by adopting the following formula:
Wherein v and u are nodes, P i,j is a control point, W i,j is a weight, i and j are sum indexes, (m+1), (n+1) is the total number of control points, P is the number of times of the NURBS curved surface in the direction corresponding to u, q is the number of times of the NURBS curved surface in the direction corresponding to v, and N i,p (u) and N j,q (v) are non-rational B spline basis functions defined on node vectors;
And reconstructing the swept volume primitive according to the scanning form to obtain a swept volume primitive reconstruction result.
According to the reverse reconstruction of the computer aided design model provided by the invention, the target body primitive comprises a stretching body primitive, a lofting body primitive, a sweeping body primitive and a rotating body primitive of the CAD model, and the body primitive reconstruction result comprises a stretching body primitive reconstruction result, a lofting body primitive reconstruction result, a sweeping body primitive reconstruction result and a rotating body primitive reconstruction result;
after the obtaining of the voxel reconstruction result, the method further comprises:
And performing Boolean operation on the extension primitive reconstruction result, the lofting primitive reconstruction result, the swept primitive reconstruction result and the rotator primitive reconstruction result to obtain a reconstructed computer aided design CAD model.
The invention also provides a reverse reconstruction device of the computer aided design model, which comprises:
The cutting module is used for carrying out plane cutting on the input grid model to obtain a cutting loop line, and the cutting loop line comprises a plurality of cutting line point columns;
The fitting module is used for carrying out discretization on the plurality of cutting line point columns to obtain a plurality of discrete line segments, and carrying out closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set;
The reconstruction module is used for respectively reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the body primitive reconstruction result is used for reconstructing a computer aided design CAD model; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for reverse reconstruction of the computer aided design model according to any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of reverse reconstruction of a computer aided design model as described in any one of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of reverse reconstruction of a computer aided design model as described in any one of the above.
According to the reverse reconstruction method and device for the computer aided design model, provided by the invention, the plane is cut on the input grid model to obtain the cutting loop line, discretization processing is carried out on a plurality of cutting line point columns to obtain a plurality of discrete line segments, closed loop fitting is carried out on the plurality of discrete line segments based on the line segments and the circular arc fitting technology to obtain the closed primitive loop set, and finally, the target primitives for carrying out the computer aided design CAD model are respectively reconstructed according to the closed primitive loop set to obtain the reconstruction result of the body primitives so as to reconstruct the computer aided design CAD model, so that CAD modeling operation is simplified, the fitting effect of the cutting loop line and the acquisition efficiency of relevant parameters of the body primitives are improved, meanwhile, the interference of manual measurement errors is reduced, and the reconstruction efficiency and accuracy of the CAD model are further improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for reverse reconstruction of a computer aided design model according to the present invention;
FIG. 2 is a schematic diagram of an interface for automatically calculating stretch parameters provided by the present invention;
FIG. 3 is a schematic diagram of an interface for acquiring a closed primitive ring set provided by the present invention;
FIG. 4 is a second flow chart of a method for reverse reconstruction of a CAD model according to the present invention;
FIG. 5 is a schematic diagram of a reverse reconstruction device of a computer aided design model according to the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes a method and apparatus for reverse reconstruction of a computer aided design model according to the present invention with reference to fig. 1 to 5.
Fig. 1 is a schematic flow chart of a method for reverse reconstruction of a computer aided design model, as shown in fig. 1, comprising the following steps:
And 110, carrying out plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns.
In this step, the input mesh model may be a three-dimensional network model, a surface model, a solid model, or the like.
In this embodiment, a closed torus may be formed on the three-dimensional mesh model surface along the trajectory swept by the mouse pointer trajectory using a lasso tool, thereby obtaining a corresponding cut torus.
In this embodiment, the cutting loop is a planar contour obtained by planar cutting the input mesh model with a specified cutting plane, and the contour includes a plurality of cutting line dot columns, and different volume primitives can be fitted and reconstructed by using the dot columns.
And 120, discretizing the plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on the line segments and the arc fitting technology to obtain a closed-loop set.
In the step, discretizing is carried out on the cutting line, namely, a straight line point row and an arc point row on the cutting ring line are separated, so that a plurality of groups of discrete line segments are obtained.
For example, each cut line point on the cut loop line may be discretized by a line reduction algorithm, e.g., using a Ramer-Douglas-Peucker (RDP) algorithm to discretize the cut line into a set of line segments, where the end points of each discrete line segment are represented as
In this embodiment, the present invention divides the cutting line into two types of elements, namely a straight line and an arc, according to its curvature characteristics; specifically, first, six nearest neighbors e ij e epsilon, j=1, 2, …,6 of each e i are taken, distances D l={|ei1ei2|,|ei2ei3|,|ei3ei | } and D r={|eiei4|,|ei4ei5|,|ei5ei6 | } on two sides are calculated, the distances are compared in D l and D r, and step size s is used; if there are two elements exceeding the defined step size s in D l and no element exceeding this threshold in D r, or two elements exceeding s in D r and no element exceeding this limit in D l, then continuing to designate e i as the split point; traversing closed primitive ring setsAnd cutting lines are segmented at the appointed segmentation points, and the segment and arc fitting technology is used for obtaining the parameter representation of the obtained segments, so that the degree of automation of cutting loop line fitting is improved, the model reconstruction efficiency is further improved, the possibility of human errors can be reduced, and more accurate and reliable CAD reconstruction is realized.
130, Respectively reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
In this step, a closed primitive ring set is obtainedAnd its corresponding cut surface P c, using various CAD reconstruction operations to reconstruct different parts of the model; specifically, a basic surface F is obtained by utilizing a curved surface sf based on loop constraint, and reconstruction processes of different body primitives are completed by adopting different CAD reconstruction operations.
In this embodiment, CAD reconstruction operations include stretching, lofting, sweeping, and rotating.
FIG. 2 is a schematic diagram of an interface for automatically calculating stretching parameters according to the present invention, in which in the embodiment shown in FIG. 2, in the initialization stage, 3D vertices ε (i.e., the end points of each discrete line segment) are obtained by RDP algorithm, the vertices are located in the world coordinate system, and then projected onto a 2D plane, and a 2D point list is obtained by coordinate transformationThe invention then calculates the bounding box B of epsilon * (representing the smallest rectangle that encloses all points in epsilon *), then translates and expands epsilon *, and projects the point sets into a 512 x 512 image to create a normalized representation for further processing and analysis at a later stage.
In this embodiment, the present invention performs Delaunay triangulation on the 2D point set ε * to obtain a set of trianglesThe triangulation process builds a triangle network covering the points of ε *, in order to create a binary mask M, the fill polygon algorithm in the sample OpenCV uses triangle T as input; specifically, the algorithm fills the inside of the triangle, generating a binary mask representing the shape of the projection object; to cope with the change in the height or position of the cutting plane, the present invention generates a new mask by moving the cutting plane up or downThe similarity between the two masks is determined by an overlap ratio (IOU) metric for quantifying the overlap between the two masks.
In this embodiment, the stretching length or the stretching height of the stretching body can be determined by calculating the distance between the initial patch in the closed torus and the boundary of the model object, so that the stretching parameters can be automatically obtained, and finally, the reconstructed stretching body primitive is obtained by a upPrism method.
In this embodiment, for the loft structure, after manually acquiring the upper and lower base planes F and manually selecting the loft modeling operation, the direct base plane F is input into the Open CASCADEs framework (OCC), and the loft plane F is constructed using the BRepOffsetAPI _ ThruSections class. And calling the BRepBuilderAPI-Sewing OCC class to splice the upper bottom surface, the lower bottom surface and the release surface together to obtain the reconstructed lofting body primitive.
In this embodiment, an arc is used to reconstruct a swept surface, after a scan modeling operation is manually selected, a scan cross-section point list and a scan path point list are fitted by means of a cutting loop line fitting, so as to construct a corresponding arc, and the arc is used to obtain a reconstructed swept volume primitive.
In this embodiment, the rotation surface can also be reconstructed using an arc; specifically, the rotational modeling operation is manually selected first, and then the rotational profile C (v) is constructed using the curve construction method described in the previous swept volume, unlike the previous acquisition scan path, where the rotational axis is constructed by selecting three points on the cutting line from step 120, which are used to form a circle; for example, the circle is represented by a nine-point circle as:
U=0,0,0,1/4,1/4,1/4,1/2,1/2,1/2,3/4,3/4,3/4,1,1,1;
The corresponding weights are respectively
In this embodiment, a straight line is created using the center o and the normal n to the corresponding cutting planeAs a rotation axis and aroundRotating C (v) 360 °, the resulting surface can be expressed as:
the node vectors are represented by U and V, and the control point is represented by P i,j=P0,j=Pj; the corresponding weights are defined as
In this embodiment, after obtaining a plurality of different volume primitives, these volume primitives are assembled to obtain a reconstructed CAD model.
According to the reverse reconstruction method of the computer aided design model, provided by the embodiment of the invention, the plane is cut on the input grid model to obtain the cutting loop line, discretization processing is carried out on a plurality of cutting line point columns to obtain a plurality of discrete line segments, closed loop fitting is carried out on the plurality of discrete line segments based on the line segments and the circular arc fitting technology to obtain the closed primitive loop set, and finally, the target primitives for carrying out the computer aided design CAD model are respectively reconstructed according to the closed primitive loop set to obtain the reconstruction result of the body primitives so as to reconstruct the computer aided design CAD model, so that CAD modeling operation is simplified, the fitting effect of the cutting loop line and the acquisition efficiency of relevant parameters of the body primitives are improved, meanwhile, the interference of manual measurement errors is reduced, and the reconstruction efficiency and accuracy of the CAD model are further improved.
In some embodiments, performing a planar cut on the input mesh model, obtaining a cut loop includes: sweeping a surface of an input grid model by utilizing a lasso tool to obtain a closed ring surface, wherein the closed ring surface comprises a plurality of patches; searching a target patch set from a plurality of patches according to a breadth-first algorithm, and determining a cutting plane according to average normal direction, a center point and height parameters corresponding to each patch in the target patch set; and cutting the input grid model according to the cutting plane to obtain a cutting loop.
In practice, an Easy3D lasso (lasso) tool may be used to form a closed torus from a three-dimensional mesh model M surface along a path swept by the mouse pointer path and pick up all patches within the torusThe ability to fit the normal to the cutting plane is enabled because the lasso tool will pick up all patches in the entire model that lie within the closed loopResulting in a false normal fit of the facet.
In this embodiment, in order to obtain a communicating and non-penetrating set of dough sheetsAdopting breadth-first algorithm (Breadth-FIRST SEARCH, BFS) to take the patch closest to the pointer as root node P * E P, re-optimizing and selecting the patch until the BFS algorithm converges, and then collecting the optimized patchAnd calculating average normal and center points as normal and height parameters to construct a cutting plane P c, and intersecting the cutting plane P c with M to form a cutting line, wherein the cutting line penetrates through the whole input grid model to obtain a corresponding cutting loop.
According to the reverse reconstruction method of the computer aided design model, a lasso tool is used for scanning the surface of the input grid model to obtain a closed ring surface, then a target surface patch set is obtained by searching from a plurality of surface patches according to a breadth-first algorithm, a cutting plane is determined according to average normal direction, a center point and height parameters corresponding to each surface patch in the target surface patch set, finally the input grid model is cut according to the cutting plane to obtain a cutting ring line, the situation that normal fitting errors of the cutting plane are easy to occur when the lasso tool is used for cutting the model can be avoided, and therefore the accuracy of model cutting is improved.
In some embodiments, the plurality of cut line point columns includes a straight line point column and a circular arc point column; before discretizing the plurality of string point columns, the method further comprises: and (3) performing sparsification processing on the linear point columns and the circular arc point columns respectively to obtain a sparsification processing result.
In this embodiment, before the discretization processing is performed on the cutting loop, coefficient processing may be performed at different positions of the cutting loop, for example, for a straight line point column of the cutting loop, an approximate straight line may be used, sparse discrete points may be separated at the primitive edge, and for a four-edge angle of the cutting loop, approximate circular arcs may be used, and denser discrete points may need to be separated at the circular arcs of the cutting loop; similarly, for other curved portions on the cutting loop, it is also necessary to separate denser discrete points, so that the original curved portion can be accurately fitted through the discrete points later.
In this embodiment, the algorithm for implementing the thinning processing includes sparse matrix multiplication, ridge regression, minimum angle regression, and the like, and the embodiment is not particularly limited.
According to the reverse reconstruction method of the computer aided design model, disclosed by the embodiment of the invention, before discretization processing is carried out on a plurality of cutting line point columns, the circular arc point columns and the circular arc point columns are respectively subjected to sparsification processing, so that a sparsification processing result is obtained, more accurate data support is provided for discretization processing of different positions of the cutting loop, and the accuracy of fitting of the cutting loop is further improved.
FIG. 3 is a schematic diagram of an interface for acquiring a closed primitive ring set, in the embodiment shown in FIG. 3, after a cutting ring is obtained by cutting an input grid model, different positions (straight edges and circular arcs) of the cutting ring are subjected to sparsification processing respectively, so that a plurality of discrete points can be obtained on the cutting ring, as shown in (a); discretizing a plurality of discrete points to obtain a plurality of discrete line segments, wherein the two ends of each discrete line segment are shown as circles in (b); and then carrying out straight line fitting on the discrete line segments corresponding to the straight line edges, and carrying out arc fitting on the discrete line segments corresponding to the arcs to obtain fitted primitives, namely a closed primitive ring set, as shown in (c).
In some embodiments, the target volume primitive comprises a stretched volume primitive of a CAD model; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set, wherein the obtaining of the reconstruction result of the body primitives comprises the following steps: optimizing position information of a cutting plane corresponding to a cutting loop line according to the five-step binary search, and calculating stretching parameters of stretching body primitives according to the cutting plane after optimizing the position information and the farthest end of a cutting plane distance input grid model, wherein the stretching parameters comprise stretching length or stretching height; reconstructing the stretching body primitive according to the stretching parameters to obtain a stretching body primitive reconstruction result.
In this embodiment, for the reconstruction process of the CAD model with a more complex structure, if the intersection ratio IOU between the cutting planes generated during the upward and downward movement is lower than the empirical threshold, a five-step binary search method may be used to obtain the exact position of the cutting plane P c; specifically, in this iterative process, by refining the position of P c to match the object boundary, the stretched length or height of the stretched body can be determined by calculating the distance between the initial P c and the distal-most end; the required height of the tensile body is expressed according to the distance so as to surround the whole object.
In this embodiment, after the stretching height is automatically determined, the corresponding stretched body primitive reconstruction result is obtained by using the upPrism method.
In this embodiment, the preset experience threshold may be set according to the user's needs, for example, the experience threshold may be set to 0.965.
According to the reverse reconstruction method of the computer aided design model, provided by the embodiment of the invention, the position information of the cutting plane corresponding to the cutting loop is optimized through five-step binary search, the stretching parameters of the stretching body primitive are calculated according to the cutting plane after the position information is optimized and the farthest end of the cutting plane distance input grid model, finally the stretching parameters are reconstructed for the stretching body primitive, the stretching body primitive reconstruction result is obtained, the automatic acquisition of the stretching parameters of the stretching body primitive is realized, the model is allowed to be directly edited in the reconstruction process, manual setting is not needed, the parameter setting error is reduced, and the accuracy of reconstructing the stretching body primitive is improved.
In some embodiments, the target volume primitive comprises a swept volume primitive of a CAD model; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set, and obtaining a body primitive reconstruction result further comprises: determining a scanning path and a profile curve according to a point set corresponding to an arc in the closed primitive ring set, and calculating a scanning form corresponding to the swept volume primitive by adopting the following formula:
Wherein v and u are nodes, P i,j is a control point, W i,j is a weight, i and j are sum indexes, (m+1), (n+1) is the total number of control points, P is the number of times of the NURBS curved surface in the direction corresponding to u, q is the number of times of the NURBS curved surface in the direction corresponding to v, and N i,p (u) and N j,q (v) are non-rational B spline basis functions defined on node vectors; and reconstructing the swept volume primitive according to the scanning form to obtain a swept volume primitive reconstruction result.
In the existing CAD model reconstruction technique, when a swept contour including an arc surface is scanned, the upper edge and the lower edge of the swept contour are easy to be classified, and the existing CAD model reconstruction technique directly processes the arc surface continuous line of the original model on the swept volume, thereby losing the detail of the model contour; and when the sweep profile is thinner (the thickness of the sweep profile is lower than a preset thickness threshold), the generated edge of the sweep body is abnormal, and in addition, the conditions of lack of sealing surfaces at two ends of the sweep body and the like can also occur, so that the reconstruction accuracy of the CAD model reconstruction technology on the sweep body element is low.
In this embodiment, the swept surface is reconstructed using an arc of a circle, which can be accurately represented by a non-uniform rational B-spline (NURBS); specifically, after the manual selection of the scan modeling operation, the scan profile point list and the scan path point list are fitted by the cutting loop line fitting method adopted in step 120, and the arc corresponding to the scan surface is constructed by adopting the curve construction method, and finally the scan profile and the scan path are returned by using the corresponding point set, and the translation form of the scan surface is determined by the following formula:
S(u,v)=T(v)+C(u);
wherein S (u, v) is the translation form of the scanning surface, T (v) is the scanning path, and C (u) is the profile curve.
In this embodiment, it is assumed that T (v) and C (u) are expressed in NURBS, and T (v) is expressed as follows:
the expression of C (u) is shown as follows:
By defining on the independent node vectors V= { V 0,…,vs } and U= { U 0,…,ur } to obtain the specific representation mode of S (U, V), and carrying out scanning reconstruction on the swept volume primitive according to the scanning form, a more accurate swept volume primitive reconstruction result can be obtained.
According to the reverse reconstruction method of the computer aided design model, provided by the embodiment of the invention, the scanning path and the profile curve are determined according to the point set corresponding to the circular arc in the closed primitive ring set, so that the scanning form corresponding to the primitive of the swept volume is calculated, and then the primitive of the swept volume is reconstructed according to the scanning form, so that the reconstruction result of the primitive of the swept volume is obtained, and the accuracy of the primitive reconstruction of the swept volume is improved.
In some embodiments, the target volume primitive comprises a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model, and the volumetric primitive reconstruction results comprise a tensile volume primitive reconstruction result, a loft volume primitive reconstruction result, a swept volume primitive reconstruction result, and a rotator primitive reconstruction result; after obtaining the voxel reconstruction result, the method further comprises: and performing Boolean operation on the extension primitive reconstruction result, the lofting primitive reconstruction result, the swept primitive reconstruction result and the rotator primitive reconstruction result to obtain a reconstructed computer aided design CAD model.
In this embodiment, after the reconstruction result (for example, the stretched volume primitive reconstruction result, the lofted volume primitive reconstruction result, the swept volume primitive reconstruction result, and the rotated body primitive reconstruction result) of each partial volume primitive of the CAD model is obtained by the individual volume primitive reconstruction method in the above embodiment, these blocks may be combined together by manually selecting an appropriate boolean operation to obtain a reconstructed CAD model.
In this embodiment, the assembly of the CAD model may also be performed by automatically selecting a boolean operation with a higher degree of matching according to a preset calculation of the degree of matching between the reconstruction result of each primitive and boolean operations of different types.
In this embodiment, boolean operations include union, intersection and difference sets, all implemented using an OCC (Open CASCADE Technology, open cascade technique) framework.
FIG. 4 is a second flow chart of the method for reverse reconstruction of a CAD model according to the present invention, wherein in the embodiment shown in FIG. 4, the reverse reconstruction of the CAD model is realized by the following steps: s1, inputting a grid model by plane cutting, and obtaining an annular cutting line point array; s2, automatically fitting the cutting line point columns into primitive edges of different types, and connecting the primitive edges to form a cutting loop; s3, constructing a cutting loop line into a body primitive through a series of classical CAD modeling operations including stretching, lofting, rotating and sweeping; s4, assembling the volume primitives together by utilizing various Boolean operations to approach the target geometric body, and obtaining the reconstructed CAD model.
According to the reverse reconstruction method of the computer aided design model, which is provided by the embodiment of the invention, the reconstructed computer aided design CAD model is obtained by carrying out Boolean operation on the extension primitive reconstruction result, the lofting primitive reconstruction result, the swept primitive reconstruction result and the rotator primitive reconstruction result, the CAD model can be obtained by assembling four primitives, and compared with the original model, the reconstructed CAD model is more concise and has no noise.
The following describes the reverse reconstruction device of the computer aided design model provided by the present invention, and the reverse reconstruction device of the computer aided design model described below and the reverse reconstruction method of the computer aided design model described above can be referred to correspondingly with each other.
Fig. 5 is a schematic structural diagram of a reverse reconstruction device of a computer aided design model according to the present invention, and as shown in fig. 5, the reverse reconstruction device of a computer aided design model includes: a cutting module 510, a fitting module 520, and a reconstruction module 530.
The cutting module 510 is configured to perform plane cutting on the input grid model to obtain a cutting loop, where the cutting loop includes a plurality of cutting line dot columns;
The fitting module 520 is configured to perform discretization on the plurality of cutting line point columns to obtain a plurality of discrete line segments, and perform closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set;
a reconstruction module 530, configured to reconstruct target primitives for performing the CAD model according to the closed primitive ring set, respectively, to obtain a reconstruction result of the primitives; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
According to the reverse reconstruction device of the computer aided design model, provided by the embodiment of the invention, the plane is cut on the input grid model to obtain the cutting loop line, discretization processing is carried out on a plurality of cutting line point columns to obtain a plurality of discrete line segments, closed loop fitting is carried out on the plurality of discrete line segments based on the line segments and the circular arc fitting technology to obtain the closed primitive loop set, and finally, the target primitives for carrying out the computer aided design CAD model are respectively reconstructed according to the closed primitive loop set to obtain the reconstruction result of the body primitives so as to reconstruct the computer aided design CAD model, so that CAD modeling operation is simplified, the fitting effect of the cutting loop line and the acquisition efficiency of relevant parameters of the body primitives are improved, meanwhile, the interference of manual measurement errors is reduced, and the reconstruction efficiency and accuracy of the CAD model are further improved.
Fig. 6 is a schematic structural diagram of an electronic device according to the present invention, and as shown in fig. 6, the electronic device may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a method of reverse reconstruction of a computer aided design model, the method comprising: performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns; discretizing a plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises one or more of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing a method of reverse reconstruction of a computer-aided design model provided by the methods described above, the method comprising: performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns; discretizing a plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises one or more of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
In yet another aspect, the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of reverse reconstruction of a computer aided design model provided by the methods described above, the method comprising: performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns; discretizing a plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the reconstruction result of the body primitive is used for reconstructing a CAD model of the computer aided design; wherein the target volume primitive comprises one or more of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for reverse reconstruction of a computer aided design model, comprising:
Performing plane cutting on the input grid model to obtain a cutting loop line, wherein the cutting loop line comprises a plurality of cutting line point columns;
Discretizing the plurality of cutting line point columns to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set;
Reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the body primitive reconstruction result is used for reconstructing a computer aided design CAD model; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
2. The method for reverse reconstruction of a computer aided design model of claim 1, wherein performing planar cutting on the input mesh model to obtain a cutting loop line comprises:
sweeping a surface of an input grid model by utilizing a lasso tool to obtain a closed ring surface, wherein the closed ring surface comprises a plurality of patches;
Searching from the plurality of patches according to a breadth-first algorithm to obtain a target patch set, and determining a cutting plane according to average normal direction, a center point and height parameters corresponding to each patch in the target patch set;
And cutting the input grid model according to the cutting plane to obtain the cutting loop.
3. The method for reverse reconstruction of a computer aided design model of claim 1, wherein the plurality of cutting line point columns include a straight line point column and an arc point column;
Before the discretizing the plurality of string point columns, the method further comprises:
And respectively carrying out sparsification processing on the straight-line point columns and the circular arc point columns to obtain a sparsification processing result.
4. The method of claim 1, wherein the target volume primitive comprises a stretched volume primitive of the CAD model;
Reconstructing target body primitives for performing Computer Aided Design (CAD) model according to the closed primitive ring set, wherein the obtaining of the reconstruction result of the body primitives comprises the following steps:
Optimizing the position information of the cutting plane corresponding to the cutting loop line according to the five-step binary search, and calculating the stretching parameters of the stretching body primitive according to the cutting plane after optimizing the position information and the farthest end of the cutting plane distance input grid model, wherein the stretching parameters comprise stretching length or stretching height;
Reconstructing the stretching body primitive according to the stretching parameters to obtain a stretching body primitive reconstruction result.
5. The method of claim 1, wherein the target volume primitive comprises a swept volume primitive of the CAD model;
reconstructing the target body primitives for performing the CAD model according to the closed primitive ring set, and obtaining the reconstruction result of the body primitives further comprises:
determining a scanning path and a profile curve according to a point set corresponding to an arc in the closed primitive ring set, and calculating a scanning form corresponding to a swept volume primitive by adopting the following formula:
Wherein v and u are nodes, P i,j is a control point, W i,j is a weight, i and j are sum indexes, (m+1), (n+1) is the total number of control points, P is the number of times of the NURBS curved surface in the direction corresponding to u, q is the number of times of the NURBS curved surface in the direction corresponding to v, and N i,p (u) and N j,q (v) are non-rational B spline basis functions defined on node vectors;
And reconstructing the swept volume primitive according to the scanning form to obtain a swept volume primitive reconstruction result.
6. The method of claim 1, wherein the target volume primitive comprises a stretched volume primitive, a loft volume primitive, a swept volume primitive, and a rotated volume primitive of the CAD model, and the volume primitive reconstruction results comprise a stretched volume primitive reconstruction result, a loft volume primitive reconstruction result, a swept volume primitive reconstruction result, and a rotated volume primitive reconstruction result;
after the obtaining of the voxel reconstruction result, the method further comprises:
And performing Boolean operation on the extension primitive reconstruction result, the lofting primitive reconstruction result, the swept primitive reconstruction result and the rotator primitive reconstruction result to obtain a reconstructed computer aided design CAD model.
7. A method for reverse reconstruction of a computer aided design model, comprising:
The cutting module is used for carrying out plane cutting on the input grid model to obtain a cutting loop line, and the cutting loop line comprises a plurality of cutting line point columns;
The fitting module is used for carrying out discretization on the plurality of cutting line point columns to obtain a plurality of discrete line segments, and carrying out closed-loop fitting on the plurality of discrete line segments based on a line segment and arc fitting technology to obtain a closed primitive ring set;
The reconstruction module is used for respectively reconstructing target body primitives for performing computer-aided design (CAD) model according to the closed primitive ring set to obtain a body primitive reconstruction result; the body primitive reconstruction result is used for reconstructing a computer aided design CAD model; wherein the target volume primitive comprises at least one of a tensile volume primitive, a loft volume primitive, a swept volume primitive, and a rotator primitive of the CAD model.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a method for reverse reconstruction of a computer aided design model according to any one of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements a method of reverse reconstruction of a computer aided design model according to any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a method of reverse reconstruction of a computer aided design model according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410507927.8A CN118427900A (en) | 2024-04-25 | 2024-04-25 | Reverse reconstruction method and device for computer aided design model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410507927.8A CN118427900A (en) | 2024-04-25 | 2024-04-25 | Reverse reconstruction method and device for computer aided design model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118427900A true CN118427900A (en) | 2024-08-02 |
Family
ID=92309703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410507927.8A Pending CN118427900A (en) | 2024-04-25 | 2024-04-25 | Reverse reconstruction method and device for computer aided design model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118427900A (en) |
-
2024
- 2024-04-25 CN CN202410507927.8A patent/CN118427900A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10832475B2 (en) | Method for constructing three-dimensional solid model with geometric error and computer-readable storage medium | |
US10062207B2 (en) | Method and system for reconstructing a three-dimensional model of point clouds | |
US9946816B2 (en) | System for visualizing a three dimensional (3D) model as printed from a 3D printer | |
US10061870B2 (en) | Automated metrology and model correction for three dimensional (3D) printability | |
US20150269290A1 (en) | Automated design and manufacturing feedback for three dimensional (3d) printability | |
JP2020115339A (en) | Extraction of feature tree from mesh | |
EP2486547A1 (en) | Method and system enabling 3d printing of three-dimensional object models | |
CN110033519A (en) | Three-dimensional modeling method, device, system and storage medium based on Implicitly function | |
Campen et al. | A Practical Guide to Polygon Mesh Repairing. | |
Holdstein et al. | Three-dimensional surface reconstruction using meshing growing neural gas (MGNG) | |
Zhu et al. | Computing a compact spline representation of the medial axis transform of a 2D shape | |
CN116188716B (en) | Method and device for reconstructing three-dimensional model of irregular complex building | |
Wang et al. | Restricted delaunay triangulation for explicit surface reconstruction | |
JP3968056B2 (en) | Shape creation apparatus, control method for operating computer apparatus as shape creation apparatus, and computer-executable program for causing computer apparatus to execute control method | |
Rajagopalan et al. | A model for interfacing geometric modeling data with rapid prototyping systems | |
Rego et al. | Growing self-reconstruction maps | |
Li et al. | On surface reconstruction: A priority driven approach | |
WO2019087032A1 (en) | Method for the reconstruction of cad models through parametric adaptation | |
CN118427900A (en) | Reverse reconstruction method and device for computer aided design model | |
Jia | Fitting a parametric model to a cloud of points via optimization methods | |
Vanco | A direct approach for the segmentation of unorganized points and recognition of simple algebraic surfaces | |
Denker et al. | On-line reconstruction of CAD geometry | |
Protopsaltis et al. | A feature-based approach to re-engineering CAD models from cross sections | |
Xu | Hexahedral Mesh Generation, Optimization, and Visualization | |
Fu et al. | LFS-Aware Surface Reconstruction from Unoriented 3D Point Clouds |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |