Reverse reconstruction method and device for computer-aided design model

By performing plane cutting and discretization of the CAD model, the closed element ring set is generated using line segment and arc fitting technology, which solves the problems of large measurement errors and poor fitting effect of cutting loops, and achieves a more efficient and accurate CAD model reconstruction.

CN118427900BActive Publication Date: 2025-01-03INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410507927.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2025-01-03
Estimated Expiration
2044-04-25

AI Technical Summary

Technical Problem

In the prior art, the reverse reconstruction of CAD model has problems such as large measurement errors and poor fitting effect of cutting loops, resulting in inaccurate reconstruction.

Method used

By plane cutting of the input mesh model, the cutting loop line is obtained, and multiple cutting line point columns are discretized and closed loop fitted. The closed element loop set is generated using line segment and arc fitting technology. According to this, CAD The target body primitives of the model are reconstructed, including stretch body primitives, loft body primitives, sweeper body primitives and rotary body primitives.

Benefits of technology

It improves the reconstruction efficiency and accuracy of the CAD model, simplifies operations, reduces the interference of manual measurement errors, and enhances the cutting loop fitting effect and bulk element parameter acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427900B_ABST
    Figure CN118427900B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for reverse reconstruction of a computer-aided design model, the method comprising: performing plane cutting on an input mesh model to obtain a cutting loop, the cutting loop comprising a plurality of cutting line point sequences; performing discretization processing on the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing target body primitives of a computer-aided design CAD model respectively according to the closed primitive ring set to obtain body primitive reconstruction results; the body primitive reconstruction results are used to reconstruct the computer-aided design CAD model; wherein the target body primitives comprise at least one of a stretched body primitive, a lofted body primitive, a swept body primitive and a rotation body primitive of the CAD model. The method of the present invention simplifies CAD modeling operations, reduces the interference of manual measurement errors, and improves the reconstruction efficiency and accuracy of CAD models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAD modeling, and in particular to a method and device for reverse reconstruction of a computer-aided design model. Background Art

[0002] Reconstruction of Computer-Aided Design (CAD) models is a key technology in the field of geometric modeling and processing. It is suitable for CAD model reconstruction scenarios where the original design documents are missing or the real object is not available. CAD reconstruction plays a key role in reverse engineering, enabling users to recreate CAD models from alternative representations.

[0003] Reverse engineering is more than just rebuilding a CAD model that closely resembles the scanned mesh. Parts may have wear defects due to use, or deviations due to specific manufacturing paradigms (such as sliding angles). Reverse engineering is used to restore the original design intent. This capability supports designers to edit new variations of the original model to facilitate a wide range of manufacturing and engineering applications.

[0004] In the related art, the reconstruction of the CAD model is achieved by using special measuring tools to accurately measure the physical CAD model, and then inputting the measured dimensions into the commonly used CAD design software. This is easily affected by measurement errors during the physical measurement process, resulting in inaccurate software fitting results. The model reconstruction method using deep learning can automatically obtain cutting loop data, but due to the lack of sharp features of the model, the cutting loop fitting effect is poor, resulting in inaccurate reconstructed CAD model. Summary of the invention

[0005] The present invention provides a method and device for reverse reconstruction of a computer-aided design model, which improves the reconstruction efficiency and accuracy of the CAD model, because the measurement error of the CAD model reconstructed using CAD design software is large, and the cutting loop fitting effect obtained by the model reconstruction method using deep learning is poor, resulting in the defect of inaccurate reconstructed CAD model.

[0006] The present invention provides a method for reverse reconstruction of a computer-aided design model, comprising:

[0007] Performing plane cutting on the input mesh model to obtain a cutting loop, wherein the cutting loop includes a plurality of cutting line point arrays;

[0008] Discretizing the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set;

[0009] The target volume primitives of the computer-aided design (CAD) model are reconstructed respectively according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model.

[0010] According to a reverse reconstruction of a computer-aided design model provided by the present invention, the plane cutting of the input mesh model to obtain the cutting loop includes:

[0011] Using a lasso tool to scan the surface of the input mesh model to obtain a closed loop surface, wherein the closed loop surface includes a plurality of face patches;

[0012] Searching for a target face set from the plurality of facets according to a breadth-first algorithm, and determining a cutting plane according to average normal, center point and height parameters corresponding to each facet in the target facet set;

[0013] The input mesh model is cut according to the cutting plane to obtain the cutting loop.

[0014] According to a reverse reconstruction of a computer-aided design model provided by the present invention, the plurality of cutting line point sequences include straight line point sequences and arc point sequences;

[0015] Before the discretization process is performed on the plurality of cutting line point sequences, the method further comprises:

[0016] The straight line point sequence and the arc point sequence are subjected to sparse processing respectively to obtain sparse processing results.

[0017] According to a reverse reconstruction of a computer-aided design model provided by the present invention, the target body primitive includes a stretched body primitive of the CAD model;

[0018] Reconstructing the target volume primitives of the computer-aided design CAD model according to the closed primitive ring set to obtain the volume primitive reconstruction results includes:

[0019] Optimizing the position information of the cutting plane corresponding to the cutting loop according to the five-step binary search, and calculating the stretching parameters of the stretching body primitive according to the cutting plane after the optimized position information and the farthest end of the cutting plane from the input grid model, wherein the stretching parameters include the stretching length or the stretching height;

[0020] The stretched body primitives are reconstructed according to the stretching parameters to obtain a stretched body primitive reconstruction result.

[0021] According to a reverse reconstruction of a computer-aided design model provided by the present invention, the target volume primitive includes a swept volume primitive of the CAD model;

[0022] The step of respectively reconstructing the target volume primitives of the computer-aided design (CAD) model according to the closed primitive ring set to obtain the volume primitive reconstruction result further comprises:

[0023] The scanning path and the profile curve are determined according to the point set corresponding to the arc in the closed primitive ring set, and the scanning form corresponding to the swept volume primitive is calculated using the following formula:

[0024]

[0025] Among them, v and u are nodes, P i,j is the control point, W i,j is the weight, i and j are the summation indexes, (m+1)*(n+1) is the total number of control points, p is the number of NURBS surfaces in the direction corresponding to u, q is the number of NURBS surfaces in the direction corresponding to v, N i,p (u) and N j,q (v) is a non-rational B-spline basis function defined on the knot vector;

[0026] The swept volume primitives are reconstructed according to the scanning form to obtain a swept volume primitive reconstruction result.

[0027] According to a reverse reconstruction of a computer-aided design model provided by the present invention, the target body primitives include a stretched body primitive, a lofted body primitive, a swept body primitive and a rotational body primitive of the CAD model, and the body primitive reconstruction results include a stretched body primitive reconstruction result, a lofted body primitive reconstruction result, a swept body primitive reconstruction result and a rotational body primitive reconstruction result;

[0028] After obtaining the volume primitive reconstruction result, the method further includes:

[0029] A Boolean operation is performed on the reconstruction result of the extended body primitive, the reconstruction result of the lofted body primitive, the reconstruction result of the swept body primitive and the reconstruction result of the rotating body primitive to obtain a reconstructed computer-aided design CAD model.

[0030] The present invention also provides a reverse reconstruction device for a computer-aided design model, comprising:

[0031] A cutting module, used for performing plane cutting on the input mesh model to obtain a cutting loop, wherein the cutting loop includes a plurality of cutting line point arrays;

[0032] A fitting module, used for discretizing the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set;

[0033] A reconstruction module is used to reconstruct the target volume primitives of the computer-aided design (CAD) model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a reverse reconstruction method of a computer-aided design model as described above is implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the reverse reconstruction method of the computer-aided design model as described in any one of the above is implemented.

[0036] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for inverse reconstruction of a computer-aided design model.

[0037] The inverse reconstruction method and device of a computer-aided design model provided by the present invention performs plane cutting on an input grid model to obtain a cutting loop, discretizes multiple cutting line point sequences to obtain multiple discrete line segments, and performs closed-loop fitting on the multiple discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set, and finally reconstructs the target volume primitives of the computer-aided design CAD model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results to reconstruct the computer-aided design CAD model, thereby simplifying the CAD modeling operation, improving the cutting loop fitting effect and the efficiency of obtaining volume primitive related parameters, and reducing the interference of manual measurement errors, thereby improving the reconstruction efficiency and accuracy of the CAD model. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 It is one of the flow charts of the reverse reconstruction method of the computer-aided design model provided by the present invention;

[0040] Figure 2 It is a schematic diagram of an interface for automatically calculating stretching parameters provided by the present invention;

[0041] Figure 3 It is a schematic diagram of an interface for obtaining a closed primitive ring set provided by the present invention;

[0042] Figure 4 This is the second flow chart of the reverse reconstruction method of the computer-aided design model provided by the present invention;

[0043] Figure 5 It is a structural schematic diagram of a reverse reconstruction device for a computer-aided design model provided by the present invention;

[0044] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Combine the following Figure 1-Figure 5 The invention describes a method and device for reverse reconstruction of a computer-aided design model.

[0047] Figure 1 It is one of the flow charts of the reverse reconstruction method of the computer-aided design model provided by the present invention, such as Figure 1 As shown, the reverse reconstruction method of the computer-aided design model includes the following steps:

[0048] Step 110: perform plane cutting on the input mesh model to obtain a cutting loop, which includes a plurality of cutting line point sequences.

[0049] In this step, the input mesh model can be a three-dimensional network model, a surface model, a solid model, etc.

[0050] In this embodiment, the lasso tool can be used to form a closed loop surface on the surface of the three-dimensional mesh model along the trajectory swept by the mouse pointer, thereby obtaining a corresponding cutting loop line.

[0051] In this embodiment, the cutting loop is a plane contour obtained by plane-cutting the input mesh model with a specified cutting plane. The contour includes a plurality of cutting line point sequences, and different volume primitives can be fitted and reconstructed using these point sequences.

[0052] Step 120: discretize the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and perform closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed-loop set.

[0053] In this step, the cutting line is discretized by separating the straight line point series and the arc point series on the cutting loop line to obtain multiple groups of discrete line segments.

[0054] For example, the cutting line points on the cutting loop can be discretized by a line simplification algorithm. For example, the Ramer-Douglas-Peucker (RDP) algorithm is used to discretize the cutting line into a set of line segments, where the endpoints of each discrete line segment are represented as

[0055] In this embodiment, according to its curvature characteristics, the present invention divides the cutting line into two types of primitives, namely, straight lines and circular arcs. Specifically, first, take each e i The six nearest neighbors of ij ∈ε,j=1,2,…,6 and calculate the distance D on both sides l ={|e i1 e i2 |,|e i2 e i3 |,|e i3 e i |} and D r ={|e i e i4 |,|e i4 e i5 |,|e i5 e i6 |}, and in D l and D r Compare the distances in D and use the step size s; if l There are two elements in D that exceed the defined step size s and r No element in D exceeds this threshold, or r There are two elements in D that exceed s. l If no element in exceeds this limit, then continue to add e i Specify as split point; traverse the set of closed primitive rings The cutting line is segmented at these specified segmentation points, and the line segment and arc fitting technology is used to obtain the parameter representation of the obtained segmentation, which improves the automation level of cutting loop fitting, thereby improving the efficiency of model reconstruction and reducing the possibility of human error, thereby achieving more accurate and reliable CAD reconstruction.

[0056] Step 130, reconstruct the target volume primitives of the computer-aided design (CAD) model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model.

[0057] In this step, after obtaining the closed primitive ring set and its corresponding cutting surface P c Afterwards, various CAD reconstruction operations are used to reconstruct different parts of the model; specifically, the basic surface F is first obtained using the loop-constrained surface sf, and different CAD reconstruction operations are used to complete the reconstruction process of different volume primitives.

[0058] In this embodiment, the CAD reconstruction operations include extrusion, lofting, sweeping, and revolving.

[0059] Figure 2 is a schematic diagram of an interface for automatically calculating stretching parameters provided by the present invention. Figure 2 In the embodiment shown, in the initialization stage, the 3D vertices ε (i.e., the endpoints of each discrete line segment) are first obtained by the RDP algorithm. These vertices are located in the world coordinate system. Then, these vertices are projected onto a 2D plane. Through coordinate transformation, a 2D point list is obtained. Then the present invention calculates ε * The bounding box B (indicates the bounding box ε * The smallest rectangle of all points in ε * These point sets are projected into a 512 × 512 image using translation and expansion transformations to create a standardized representation that facilitates further processing and analysis in subsequent stages.

[0060] In this embodiment, the present invention performs a 2D point set ε * Perform Delaunay triangulation to obtain a set of triangles This triangulation process constructs a cover ε *To create a binary mask M, the fill polygon algorithm in OpenCV is sampled and the triangle T is used as input; specifically, the algorithm fills the interior of the triangle and generates a binary mask representing the shape of the projected object; to handle changes in the height or position of the cutting plane, the present invention generates a new mask by moving the cutting plane up or down. The similarity between two masks is determined by the intersection-over-union (IOU) metric, which is used to quantify the overlap between the two masks.

[0061] In this embodiment, the stretching length or height of the stretching body can be determined by calculating the distance between the initial face in the closed loop and the boundary of the model object, thereby realizing automatic acquisition of the stretching parameters, and finally obtaining the reconstructed stretching body primitive through the upPrism method.

[0062] In this embodiment, for the lofted structure, after manually obtaining the upper and lower basic surfaces F and manually selecting the lofting modeling operation, the basic surface F is directly input into the Open CASCADE framework (OCC), and the lofting surface F is constructed using the BRepOffsetAPI_ThruSections class. The OCC class of the BRepBuilderAPI_Sewing class is called to splice the upper bottom surface, the lower bottom surface and the release surface together to obtain the reconstructed lofted body primitive.

[0063] In this embodiment, an arc is used to reconstruct the swept surface. After manually selecting the scan modeling operation, the scan profile point list and the scan path point list are fitted by cutting loop fitting to construct the corresponding arc, and the reconstructed swept volume primitive is obtained using the arc.

[0064] In this embodiment, the rotation surface can also be reconstructed using an arc; specifically, the rotation modeling operation is manually selected first, and then the rotation profile C(v) is constructed using the curve construction method described in the previous swept volume. Different from the previous acquisition of the scanning path, here the rotation axis is constructed by selecting three points from the cutting line in step 120, and these points are used to form a circle; for example, the circle is represented by a nine-point circle as follows:

[0065] 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;

[0066] The corresponding weights are

[0067] In this example, a straight line is created using the center o of the circle and the normal n of the corresponding cutting plane. as the axis of rotation and around Rotating C(v) by 360°, the resulting surface can be expressed as:

[0068]

[0069] Among them, the node vectors are represented by U and V, and the control point is represented by P i,j =P 0,j =P j ; The corresponding weight is defined as:

[0070]

[0071] In this embodiment, after obtaining a plurality of different volume primitives, these volume primitives are assembled to obtain a reconstructed computer-aided design (CAD) model.

[0072] The inverse reconstruction method of a computer-aided design model provided by an embodiment of the present invention performs plane cutting on an input mesh model to obtain a cutting loop, discretizes multiple cutting line point sequences to obtain multiple discrete line segments, and performs closed-loop fitting on the multiple discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set, and finally reconstructs the target volume primitives of the computer-aided design CAD model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results to reconstruct the computer-aided design CAD model, thereby simplifying the CAD modeling operation, improving the cutting loop fitting effect and the efficiency of obtaining volume primitive related parameters, and reducing the interference of manual measurement errors, thereby improving the reconstruction efficiency and accuracy of the CAD model.

[0073] In some embodiments, performing planar cutting on an input mesh model to obtain a cutting loop includes: using a lasso tool to scan the surface of the input mesh model to obtain a closed loop, the closed loop including multiple facets; searching from the multiple facets according to a breadth-first algorithm to obtain a target facet set, and determining a cutting plane according to the average normal, center point and height parameters corresponding to each facet in the target facet set; and cutting the input mesh model according to the cutting plane to obtain a cutting loop.

[0074] In actual operation, you can use the lasso tool of Easy3D to form a closed loop from the surface of a 3D mesh model M along the trajectory of the mouse pointer, and pick up all the faces in the loop. The function of fitting the normal of the cutting plane can be realized because the lasso tool will pick up all the faces in the closed loop of the entire model. This results in errors in the normal fitting of the cutting surface.

[0075] In this embodiment, in order to obtain a set of connected and non-penetrating patches, The breadth-first search (BFS) algorithm is used to select the face closest to the pointer as the root node p. *∈P, re-optimize and select patches until the BFS algorithm converges, and then put the optimized patch set Calculate the average normal and center point to construct the cutting plane P as the normal and height parameters c , and through P c It intersects with M to form a cutting line, which runs through the entire input mesh model to obtain the corresponding cutting loop.

[0076] The reverse reconstruction method of a computer-aided design model provided by an embodiment of the present invention scans the surface of an input mesh model using a lasso tool to obtain a closed loop surface, then searches from multiple patches according to a breadth-first algorithm to obtain a target patch set, and determines a cutting plane according to the average normal, center point and height parameters corresponding to each patch in the target patch set, and finally cuts the input mesh model according to the cutting plane to obtain a cutting loop line, which can avoid the situation where the cutting surface normal fitting error is easy to occur when using the lasso tool to cut the model, thereby improving the accuracy of model cutting.

[0077] In some embodiments, the plurality of cutting line point sequences include straight line point sequences and arc point sequences; before discretizing the plurality of cutting line point sequences, the method further includes: performing sparse processing on the straight line point sequences and the arc point sequences respectively to obtain sparse processing results.

[0078] In this embodiment, before the cutting loop is discretized, coefficient processing can be performed separately according to different positions of the cutting loop. For example, for the straight line point sequence of the cutting loop, which is approximately a straight line, sparse discrete points can be separated at the edge of the primitive, while for the four corners of the cutting loop that are approximately circular arcs, denser discrete points need to be separated at the circular arcs of the cutting loop; similarly, for other curved parts on the cutting loop, denser discrete points also need to be separated to facilitate the subsequent accurate fitting of the original curved parts through these discrete points.

[0079] In this embodiment, the algorithms for implementing the sparse processing include sparse matrix multiplication, ridge regression, and minimum angle regression, etc., which are not specifically limited in this embodiment.

[0080] The reverse reconstruction method of the computer-aided design model provided in an embodiment of the present invention obtains a sparse processing result by thinning the arc point series and the arc point series respectively before discretizing the multiple cutting line point series, thereby providing more accurate data support for the discretization processing of different positions of the cutting loop line, thereby improving the accuracy of the cutting loop line fitting.

[0081] Figure 3 is a schematic diagram of an interface for obtaining a closed primitive ring set provided by the present invention. Figure 3In the illustrated embodiment, after the input mesh model is cut to obtain a cutting loop, different positions of the cutting loop (straight edges and circular arcs) are thinned out respectively, so that a plurality of discrete points can be obtained on the cutting loop, as shown in (a); the plurality of discrete points are discretized to obtain a plurality of discrete line segments, and the two ends of each discrete line segment are shown as circles in (b); then, the discrete line segments corresponding to the straight edges are fitted with straight lines, and the discrete line segments corresponding to the circular arcs are fitted with circular arcs, so as to obtain fitted primitives, i.e., a ring-closed primitive ring set, as shown in (c).

[0082] In some embodiments, the target body primitives include stretched body primitives of a CAD model; the target body primitives of a computer-aided design CAD model are reconstructed separately according to a set of closed primitive rings to obtain body primitive reconstruction results including: optimizing the position information of the cutting plane corresponding to the cutting loop line according to a five-step binary search, and calculating the stretching parameters of the stretched body primitives according to the cutting plane after the optimized position information and the farthest end of the cutting plane from the input mesh model, the stretching parameters including the stretching length or the stretching height; reconstructing the stretched body primitives according to the stretching parameters to obtain the stretched body primitive reconstruction results.

[0083] In this embodiment, for the reconstruction process of a CAD model with a more complex structure, if the intersection-over-union 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 can be used to obtain the cutting plane P. c Specifically, in this iterative process, by refining P c The position of the stretched body is matched with the object boundary, and the stretched length or height of the stretched body can be calculated by calculating the initial P c and the farthest end; this distance represents the height of the extruded body needed to enclose the entire object.

[0084] In this embodiment, after the stretching height is automatically determined, the upPrism method is used to obtain the corresponding stretching body primitive reconstruction result.

[0085] In this embodiment, the preset experience threshold can be set according to user needs. For example, the experience threshold can be set to 0.965.

[0086] The reverse reconstruction method of the computer-aided design model provided by the embodiment of the present invention optimizes the position information of the cutting plane corresponding to the cutting loop through a five-step binary search, and calculates the stretching parameters of the stretched body primitive according to the cutting plane after the optimized position information and the farthest end of the cutting plane from the input grid model, and finally reconstructs the stretched body primitive according to the stretching parameters to obtain the reconstruction result of the stretched body primitive, thereby realizing the automatic acquisition of the stretching parameters of the stretched body primitive, allowing the model to be directly edited during the reconstruction process without manual setting, reducing parameter setting errors, and improving the accuracy of reconstruction of the stretched body primitive.

[0087] In some embodiments, the target volume primitives include swept volume primitives of a CAD model; and reconstructing the target volume primitives of a computer-aided design CAD model according to a closed primitive ring set to obtain a volume primitive reconstruction result further includes: 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 using the following formula:

[0088]

[0089] Among them, v and u are nodes, P i,j is the control point, W i,j is the weight, i and j are the summation indexes, (m+1)*(n+1) is the total number of control points, p is the number of NURBS surfaces in the direction corresponding to u, q is the number of NURBS surfaces in the direction corresponding to v, N i,p (u) and N j,q (v) is a non-rational B-spline basis function defined on the node vector; the swept volume primitive is reconstructed according to the scanning form to obtain the swept volume primitive reconstruction result.

[0090] It should be noted that in the existing CAD model reconstruction technology, when scanning a swept contour containing an arc surface, the upper and lower edges of the swept contour are prone to classification problems. The existing CAD model reconstruction technology directly connects the arc surface of the original model to process the swept body with straight lines, and the model contour details are lost; and when the swept contour is thin (the thickness of the swept contour is lower than the preset thickness threshold), the edge of the generated swept body is abnormal, and there is also a lack of sealing surfaces at both ends of the swept body, resulting in low reconstruction accuracy of the swept body primitives by the CAD model reconstruction technology.

[0091] In this embodiment, the arc is used to reconstruct the swept surface, which can be accurately represented by non-uniform rational B-spline (NURBS); specifically, after manually selecting the scanning modeling operation, the scanning profile point list and the scanning path point list are fitted by the cutting loop fitting method used in step 120, and the arc corresponding to the swept surface is constructed by the curve construction method, and finally the scanning profile and the scanning path are returned by the corresponding point set, and the translation form of the scanning surface is determined by the following formula:

[0092] S(u,v)=T(v)+C(u);

[0093] Among them, S(u,v) is the translation form of the scanning surface, T(v) is the scanning path, and C(u) is the profile curve.

[0094] In this embodiment, assuming that T(v) and C(u) are represented by NURBS, T(v) is represented as follows:

[0095]

[0096] C(u) is expressed as follows:

[0097]

[0098] By defining the vector V = {v0, ..., v s} and U={u0,...,u r}, a specific representation of S(u,v) is obtained, and the swept volume primitives are scanned and reconstructed according to the scanning form, so as to obtain a more accurate swept volume primitive reconstruction result.

[0099] The reverse reconstruction method of the computer-aided design model provided by the embodiment of the present invention determines the scanning path and the profile curve according to the point set corresponding to the arc in the closed primitive ring set to calculate the scanning form corresponding to the swept body primitive, and then reconstructs the swept body primitive according to the scanning form to obtain the swept body primitive reconstruction result, thereby improving the accuracy of the swept body primitive reconstruction.

[0100] In some embodiments, the target body primitives include stretched body primitives, lofted body primitives, swept body primitives and rotated body primitives of the CAD model, and the body primitive reconstruction results include stretched body primitive reconstruction results, lofted body primitive reconstruction results, swept body primitive reconstruction results and rotated body primitive reconstruction results; after obtaining the body primitive reconstruction results, the method also includes: performing Boolean operations on the stretched body primitive reconstruction results, the lofted body primitive reconstruction results, the swept body primitive reconstruction results and the rotated body primitive reconstruction results to obtain the reconstructed computer-aided design CAD model.

[0101] In this embodiment, after obtaining the reconstruction results of each partial volume primitive of the CAD model (for example, the reconstruction results of the stretched volume primitive, the reconstruction results of the lofted volume primitive, the reconstruction results of the swept volume primitive, and the reconstruction results of the rotated volume primitive) by the volume primitive reconstruction methods in the above embodiments, these blocks can be merged together by manually selecting appropriate Boolean operations to obtain the reconstructed CAD model.

[0102] In this embodiment, according to the preset matching degree between the reconstruction results of each primitive and different types of Boolean operations, a Boolean operation with a higher matching degree may be automatically selected to perform the assembly of the CAD model.

[0103] In this embodiment, Boolean operations include union, intersection and difference, and these Boolean operations are all implemented using an OCC (OpenCASCADE Technology) framework.

[0104] Figure 4 This is a second flow chart of the reverse reconstruction method of the computer-aided design model provided by the present invention. Figure 4 In the illustrated embodiment, the reverse reconstruction of the CAD model is achieved through the following steps: S1. Use a plane to cut the input mesh model and obtain a circular cutting line point sequence; S2. Automatically fit the cutting line point sequence into different types of primitive edges and connect them to form a cutting loop; S3. Through a series of classic CAD modeling operations, including stretching, lofting, rotation and sweeping, the cutting loop is constructed into a volume primitive; S4. Use a variety of Boolean operations to assemble these volume primitives together to approach the target geometry, thereby obtaining the reconstructed CAD model.

[0105] The reverse reconstruction method of the computer-aided design model provided in the embodiment of the present invention obtains a reconstructed computer-aided design CAD model by performing Boolean operations on the reconstruction results of the extended body primitives, the lofted body primitives, the swept body primitives and the rotational body primitives. The CAD model can be assembled by four body primitives, and the reconstructed CAD model is simpler and has no noise than the original model.

[0106] The reverse reconstruction device of the computer-aided design model provided by the present invention is described below. 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 each other.

[0107] Figure 5 Schematic diagram of the structure of the reverse reconstruction device of the computer-aided design model provided by the present invention, such as Figure 5 As shown, the reverse reconstruction device of the computer-aided design model includes: a cutting module 510, a fitting module 520 and a reconstruction module 530.

[0108] A cutting module 510 is used to perform plane cutting on the input mesh model to obtain a cutting loop, wherein the cutting loop includes a plurality of cutting line point sequences;

[0109] The fitting module 520 is used to discretize the multiple cutting line point sequences to obtain multiple discrete line segments, and perform closed-loop fitting on the multiple discrete line segments based on the line segment and arc fitting technology to obtain a closed primitive ring set;

[0110] The reconstruction module 530 is used to reconstruct the target volume primitives of the computer-aided design (CAD) model according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model.

[0111] The reverse reconstruction device of the computer-aided design model provided by the embodiment of the present invention performs plane cutting on the input grid model to obtain a cutting loop, discretizes multiple cutting line point sequences to obtain multiple discrete line segments, and performs closed-loop fitting on the multiple discrete line segments based on the line segment and arc fitting technology to obtain a closed primitive ring set, and finally reconstructs the target body primitives of the computer-aided design CAD model respectively according to the closed primitive ring set to obtain the body primitive reconstruction result to reconstruct the computer-aided design CAD model, which simplifies the CAD modeling operation, improves the cutting loop fitting effect and the efficiency of obtaining the relevant parameters of the body primitives, and at the same time reduces the interference of manual measurement errors, thereby improving the reconstruction efficiency and accuracy of the CAD model.

[0112] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the reverse reconstruction method of the computer-aided design model, the method comprising: performing plane cutting on the input mesh model to obtain a cutting loop, the cutting loop comprising a plurality of cutting line point sequences; performing discretization processing on the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on the line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing the target body primitives of the computer-aided design CAD model respectively according to the closed primitive ring set to obtain a body primitive reconstruction result; the body primitive reconstruction result is used to reconstruct the computer-aided design CAD model; wherein the target body primitive comprises one or more of a stretched body primitive, a lofted body primitive, a swept body primitive and a rotation body primitive of the CAD model.

[0113] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0114] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the reverse reconstruction method of the computer-aided design model provided by the above-mentioned methods, and the method includes: performing plane cutting on the input mesh model to obtain a cutting loop, and the cutting loop includes multiple cutting line point columns; discretizing the multiple cutting line point columns to obtain multiple discrete line segments, and performing closed-loop fitting on the multiple discrete line segments based on the line segment and arc fitting technology to obtain a closed primitive ring set; according to the closed primitive ring set, the target body primitives of the computer-aided design CAD model are respectively reconstructed to obtain the body primitive reconstruction result; the body primitive reconstruction result is used to reconstruct the computer-aided design CAD model; wherein, the target body primitive includes one or more of the stretched body primitive, lofted body primitive, swept body primitive and rotated body primitive of the CAD model.

[0115] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the reverse reconstruction method of the computer-aided design model provided by the above-mentioned methods, the method comprising: performing plane cutting on the input mesh model to obtain a cutting loop, the cutting loop comprising a plurality of cutting line point sequences; discretizing the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on the line segment and arc fitting technology to obtain a closed primitive ring set; reconstructing the target body primitives of the computer-aided design (CAD) model respectively according to the closed primitive ring set to obtain body primitive reconstruction results; the body primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target body primitives comprise one or more of the stretched body primitives, lofted body primitives, swept body primitives and rotated body primitives of the CAD model.

[0116] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for reverse reconstruction of a computer-aided design model, characterized in that: include: Performing plane cutting on the input mesh model to obtain a cutting loop, wherein the cutting loop includes a plurality of cutting line point arrays; Discretizing the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set; Reconstructing the target volume primitives of the computer-aided design (CAD) model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model; The target volume primitives include stretched volume primitives of the CAD model; Reconstructing the target volume primitives of the computer-aided design CAD model according to the closed primitive ring set to obtain the volume primitive reconstruction results includes: Optimizing the position information of the cutting plane corresponding to the cutting loop according to the five-step binary search, and calculating the stretching parameters of the stretching body primitive according to the cutting plane after the optimized position information and the farthest end of the cutting plane from the input grid model, wherein the stretching parameters include the stretching length or the stretching height; Reconstructing the stretched body primitives according to the stretching parameters to obtain a stretched body primitive reconstruction result; The target volume primitives include swept volume primitives of the CAD model; The step of respectively reconstructing the target volume primitives of the computer-aided design (CAD) model according to the closed primitive ring set to obtain the volume primitive reconstruction result further comprises: The scanning path and the profile curve are determined according to the point set corresponding to the arc in the closed primitive ring set, and the scanning form corresponding to the swept volume primitive is calculated using the following formula: Among them, v and u are nodes, P i,j is the control point, W i,j is the weight, i and j are the summation indexes, (m+1)*(n+1) is the total number of control points, p is the number of NURBS surfaces in the direction corresponding to u, q is the number of NURBS surfaces in the direction corresponding to v, N i,p (u) and N j,q (v) is a non-rational B-spline basis function defined on the knot vector; The swept volume primitives are reconstructed according to the scanning form to obtain a swept volume primitive reconstruction result.

2. The method for reverse reconstruction of a computer-aided design model according to claim 1, characterized in that: The plane cutting of the input mesh model to obtain the cutting loop includes: Using a lasso tool to scan the surface of the input mesh model to obtain a closed loop surface, wherein the closed loop surface includes a plurality of face patches; Searching for a target face set from the plurality of facets according to a breadth-first algorithm, and determining a cutting plane according to average normal, center point and height parameters corresponding to each facet in the target facet set; The input mesh model is cut according to the cutting plane to obtain the cutting loop.

3. The method for reverse reconstruction of a computer-aided design model according to claim 1, characterized in that: The plurality of cutting line point arrays include straight line point arrays and arc point arrays; Before the discretization process is performed on the plurality of cutting line point sequences, the method further comprises: The straight line point sequence and the arc point sequence are subjected to sparse processing respectively to obtain sparse processing results.

4. The method for reverse reconstruction of a computer-aided design model according to claim 1, characterized in that: The target body primitives include the stretched body primitives, the lofted body primitives, the swept body primitives and the rotational body primitives of the CAD model, and the body primitive reconstruction results include the stretched body primitive reconstruction results, the lofted body primitive reconstruction results, the swept body primitive reconstruction results and the rotational body primitive reconstruction results; After obtaining the volume primitive reconstruction result, the method further includes: A Boolean operation is performed on the reconstruction result of the extended body primitive, the reconstruction result of the lofted body primitive, the reconstruction result of the swept body primitive and the reconstruction result of the rotating body primitive to obtain a reconstructed computer-aided design CAD model.

5. A reverse reconstruction device for a computer-aided design model, applied to the reverse reconstruction method for a computer-aided design model as claimed in claim 1, characterized in that: include: A cutting module, used for performing plane cutting on the input mesh model to obtain a cutting loop, wherein the cutting loop includes a plurality of cutting line point arrays; A fitting module, used for discretizing the plurality of cutting line point sequences to obtain a plurality of discrete line segments, and performing closed-loop fitting on the plurality of discrete line segments based on line segment and arc fitting technology to obtain a closed primitive ring set; A reconstruction module is used to reconstruct the target volume primitives of the computer-aided design (CAD) model respectively according to the closed primitive ring set to obtain volume primitive reconstruction results; the volume primitive reconstruction results are used to reconstruct the computer-aided design (CAD) model; wherein the target volume primitives include at least one of the stretched volume primitives, lofted volume primitives, swept volume primitives and rotated volume primitives of the CAD model.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the reverse reconstruction method of the computer-aided design model according to any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for reverse reconstruction of the computer-aided design model according to any one of claims 1 to 4 is implemented.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for reverse reconstruction of the computer-aided design model according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Medical image based segmentation and 3D reconstruction method and 3D printing system

    CN106373168A

  • Training method of sketch sequence reconstruction model, geometric model reconstruction method and equipment

    CN117725966A