Brep-based cad model comparison method, apparatus, and storage medium

By using a BREP-based method, combined with visual comparison and boundary representation data comparison, the subjectivity and error issues in CAD model comparison in existing technologies are resolved, achieving accurate and comprehensive comparison results for CAD models.

CN119312543BActive Publication Date: 2025-11-25SHENZHEN POISSON SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, the comparison methods for CAD models mainly rely on visual view comparison, which has the problems of high subjectivity and large error, and cannot accurately determine the complete consistency of CAD models of different formats.

Method used

The method based on BREP is adopted. First, the differences between models are judged by visualization comparison. Then, the consistency of the models is determined by comparing the boundary representations of BREP data. This includes visualization techniques such as color mapping, slicing analysis and dynamic comparison, as well as parameter comparison of points, curves and surfaces and comparison of topological elements.

Benefits of technology

It enables objective and accurate comparison of CAD models, quickly identifies model differences and discovers subtle variations, and provides more accurate and comprehensive comparison results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312543B_ABST
    Figure CN119312543B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer-aided engineering, and provides a CAD model comparison method based on BREP, which comprises the following steps: visually comparing two target CAD models; if the visual comparison result of the two target CAD models is inconsistent, it is determined that the two target CAD models are different models; if the visual comparison result of the two target CAD models is consistent, boundary representation (BREP) data of the two target CAD models is compared; and if the BREP data comparison result of the two target CAD models is consistent, it is determined that the two target CAD models are the same model. The technical scheme can objectively and accurately compare CAD models.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] In the field of computer-aided design (CAD), the boundary representation (BREP) format is a format for representing a geometric model of a three-dimensional entity, which represents the entity by describing the geometric features of the boundary of the entity. In mainstream CAD modeling software, such as SolidWorks, CATIA, UG, etc., the BREP format is widely used. However, because the model formats in these software are not the same, it is generally not possible to directly compare complete data. In order to determine whether the entities represented by different format CAD models are completely consistent, it is generally necessary to convert the CAD model formats to a unified format, such as STEP, IGES, etc.

[0003] At present, the method for comparing CAD models is visual view comparison, that is, by comparing the views of CAD models to determine whether the CAD models are the same. However, because the above method only compares the views that can be seen between CAD models, there is not only strong subjectivity, but also there can be a large error. SUMMARY

[0004] The present application provides a CAD model comparison method based on BREP, a device and a storage medium, 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] comparing the visualizations of 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 results of the BREP data comparison of the two target CAD models are consistent, determining that the two target CAD models are the same model.

[0010] In another aspect, the present application provides a CAD model comparison device based on BREP, the device comprising:

[0011] a first comparison module configured to compare the two target CAD models visually;

[0012] a first determination module configured to determine that the two target CAD models are different models if the visual comparison result of the two target CAD models is inconsistent;

[0013] a second comparison module configured to compare boundary representation (BREP) data of the two target CAD models if the visual comparison result of the two target CAD models is consistent;

[0014] a second determination module configured to determine that the two target CAD models are the same model if the BREP data comparison result of the two target CAD models is consistent.

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

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

[0017] As can be seen from the above technical solution provided by the present application, after the visual comparison of the two target CAD models, if the visual comparison result of the two target CAD models is inconsistent, the two target CAD models are not the same model; if the visual comparison result of the two target CAD models is consistent, the BREP data of the two target CAD models is further compared to determine whether the two target CAD models are the same model. Since the visual comparison has a certain intuitiveness, the two target CAD models are directly determined to be different models through the visual comparison, and an accurate comparison result can be quickly obtained. The BREP data of the two target CAD models is compared, and the subtle differences between the two target CAD models can be accurately found. Each item of data of the two target CAD models is accurately compared. In summary, the two schemes are combined in the present application, and a more accurate and comprehensive comparison result can be obtained. BRIEF DESCRIPTION OF DRAWINGS

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of the BREP-based CAD model comparison method provided in the embodiments of this application;

[0020] Figure 2 This is a schematic diagram of the structure of the BREP-based CAD model comparison device provided in the embodiments of this application;

[0021] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0022] Figure 4 This is a flowchart of a BREP-based CAD model comparison method provided in another embodiment of this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

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

[0025] For ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn to actual scale.

[0026] In the field of Computer-Aided Diagnosis (CAD), Boundary Representation (BREP) format is a format used to represent the geometric models of 3D solids. It represents solids by describing the geometric features of their boundaries and is widely used in mainstream CAD modeling software such as SolidWorks, CATIA, and UG. However, because the model formats in these software programs are not entirely the same, direct comparison of complete data is usually not possible. To determine whether the solids represented by different CAD models are completely identical, it is generally necessary to convert the CAD model formats to a unified format, such as STEP or IGES. Currently, the method for comparing CAD models is visual view comparison, that is, comparing the views of the CAD models to determine whether they are the same. However, since the above method only compares the "visible" views between CAD models, it is not only highly subjective but may also contain significant errors.

[0027] To address the aforementioned problems in the existing technology, this application proposes a BREP-based CAD model comparison method, the flowchart of which is attached. Figure 1 As shown, the main steps include S101 to S104, which are detailed below:

[0028] Step S101: Visualize and compare the two target CAD models.

[0029] In this embodiment, the target CAD model refers to the CAD model to be compared. Here, visually comparing two target CAD models mainly involves using various visualization techniques and methods to display and analyze the differences and similarities between them. As one embodiment of this application, visually comparing two target CAD models can be achieved by transforming them to present and compare different aspects in a visual form, including one or a combination of color mapping, slice analysis, or dynamic comparison. The implementation process of these methods is described in detail below:

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

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

[0032] 3) Dynamic comparison, that is, loading two target CAD models into the same visualization interface; aligning the two target CAD models in 3D space; performing operations such as rotation, scaling and translation on the two target CAD models to observe the models from different angles; setting one of the two target CAD models to be semi-transparent or using a different display style so that the two target CAD models can be displayed overlapping; observing the differences between the two target CAD models through dynamic operations, thereby identifying possible differences and similarities.

[0033] As another embodiment of this application, visual comparison between two target CAD models can be achieved by directly comparing rendered images or screenshots of the two target CAD models to determine the differences in visual effects and image content, including pixel-level comparison and / or visual difference analysis. The implementation process of the above two schemes is described in detail below:

[0034] 1) Pixel-level comparison: This involves generating rendered images or screenshots from two target CAD models, ensuring that the two images generated from each target CAD model have the same resolution and viewing angle; performing preprocessing operations such as denoising and contrast enhancement on the two images to improve analysis accuracy; comparing each pixel of the two images one by one, calculating the differences (e.g., differences in RGB values), generating a difference map, and marking the different areas as the difference regions; and using a difference map visualization tool to highlight the difference regions with color (e.g., red for difference, green for sameness).

[0035] 2) Visual difference analysis, which involves aligning two target CAD models in the same coordinate system; extracting the geometric features (e.g., edges, corners, surface features, etc.) or image feature information (e.g., texture, shape) of the two target CAD models respectively; comparing different features using a preset algorithm (e.g., SIFT, SURF, etc.) to identify the parts where the two target CAD models differ, thus obtaining the difference regions; visualizing the difference regions using different colors or markers; performing difference analysis on the difference regions and summarizing the results of the difference analysis.

[0036] Step S102: If the results of the visualization comparison of the two target CAD models are inconsistent, then the two target CAD models are determined to be different models.

[0037] As mentioned earlier, visually comparing two target CAD models primarily involves using various visualization techniques and methods to demonstrate and analyze their differences and similarities. On one hand, visual comparisons typically reveal significant differences in shape, size, surface features, etc. These differences often directly reflect the different characteristics of the models, implying differences in their construction or generation processes. On the other hand, if two models visually exhibit different geometries (e.g., face positions, edge lengths, surface smoothness, etc.), this usually indicates they are different models, and inconsistent geometric features generally mean differences in design, parameters, or generation algorithms. Of course, from an engineering and scientific perspective, it is generally assumed that if two models are consistent in one aspect, they are likely the same. Conversely, if two models exhibit inconsistencies in multiple aspects, this strengthens the possibility that they are different models. Therefore, if the results of a visual comparison of two target CAD models are inconsistent, it can be determined that the two target CAD models are different models.

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

[0039] If the visualization comparison results of 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 visualization comparison (e.g., color mapping, slicing analysis, etc. show no significant differences), this indicates that they are similar in some features, but this does not rule out the possibility of subtle differences or undetected differences in other aspects. Furthermore, the two models may be similar in most features, but differ in details, topology, or other aspects, which may not be fully captured by the visualization method. Thirdly, if the model structure is complex, there may be many potential differences, such as subtle shape variations, surface features, etc., which may appear consistent at the macroscopic level but differ at the microscopic level. Therefore, for further confirmation, if the visualization comparison results 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 this application, comparing the BREP data of two target CAD models may involve: obtaining the part types of the two target CAD models; and comparing the BREP data of the two target CAD models using an algorithm corresponding to the part types of the two target CAD models. In the above embodiments, the part types of the two target CAD models refer to the fact that the parts of any target CAD model may be of body type, isolated geometry type, or assembly type. It should be noted that a comparison is only necessary if the part types of the two target CAD models are the same, or, conversely, the fact that the part types of the two target CAD models are the same is a prerequisite for comparison. For example, a comparison is only necessary if the part types of the two target CAD models are both body, isolated geometry, or assembly. If the part types of the two target CAD models are different, for example, one target CAD model has a body type and the other has isolated geometry or assembly types, then there is no need for comparison, because if the part types are different, the two target CAD models cannot be the same model.

[0040] In this embodiment, comparing the BREP data of two target CAD models using an algorithm corresponding to the part types of the two target CAD models can be achieved through steps S1 to S6, as can be referred to... Figure 4 The flowchart of the BREP-based CAD model comparison method is explained in detail below:

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

[0042] Since the types of part entities (such as assemblies, isolated geometries, and bodies) are determined when they are created, and these types are stored in the kernel, the types of these part entities can be obtained by traversing the part list and using the application programming interface (API) provided by the kernel. This allows us to determine 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 achieved by traversing the part list to determine whether the part types of the two target CAD models are both body types or isolated geometry types.

[0043] Step S2: If the part types of the two target CAD models are different and are assembly types, then 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 solid types or isolated geometry types.

[0044] As mentioned earlier, the premise for comparing two target CAD models is that their part types are the same. Therefore, if the part types of the two target CAD models are different (both are assembly types), it is necessary to compare the BREP data of the two target CAD models by determining whether their part types are both solid types or isolated geometry types. It can be understood that if step S1 involves traversing the part list to determine whether the part types of the two target CAD models are both solid types or isolated geometry types, then step S2 is correspondingly: if the part types of the two target CAD models are different (both are solid types or isolated geometry types), then it is necessary to compare the BREP data of the two target CAD models by determining whether their part types are both assembly types.

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

[0046] Step S21: Determine whether the part types of the two target CAD models are both isolated geometry types.

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

[0048] Step S22: If the part types of the two target CAD models are both isolated geometry types, then 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 geometry types.

[0049] Specifically, comparing the BREP data of two target CAD models by comparing the geometric elements of parts of two target CAD models that are both isolated geometry types can be achieved through steps S221 to S222:

[0050] Step S221: Compare the parameters of points, curves, and surfaces of parts in two target CAD models that are both isolated geometry types.

[0051] The parameters of points in isolated geometry parts mainly include position, such as two-dimensional or three-dimensional coordinates. The parameters of curves in isolated geometry parts mainly include basic items such as orientation, category, and curve parameters. In addition, different curves contain different parameters, as explained below:

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

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

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

[0055] (4) If the curve is a BCurve curve, its parameters include the degree, whether the surface is rational, whether it is closed, whether it is periodic, vertices, knots, and curve type.

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

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

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

[0059] (5) If the curve is a polyline curve, its parameters include closure, base parameters and positions.

[0060] The surface parameters of isolated geometric parts mainly include basic items such as orientation, type, U direction parameter, V direction parameter, location, coordinate axis, reference direction, and surface parameters. In addition, different surfaces contain different parameters, as explained below:

[0061] (1) If the surface is a plane, i.e., P1ane (a plane is a surface with curvature of 0), then there are no comparable parameters;

[0062] (2) If the surface is a cylindrical surface, its parameters include the 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 the 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, its parameters include whether the surface is rational, the surface shape, whether the surface is self-intersecting, whether it is convex, the degree in the V direction, the periodicity in the V direction, whether the V direction is closed, the node type in the V direction, the number of nodes in the V direction, the degree in the U direction, the periodicity in the U direction, whether the U direction is closed, the node type in the U direction, the number of nodes in the U direction, the number of vertices, and the vertex dimension.

[0067] (7) If the surface is a SweepSurface, its parameters include the entity class or the 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.

[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 parts in two target CAD models that are both isolated geometry types are consistent, then the results of the BREP data comparison of the two target CAD models are confirmed to be consistent.

[0072] In the above embodiments, the so-called consistent parameters of points, curves, and surfaces of parts in two target CAD models that are both isolated geometric types means that the parameters of points of parts in two target CAD models that are both isolated geometric types are consistent, the parameters of curves of parts in two target CAD models that are both isolated geometric types are consistent, and the parameters of surfaces of parts in two target CAD models that are both isolated geometric types are consistent.

[0073] Step S23: If the part types of the two target CAD models are both solid types, then the BREP data of the two target CAD models with the same part type are compared by comparing the topological elements of the parts of the two target CAD models with the same part 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 can be achieved through steps S231 to S234, as detailed below:

[0075] Step S231: According to the top-down layering rule, the topological elements of the body type part are divided into body layer voxels, surface layer voxels and edge layer voxels. Among them, the edge layer voxels are the lower layer voxels of the body type part, 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] Unlike the comparison method for parts of assembly type or isolated geometry type, in this embodiment, if the parts of two target CAD models are both of the body type, the topological elements of each body type part are divided into body layer voxels, surface layer voxels, and edge layer voxels according to a top-down layering rule. Here, an edge voxel is a one-dimensional topological element, defined by its two vertices, and can be a straight line or a curve; the edge voxel is the lower layer voxel of the body type part. A surface voxel is a two-dimensional topological element, a region enclosed by edges, usually a plane or a curved surface; the surface voxel is the upper layer voxel of the edge voxel. A body layer (Shell or Solid) voxel is a three-dimensional topological element, composed of one or more boundary surfaces, forming a closed solid; the body layer voxel is the upper layer voxel of the surface voxel.

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

[0078] It should be noted that although this application compares the volumetric voxels of parts in two target CAD models, the volumetric voxels are not compared directly, but rather the regions and lumps of the parts in the two target CAD models are compared separately. As for surface voxels, their comparison logic includes the comparison of their associated surface elements, while the comparison logic for edge voxels includes the comparison of their associated curve elements.

[0079] It should also be noted that the classification of volume voxels, surface voxels, and edge voxels is only a basic classification of the topological element types of volume-type parts. Strictly speaking, below volume voxels are shell elements, then surface voxels, below surface voxels are loop elements, below loop elements are fin / coedge elements, below fin / coedge elements are edge voxels, and below edge voxels are vertices, i.e., zero-dimensional elements, representing the position of a point.

[0080] Step S233: If the BREP data comparison results of the current layer voxels of the parts of the two target CAD models of the same 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 same body type are inconsistent.

[0081] It should be noted that although the parts of the two target CAD models of the same volume type are compared layer by layer in the order of volume layer voxels, surface layer voxels, and edge layer voxels, the BREP data comparison result of the two target CAD models of the same volume type strictly depends on the BREP data comparison result of the voxels above the current layer voxel. In other words, if the BREP data comparison result of the current layer voxels of the parts of the two target CAD models of the same volume type is the same, then the BREP data comparison result of the voxels above the current layer voxel is examined; otherwise, it is determined that the BREP data comparison results of the two target CAD models of the same volume type are inconsistent. Figure 4As shown. For example, if the BREP data comparison results of the edge voxels of parts in two target CAD models of the same volume type are different, then it is determined that the BREP data comparison results of the two target CAD models of the same volume type are inconsistent. If the BREP data comparison results of the edge voxels of parts in two target CAD models of the same volume type are the next step, then the BREP data comparison results of the upper voxels of the edge voxels of the two target CAD models are examined, namely Fin / Coedge elements, Loop elements, or surface voxels. If the BREP data comparison results of Fin / Coedge elements are inconsistent, then it is determined that the BREP data comparison results of the two target CAD models of the same volume type are inconsistent. If the BREP data comparison results of Fin / Coedge elements are consistent, then the BREP data comparison results of the Loop elements of the two target CAD models are examined. If the BREP data comparison results of Loop elements are inconsistent, then it is determined that the BREP data comparison results of the two target CAD models of the same volume type are inconsistent. If the data comparison results are consistent, then the comparison of BREP data of the surface voxels of the parts in the two target CAD models is further examined. If the BREP data comparison results of the surface voxels are inconsistent, then the comparison results of the BREP data of the two target CAD models of the same volume type are inconsistent. If the BREP data comparison results of the surface voxels are consistent, then the comparison results of the BREP data of the shell elements of the parts in the two target CAD models are further examined. If the BREP data comparison results of the shell elements are inconsistent, then the comparison results of the BREP data of the regions or lumps of the parts in the two target CAD models are inconsistent. If the BREP data comparison results of the regions or lumps are inconsistent, then the comparison results of the BREP data of the two target CAD models of the same volume type are inconsistent; otherwise, the comparison results of the BREP data of the two target CAD models of the same volume type are consistent.

[0082] Step S234: If the BREP data comparison results of all layered voxels of the parts of the two target CAD models of the same body type are the same, then it is determined that the BREP data comparison results of the two target CAD models of the same 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 this embodiment, a part of an assembly type may have one or more instances. Each instance has the standard form: [Assembly to which it belongs, transformation matrix, sub-part], where the sub-part can be a body type or an assembly type. The transformation matrix in the instance corresponding to the part of the assembly type represents the transformation relationship of the part in that instance in the coordinate system of the upper-level assembly. The following are the transformation matrices in the instances corresponding to the parts of the target CAD model provided in this embodiment:

[0085]

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

[0087] Step S4: If the transformation matrices in the corresponding instances of the parts of two target CAD models with the same part type (assembly type) are consistent, then determine whether the sub-part types of the two target CAD models with the same part type (assembly type) are also assembly types.

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

[0089] Step S5: If the sub-parts of two target CAD models with the same part type are both assembly types, the process proceeds 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 with the same part type.

[0090] If two target CAD models with the same part type (assembly type) also have sub-parts with the same assembly type, the process proceeds to step S3. Since step S3 determines whether the transformation matrices in the corresponding instances of the parts in the two target CAD models are consistent after confirming that the part types of the two target CAD models are both assembly types, proceeding to step S3 after confirming that the sub-part types of the two target CAD models are both assembly types means determining whether the transformation matrices in the corresponding instances of the sub-parts in the two target CAD models are consistent by traversing the instance list.

[0091] If the sub-part types of two target CAD models with the same part type are assembly type, but are neither assembly type nor isolated geometry type, it means that the sub-part types of the two target CAD models are body type. 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 with the same part type. The implementation method is similar to steps S231 to S234, except that the parts of the two target CAD models are changed to the sub-parts of the two target CAD models.

[0092] Considering that different kernel engines support different levels of precision 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 in the above embodiment further includes: before comparing the BREP data of the parts of two target CAD models of the same volume 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 the same volume type and / or the bounding box corresponding to the multidimensional voxels, wherein the multidimensional voxels include volume layer voxels, surface layer voxels or edge layer voxels.

[0093] For example, when comparing the topmost voxels (i.e., the body voxels) of two target CAD models of the same body type, before comparing their surface voxels, the contrast tolerance of the lower voxels (Regions or Lumps) of the body voxels is adaptively adjusted based on the bounding boxes corresponding to the topmost voxels (i.e., the body type) and / or the topmost voxel type of the two target CAD models. As an embodiment of this application's adaptive adjustment of the contrast tolerance of the lower topological elements or voxels of multidimensional voxels, assuming the diagonal length of the bounding box corresponding to the topmost voxel type (i.e., the body voxel) of the two target CAD models is L, and the contrast tolerance of the Regions or Lumps is P, 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 If 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 example, if the volume-level voxels of the parts in the two target CAD models being compared are edge-level voxels, including BCurve, TRCurve, ICurve, or SPCurve, then the adjustment rule for the contrast tolerance of the lower-level voxels (vertex elements) of the edge-level voxels is: the contrast tolerance can be directly set to the curve length of BCurve, TRCurve, ICurve, or SPCurve multiplied by 0.18.

[0101] If the volume layer voxels of the parts of the two target CAD models being compared are surface voxels, including surfaces, then the adjustment rule for the contrast tolerance of the lower voxel, i.e., the loop element, of the surface voxel is: the contrast tolerance can be directly set to the diagonal length of the bounding box of the surface * 0.11.

[0102] The 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 parts of two target CAD models with the same part type (assembly type) are inconsistent, the process proceeds to step S3.

[0104] The process moves 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 representations of the two target CAD models are consistent with the results of the BREP data comparison, then the two target CAD models are determined to be the same model.

[0106] From the above appendix Figure 1 As illustrated in the BREP-based CAD model comparison method, after visually comparing two target CAD models, if the results are inconsistent, the two target CAD models cannot be the same. If the results are consistent, further comparison of their BREP data is used to determine if they are the same. Since visual comparison is intuitive, directly identifying two target CAD models as different through visual comparison can quickly yield accurate results. Furthermore, comparing their BREP data allows for precise identification of subtle differences between the two target CAD models, enabling a more accurate and comprehensive comparison of each data point. Therefore, this application combines these two approaches to obtain more accurate and comprehensive comparison results.

[0107] Please see the appendix Figure 2 This application provides a BREP-based CAD model comparison device, which may include a first comparison module 201, a first determination module 202, a second comparison module 203, and a second determination module 204, as detailed below:

[0108] The first comparison module 201 is used to visually compare two target CAD models;

[0109] The first determining module 202 is used to determine that the two target CAD models are different models if the results of the visualization comparison of the two target CAD models are inconsistent.

[0110] 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 visualization comparison of the two target CAD models are consistent.

[0111] The second determining module 204 is used to determine that the two target CAD models are the same model if the boundary representations of the two target CAD models are consistent in the comparison of BREP data.

[0112] From the above appendix Figure 2As illustrated by the BREP-based CAD model comparison device, after visually comparing two target CAD models, if the results are inconsistent, the two target CAD models cannot be the same. If the results are consistent, further comparison of their BREP data is used to determine if they are the same. Since visual comparison is intuitive, directly determining that two target CAD models are different through visual comparison can quickly yield accurate results. Furthermore, comparing their BREP data allows for precise identification of subtle differences between the two target CAD models, enabling a more accurate and comprehensive comparison of each data point. Therefore, this application combines these two approaches to obtain more accurate and comprehensive comparison results.

[0113] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 3 As shown, the electronic device 3 in 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 for a BREP-based CAD model comparison method. When the processor 30 executes the computer program 32, it implements the steps described in the BREP-based CAD model comparison method embodiment, for example... Figure 1 The steps S101 to S104 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of the first comparison module 201, the first determination module 202, the second comparison module 203, and the second determination module 204 are shown.

[0114] For example, the computer program 32 of the BREP-based CAD model comparison method mainly includes: performing a visual comparison between two target CAD models; if the results of the visual comparison of the two target CAD models are inconsistent, then 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, then comparing the boundary representation BREP data of the two target CAD models; if the results of the comparison of the boundary representation BREP data of the two target CAD models are consistent, then determining that the two target CAD models are 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 executed by the processor 30 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 32 in the electronic device 3. For example, 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). 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] Electronic device 3 may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device may also include input / 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 (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), 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.

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

[0118] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed. That is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0119] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0120] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0121] In the embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

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

[0123] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0124] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program for the BREP-based CAD model comparison method can be stored in a storage medium. When executed by a processor, this computer program can implement the steps of the various method embodiments described above, namely, performing a visual comparison between two target CAD models; if the results of the visual comparison of the two target CAD models are inconsistent, then 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, then the boundary representations of the two target CAD models are compared using BREP data; if the results of the boundary representations of the two target CAD models are consistent, then the two target CAD models are determined to be the same model. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. Storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of storage media can be appropriately added to or removed according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media may not include electrical carrier signals and telecommunication signals.

[0125] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application. The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the protection scope of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this invention.

Claims

1. A BREP-based CAD model comparison method, characterized in that, The method includes: Visualize the comparison between two target CAD models; If the results of the visualization comparison of the two target CAD models are inconsistent, then the two target CAD models are determined to be different models; If the visualization comparison results of the two target CAD models are consistent, then the boundary representation BREP data of the two target CAD models are compared. The comparison of the boundary representation BREP data of the two target CAD models includes: obtaining the part types of the two target CAD models; and comparing the boundary representation BREP data of the two target CAD models using an algorithm corresponding to the part types of the two target CAD models. If the boundary representations of the two target CAD models are consistent with the results of the BREP data comparison, then the two target CAD models are determined to be the same model.

2. The BREP-based CAD model comparison method as described in claim 1, characterized in that, The step of comparing the boundary representation BREP data of the two target CAD models based on their part types using an algorithm corresponding to the part types of the two target CAD models includes steps S1 to S6: Step S1: By traversing the parts list, determine whether the parts of the two target CAD models are both assembly types; Step S2: If the part types of the two target CAD models are different and are assembly types, then the boundary representation BREP data of the two target CAD models are compared by determining whether the part types of the two target CAD models are both solid types or isolated geometry types. 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 with the same part type are consistent by traversing the instance list. Step S4: If the transformation matrices in the corresponding instances of the parts of two target CAD models whose part types are the same as the assembly type are consistent, then 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. Step S5: If the sub-part types of two target CAD models whose part types are the same as the assembly type are the same as the assembly type, the process proceeds 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 assembly type. Step S6: If the transformation matrices of the corresponding instances of the parts of two target CAD models with the same part type as the assembly type are inconsistent, the process proceeds to step S3.

3. The BREP-based CAD model comparison method as described in claim 2, 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 solid types or isolated geometry types includes: Determine whether the part types of the two target CAD models are both isolated geometry types; If the part types of the two target CAD models are both isolated geometry types, then the boundary representation 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 geometry types. If the two target CAD models have the same part type as volume, then the boundary representation BREP data of the two target CAD models with the same part type are compared by comparing the topological elements of the parts of the two target CAD models with the same volume type.

4. The BREP-based CAD model comparison method as described in claim 3, characterized in that, The comparison of the boundary representation BREP data of the two target CAD models by comparing the geometric elements of parts of the two target CAD models that are of the same isolated geometry type includes: Compare the parameters of points, surfaces, and curves of parts in two target CAD models that are both of the same isolated geometry type; If the parameters of the points, surfaces, and curves correspond to each other, then the boundary representations of the two target CAD models are determined to be consistent based on the BREP data comparison results.

5. The BREP-based CAD model comparison method as described in claim 3, characterized in that, The comparison of the boundary representation BREP data of two target CAD models of the same body type by comparing the topological elements of parts of the two target CAD models of the same body type includes: According to the top-down layering rule, the topological elements of the body type part are divided into body layer voxels, surface layer voxels and edge layer voxels. The edge layer voxels are the lower layer voxels of the body type part, 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. The BREP data of the parts of the two target CAD models of the same body type are compared layer by layer in the order of body layer voxels, surface layer voxels, and edge layer voxels. If the BREP data comparison results of the current layer voxels of the parts of the two target CAD models of the same body type are the same, then the BREP data comparison results of the upper layer voxels of the current layer voxels are examined; otherwise, it is determined that the BREP data comparison results of the two target CAD models of the same body type are inconsistent. If the BREP data comparison results of all layered voxels of the parts of two target CAD models of the same body type are the same, then the BREP data comparison results of the two target CAD models of the same body type are determined to be consistent.

6. The BREP-based CAD model comparison method as described in claim 5, characterized in that, The method further includes: Before comparing the BREP data of parts in two target CAD models of the same volume type layer by layer, the contrast tolerance of the lower-level 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 in the two target CAD models of the same volume type. The multidimensional voxels include the volume layer voxels, surface layer voxels, or edge layer voxels.

7. A BREP-based CAD model comparison device, characterized in that, The device includes: The first comparison module is used to visually compare two target CAD models; The first determining module is used to determine that the two target CAD models are different models if the results of the visualization comparison of the two target CAD models are inconsistent. The second comparison module is used to compare the boundary representation BREP data of the two target CAD models if the results of the visualization comparison of the two target CAD models are consistent. The comparison of the boundary representation BREP data of the two target CAD models includes: obtaining the part types of the two target CAD models; and comparing the boundary representation BREP data of the two target CAD models using an algorithm corresponding to the part types of the two target CAD models. The second determining module is used 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.

8. An electronic device, the 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, it implements the steps of the method as described in any one of claims 1 to 6.

9. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

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

    CN117237580A

  • Method and System for Comparing 3D Models

    US20180300533A1