BREP-based CAD model comparison method and device and storage medium

By combining visual comparison and BREP data comparison in CAD model comparison, the problem of subjectivity and error in CAD model comparison in the existing technology is solved, and more accurate model comparison results are achieved, especially in judging the nuances of CAD model. Have significant advantages.

CN119312543AActive Publication Date: 2025-01-14SHENZHEN POISSON SOFTWARE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411354990.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-14
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The existing CAD model comparison methods mainly rely on visual view comparison, which has subjectivity and large errors, making it difficult to accurately judge whether the entities of CAD models of different formats are completely consistent.

Method used

Using the CAD model comparison method based on BREP, visual comparison is performed first, and if the results are inconsistent, it is determined as different models; if the results are consistent, the boundary representation BREP data will be further compared, and the similarity of the model will be determined through detailed geometric features and topological comparisons. and the difference.

Benefits of technology

A more accurate and comprehensive comparison result of the CAD model is achieved, which reduces subjectivity, can quickly identify significant differences in the model and discover nuances, and improves the accuracy of the comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312543A_ABST
    Figure CN119312543A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer-aided engineering, and provides a BREP-based CAD model comparison method, which comprises the following steps of: carrying out visual comparison between two target CAD models; if the visual comparison results of the two target CAD models are inconsistent, determining that the two target CAD models are different models; if the visual comparison results of the two target CAD models are consistent, comparing boundary representation BREP data of the two target CAD models; and if the boundaries of the two target CAD models indicate that the BREP data comparison results are consistent, determining that the two target CAD models are the same models. According to the technical scheme, the CAD models can be objectively and accurately compared.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer-aided engineering, and in particular to a CAD model comparison method, device and storage medium based on BREP. Background Art

[0002] In the field of Computer Aided Design (CAD), the Boundary Representation (BREP) format is a format used to represent the geometric model of a three-dimensional entity. It represents the entity by describing the geometric features of the entity boundary. It is widely used in mainstream CAD modeling software, such as SolidWorks, CATIA, and UG. However, since the model formats in these software are not the same, it is usually impossible to directly compare the complete data. In order to determine whether the entities represented by CAD models in different formats are completely consistent, it is generally necessary to convert the CAD model format to a unified format, such as STEP, IGES, etc.

[0003] At present, the comparison method of CAD models is visual view comparison, that is, judging whether the CAD models are the same by comparing the views of the CAD models. However, since the above method only compares the "visible" views between the CAD models, it is not only highly subjective, but also may have large errors. Summary of the invention

[0004] The present application provides a CAD model comparison method, device and storage medium based on BREP, which can objectively and accurately compare CAD models.

[0005] In one aspect, the present application provides a CAD model comparison method based on BREP, the method comprising:

[0006] Perform a visual comparison between two target CAD models;

[0007] If the results of the visual comparison of the two target CAD models are inconsistent, determining that the two target CAD models are different models;

[0008] If the results of the visual comparison of the two target CAD models are consistent, comparing the boundary representation BREP data of the two target CAD models;

[0009] If the boundary representation BREP data comparison results of the two target CAD models are consistent, it is determined that the two target CAD models are the same model.

[0010] On the other hand, the present application provides a CAD model comparison device based on BREP, the device comprising:

[0011] A first comparison module, used for visually comparing two target CAD models;

[0012] A first determination module, configured to determine that the two target CAD models are different models if the results of the visual comparison of the two target CAD models are inconsistent;

[0013] A second comparison module, configured to compare the boundary representation BREP data of the two target CAD models if the visual comparison results of the two target CAD models are consistent;

[0014] The second determination module is used to determine that the two target CAD models are the same model if the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent.

[0015] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the technical solution of the above-mentioned BREP-based CAD model comparison method when executing the computer program.

[0016] In a fourth aspect, the present application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the technical solution of the above-mentioned BREP-based CAD model comparison method.

[0017] From the technical solution provided by the present application, it can be known that after visually comparing the two target CAD models, if the results of the visual comparison of the two target CAD models are inconsistent, the two target CAD models cannot be the same model; if the results of the visual comparison of the two target CAD models are consistent, then the two target CAD models are further determined to be the same model by comparing the BREP data of the two target CAD models. Since the visual comparison has a certain intuitiveness, the two target CAD models can be directly determined as different models through the visual comparison, and an accurate visual comparison result can be quickly obtained. By comparing the BREP data of the two target CAD models, the subtle differences between the two target CAD models can be accurately found, and each data of the two target CAD models can be accurately compared. In summary, the present application combines the two solutions to obtain more accurate and comprehensive comparison results. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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 or the description of the prior art 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.

[0019] Figure 1 is a flow chart of a CAD model comparison method based on BREP provided in an embodiment of the present application;

[0020] Figure 2 is a structural schematic diagram of a CAD model comparison device based on BREP provided in an embodiment of the present application;

[0021] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0022] Figure 4 It is a flow chart of a BREP-based CAD model comparison method provided in another embodiment of the present application. DETAILED DESCRIPTION

[0023] 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.

[0024] In this specification, adjectives such as first and second may be used only to distinguish one element or action from another element or action, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be interpreted as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.

[0025] In this specification, for the convenience of description, the sizes of various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0026] In the field of Computer Aided Diagnosis (CAD), the Boundary Representation (BREP) format is a format used to represent the geometric model of a three-dimensional entity. It represents the entity by describing the geometric features of the entity boundary. It is widely used in mainstream CAD modeling software, such as SolidWorks, CATIA, UG, etc. However, since the model formats in these software are different, it is usually impossible to directly compare the complete data. In order to determine whether the entities represented by CAD models in different formats are completely consistent, it is generally necessary to convert the CAD model format into a unified format, such as STEP, IGES, etc. At present, the comparison method of CAD models is visual view comparison, that is, judging whether the CAD models are the same by comparing the views of the CAD models. However, since the above method only compares the "visible" views between CAD models, it not only has a strong subjectivity, but also may have large errors.

[0027] In view of the above problems in the prior art, this application proposes a CAD model comparison method based on BREP, and its flow chart is shown in the attached figure. Figure 1 As shown, it mainly includes steps S101 to S104, which are described in detail as follows:

[0028] Step S101: Perform a visual comparison between two target CAD models.

[0029] In the embodiment of the present application, the target CAD model refers to the CAD model to be compared. Here, the visual comparison between the two target CAD models is mainly through various visualization techniques and methods to display and analyze the differences and similarities between the two target CAD models. As an embodiment of the present application, the visual comparison between the two target CAD models can be performed by transformation, and the different aspects of the two target CAD models are presented and compared in a visual form, including one or a combination of color mapping, slice analysis or dynamic comparison. The implementation process of the above-mentioned several solutions is specifically described below:

[0030] 1) Color mapping, i.e., using geometric analysis tools to calculate the geometric differences (e.g., volume, area, shape, etc.) of two target CAD models; generating a difference matrix of the model to represent the degree of difference of each part of the two target CAD models; mapping the difference values ​​to a color range (e.g., from green for no difference to red for a large difference) according to the difference matrix, obtaining a color mapping value, and setting a threshold for color mapping; applying the color mapping value to the target CAD model so that different areas display different colors according to the degree of difference; observing the color changes, identifying and analyzing the areas with significant differences in the two target CAD models.

[0031] 2) Slice analysis, i.e., aligning the two target CAD models in the same coordinate system; selecting the direction of the slices (e.g., XY, XZ, YZ planes) and the spacing of the slices, and determining the number of slices so as to generate enough slices for comparison; generating slices on each target CAD model to obtain multiple cut cross-sections; comparing each pair of slices one by one in terms of shape, area, holes and other features; summarizing the comparison results of each slice and analyzing the overall differences between the two target CAD models.

[0032] 3) Dynamic comparison, i.e., loading the two target CAD models into the same visualization interface; aligning the two target CAD models in three-dimensional space; rotating, scaling, and translating the two target CAD models so as to observe the models from different angles; setting one of the two target CAD models to be semi-transparent or using different display styles so that the two target CAD models can be displayed overlappingly; observing the differences between the two target CAD models through dynamic operations, thereby identifying possible differences and similarities.

[0033] As another embodiment of the present application, the visual comparison between the two target CAD models may be performed by directly comparing the renderings or screenshots of the two target CAD models, thereby determining the difference in visual effects and image contents of the two target CAD models, including pixel-level comparison and / or visual difference analysis. The implementation process of the above two solutions is specifically described below:

[0034] 1) Pixel-level comparison, that is, generating rendered images or screenshots from two target CAD models to ensure that the two images generated by the two target CAD models are the same in resolution and viewing angle; performing preprocessing operations such as denoising and contrast enhancement on the two images to improve the analysis accuracy; comparing each pixel of the two images one by one, calculating the difference (such as the difference in RGB values), generating a difference map, marking the different areas, i.e., the difference areas; using the difference map visualization tool, highlighting the difference areas with colors (for example, red for difference and green for the same).

[0035] 2) Visual difference analysis, i.e., aligning the two target CAD models in the same coordinate system; extracting the geometric features (e.g., edges, corners, surface features, etc.) or feature information (e.g., texture, shape) of the two target CAD models respectively; comparing different features through preset algorithms (e.g., SIFT, SURF, etc.), identifying the different parts of the two target CAD models, and obtaining the difference areas; visualizing the difference areas using different colors or markers; performing difference analysis on the difference areas and summarizing the results of the difference analysis.

[0036] Step S102: If the results of the visual comparison of the two target CAD models are inconsistent, it is determined that the two target CAD models are different models.

[0037] As mentioned above, visual comparison between two target CAD models mainly uses various visualization techniques and methods to display and analyze the differences and similarities between the two target CAD models. On the one hand, visual comparison can usually reveal obvious differences in the shapes, sizes, surface features, etc. of the models, which often directly reflect the different characteristics of the models, meaning that their construction or generation processes are different; on the other hand, if the two models visually show different geometric shapes (such as the position of the face, the length of the edge, the smoothness of the surface, etc.), this usually indicates that they are different models, and inconsistent geometric features usually mean that the models are different in design, parameters or generation algorithms. Of course, from an engineering and scientific perspective, it is usually assumed that if two models are consistent in one aspect, they may be the same. On the contrary, if the two models show inconsistencies in multiple aspects, this strengthens the possibility that they are different models. Therefore, if the results of the visual comparison of the two target CAD models are inconsistent, it can be determined that the two target CAD models are different models.

[0038] Step S103: If the visual comparison results of the two target CAD models are consistent, then the boundary representation BREP data of the two target CAD models are compared.

[0039] If the results of the visual comparison of the two target CAD models are inconsistent, it can be determined that the two target CAD models are different models. If the two models show consistency in the visual comparison (for example, color mapping, slice analysis, etc. all show no obvious difference), this indicates that they are similar in some features, but this does not exclude that they have subtle differences or undetected differences in other aspects. In addition, the two models may be similar in most features, but different in details, topology or other aspects, and these differences may not be fully captured in the visualization method. On the third hand, if the model structure is complex, there may be many potential differences, such as subtle shape changes, surface features, etc., which may look consistent at the macro level but have differences at the micro level. Therefore, in order to make further confirmation, if the results of the visual comparison of the two target CAD models are consistent, the boundary representation (BREP) data of the two target CAD models are compared. As an embodiment of the present application, comparing the boundary representation BREP data of the two target CAD models can be: obtaining the part types of the two target CAD models; according to the part types of the two target CAD models, using the algorithm corresponding to the part types of the two target CAD models to compare the BREP data of the two target CAD models. In the above embodiment, the part type of the two target CAD models means that the part of any target CAD model may be a body type, that is, Body, an isolated geometry type, that is, Isolated Geometry, or an assembly type, that is, Assembly. It should be noted that only when the part types of the two target CAD models are the same, is there a need for comparison, or, the same part type of the two target CAD models is a prerequisite for comparing the two target CAD models. For example, only when the part types of the two target CAD models are the same as Body, Isolated Geometry, or Assembly, is there a need for comparison. If the part types of the two target CAD models are different, for example, the part type of one target CAD model is Body, and the part type of the other target CAD model is Isolated Geometry or Assembly, there is no need for comparison, because the two target CAD models cannot be the same model if the part types are different.

[0040] In the embodiment of the present application, according to the part types of the two target CAD models, the BREP data of the two target CAD models can be compared by using an algorithm corresponding to the part types of the two target CAD models through steps S1 to S6, which can be referred to as Figure 4 The process of the exemplary BREP-based CAD model comparison method is described in detail as follows:

[0041] Step S1: By traversing the parts list, determine whether the part types of the two target CAD models are the same assembly type.

[0042] Since the types of part entities (Entity) such as assemblies, isolated geometric bodies and bodies are determined when they are created, and their types are stored in the kernel, the types of these part entities can be obtained by traversing the parts list and using the application program interface API provided by the kernel, thereby determining whether the part types of the two target CAD models are both assembly types. It should be noted that, as an alternative, step S1 can also be to determine whether the part types of the two target CAD models are both body types or isolated geometric body types by traversing the parts list.

[0043] Step S2: If the part types of the two target CAD models are different from each other and are assembly types, the BREP data of the two target CAD models are compared by determining whether the part types of the two target CAD models are both body types or isolated geometry types.

[0044] As mentioned above, the same part type of the two target CAD models is a prerequisite for comparing the two target CAD models. Therefore, if the part types of the two target CAD models are different and are assembly types, it is necessary to compare the BREP data of the two target CAD models by judging whether the part types of the two target CAD models are both body types or isolated geometric body types. It can be understood that if step S1 is to determine whether the part types of the two target CAD models are both body types or isolated geometric body types by traversing the parts list, then step S2 is corresponding to: if the part types of the two target CAD models are different and are body types or isolated geometric body types, the BREP data of the two target CAD models are compared by judging whether the part types of the two target CAD models are both assembly types.

[0045] Specifically, comparing the BREP data of the two target CAD models by judging whether the part types of the two target CAD models are both body type or isolated geometric body type is achieved through the following steps S21 to S23:

[0046] Step S21: Determine whether the part types of the two target CAD models are the same isolated geometric body type.

[0047] It should be noted that, similar to determining whether the part types of the two target CAD models are the same assembly type, determining whether the part types of the two target CAD models are the same isolated geometry type is also achieved by traversing the parts list.

[0048] Step S22: If the part types of the two target CAD models are both isolated geometric body types, the BREP data of the two target CAD models are compared by comparing the geometric elements of the parts of the two target CAD models that are both isolated geometric body types.

[0049] Specifically, comparing the BREP data of two target CAD models by comparing the geometric elements of the parts of the two target CAD models of the same isolated geometric body type can be achieved through steps S221 to S222:

[0050] Step S221: respectively comparing the parameters of points, curves and surfaces of parts of two target CAD models of the same isolated geometric body type.

[0051] The parameters of points of isolated geometry type parts mainly include positions, such as 2D coordinates or 3D coordinates. The parameters of curves of isolated geometry type parts mainly include basic items such as orientation, category and curve parameters. In addition, different curves contain different parameters, as described below:

[0052] (1) If the curve is a straight line, i.e. Line (a straight line is a curve with a curvature of 0), then its parameters include location and axis.

[0053] (2) If the curve is a circle, its parameters include radius, center location, axis, and reference direction.

[0054] (3) If the curve is an ellipse, its parameters include major radius, minor radius, center location, axis, and reference direction.

[0055] (4) If the curve is a BCurve curve, its parameters include angle (Degree), whether the surface is rational (Isrational), whether it is closed (Is closed), whether it is periodic (Is periodic), vertices (Vertices), nodes (Knots) and curve type (Curve Type);

[0056] (5) If the curve is an ICurve curve, there are no comparable parameters;

[0057] (6) If the curve is an SPCurve curve, there are no comparable parameters;

[0058] (7) If the curve is a TRCurve curve, there are no comparable parameters;

[0059] (5) If the curve is a Polyline curve, its parameters include Closure, Base param and Positions.

[0060] The parameters of the surface of isolated geometric parts mainly include orientation, type, U direction param, V direction param, location, axis, reference direction and surface parameters. In addition, different surfaces contain different parameters, as described below:

[0061] (1) If the surface is a plane, that is, P1ane (a plane is a surface with zero curvature), then there are no comparable parameters;

[0062] (2) If the surface is a cylinder, its parameters include radius;

[0063] (3) If the surface is a cone, its parameters include radius and semi-angle;

[0064] (4) If the surface is a sphere, its parameters include radius;

[0065] (5) If the surface is a torus, its parameters include the major radius and the minor radius;

[0066] (6) If the surface is a BSurface surface, its parameters include whether the surface is rational (Is rational), surface shape (Bsurf form), whether the surface is self-intersect (SelfIntersect), whether it is convex (Convexity), V degree (V degree), V periodicity (IfV periodic), whether it is closed in the V direction (IfV closed), V node type (V Kont Type), V node count (V Kont Count), U degree (U degree), U periodicity (IfU periodic), whether it is closed in the U direction (IfU closed), U node type (U Kont Type), U node count (U Kont Count), Vertice count (Vertice count) and Vertice Dimension (Vertice Dimension);

[0067] (7) If the surface is a SweepSurface, its parameters include entity class or direction;

[0068] (8) If the surface is an OffsetSurface, its parameters include the offset distance;

[0069] (9) If the surface is a SpinSurface, its parameters do not include the reference direction (Ref Direction);

[0070] (10) If the surface is a BlendSurface, the parameters include the radius.

[0071] Step S222: If the parameters of points, curves and surfaces of the parts of the two target CAD models of the same isolated geometric body type correspond to each other, it is determined that the results of the BREP data comparison of the two target CAD models are consistent.

[0072] In the above embodiment, the so-called corresponding and consistent parameters of points, curves and surfaces of parts of two target CAD models of the same isolated geometric body type respectively refer to that the parameters of points of parts of two target CAD models of the same isolated geometric body type are consistent, the parameters of curves of parts of two target CAD models of the same isolated geometric body type are consistent, and the parameters of surfaces of parts of two target CAD models of the same isolated geometric body type are consistent.

[0073] Step S23: If the part types of the two target CAD models are both solid type, the BREP data of the two target CAD models whose part types are both solid type are compared by comparing the topological elements of the parts of the two target CAD models whose part types are both solid type.

[0074] Specifically, comparing the BREP data of two target CAD models of the same body type by comparing the topological elements of the parts of the two target CAD models of the same body type can be achieved through steps S231 to S234, as described in detail as follows:

[0075] Step S231: According to the top-down layering rule, the topological elements of the body-type parts are divided into body layer voxels, surface layer voxels and edge layer voxels, wherein the edge layer voxels are the lower layer voxels of the body-type parts, the surface layer voxels are the upper layer voxels of the edge layer voxels, and the body layer voxels are the upper layer voxels of the surface layer voxels.

[0076] Different from the comparison method of parts of assembly type or isolated geometric type, in the embodiment of the present application, if the parts of the two target CAD models are of the same body type, the topological elements of the parts of each body type are divided into volume layer voxels, surface layer voxels and edge layer voxels according to the top-down layering rule. Here, the edge layer (Edge) voxel is a one-dimensional topological element, defined by the vertices at both ends, which can be a straight line or a curve; the edge layer voxel is the lower layer voxel of the body type part. The surface layer (Face) voxel is a two-dimensional topological element, an area surrounded by edges, usually a plane or a curved surface; the surface layer voxel is the upper layer voxel of the edge layer voxel. The volume layer (Shell or Solid) voxel is a three-dimensional topological element, composed of one or more boundary surfaces to form a closed solid; the volume layer voxel is the upper layer voxel of the surface layer voxel.

[0077] Step S232: Compare the BREP data of the parts of the two target CAD models of volume type layer by layer in the order of volume layer voxels, surface layer voxels and edge layer voxels.

[0078] It should be noted that although the present application compares the volume voxels of the parts of the two target CAD models, the volume voxels are not directly compared, but the Regions (regions) and Lumps (blocks) of the parts of the two target CAD models are compared respectively. As for the surface voxels, the comparison logic includes the comparison of the surface elements associated with them, and the comparison logic of the edge voxels includes the comparison of the curve elements associated with them.

[0079] It should also be noted that the division of volume voxels, surface voxels and edge voxels is only a basic division of the topological element types of volume-type parts. If the division is strict, the volume voxels are under the shell elements, the shell elements are the surface voxels, the surface voxels are under the loop elements, the loop elements are under the fin (fin) / coedge (coedge) elements, the fin / coedge elements are under the edge voxels, and the edge voxels are under the vertex (Vertex) or zero-dimensional elements, indicating the position of a point.

[0080] Step S233: If the BREP data comparison results of the current layered voxels of the parts of the two target CAD models of the body type are the same, continue to examine the BREP data comparison results of the upper layer voxels of the current layered voxels, otherwise it is determined that the BREP data comparison results of the two target CAD models of the body type are inconsistent.

[0081] It should be noted that, although the parts of the two target CAD models of the body type are compared layer by layer in the order of body layer voxels, surface layer voxels and edge layer voxels, the result of the BREP data comparison of the two target CAD models of the body type is strictly dependent on the BREP data comparison result of the upper layer voxels of the current layer voxels. In other words, if the BREP data comparison results of the current layer voxels of the parts of the two target CAD models of the body type are the same, then continue to examine the BREP data comparison results of the upper layer voxels of the current layer voxels, otherwise it is determined that the BREP data comparison results of the two target CAD models of the body type are inconsistent, such as Figure 4As shown. For example, if the BREP data comparison results of the edge layer voxels of the parts of the two target CAD models of the body type are different, then it is determined that the results of the BREP data comparison of the two target CAD models of the body type are inconsistent; if the BREP data comparison results of the edge layer voxels of the parts of the two target CAD models of the body type are the same, then the BREP data comparison results of the upper layer voxels of the edge layer voxels of the parts of the two target CAD models, that is, the Fin / Coedge elements, Loop (ring) elements or surface voxels are further investigated; if the BREP data comparison results of the Fin / Coedge elements are inconsistent, then it is determined that the results of the BREP data comparison of the two target CAD models of the body type are inconsistent; if the BREP data comparison results of the Fin / Coedge elements are consistent, then the BREP data comparison results of the Loop elements of the parts of the two target CAD models are further investigated; if the BREP data comparison results of the Loop elements are inconsistent, then it is determined that the results of the BREP data comparison of the two target CAD models of the body type are inconsistent; if the BREP data comparison results of the Loop elements are consistent, then the BREP data comparison results of the Loop elements of the parts of the two target CAD models are further investigated. If the data comparison results are consistent, the BREP data comparison results of the surface voxels of the parts of the two target CAD models will continue to be examined; if the BREP data comparison results of the surface voxels are inconsistent, it is determined that the results of the BREP data comparison of the two target CAD models of body type are inconsistent; if the BREP data comparison results of the surface voxels are consistent, the BREP data comparison results of the shell elements of the parts of the two target CAD models will continue to be examined; if the BREP data comparison results of the shell elements are inconsistent, it is determined that the results of the BREP data comparison of the two target CAD models of body type are inconsistent; if the BREP data comparison results of the shell elements are consistent, the BREP data comparison results of the Regions or Lumps of the parts of the two target CAD models will continue to be examined; if the BREP data comparison results of Regions or Lumps are inconsistent, it is determined that the results of the BREP data comparison of the two target CAD models of body type are inconsistent, otherwise, it is determined that the results of the BREP data comparison of the two target CAD models of body type are consistent.

[0082] Step S234: When the BREP data comparison results of all layered voxels of the parts of the two target CAD models of the body type are the same, it is determined that the BREP data comparison results of the two target CAD models of the body type are consistent.

[0083] Step S3: If the part types of the two target CAD models are both assembly types, then determine whether the transformation matrices in the corresponding instances of the parts of the two target CAD models are consistent by traversing the instance list.

[0084] In the embodiment of the present application, a part of an assembly type may have one or more instances (Instance), and the standard form of each instance is: [Assembly, transformation matrix, sub-part], where the sub-part can be a body type or an assembly type. The transformation matrix in the corresponding instance of the assembly type part represents the transformation relationship of the part in the instance in the coordinate system of the upper assembly. The following is the transformation matrix in the corresponding instance of the part of the target CAD model provided in the embodiment of the present application:

[0085]

[0086] Where R represents a non-singular transformation matrix, including rotation, reflection, non-uniform scaling and shear components, T (i.e., T x , T y and T z ) represents the translation vector corresponding to the coordinate axis direction, P (i.e. P x , P y and P z ) represents the perspective term in the viewing transformation, which must be zero in the transformation used for modeling. S is the global scaling factor, which must be greater than zero and whose value is the inverse of the global scaling ratio.

[0087] Step S4: If the transformation matrices in the corresponding instances of the parts of the two target CAD models whose part types are both assembly types are consistent, it is determined whether the sub-part types of the two target CAD models whose part types are both assembly types are both assembly types.

[0088] Since the parts of the assembly type are assembled from several parts, and the sub-parts of the target CAD model refer to the parts of the parts of the target CAD model, after determining that the transformation matrices in the corresponding instances of the parts of the two target CAD models whose part types are the same as the assembly type are consistent, it is necessary to further determine whether the sub-part types of the two target CAD models whose part types are the same as the assembly type are the same assembly type.

[0089] Step S5: If the sub-part types of the two target CAD models whose part types are both assembly types are both assembly types, the process goes to step S3, otherwise the BREP data of the two target CAD models are compared by comparing the topological elements of the sub-parts of the two target CAD models whose part types are both body types.

[0090] If the sub-part types of the two target CAD models whose part types are both assembly types are both assembly types, the process goes to step S3. Since step S3 is to determine whether the transformation matrices in the corresponding instances of the parts of the two target CAD models are consistent by traversing the instance list after determining that the part types of the two target CAD models are both assembly types. Therefore, when it is determined that the sub-part types of the two target CAD models whose part types are both assembly types are both assembly types, the process goes to step S3, which means to determine whether the transformation matrices in the corresponding instances of the sub-parts of the two target CAD models are consistent by traversing the instance list.

[0091] If the sub-part types of two target CAD models whose part types are both assembly types are neither assembly types nor isolated geometric bodies, it means that the sub-part types of the two target CAD models are body types. Therefore, the BREP data of the two target CAD models are compared by comparing the topological elements of the sub-parts of the two target CAD models whose part types are both body types. The implementation method is similar to steps S231 to S234, except that the parts of the two target CAD models become sub-parts of the two target CAD models.

[0092] Taking into account that different kernel engines may support different precisions when creating the same CAD model under the same parameters, and in order to accurately match the corresponding voxels when the voxels are similar, the method of the above embodiment also includes: before comparing the BREP data of parts of two target CAD models of body type layer by layer, adaptively adjusting the comparison tolerance of the lower-level topological elements or voxels of the multidimensional voxels according to the topological element type of the parts of the two target CAD models of body type and / or the bounding box corresponding to the multidimensional voxels, wherein the multidimensional voxels include body layer voxels, surface layer voxels or edge layer voxels.

[0093] For example, when comparing the top voxels of the parts of the two target CAD models of the body type, i.e., the body voxels (i.e., the body type of the parts), before comparing the surface voxels, the contrast tolerance of the lower voxels of the body voxels, i.e., Regions or Lumps, is adaptively adjusted according to the top voxels of the parts of the two target CAD models of the body type, i.e., the body voxels (i.e., the body type) and / or the bounding box corresponding to the top voxel type. As an embodiment of the present application for adaptively adjusting the contrast tolerance of the lower topological elements or voxels of the multidimensional voxels, it is assumed that the diagonal length of the bounding box corresponding to the top voxel type, i.e., the body voxel of the parts of the two target CAD models is L, and the contrast tolerance of the contrast tolerance of Regions or Lumps is P, and the adjustment rule is that the smaller L is, the smaller P is, for example:

[0094] If L ≥ 1, then P = 4e -2 ; e is the natural index, the same below;

[0095] If e -2 ≤L<1, then P=4e -4 ;

[0096] If e -4 ≤L <e -2 , then P = 4e -6 ;

[0097] If e -6 ≤L <e -4 , then P = 4e -8 ;

[0098] If e -8 ≤L <e -6 , then P = 4e -10 ;

[0099] If L <e -8 , then P = 4e- 12 .

[0100] For another example, if the volume voxels of the parts of the two target CAD models of the compared volume type are edge voxels, including BCurve, TRCurve, ICurve or SPCurve, then the adjustment rule of the comparison tolerance of the lower voxels of the edge voxels, i.e., the vertex elements, is as follows: the comparison tolerance can be directly set to the curve length of BCurve, TRCurve, ICurve or SPCurve * 0.18

[0101] If the volume voxels of the parts of the two target CAD models of the compared volume type are surface voxels, including surfaces (Surface), then the adjustment rule for the comparison tolerance of the lower voxels of the surface voxels, namely the Loop elements, is: the comparison tolerance can be directly set to the diagonal length of the bounding box of the surface * 0.11.

[0102] Adjustment of the contrast tolerance means that when comparing two voxels, as long as the absolute value of the error of their BREP data is not greater than the contrast tolerance set for the two voxels, the two voxels being compared are considered to be the same.

[0103] Step S6: If the transformation matrices in the corresponding instances of the two target CAD models whose part types are the same assembly type are inconsistent, the process goes to step S3.

[0104] The process goes to step S3, which means that it is necessary to traverse the instance list again to determine whether the transformation matrices in the corresponding instances of the parts of the two target CAD models are consistent.

[0105] Step S104: If the boundary representation BREP data comparison results of the two target CAD models are consistent, it is determined that the two target CAD models are the same model.

[0106] From the above attached Figure 1 It can be seen from the example BREP-based CAD model comparison method that after visually comparing the two target CAD models, if the results of the visual comparison of the two target CAD models are inconsistent, the two target CAD models cannot be the same model; if the results of the visual comparison of the two target CAD models are consistent, then the two target CAD models are further determined to be the same model by comparing the BREP data of the two target CAD models. Since the visual comparison has a certain intuitiveness, the two target CAD models can be directly determined as different models through the visual comparison, and an accurate visual comparison result can be quickly obtained. By comparing the BREP data of the two target CAD models, the subtle differences between the two target CAD models can be accurately found, and each data of the two target CAD models can be accurately compared. In summary, this application combines the two schemes to obtain more accurate and comprehensive comparison results.

[0107] Please see attached Figure 2 , is a CAD model comparison device based on BREP provided in an embodiment of the present application, the device may include a first comparison module 201, a first determination module 202, a second comparison module 203 and a second determination module 204, which are described in detail as follows:

[0108] A first comparison module 201 is used to perform a visual comparison between two target CAD models;

[0109] A first determination module 202, configured to determine that the two target CAD models are different models if the results of the visual comparison of the two target CAD models are inconsistent;

[0110] A second comparison module 203 is used to compare the boundary representation BREP data of the two target CAD models if the visual comparison results of the two target CAD models are consistent;

[0111] The second determination module 204 is configured to determine that the two target CAD models are the same model if the boundary representation BREP data comparison results of the two target CAD models are consistent.

[0112] From the above attached Figure 2It can be seen from the example BREP-based CAD model comparison device that after visually comparing the two target CAD models, if the results of the visual comparison of the two target CAD models are inconsistent, the two target CAD models cannot be the same model; if the results of the visual comparison of the two target CAD models are consistent, then the two target CAD models are further determined to be the same model by comparing the BREP data of the two target CAD models. Since the visual comparison has a certain intuitiveness, the two target CAD models can be directly determined as different models through the visual comparison, and an accurate visual comparison result can be quickly obtained. By comparing the BREP data of the two target CAD models, the subtle differences between the two target CAD models can be accurately found, and each data of the two target CAD models can be accurately compared. In summary, the present application combines the two schemes to obtain more accurate and comprehensive comparison results.

[0113] Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program of a CAD model comparison method based on BREP. When the processor 30 executes the computer program 32, the steps in the above-mentioned CAD model comparison method embodiment based on BREP are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 2 The functions of the first comparing module 201 , the first determining module 202 , the second comparing module 203 and the second determining module 204 are shown.

[0114] Exemplarily, the computer program 32 of the CAD model comparison method based on BREP mainly includes: visually comparing two target CAD models; if the results of the visual comparison of the two target CAD models are inconsistent, the two target CAD models are determined to be different models; if the results of the visual comparison of the two target CAD models are consistent, the boundary representation BREP data of the two target CAD models are compared; if the results of the boundary representation BREP data comparison of the two target CAD models are consistent, the two target CAD models are determined to be the same model. The computer program 32 can be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units can be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3. For example, the computer program 32 can be divided into the functions of a first comparison module 201, a first determination module 202, a second comparison module 203 and a second determination module 204 (modules in the virtual device), and the specific functions of each module are as follows: the first comparison module 201 is used to perform a visual comparison between two target CAD models; the first determination module 202 is used to determine that the two target CAD models are different models if the results of the visual comparison of the two target CAD models are inconsistent; the second comparison module 203 is used to compare the boundary representation BREP data of the two target CAD models if the results of the visual comparison of the two target CAD models are consistent; the second determination module 204 is used to determine that the two target CAD models are the same model if the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent.

[0115] The electronic device 3 may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0116] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0117] The memory 31 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 31 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 3. Further, the memory 31 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 31 is used to store computer programs and other programs and data required by the electronic device. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0118] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0119] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0120] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0121] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0124] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program of the BREP-based CAD model comparison method can be stored in a storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments, that is, visually compare the two target CAD models; if the results of the visual comparison of the two target CAD models are inconsistent, it is determined that the two target CAD models are different models; if the results of the visual comparison of the two target CAD models are consistent, the boundary representation BREP data of the two target CAD models are compared; if the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent, it is determined that the two target CAD models are the same model. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Storage media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media do not include electric carrier signals and telecommunication signals.

[0125] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present invention.

Claims

1. A CAD model comparison method based on BREP, characterized in that: The method comprises: Perform a visual comparison between two target CAD models; If the results of the visual comparison of the two target CAD models are inconsistent, determining that the two target CAD models are different models; If the results of the visual comparison of the two target CAD models are consistent, comparing the boundary representation BREP data of the two target CAD models; If the boundary representation BREP data comparison results of the two target CAD models are consistent, it is determined that the two target CAD models are the same model.

2. The CAD model comparison method based on BREP as claimed in claim 1, characterized in that: The comparing the boundary representation BREP data of the two target CAD models comprises: Obtaining part types of the two target CAD models; According to the part types of the two target CAD models, the boundary representation BREP data of the two target CAD models are compared using an algorithm corresponding to the part types of the two target CAD models.

3. The CAD model comparison method based on BREP as claimed in claim 2, characterized in that: According to the part types of the two target CAD models, the boundary representation BREP data of the two target CAD models are compared using an algorithm corresponding to the part types of the two target CAD models, including steps S1 to S6: Step S1: determining whether the part types of the two target CAD models are the same assembly type by traversing the parts list; Step S2: if the part types of the two target CAD models are different from each other and are assembly types, comparing the boundary representation BREP data of the two target CAD models by determining whether the part types of the two target CAD models are both body types or isolated geometric body types; Step S3: if the part types of the two target CAD models are both assembly types, determining whether the transformation matrices in the corresponding instances of the parts of the two target CAD models whose part types are both the assembly type are consistent by traversing the instance list; Step S4: if the transformation matrices in the part corresponding instances of the two target CAD models whose part types are the same as the assembly type are consistent, then determining whether the sub-part types of the two target CAD models whose part types are the same as the assembly type are the same as the assembly type; Step S5: if the sub-part types of the two target CAD models whose part types are the same as the assembly type are the same as the assembly type, the process goes to step S3, otherwise the boundary representation BREP data of the two target CAD models are compared by comparing the topological elements of the sub-parts of the two target CAD models whose part types are the same as the body type; Step S6: If the transformation matrices in the corresponding instances of the two target CAD models whose part types are the same as the assembly type are inconsistent, the process goes to step S3.

4. The CAD model comparison method based on BREP as claimed in claim 3, characterized in that: The step of comparing the boundary representation BREP data of the two target CAD models by determining whether the part types of the two target CAD models are both body type or isolated geometric body type comprises: Determining whether the part types of the two target CAD models are both isolated geometric body types; If the part types of the two target CAD models are both isolated geometric body types, comparing the boundary representation BREP data of the two target CAD models by comparing geometric elements of the parts of the two target CAD models that are both isolated geometric body types; If the part types of the two target CAD models are both body types, the boundary representation BREP data of the two target CAD models whose part types are both body types are compared by comparing the topological elements of the parts of the two target CAD models whose part types are both body types.

5. The CAD model comparison method based on BREP as claimed in claim 4, characterized in that: The step of comparing the boundary representation BREP data of the two target CAD models by comparing the geometric elements of the parts of the two target CAD models of the same isolated geometric body type comprises: Comparing the parameters of points, surfaces and curves of parts of two target CAD models of the same isolated geometric body type respectively; If the parameters of the points, surfaces and curves correspond to each other, respectively, it is determined that the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent.

6. The CAD model comparison method based on BREP as claimed in claim 4, characterized in that: The step of comparing the boundary representation BREP data of the two target CAD models of the same body type by comparing the topological elements of the parts of the two target CAD models of the same body type comprises: According to the top-down layering rule, the topological elements of the body-type parts are divided into body-layer voxels, surface-layer voxels and edge-layer voxels, wherein the edge-layer voxels are the lower-layer voxels of the body-type parts, the surface-layer voxels are the upper-layer voxels of the edge-layer voxels, and the body-layer voxels are the upper-layer voxels of the surface-layer voxels; Comparing the BREP data of the parts of the two target CAD models of the volume type layer by layer in the order of the volume layer voxels, the surface layer voxels and the edge layer voxels; If the BREP data comparison results of the current layered voxels of the parts of the two target CAD models of the body type are the same, then continue to examine the BREP data comparison results of the upper layer voxels of the current layered voxels, otherwise it is determined that the BREP data comparison results of the two target CAD models of the body type are inconsistent; When the BREP data comparison results of all layered voxels of the parts of the two target CAD models of the body type are the same, it is determined that the BREP data comparison results of the two target CAD models of the body type are consistent.

7. The CAD model comparison method based on BREP as claimed in claim 6, characterized in that: The method further comprises: Before comparing the BREP data of the parts of the two target CAD models of the body type layer by layer, the comparison tolerance of the lower-layer topological elements or voxels of the multidimensional voxels is adaptively adjusted according to the topological element type and / or the bounding box corresponding to the multidimensional voxels of the parts of the two target CAD models of the body type. The multidimensional voxels include the body layer voxels, surface layer voxels or edge layer voxels.

8. A CAD model comparison device based on BREP, characterized in that: The device comprises: A first comparison module, used for visually comparing two target CAD models; A first determination module, configured to determine that the two target CAD models are different models if the results of the visual comparison of the two target CAD models are inconsistent; A second comparison module, configured to compare the boundary representation BREP data of the two target CAD models if the results of the visual comparison of the two target CAD models are consistent; The second determination module is used to determine that the two target CAD models are the same model if the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent.

9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • CAD model matching method and system based on multi-view and machining feature recognition

    CN117237580A

  • Method for Comparing First Computer-Aided 3D Model with a Second Computer-Aided 3D Model

    US20100135535A1

  • Method and System for Comparing 3D Models

    US20180300533A1

  • Techniques for generating subjective style comparison metrics for b-REPS of 3D CAD objects

    US20220156415A1