Method and device for automatically extracting skeleton of three-dimensional Brep model
By processing topological edges and groove feature surfaces on the Brep model, the initial skeleton information is extracted and merged, and the problem of insufficient precision of skeleton extraction in the prior art is solved, and a higher precision skeleton extraction is achieved.
Patent Information
- Application Number
- CN202411629757.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-07
AI Technical Summary
The existing skeleton extraction methods for three-dimensional models are insufficiently accurate, especially in retaining model details, resulting in the extracted skeleton being inaccurate enough.
By analyzing the topological geometric information of the Brep model, redundant topological edges are extracted and removed and filled to obtain the simplified model; then, based on the topological geometric information of the simplified model, the preset groove feature surface is extracted and removed and filled to obtain the preprocessed model; then the initial skeleton information in the preprocessed model is extracted, and the skeleton corresponding to the Brep model is merged according to the preset merge conditions, and finally the skeleton corresponding to the Brep model is obtained.
Improve the accuracy of skeleton extraction, avoid details loss caused by discretization, and ensure the retention of details during skeleton extraction.
Smart Images

Figure CN119579834A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphics processing, and in particular to a method and device for automatically extracting the skeleton of a three-dimensional Brep model. Background Art
[0002] The skeleton is the central axis or main line of an object. It is a simplified representation of an object with more concise and stable features. It can be used to describe the basic shape, topological structure and spatial relationship of an object. Skeleton extraction is an important technology in the field of computer vision. It is used to extract the skeleton structure of an object from an image or a three-dimensional model. It is widely used in image processing, feature extraction, pattern recognition, computer-aided design and other fields.
[0003] In the field of computer-aided design (CAD), skeleton extraction is helpful for CAD modeling, virtual reality and other applications. By extracting the skeleton structure, the shape and structure of the object can be described; the curvature and shape of the skeleton can be used to achieve CAD modeling, structural analysis and operation simulation of the object; the structure and stress performance of mechanical parts can be analyzed through the skeleton, and interference between parts can be detected.
[0004] The current skeleton extraction of three-dimensional models is done through topology thinning, also known as the simulated burnt grass model method. This type of algorithm starts from the boundary and iteratively peels off the discrete model layer by layer until only a one-dimensional skeleton remains.
[0005] This method discretizes the original model, but discretization will lose the detailed information in the model, resulting in the extracted skeleton being inaccurate. Summary of the invention
[0006] The purpose of this application is to provide a method and device for automatically extracting the skeleton of a three-dimensional Brep model, which can improve the accuracy of skeleton extraction. To achieve the above purpose, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for automatically extracting a skeleton of a three-dimensional Brep model, comprising:
[0008] According to the topological geometry information of the Brep model, redundant topological edges in the Brep model are obtained, and the redundant topological edges are removed and filled to obtain a simplified model;
[0009] According to the topological geometric information of the simplified model, a preset groove feature surface in the simplified model is obtained, and the preset groove feature surface is removed and filled to obtain a preprocessed model;
[0010] Extracting initial skeleton information from the preprocessing model;
[0011] Merging the initial skeleton information according to a preset merging condition;
[0012] The skeleton corresponding to the Brep model is obtained according to the initial skeleton information after the merging process.
[0013] In a second aspect, the present application provides a three-dimensional Brep model skeleton automatic extraction device, the three-dimensional Brep model skeleton automatic extraction device comprising:
[0014] A first acquisition module is used to acquire redundant topological edges in the Brep model according to the topological geometric information of the Brep model, and remove and fill the redundant topological edges to obtain a simplified model;
[0015] A second acquisition module is used to acquire a preset groove feature surface in the simplified model according to the topological geometric information of the simplified model, and remove and fill the preset groove feature surface to obtain a preprocessing model;
[0016] An extraction module, used to extract initial skeleton information from the preprocessing model;
[0017] A merging module, used for merging the initial skeleton information according to a preset merging condition;
[0018] The third acquisition module is used to acquire the skeleton corresponding to the Brep model according to the initial skeleton information after the merging process.
[0019] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for automatic skeleton extraction of a three-dimensional Brep model described in any one of the above.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned methods for automatically extracting the skeleton of a three-dimensional Brep model.
[0021] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned methods for automatically extracting the skeleton of a three-dimensional Brep model.
[0022] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0023] The present application provides a method and device for automatically extracting the skeleton of a three-dimensional Brep model, including: obtaining redundant topological edges in the Brep model according to the topological geometric information of the Brep model, and removing and filling the redundant topological edges to obtain a simplified model; obtaining preset groove feature surfaces in the simplified model according to the topological geometric information of the simplified model, and removing and filling the preset groove feature surfaces to obtain a preprocessed model; extracting initial skeleton information in the preprocessed model; merging the initial skeleton information according to preset merging conditions; and obtaining the skeleton corresponding to the Brep model according to the merged initial skeleton information. For a three-dimensional Brep model, it contains accurate topological geometric information. The present application analyzes the geometric information of the topological surface of the Brep model and extracts the skeleton of the three-dimensional model by a direct calculation method without decomposing the Brep model into discrete voxels, thereby not ignoring any skeleton details and improving the accuracy of skeleton extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a flow chart of a method for automatically extracting a skeleton of a three-dimensional Brep model according to an exemplary embodiment;
[0026] Figure 2 A schematic diagram of a groove provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of a scanning surface provided in an embodiment of the present application;
[0028] Figure 4 A top view of a scanning curved surface provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of a swept surface obtained by a closed contour provided in an embodiment of the present application;
[0030] Figure 6 A schematic diagram of a topological surface and a path line provided in an embodiment of the present application;
[0031] Figure 7 for Figure 6 The topological surface shown and the contour line diagram corresponding to the schematic diagram of a path line;
[0032] Figure 8Schematic diagram of skeleton, outline and simplified model corresponding to a three-dimensional Brep solid model with two small holes, one oblique notch and a hollow center provided in one embodiment of the present application;
[0033] Fig. 9 A schematic diagram of a skeleton, a contour and a simplified model corresponding to a three-dimensional Brep solid model of a chair backrest structure provided in an embodiment of the present application;
[0034] Fig.10 Schematic diagram of skeleton, outline and simplified model corresponding to the three-dimensional Brep solid model with grooves provided in one embodiment of the present application;
[0035] Fig.11 Schematic diagram of the skeleton, outline and simplified model corresponding to the three-dimensional Brep solid model of the steel beam structure provided in one embodiment of the present application Figure 1 ;
[0036] Fig.12 Schematic diagram of the skeleton, outline and simplified model corresponding to the three-dimensional Brep solid model of the steel beam structure provided in one embodiment of the present application Figure 2 ;
[0037] Fig.13 A schematic diagram of functional modules of a skeleton automatic extraction device for a three-dimensional Brep model provided in one embodiment of the present application;
[0038] Fig.14 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0041] The skeleton is the central axis or main line of an object. It is a simplified representation of an object with more concise and stable features. It can be used to describe the basic shape, topological structure and spatial relationship of an object. Skeleton extraction is an important technology in the field of computer vision. It is used to extract the skeleton structure of an object from an image or a three-dimensional model. It is widely used in image processing, feature extraction, pattern recognition, computer-aided design and other fields.
[0042] In the field of computer-aided design (CAD), skeleton extraction is helpful for CAD modeling, virtual reality and other applications. By extracting the skeleton structure, the shape and structure of the object can be described; the curvature and shape of the skeleton can be used to achieve CAD modeling, structural analysis and operation simulation of the object; the structure and stress performance of mechanical parts can be analyzed through the skeleton, and interference between parts can be detected.
[0043] As a research topic in interdisciplinary majors such as computer vision, computer graphics, computational geometry, point set topology and graph theory, skeleton has produced a wealth of theoretical methods and mathematical tools through nearly 40 years of research, especially skeleton extraction of two-dimensional images, for which mature methods and tools are available.
[0044] The skeleton extraction of three-dimensional models started later, and its existing extraction methods can be mainly divided into three categories: (1) Topology Thinning, also known as the simulated grass burning model method. This type of algorithm starts from the boundary and iteratively peels off the discretized model layer by layer until only a one-dimensional skeleton remains; (2) Distance field-based methods first generate the distance field of the model, then extract the local extreme points in the distance field, and then connect these points and make some refinement adjustments to obtain the skeleton; (3) Generalized potential field method, assuming that uniformly distributed similar charge sources are gathered on the boundary of the model, using the Newtonian electrostatic mechanics model to establish a force field, allowing the seed points to gradually move to the mechanical equilibrium point, and then connecting these equilibrium points based on the adjacent relationship of the seed points to obtain the skeleton.
[0045] These methods are basically extended applications of image skeleton extraction methods on discrete three-dimensional models, but these methods are only applicable to discrete three-dimensional models. The three-dimensional model needs to be voxelized first, and then the skeleton is extracted from the voxelized three-dimensional model. The extracted skeleton is an approximate skeleton representation, and the extraction result is not accurate enough.
[0046] In order to solve the above technical problems, the present disclosure proposes a method and device for automatically extracting the skeleton of a three-dimensional Brep model.
[0047] Figure 1 is a flowchart of a method for automatically extracting a skeleton of a three-dimensional Brep model according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps S101-S105:
[0048] In step S101, redundant topological edges in the Brep model are obtained according to the topological geometry information of the Brep model, and the redundant topological edges are removed and filled to obtain a simplified model.
[0049] The Brep model here may illustratively refer to the Brep model of any entity.
[0050] In one embodiment, when executing step S101, the following steps S1011-S1015 are executed for each first internal topological edge in the Brep model:
[0051] S1011. Obtain the adjacent topological surface of the current first internal topological edge.
[0052] The first internal topological edge is an internal topological edge of a manifold in the Brep model, and the internal topological edge of the manifold is not a boundary. The current first internal topological edge is an internal topological edge of a manifold in the Brep model to be processed.
[0053] For an internal (non-boundary) topological edge e of a manifold in a three-dimensional Brep model i , get e i The adjacent topological surface g j and g k .
[0054] S1012. Obtain the maximum curvature point in the current first internal topological edge, and obtain the tangent direction at the maximum curvature point.
[0055] Find e i The point with the largest curvature p m And calculate the tangent direction n at this point m .
[0056] Among them, p m Represents the point of maximum curvature.
[0057] S1013. Calculate the outward normal of each adjacent topological surface of the current first internal topological edge at the point of maximum curvature.
[0058] Calculate g separately j In p m The outward normal n j , and g k In p m The outward normal n k .
[0059] S1014. Obtain a concave-convex value corresponding to the current first internal topological edge according to the tangent direction and each outward normal direction.
[0060] Then i The bump value in, represents the cross product of vectors, and ⊙ represents the dot product of vectors.
[0061] S1015: When the concave-convex value satisfies a preset redundancy value and two adjacent topological surfaces of the current first internal topological edge are equivalent surfaces, determine that the current first internal topological edge is a redundant topological edge.
[0062] If ATi If it is approximately 0 (e.g. less than 10E-6), then e is called i is a smooth edge; if AT i If is positive, then e i is a concave edge; if AT i If it is negative, then e i For convex edge.
[0063] If the topological edge e i is a smooth edge, and its adjacent topological surface g j and g k The geometric surfaces of are equivalent, then we think that e i is a redundant edge.
[0064] Among them, whether the geometric surfaces are equivalent can be judged by the following two conditions:
[0065] 1. The types of geometric surfaces are the same (i.e. planes and planes, cylinders and cylinders, etc.); 2. The parameters of the geometric surfaces are similar, so that the shapes of the geometric surfaces are the same.
[0066] In a three-dimensional Brep model, redundant edges can be traversed, searched, and determined according to the above method, and then the geometric modeling kernel capability can be called to remove them. While removing redundant topological edges, adjacent topological faces will be automatically merged.
[0067] In step S102, according to the topological geometric information of the simplified model, the preset groove feature surface in the simplified model is obtained, and the preset groove feature surface is removed and filled to obtain a preprocessed model;
[0068] In one embodiment, when executing step S102, it includes executing the following steps S1021-S1026 for each second internal topological edge in the simplified model:
[0069] S1021. Obtain the first half edge and the second half edge corresponding to the current second internal topological edge.
[0070] The second internal topological edge is an internal topological edge of the manifold in the simplified model, and the internal topological edge of the manifold is not a boundary. The current second internal topological edge is an internal topological edge of the manifold in the simplified model to be currently processed.
[0071] For an internal (non-boundary) topological edge e of a manifold in the simplified model k and its two half edges he1 and he2.
[0072] Among them, he1 represents the first half edge, and he2 represents the second half edge.
[0073] S1022. Obtain the first surface where the first half edge is located and the second surface where the second half edge is located.
[0074] The surface where he1 is located is f1, and the surface where he2 is located is f2.
[0075] Among them, f1 represents the first surface, and f2 represents the second surface.
[0076] S1023. Obtain the first ring where the first half edge is located and the second ring where the second half edge is located.
[0077] The ring where he1 is located is lp1, and the ring where he2 is located is lp2.
[0078] Among them, lp1 represents the first ring, and lp2 represents the second ring.
[0079] S1024: When the first ring is an inner ring, the second ring is an outer ring, and an area ratio of the second surface to the first surface is less than a preset threshold, determine that the second ring is a candidate surface of the groove feature.
[0080] If lp1 is an inner-loop, lp2 is an outer-loop, and the area ratio of f2 to f1 is less than a certain preset threshold (such as 0.1), f2 is considered to be a candidate surface of a groove feature.
[0081] S1025. Obtain a face set corresponding to the candidate face of the groove feature; when there is no bottom cover face for the candidate face of the groove feature, the face set includes the topological face corresponding to the candidate face of the groove feature; or, when there is a bottom cover face for the candidate face of the groove feature, the face set includes the topological face corresponding to the candidate face of the groove feature and the bottom cover face.
[0082] For each candidate face of the groove feature, i Create a face set F i ={f i |i=0,…,k}, k is the number of topological surfaces.
[0083] When adding the bottom surface of the groove feature, you first need to determine the bottom surface of the groove feature. For any candidate surface f of the groove feature i and one of its neighbors f j , if f i Not a mixed (fillet) surface, f i The number of neighbors of f is greater than 1, i The number of rings is 2, f j The number of rings is 1, then we assume that f j It is the bottom surface of the groove feature.
[0084] If f i There is a back cover f j , f j Join Fi Middle, that is, F i ={f i ,f j}.
[0085] like Figure 2 As shown, the top surface of the model contains two groove features (i.e., a set of dark topological surfaces). Among them, the left groove feature has a bottom surface (i.e., a blind hole), so the bottom surface needs to be added to the candidate surfaces of the left groove feature. The right groove feature has no bottom surface (i.e., a through hole), so there is no need to add a bottom surface to the candidate surfaces of the right groove feature.
[0086] S1026. If the face set is a concave face set, determine that the faces in the face set are preset groove feature faces.
[0087] If F i is a concave set, then F i It is a collection of preset groove feature faces. The geometric modeling kernel capability is called to remove the preset groove feature faces, and the geometric modeling kernel is allowed to fill the removed holes through option settings.
[0088] Among them, the face set is a concave face set, including:
[0089] If the face set meets the preset groove face condition, the face set is determined to be a concave face set.
[0090] The preset concave surface conditions are: the topological surfaces in the face set are connected. The topological edges of the face set are concave edges. If the face set includes mixed surfaces, other mixed surfaces that are smoothly connected to the mixed surfaces are also included. And, if the face set includes only one topological surface, the number of adjacent surfaces to the only included topological surface is less than the number of rings of the one topological surface.
[0091] Concave surface set definition: For a topological surface set M = {m i |i=0,…,k}, k is the number of topological faces. If F is a concave face set, it must satisfy the following conditions: ① The set F is a connected set of topological faces, that is, for any face m i ∈M, m j ∈M,m i and m j is directly connected (including common edges) or through some other m n ∈M is indirectly connected; ② The boundary topological edges of set M are all concave edges; ③ If set M contains a mixed surface, it must contain other mixed surfaces that are smoothly connected to the mixed surface (the common edge is a smooth edge); ④ If k is equal to 1, it only contains one topological surface m i , then m i The number of adjacent faces of must be less than m i The number of loops.
[0092] In step S103, initial skeleton information in the preprocessing model is extracted.
[0093] In this step, the initial skeleton information is extracted using different methods according to the geometric surface type of each preprocessed topological surface in the preprocessed model.
[0094] After the extraction is completed, the initial skeleton information set {SK i}.
[0095] First, the skeleton information definition is introduced.
[0096] like Figure 3 As shown in the figure, the swept surface S(u,w) is the trajectory formed by the continuous movement of the profile line P(u) along the path line Q(w). The profile line that forms the surface is called the mother line, and the mother line at any moving position on the surface is called the element line. When the path is a straight line, the swept surface is a cylinder; when the path line is an arc, the swept surface is a rotation surface. Figure 4 is the top view of the swept surface.
[0097] The Frenet coordinate frame (t, b, n) at any point q(w) on the path line is defined as:
[0098]
[0099] b(w)=normalized(Q,w(w)×Q,ww(w));
[0100] n(w)=normalized(b(w)×t(w));
[0101] Where normalized is the vector normalization, Q,ww is the second-order derivative of the curve.
[0102] For a regular swept surface, the element line at any point q(w) on the path line is perpendicular to the path line, so the swept surface can be defined as:
[0103] S(u,w)=Q(w)+Roate(w)*scale(w)*P(u),u∈[0,1],w∈[0,1]);
[0104] Among them, Roate(w) is the transformation matrix of the mother line moving along the path, that is, the mother line P(u) is rotated and transformed until its x-axis and z-axis are aligned with n(w) and b(w) respectively; scale(w) is the scaling ratio of the element line to the mother line, which is usually equal to 1, that is, the element line and the mother line are exactly the same in shape.
[0105] According to the properties of the swept surface, it can be seen that the path Q(w) is similar in shape to the skeleton curve and is the offset of the skeleton curve. Figure 5 It is a swept surface obtained by a closed contour, and its path is a skeleton of the swept surface.
[0106] Therefore, the skeleton information of the topological face set (referred to as the face set skeleton) is defined as a 4-tuple FacesSkeleton (target-faces, path-curves, profile-plane, profile-curves), where target-faces is the target topological face set, path-curves is the sweep path line set, profile-plane is the plane where the sweep profile is located, and profile-curves is the sweep profile line set. For a 3D Brep model, the model body skeleton is composed of several face set skeletons, that is, BodySketleton = {FacesSkeleton i}.
[0107] The contour extraction process of topological surfaces is further introduced.
[0108] like Figure 6 As shown in , given a topological surface (face) and a path line (Path curve), select several sampling points on the path line (e.g., sampling according to the parameter domain ratio of 0.25, 0.50, 0.75); ② As Figure 7 As shown in the figure, for each sampling point P, calculate the tangent n of the path line at the sampling point P, construct a plane pl with point P and tangent n, calculate the section curve sc of the plane pl and the topological surface, and obtain an initial contour binary group (pl, sc); ③ Sort all the initial contour binary groups by the length of the section curve, and select the contour with the largest length (pl m ,sc m ) is a candidate contour binary; ④ Verify the validity of the contour: for each non-candidate contour binary (pl n ,sc n ), use pl n to pl m The transformation matrix Trans(pl n ,pl m ) Transform the contour sc n , get the contour sc n2 , in sc n2⑤Use a number of points (such as 10) uniformly according to the parameter domain, use the geometric modeling kernel to obtain the projection point p2 of the sampling point p on the topological surface, and calculate the distance d between point p and point p2. If the distance d is greater than the set threshold (such as 10E-4), the contour is invalid and the extraction failure is returned; ⑤If the distance d is less than or equal to the set threshold, use the general least squares method to simplify the cross-section line sc m All spline curves in the approximation of straight lines, arcs, and elliptical arcs, and update sc with simplified curves m ⑥ The result returned is a topological surface contour tuple (pl m ,sc m ). Among them, the sampling point corresponding to the distance d less than or equal to the set threshold is called the target sampling point. The following introduces the skeleton information extraction process of the topological surface.
[0109] 1. Plane.
[0110] If the current preprocessed topological surface is a plane, among the edges of the current preprocessed topological surface, select the target edge with the longest length and satisfying the first path line condition as the path line; the first path line condition includes: the target edge is a straight line edge, or the target edge can be fitted as a straight line, or the target edge is one of the two arc edges in the current preprocessed topological surface; contour line extraction is performed on the current preprocessed topological surface and the path line to obtain a contour binary group; if the contour line binary group satisfies the first preset skeleton information condition, the skeleton information corresponding to the current preprocessed topological surface is obtained according to the current preprocessed topological surface, the path line and the contour binary group.
[0111] Select the longest edge e in the current preprocessed topology face m is a path line and satisfies e m It is a straight line edge or can be fitted into a straight line using the general least squares method, or one of the two arc edges in the topological face face; then use (face, e m ) performs the above-mentioned contour extraction, such as obtaining the contour binary group (pl m ,sc m ) and satisfy Length(sc m )*Length(e m )>0.6*Area(face), create a skeleton information 4-tuple ({face},{e m},pl m ,sc m ), where Length() represents length and Area() represents area.
[0112] 2. Cylindrical surface.
[0113] If the current preprocessed topological surface is a cylindrical surface, the projection segment of the axis of the cylindrical surface in the current preprocessed topological surface is used as the path line;
[0114] Perform contour line extraction on the current preprocessed topological surface and the path line to obtain a first contour binary group, and obtain first skeleton information corresponding to the current preprocessed topological surface according to the first contour binary group, the current preprocessed topological surface and the path line;
[0115] Detect whether the section line and the path line in the contour binary meet the second preset skeleton information extraction condition, perform contour line extraction on the current preprocessed topological surface and the section line to obtain a second contour binary; obtain the second skeleton information corresponding to the current preprocessed topological surface based on the second contour binary, the current preprocessed topological surface and the section line.
[0116] The cylindrical surface can be regarded as a stretching surface and a rotating surface. As a stretching surface, the projection segment axis of the cylindrical surface axis in the topological surface face is used as the path, and the above contour line extraction is performed using (face, axis). For example, the contour binary (pl m1 ,sc m1 ), create a skeleton information 4-tuple ({face},{axis},pl m1 ,sc m1 ).
[0117] In ({face},{axis},pl m1 ,sc m1 ), if Length(sc m1 )>5*Length(axis), then the cylindrical surface can be regarded as a rotation surface and (face,sc m1 ) performs the above-mentioned contour extraction, such as obtaining the contour binary group (pl m2 ,sc m2 ), create a skeleton information 4-tuple ({face}, sc m1 ,pl m2 ,sc m2 ).
[0118] 3. Conical surface.
[0119] If the current preprocessed topological surface is a conical surface, when the half angle of the conical surface is approximately 0 (such as less than 0.1 degrees, similar to a cylindrical surface), the projection segment axis of the conical surface axis in the topological surface face is used as the path, and the above contour line extraction is performed using (face, axis). If the contour binary (pl m ,sc m ), create a skeleton information 4-tuple ({face},{axis},pl m ,sc m ).
[0120] 4. Torus.
[0121] If the current preprocessed topological surface is a torus, the projection segment circle of the base circle of the torus in the topological surface face is used as the path, and (face, circle) is used to perform (2.2) contour extraction. If the contour binary (pl m ,sc m ), create a skeleton information 4-tuple ({face},{circle},pl m ,sc m ).
[0122] 5. Free-form surface.
[0123] If the current preprocessed topological surface is a free-form surface, first use the least squares method to try to simplify it to a quadratic surface (plane, cylinder, cone or torus).
[0124]
[0125] Among them, r is the fitting error, g(u i ,v i ) is the parametric equation of the target quadratic surface, w i is the weight, d ij is the sampling point on the free surface and the distance from the sampling point to the target quadratic surface g(u i ,v i ) is the distance between the projection points of the convex surface and the concave surface of the concave surface. The approximate quadratic surface is obtained by minimizing r.
[0126] If it can be simplified to a plane, cylinder, cone or torus and meets a certain error range, the corresponding methods mentioned above are called to extract its skeleton information; if it is a swept surface, the swept surface path is used as the extraction path, otherwise the longest topological edge e is used. m As the extraction path path, then use (face, path) to perform the above contour extraction, such as obtaining the contour binary (pl m ,sc m ), create a skeleton information 4-tuple ({face},{path},pl m ,sc m ).
[0127] In step S104, the initial skeleton information is merged according to a preset merging condition.
[0128] In one embodiment, step S104 includes the following sub-steps S1041-S1045:
[0129] S1041. Determine whether each two pieces of initial skeleton information in the initial skeleton information satisfy a preset equivalence condition, merge the two pieces of initial skeleton information satisfying the preset equivalence condition, obtain preprocessed skeleton information, and use the preprocessed skeleton information to replace the corresponding two pieces of initial skeleton information to obtain a first skeleton information set.
[0130] Specifically, step S1041 includes the following sub-steps S10411-S10417:
[0131] S10411. If the topological surfaces in the two initial skeleton information are connected and the path lines in the two initial skeleton information are equivalent, determine that the two initial skeleton information meet a preset equivalent condition;
[0132] S10412. Construct a first plane with the intersection of the plane corresponding to the first initial skeleton information and the path line corresponding to the second initial skeleton information as the origin and the direction of the plane corresponding to the first initial skeleton information as the normal; the plane corresponding to the first initial skeleton information is a plane constructed according to the first target sampling point on the path line of the first initial skeleton information and the tangent at the first target sampling point; wherein the first initial skeleton information and the second initial skeleton information are two pieces of initial skeleton information that meet a preset equivalence condition.
[0133] S10413, transforming the contour line corresponding to the second initial skeleton information according to the transformation matrix from the plane corresponding to the second initial skeleton information to the first plane to obtain a transformation curve; the plane corresponding to the second initial skeleton information is a plane constructed according to the second target sampling point on the path line of the second initial skeleton information and the tangent at the second target sampling point;
[0134] S10414: If the transformation curve and the contour line corresponding to the first initial skeleton information are connected end to end, splicing the transformation curve and the contour line corresponding to the first initial skeleton information to obtain a spliced contour line;
[0135] S10415, merging the topological surface of the first initial skeleton information with the topological surface of the second initial skeleton information to obtain a merged topological surface;
[0136] S10416, obtaining pre-processed skeleton information according to the merged topological surface, the path line corresponding to the first initial skeleton information, the plane corresponding to the first initial skeleton information, and the spliced contour line;
[0137] S10417. Use the pre-processed skeleton information to replace the first initial skeleton information and the second initial skeleton information.
[0138] In this step, the adjacent initial skeleton information is merged based on the connectivity of the topological surface and the equivalence of the skeleton path.
[0139] For the initial skeleton information SK1(faces1,path1,plane1,profile1) and SK2(faces2,path2,plane2,profile2), if the following conditions are met: ①faces1 and faces2 are connected; ②path1 and path2 are equivalent (e.g., there is only one parallel straight line or arc with parallel normals); then try to merge SK1 and SK2: ①Construct plane plane22 with the intersection of path2 and plane1 interP as the origin and the direction of plane1 as the normal; ②Transform profile2 with the transformation matrix from plane2 to plane22 to obtain profile22; ③If profile1 and profile22 are connected end to end, concatenate them to obtain newProfile, otherwise return failure; ④Create the merged preprocessed skeleton information SK(faces1∪faces2,path1,plane1,newProfile) and use it to replace SK1 and SK2.
[0140] Among them, faces1 is the topological surface, path1 is the path line, plane1 is Pl in contour line extraction, and profile1 is the contour line.
[0141] Before executing step S1041, the initial skeleton information extracted in the above steps may be sorted according to a topological surface priority setting criterion.
[0142] The priority criteria may include: ① the initial skeleton information of the plane, sorted from large to small according to the area of its target topological surface; ② the initial skeleton information of the conical surface takes precedence over other types of surfaces to avoid redundant skeleton merging; ③ other criteria for adapting the scene.
[0143] When executing step S1041, it can be executed in order according to the sorted initial skeleton information, that is, the first-ranked initial skeleton information can be used as a benchmark to determine whether other initial skeleton information ranked after it can be merged with the initial skeleton information. After the judgment is completed, those that can be merged can be merged, and then the second-ranked initial skeleton information can be used as a benchmark to determine whether other initial skeleton information ranked after it can be merged with the initial skeleton information, and so on.
[0144] For example, the order of sorted initial skeleton information is initial skeleton information 1, initial skeleton information 2, initial skeleton information 3 and initial skeleton information 4. First, taking initial skeleton information 1 as a benchmark, determine whether initial skeleton information 1 and initial skeleton information 2 can be merged, determine whether initial skeleton information 1 and initial skeleton information 3 can be merged, and determine whether initial skeleton information 1 and initial skeleton information 4 can be merged. Assuming that initial skeleton information 1 and initial skeleton information 2 can be merged, initial skeleton information 1 and initial skeleton information 2 are merged to obtain initial skeleton information 1`. At this time, the new initial skeleton information is initial skeleton information 1`, initial skeleton information 3 and initial skeleton information 4. Then, taking initial skeleton information 3 as a benchmark, determine whether initial skeleton information 3 and initial skeleton information 4 can be merged. If initial skeleton information 3 and initial skeleton information 4 cannot be merged, then the first initial skeleton information set finally obtained is initial skeleton information 1`, initial skeleton information 3 and initial skeleton information 4.
[0145] S1042. Determine whether each two preset skeleton information in the first skeleton information set meet the preset compatibility condition, merge the two pre-processed skeleton information that meet the preset compatibility condition to obtain candidate skeleton information, and use the candidate skeleton information to replace the corresponding two pre-processed skeleton information to obtain the second skeleton information set.
[0146] In this step, compatible pre-processed skeleton information is merged based on the compatibility determination of the skeleton paths.
[0147] For the pre-processed skeleton information SK3 (faces3, path3, plane3, profile3) and SK4 (faces4, path4, plane4, profile4), if the following preset compatibility conditions are met: ① path3 and path4 are geometrically equivalent (such as: straight lines are parallel, arcs are normal-parallel, free curves are finely sampled points coincident, etc.); ② the overlapping area is greater than 80% (Note: arcs of different radii must first be adjusted to the same radius, and then the overlapping area is calculated); then the paths path3 and path4 are said to be compatible.
[0148] In one embodiment, step S1042 includes the following sub-steps S10423-S10428:
[0149] S10423, transforming the contour line of the second preprocessed skeleton information to the plane corresponding to the first preprocessed skeleton information. The first preprocessed skeleton information and the second preprocessed skeleton information are two preprocessed skeleton information that meet a preset compatibility condition. The plane corresponding to the first preprocessed skeleton information is a plane constructed based on the target sampling point on the path line of the first preprocessed skeleton information and the tangent at the target sampling point.
[0150] S10424. Construct a second plane with the intersection of the path line of the second preprocessing skeleton and the plane corresponding to the first preprocessing skeleton information as the origin and with the tangent direction of the path line of the second preprocessing skeleton at the intersection as the normal.
[0151] S10423. Use the transformation matrix of the second plane to transform the contour line of the second preprocessed skeleton to obtain a transformed contour line.
[0152] S10424: Merge the contour line of the first preprocessed skeleton information and the transformed contour line, and remove the overlapping areas to obtain a merged contour line.
[0153] S10425. Merge the path line of the first preprocessed skeleton information and the path line of the second preprocessed skeleton information, and remove the overlapping areas to obtain a merged path line.
[0154] S10426. Merge the topological surface of the first preprocessed skeleton information and the topological surface of the second preprocessed skeleton information to obtain a merged topological surface.
[0155] S10427. Obtain candidate skeleton information according to the merged topological surface, the merged path line, the plane of the first preprocessed skeleton information, and the merged contour line.
[0156] S10428. Use the candidate skeleton information to replace the first preprocessed skeleton information and the second preprocessed skeleton information.
[0157] ①Transform profile4 to plane3 to align profile3: construct plane plane44 with the intersection of path4 and plane3 interP as the origin and the tangent of path4 at interP as the normal; use the transformation matrix of plane44 to transform profile4 to obtain profile44; ②Merge profile3 and profile44, and remove the overlapping areas to obtain combineProfile; ③Merge them into path3 and path4, and remove the overlapping areas to obtain combinePath; ④Create the merged skeleton information SK(faces3∪faces4,combinePath,plane3,combineProfile), and use it to replace SK3 and SK4.
[0158] S1043, in the second skeleton information set, aligning the skeleton path corresponding to the candidate skeleton information to the centroid position of the target face set according to the geometric information of the skeleton contour corresponding to the candidate skeleton information to obtain aligned skeleton information, and using the aligned skeleton information to replace the corresponding candidate skeleton information to obtain a third skeleton information set;
[0159] In this step, the skeleton path is aligned to the centroid position of its target face set according to the geometric information of the skeleton contour.
[0160] In one embodiment, when executing the above step S1043, the following steps S10431-S10434 may be performed for each candidate skeleton information:
[0161] S10431. When the path line of the candidate skeleton information is a straight line, project the centroid corresponding to the candidate skeleton information onto the path line of the candidate skeleton information to obtain a projection point;
[0162] S10432. Use the translation matrix from the centroid to the projection point to translate the path line and the plane corresponding to the candidate skeleton information respectively; the plane corresponding to the candidate skeleton information is a plane constructed based on the target sampling point on the path line of the candidate skeleton information and the tangent at the target sampling point.
[0163] S10433, obtaining alignment skeleton information corresponding to the candidate skeleton information according to the topological surface of the candidate skeleton information, the translated path line, the plane corresponding to the translated candidate skeleton information, and the contour line of the candidate skeleton information;
[0164] S10434. Use the aligned skeleton information to replace the candidate skeleton information.
[0165] The contour is a simplified expression of the cross section of the target topological face set, so the centroid of the contour can be regarded as the centroid of the target face set. The steps to calculate the centroid of the contour are: ① Create a key point set keyPoints; ② For each curve of the contour, if it is an arc, add its center to keyPoints, and for other curves, add its curvature sampling points to keyPoints; ③ Use the weighted average method (such as the weight of the center is 5 and the weight of other points is 1) to calculate the centroid of these key points and obtain the contour centroid gravityPoint, that is, gravityPoint=∑(kp i *w i ) / n|i=0…n, where kp i ∈keyPoints, n is the number of keyPoints.
[0166] Given a candidate skeleton information SK (faces, path, plane, profile), ① for a straight line path, first project the centroid gravityPoint to the path path to obtain the projection point matchPoint, and then use the translation matrix from gravityPoint to matchPoint to translate the path and plane respectively to obtain translatedPath and translatedPlane. The aligned skeleton information is SK`(faces, translatedPath, translatedPlane, profile), which is used to replace SK; ② for a non-straight line path, in addition to the translation transformation of the path path and the plane plane, the profile also needs to be offset. This disclosure does not deal with this situation for the time being, so it will not be repeated here.
[0167] S1044, determining whether each two aligned skeleton information of the third skeleton information set meet a preset splicing condition, splicing the two aligned skeleton information that meet the preset splicing condition to obtain spliced skeleton information, and replacing the corresponding two aligned skeleton information with the spliced skeleton information to obtain a fourth skeleton information set;
[0168] In this step, the aligned skeleton information that can be spliced is merged based on the judgment of contour similarity and the splicingability of the skeleton path.
[0169] The preset splicing conditions include: the contour lines in the two aligned skeleton information are similar, and the path lines of the two aligned skeleton information are connected end to end;
[0170] The similarity of the contour lines in the two aligned skeleton information includes: the number of contour lines in the two aligned skeleton information is the same, and the contour lines with longer lengths in the two aligned skeleton information cover the contour lines with shorter lengths.
[0171] Specifically, if the first alignment skeleton information and the second alignment skeleton information are similar, and the path line of the first alignment skeleton information and the path line of the second alignment skeleton information are connected end to end, then a merged topological surface of the topological surface of the first alignment skeleton information and the topological surface of the second alignment skeleton information are obtained, and a merged path line of the path line of the first alignment skeleton information and the path line of the second alignment skeleton information are obtained; based on the merged topological surface, the merged path line, the plane of the first alignment skeleton information, and the contour line of the first alignment skeleton information, the spliced skeleton information corresponding to the first alignment skeleton information and the second alignment skeleton information is obtained; and the spliced skeleton information is used to replace the first alignment skeleton information and the second alignment skeleton information.
[0172] Given two profiles, profile5 and profile6, if: ① the number of curves of the profiles is the same; ② the profile with a longer length (named profile m ) contains another contour (completely coincides or overlaps); then profile5 is said to be similar to profile6.
[0173] For the first alignment skeleton information SK5(faces5,path5,plane5,profile5) and the second alignment SK6(faces6,path6,plane6,profile6), if profile5 is similar to profile6, and path5 and pathe6 are connected end to end, then the two skeletons are combined to form SK(faces5∪faces6,path5∪path6,plane5,profile6). m ) and use it to replace SK5 and SK6.
[0174] S1045. Delete redundant skeleton information in the fourth skeleton information set to obtain sorted skeleton information.
[0175] In this step, redundant skeleton information in the spliced skeleton information is deleted according to the nestedness determination of the topological surface.
[0176] Specifically, when executing step S1045, the following sub-steps S10451-S10455 are executed for every two spliced skeleton information in the fourth skeleton information set:
[0177] S10451, obtaining edges on all inner rings of the first splicing skeleton information;
[0178] S10453, obtaining the boundary edge of the second splicing skeleton information;
[0179] S10454: If the boundary edges of the second spliced skeleton information are all included in the edges on all inner rings of the first spliced skeleton information, then determine that the second spliced skeleton information is redundant skeleton information;
[0180] S10455. Delete the second splicing skeleton information.
[0181] For skeleton information SK7 (faces7, path7, plane7, profile7) and SK8 (faces8, path8, plane8, profile8), get all the edges innerEdges7 on the inner ring of faces7, get the boundary edges boundaryEdges8 of faces8, if SK8 is considered redundant and is removed from the set {SK i}.
[0182] The set of initial skeleton information {SK i}, through the skeleton post-processing of step S104, a more concise and optimized face set skeleton information set {SK i `}.
[0183] In step S105, a skeleton corresponding to the Brep model is obtained according to the merged skeleton information.
[0184] Furthermore, in the present disclosure, for each set of face set skeleton information, a simplified three-dimensional model can be reconstructed using the sweep modeling capability of the geometric modeling kernel based on information such as the swept profiles, the swept paths, and the profile planes where the swept profiles are located. The skeleton information of the non-closed contours is reconstructed to obtain a sheet-body model, and the skeleton information of the closed contours is reconstructed to obtain a solid model.
[0185] The simplified model obtained through reconstruction can be used for subsequent simulation analysis to provide more model information for simulation analysis.
[0186] In the present disclosure, when automatically extracting the skeleton of a three-dimensional Brep model of a three-dimensional Brep model, the method includes: (1) model preprocessing. According to the topological geometric information of the Brep model, combined with the determination of the convexity of the topological edge, redundant topological edges and preset groove surface features are found, and the geometric modeling kernel capability is used to remove them to obtain a concise model; (2) skeleton extraction. For each topological surface of the Brep model, different methods are used to extract its skeleton information according to its geometric surface type; (3) skeleton post-processing. According to the topological surface priority setting criteria, the extracted skeleton information is sorted; according to the connectivity of the topological surface and the equivalence of the skeleton path, adjacent skeleton information is merged; according to the compatibility determination of the skeleton path, compatible skeleton information is merged; according to the geometric information of the skeleton contour, the skeleton path is aligned to the centroid position of the target face set; according to the determination of the similarity of the skeleton contour and the splicing of the skeleton path, the splicing skeleton information is merged; according to the nesting determination of the topological surface, redundant skeleton information is deleted; (4) the skeleton of the Brep model is obtained according to the skeleton information, and the simplified model is reconstructed using the skeleton information.
[0187] The present disclosure can well realize the automatic skeleton extraction of three-dimensional Brep models such as three-dimensional Brep models of pipelines and steel structures. The skeleton is the central axis or main line of an object and is a natural one-dimensional representation of an object. The skeleton of a three-dimensional model can be regarded as composed of the position points of the centers of all the largest inscribed spheres in the object. For a three-dimensional Brep model, it contains accurate topological geometric information. The present disclosure analyzes the geometric information of the topological surface of the Brep model and extracts the skeleton of the three-dimensional model by direct calculation without decomposing the Brep model into discrete voxels, thereby not ignoring any skeleton details and improving the accuracy of skeleton extraction.
[0188] The present invention can well realize the automatic skeleton extraction of three-dimensional Brep models such as pipelines and steel structures, solving the defects of existing methods that can only process discrete three-dimensional models, the extraction process is complicated and the extraction results are inaccurate. At the same time, the three-dimensional Brep model can also be reconstructed to provide more model information for simulation analysis.
[0189] The present disclosure also provides the following examples.
[0190] like Figure 8 As shown, Figure 8 (a) is a three-dimensional Brep solid model with grooves. Figure 8 (b) and (c) are the skeleton and contour extracted by the method disclosed in the present invention. Figure 8 (d) a simplified model reconstructed from the skeleton information extracted by the method of the present disclosure, Figure 8 (e) in the figure shows the original solid model and the simplified model at the same time.
[0191] like Fig. 9 As shown, Fig. 9 (a) is a three-dimensional Brep solid model with two small holes, one oblique slot, and a hollow center. Fig. 9 (b), (c), (d) and (e) are respectively the skeleton, contour, reconstructed simplified model, original entity model and simplified model extracted by the method disclosed in the present invention.
[0192] like Fig.10 As shown, Fig.10 (a) is a three-dimensional Brep solid model of a chair back structure. Fig.10 (b) and (c) are respectively the skeleton extracted by the method disclosed in the present invention and the simplified model reconstructed from the skeleton information.
[0193] like Fig.11 As shown, Fig.11 (a) is a 3D Brep multi-entity model of a steel beam structure. Fig.11(b) and (c) are respectively the skeleton extracted from each entity by the method disclosed in the present invention and the simplified model reconstructed from the skeleton information.
[0194] like Fig.12 As shown, Fig.12 (a) is another 3D Brep solid model of a steel beam structure. Fig.12 (b) and (c) are respectively the skeleton extracted from each entity by the method disclosed in the present invention and the simplified model reconstructed from the skeleton information.
[0195] Based on the same inventive concept, the embodiment of the present application also provides a three-dimensional Brep model skeleton automatic extraction device for implementing the three-dimensional Brep model skeleton automatic extraction method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the embodiments of one or more three-dimensional Brep model skeleton automatic extraction devices provided below can refer to the limitations of the three-dimensional Brep model skeleton automatic extraction method above, and will not be repeated here.
[0196] In an exemplary embodiment, Fig.13 As shown, a skeleton automatic extraction device for a three-dimensional Brep model is provided, and the skeleton automatic extraction device for a three-dimensional Brep model comprises:
[0197] A first acquisition module 11 is used to acquire redundant topological edges in the Brep model according to the topological geometric information of the Brep model, and remove and fill the redundant topological edges to obtain a simplified model;
[0198] A second acquisition module 12 is used to acquire a preset groove feature surface in the simplified model according to the topological geometric information of the simplified model, and remove and fill the preset groove feature surface to obtain a preprocessing model;
[0199] An extraction module 13, used to extract initial skeleton information from the preprocessing model;
[0200] A merging module 14, configured to merge the initial skeleton information according to a preset merging condition;
[0201] The third acquisition module 15 is used to acquire the skeleton corresponding to the Brep model according to the initial skeleton information after the merging process.
[0202] In one embodiment, the first acquisition module is specifically configured to perform the following steps on each first internal topological edge in the Brep model:
[0203] Get two adjacent topological faces of the current first internal topological edge;
[0204] Obtaining the maximum curvature point in the current first internal topological edge, and obtaining the tangent direction at the maximum curvature point;
[0205] Calculate the outward normal of each of the adjacent topological faces of the current first internal topological edge at the point of maximum curvature;
[0206] Acquire the concave-convex value corresponding to the current first internal topological edge according to the tangent direction and each of the outward normal directions;
[0207] When the concave-convex value satisfies a preset redundancy value and two adjacent topological surfaces of the current first internal topological edge are equivalent surfaces, the current first internal topological edge is determined to be the redundant topological edge.
[0208] In one embodiment, the second acquisition module is specifically configured to perform the following steps on each second internal topological edge in the simplified model:
[0209] Get the first half edge and the second half edge corresponding to the current second internal topology edge;
[0210] Get the first face where the first half edge is located, and the second face where the second half edge is located;
[0211] Get the first ring where the first half edge is located, and the second ring where the second half edge is located;
[0212] When the first ring is an inner ring, the second ring is an outer ring, and an area ratio of the second surface to the first surface is less than a preset threshold, determining that the second ring is a candidate surface of a groove feature;
[0213] Acquire a face set corresponding to the candidate face of the groove feature; when the candidate face of the groove feature does not have a bottom cover face, the face set includes the topological face corresponding to the candidate face of the groove feature, or, when the candidate face of the groove feature has a bottom cover face, the face set includes the topological face corresponding to the candidate face of the groove feature and the bottom cover face;
[0214] If the face set is a concave face set, determining a face in the face set as the preset groove feature face;
[0215] Wherein, the face set is a concave face set, including:
[0216] If the face set meets the preset groove face condition, determining the face set to be the concave face set;
[0217] The preset groove surface conditions are: the topological surfaces in the face set are connected; the topological edges of the face set are concave edges; if the face set includes mixed surfaces, other mixed surfaces that are smoothly connected to the mixed surfaces are also included; and if the face set includes only one topological surface, the number of adjacent surfaces to the only included one topological surface is less than the number of rings of the one topological surface.
[0218] In one embodiment, the merging module is specifically used for:
[0219] Determine whether each two pieces of initial skeleton information in the initial skeleton information meet a preset equivalent condition, merge the two pieces of initial skeleton information that meet the preset equivalent condition to obtain pre-processed skeleton information, and use the pre-processed skeleton information to replace the corresponding two pieces of initial skeleton information to obtain a first skeleton information set;
[0220] Determine whether each two of the preset skeleton information in the first skeleton information set meet a preset compatibility condition, merge the two pre-processed skeleton information that meet the preset compatibility condition to obtain candidate skeleton information, and use the candidate skeleton information to replace the corresponding two pre-processed skeleton information to obtain a second skeleton information set;
[0221] According to the geometric information of the skeleton contour corresponding to each of the candidate skeleton information in the second skeleton information set, align the skeleton path corresponding to the candidate skeleton information to the centroid position of the target face set to obtain aligned skeleton information, and use the aligned skeleton information to replace the corresponding candidate skeleton information to obtain a third skeleton information set;
[0222] Determine whether each two aligned skeleton information of the third skeleton information set meet a preset splicing condition, splice the two aligned skeleton information that meet the preset splicing condition to obtain spliced skeleton information, and use the spliced skeleton information to replace the corresponding two aligned skeleton information to obtain a fourth skeleton information set;
[0223] The redundant skeleton information in the fourth skeleton information set is deleted to obtain the sorted skeleton information.
[0224] In one embodiment, in the aspect of judging whether each two pieces of the initial skeleton information satisfy a preset equivalent condition, merging the two pieces of initial skeleton information satisfying the preset equivalent condition, and replacing the corresponding two pieces of initial skeleton information with the merged skeleton information, the merging module is specifically configured to include:
[0225] If the topological surfaces in the two initial skeleton information are connected, and the path lines in the two initial skeleton information are equivalent, it is determined that the two initial skeleton information meet the preset equivalent condition;
[0226] A first plane is constructed with the intersection of the plane corresponding to the first initial skeleton information and the path line corresponding to the second initial skeleton information as the origin and the direction of the plane corresponding to the first initial skeleton information as the normal direction; the plane corresponding to the first initial skeleton information is a plane constructed according to the first target sampling point on the path line of the first initial skeleton information and the tangent at the first target sampling point; wherein the first initial skeleton information and the second initial skeleton information are the two initial skeleton information satisfying the preset equivalent condition;
[0227] The contour line corresponding to the second initial skeleton information is transformed according to a transformation matrix from the plane corresponding to the second initial skeleton information to the first plane to obtain a transformation curve; the plane corresponding to the second initial skeleton information is a plane constructed according to the second target sampling point on the path line of the second initial skeleton information and the tangent at the second target sampling point;
[0228] If the transformation curve and the contour line corresponding to the first initial skeleton information are connected end to end, splicing the transformation curve and the contour line corresponding to the first initial skeleton information to obtain a spliced contour line;
[0229] Merging the topological surface of the first initial skeleton information and the topological surface of the second initial skeleton information to obtain a merged topological surface;
[0230] Acquire the merged skeleton information according to the merged topological surface, the path line corresponding to the first initial skeleton information, the plane corresponding to the first initial skeleton information and the splicing contour line;
[0231] The first initial skeleton information and the second initial skeleton information are replaced by the merged skeleton information.
[0232] In one embodiment, in the aspect of merging the two pre-processed skeleton information satisfying the preset compatibility condition to obtain candidate skeleton information, and using the candidate skeleton information to replace the corresponding two pre-processed skeleton information, the merging module is specifically used to:
[0233] transforming the contour line of the second preprocessed skeleton information to the plane corresponding to the first preprocessed skeleton information; the first preprocessed skeleton information and the second preprocessed skeleton information are two pieces of preprocessed skeleton information that meet the preset compatibility condition;
[0234] Taking the intersection of the path line of the second preprocessed skeleton and the plane corresponding to the first preprocessed skeleton information as the origin, and taking the tangent direction of the path line of the second preprocessed skeleton at the intersection as the normal to construct a second plane;
[0235] Transforming the contour line of the second preprocessed skeleton using the transformation matrix of the second plane to obtain a transformed contour line;
[0236] Merging the contour line of the first preprocessed skeleton information and the transformed contour line, and removing the overlapping area to obtain a merged contour line;
[0237] Merging the path line of the first preprocessed skeleton information and the path line of the second preprocessed skeleton information, and removing the overlapping area to obtain a merged path line;
[0238] Merging a topological surface of the first preprocessed skeleton information and a topological surface of the second preprocessed skeleton information to obtain a merged topological surface;
[0239] Acquire the candidate skeleton information according to the merged topological surface, the merged path line, the plane of the first preprocessed skeleton information and the merged contour line;
[0240] The candidate skeleton information is used to replace the first pre-processed skeleton information and the second pre-processed skeleton information.
[0241] In one embodiment, according to the geometric information of the skeleton contour corresponding to each of the candidate skeleton information in the second skeleton information set, the skeleton path corresponding to the candidate skeleton information is aligned to the centroid position of the target face set to obtain the aligned skeleton information, and the aligned skeleton information is used to replace the corresponding candidate skeleton information, the merging module is specifically used to:
[0242] Perform the following steps for each candidate skeleton information:
[0243] When the path line of the candidate skeleton information is a straight line, projecting the centroid corresponding to the candidate skeleton information onto the path line of the candidate skeleton information to obtain a projection point;
[0244] Use the translation matrix from the centroid to the projection point to translate the path line and the plane corresponding to the candidate skeleton information respectively;
[0245] Acquire alignment skeleton information corresponding to the candidate skeleton information according to the topological surface of the candidate skeleton information, the translated path line, the translated plane corresponding to the candidate skeleton information, and the contour line of the candidate skeleton information;
[0246] Using the aligned skeleton information to replace the candidate skeleton information;
[0247] In one embodiment, the preset splicing condition includes: the contour lines in the two aligned skeleton information are similar, and the path lines of the two aligned skeleton information are connected end to end;
[0248] The similarity of the contour lines in the two aligned skeleton information includes: the number of contour lines in the two aligned skeleton information is the same, and the contour lines with longer lengths in the two aligned skeleton information cover the contour lines with shorter lengths.
[0249] In one embodiment, in terms of deleting redundant skeleton information in the fourth skeleton information set, the merging module is specifically configured to:
[0250] The following sub-steps are performed for every two concatenated skeleton information in the fourth skeleton information set:
[0251] Get the edges on all inner rings of the first splicing skeleton information;
[0252] Get the boundary edge of the second splicing skeleton information;
[0253] If the boundary edges of the second splicing skeleton information are all included in the edges on all inner rings of the first splicing skeleton information, then determining that the second splicing skeleton information is redundant skeleton information;
[0254] Delete the second splicing skeleton information.
[0255] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store skeleton processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a skeleton automatic extraction method of a three-dimensional Brep model is implemented.
[0256] Those skilled in the art will understand that Fig.14The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0257] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0258] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0259] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0260] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0261] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0262] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0263] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0264] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for automatically extracting the skeleton of a three-dimensional Brep model, characterized in that: The skeleton automatic extraction method of the three-dimensional Brep model comprises: According to the topological geometry information of the Brep model, redundant topological edges in the Brep model are obtained, and the redundant topological edges are removed to obtain a simplified model; According to the topological geometric information of the simplified model, a preset groove feature surface in the simplified model is obtained, and the preset groove feature surface is removed and filled to obtain a preprocessed model; Extracting initial skeleton information from the preprocessing model; Merging the initial skeleton information according to a preset merging condition; The skeleton corresponding to the Brep model is obtained according to the initial skeleton information after the merging process.
2. The automatic skeleton extraction method of the three-dimensional Brep model according to claim 1, characterized in that: The obtaining of redundant topological edges in the Brep model includes: For each first internal topological edge in the Brep model, perform the following steps: Get two adjacent topological faces of the current first internal topological edge; Obtaining the maximum curvature point in the current first internal topological edge, and obtaining the tangent direction at the maximum curvature point; Calculate the outward normal of each of the adjacent topological faces of the current first internal topological edge at the point of maximum curvature; Acquire the concave-convex value corresponding to the current first internal topological edge according to the tangent direction and each of the outward normal directions; When the concave-convex value satisfies a preset redundancy value and two adjacent topological surfaces of the current first internal topological edge are equivalent surfaces, the current first internal topological edge is determined to be the redundant topological edge.
3. The automatic skeleton extraction method of the three-dimensional Brep model according to claim 1, characterized in that: The step of obtaining a preset groove feature surface in the simplified model includes: The following steps are performed for each second internal topological edge in the simplified model: Get the first half edge and the second half edge corresponding to the current second internal topology edge; Get the first face where the first half edge is located, and the second face where the second half edge is located; Get the first ring where the first half edge is located, and the second ring where the second half edge is located; When the first ring is an inner ring, the second ring is an outer ring, and an area ratio of the second surface to the first surface is less than a preset threshold, determining that the second ring is a candidate surface of a groove feature; Acquire a face set corresponding to the candidate face of the groove feature; when the candidate face of the groove feature does not have a bottom cover face, the face set includes the topological face corresponding to the candidate face of the groove feature, or, when the candidate face of the groove feature has a bottom cover face, the face set includes the topological face corresponding to the candidate face of the groove feature and the bottom cover face; If the face set is a concave face set, determining a face in the face set as the preset groove feature face; Wherein, the face set is a concave face set, including: If the face set meets the preset groove face condition, determining the face set to be the concave face set; The preset groove surface conditions are: the topological surfaces in the face set are connected; the topological edges of the face set are concave edges; if the face set includes mixed surfaces, other mixed surfaces that are smoothly connected to the mixed surfaces are also included; and if the face set includes only one topological surface, the number of adjacent surfaces to the only included one topological surface is less than the number of rings of the one topological surface.
4. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 1, characterized in that: The merging process of the initial skeleton information according to a preset merging condition includes: Determine whether each two pieces of initial skeleton information in the initial skeleton information meet a preset equivalent condition, merge the two pieces of initial skeleton information that meet the preset equivalent condition to obtain pre-processed skeleton information, and use the pre-processed skeleton information to replace the corresponding two pieces of initial skeleton information to obtain a first skeleton information set; Determine whether each two of the preset skeleton information in the first skeleton information set meet a preset compatibility condition, merge the two pre-processed skeleton information that meet the preset compatibility condition to obtain candidate skeleton information, and use the candidate skeleton information to replace the corresponding two pre-processed skeleton information to obtain a second skeleton information set; According to the geometric information of the skeleton contour corresponding to each of the candidate skeleton information in the second skeleton information set, align the skeleton path corresponding to the candidate skeleton information to the centroid position of the target face set to obtain aligned skeleton information, and use the aligned skeleton information to replace the corresponding candidate skeleton information to obtain a third skeleton information set; Determine whether each two aligned skeleton information of the third skeleton information set meet a preset splicing condition, splice the two aligned skeleton information that meet the preset splicing condition to obtain spliced skeleton information, and use the spliced skeleton information to replace the corresponding two aligned skeleton information to obtain a fourth skeleton information set; The redundant skeleton information in the fourth skeleton information set is deleted to obtain the sorted skeleton information.
5. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 4, characterized in that: The step of judging whether each two pieces of initial skeleton information in the initial skeleton information satisfy a preset equivalent condition, merging the two pieces of initial skeleton information satisfying the preset equivalent condition, and replacing the corresponding two pieces of initial skeleton information with the merged pieces of skeleton information includes: If the topological surfaces in the two initial skeleton information are connected, and the path lines in the two initial skeleton information are equivalent, it is determined that the two initial skeleton information meet the preset equivalent condition; A first plane is constructed with the intersection of the plane corresponding to the first initial skeleton information and the path line corresponding to the second initial skeleton information as the origin and the direction of the plane corresponding to the first initial skeleton information as the normal direction; the plane corresponding to the first initial skeleton information is a plane constructed according to the first target sampling point on the path line of the first initial skeleton information and the tangent at the first target sampling point; wherein the first initial skeleton information and the second initial skeleton information are the two initial skeleton information satisfying the preset equivalent condition; The contour line corresponding to the second initial skeleton information is transformed according to a transformation matrix from the plane corresponding to the second initial skeleton information to the first plane to obtain a transformation curve; the plane corresponding to the second initial skeleton information is a plane constructed according to the second target sampling point on the path line of the second initial skeleton information and the tangent at the second target sampling point; If the transformation curve and the contour line corresponding to the first initial skeleton information are connected end to end, splicing the transformation curve and the contour line corresponding to the first initial skeleton information to obtain a spliced contour line; Merging the topological surface of the first initial skeleton information and the topological surface of the second initial skeleton information to obtain a merged topological surface; Acquire the merged skeleton information according to the merged topological surface, the path line corresponding to the first initial skeleton information, the plane corresponding to the first initial skeleton information and the splicing contour line; The first initial skeleton information and the second initial skeleton information are replaced by the merged skeleton information.
6. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 4, characterized in that: The step of merging the two pre-processed skeleton information satisfying the preset compatibility condition to obtain candidate skeleton information, and using the candidate skeleton information to replace the corresponding two pre-processed skeleton information includes: transforming the contour line of the second preprocessed skeleton information to the plane corresponding to the first preprocessed skeleton information; the first preprocessed skeleton information and the second preprocessed skeleton information are two pieces of preprocessed skeleton information that meet the preset compatibility condition; Taking the intersection of the path line of the second preprocessed skeleton and the plane corresponding to the first preprocessed skeleton information as the origin, and taking the tangent direction of the path line of the second preprocessed skeleton at the intersection as the normal to construct a second plane; Transforming the contour line of the second preprocessed skeleton using the transformation matrix of the second plane to obtain a transformed contour line; Merging the contour line of the first preprocessed skeleton information and the transformed contour line, and removing the overlapping area to obtain a merged contour line; Merging the path line of the first preprocessed skeleton information and the path line of the second preprocessed skeleton information, and removing the overlapping area to obtain a merged path line; Merging a topological surface of the first preprocessed skeleton information and a topological surface of the second preprocessed skeleton information to obtain a merged topological surface; Acquire the candidate skeleton information according to the merged topological surface, the merged path line, the plane of the first preprocessed skeleton information and the merged contour line; The candidate skeleton information is used to replace the first pre-processed skeleton information and the second pre-processed skeleton information.
7. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 4, characterized in that: According to the geometric information of the skeleton contour corresponding to each of the candidate skeleton information in the second skeleton information set, aligning the skeleton path corresponding to the candidate skeleton information to the centroid position of the target face set to obtain aligned skeleton information, and using the aligned skeleton information to replace the corresponding candidate skeleton information, including: Perform the following steps for each candidate skeleton information: When the path line of the candidate skeleton information is a straight line, projecting the centroid corresponding to the candidate skeleton information onto the path line of the candidate skeleton information to obtain a projection point; Use the translation matrix from the centroid to the projection point to translate the path line of the candidate skeleton information and the plane corresponding to the candidate skeleton information respectively; Acquire alignment skeleton information corresponding to the candidate skeleton information according to the topological surface of the candidate skeleton information, the path line of the translated candidate skeleton information, the plane corresponding to the translated candidate skeleton information, and the contour line of the candidate skeleton information; The candidate skeleton information is replaced by the aligned skeleton information.
8. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 4, characterized in that: The preset splicing conditions include: the contour lines in the two aligned skeleton information are similar, and the path lines of the two aligned skeleton information are connected end to end; The similarity of the contour lines in the two aligned skeleton information includes: the number of contour lines in the two aligned skeleton information is the same, and the contour lines with longer lengths in the two aligned skeleton information cover the contour lines with shorter lengths.
9. The method for automatically extracting the skeleton of a three-dimensional Brep model according to claim 4, characterized in that: The deleting redundant skeleton information in the fourth skeleton information set includes: The following sub-steps are performed for every two concatenated skeleton information in the fourth skeleton information set: Get the edges on all inner rings of the first splicing skeleton information; Get the boundary edge of the second splicing skeleton information; If the boundary edges of the second splicing skeleton information are all included in the edges on all inner rings of the first splicing skeleton information, then determining that the second splicing skeleton information is redundant skeleton information; Delete the second splicing skeleton information.
10. A skeleton automatic extraction device for a three-dimensional Brep model, characterized in that: The automatic skeleton extraction device of the three-dimensional Brep model comprises: A first acquisition module is used to acquire redundant topological edges in the Brep model according to the topological geometric information of the Brep model, and remove and fill the redundant topological edges to obtain a simplified model; A second acquisition module is used to acquire a preset groove feature surface in the simplified model according to the topological geometric information of the simplified model, and remove and fill the preset groove feature surface to obtain a preprocessing model; An extraction module, used to extract initial skeleton information from the preprocessing model; A merging module, used for merging the initial skeleton information according to a preset merging condition; The third acquisition module is used to acquire the skeleton corresponding to the Brep model according to the initial skeleton information after the merging process.