A CAD reconstruction method and device based on construction subtractive primitives and gaussian attachment
Patent Information
- Application Number
- CN202611507759.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0010]本申请提供一种基于构造减材基元与高斯附着的CAD重建方法及装置,以解决现有基元式CAD重建过程中负基元可能未形成有效减除或者对主体结构产生过度减除,以及基元紧凑化可能破坏复合减材结构及其构造关系,进而影响CAD特征恢复和参数化编辑的问题
本申请通过在联合优化中采用布尔差集保护正则损失,根据负基元与正基元之间的占据交叠情况对负基元的有效减除进行约束,并根据主体结构的核心区域保留情况限制负基元的过度减除,使负基元能够参与孔、槽等减材特征的表达,同时降低负基元未形成实际减除以及负基元过度侵入主体结构的情况对重建结果的影响,有利于兼顾减材特征表达和主体结构完整性。
Smart Images

Figure CN123015860A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D reconstruction technology in computer vision and computer-aided design, specifically to parametric geometric reconstruction and editable CAD modeling technology based on multi-view images. Background Technology
[0002] With the development of computer vision, computer graphics, and computer-aided design (CAD) technologies, the recovery of 3D models from images, scanned data, or other observational data has been widely applied in scenarios such as the digitization of mechanical parts, reverse engineering of products, virtual assembly, and geometric content generation. Compared to simply generating triangular meshes, point clouds, or voxel models, CAD models typically require explicit geometric primitives, structural relationships, and editable features such as holes, slots, and bosses to facilitate subsequent parameter modifications and engineering applications.
[0003] Existing primitive fitting methods based on point clouds, meshes, or voxels typically require first segmenting the 3D input and then fitting the local region into the corresponding parameterized geometric unit. Therefore, they are somewhat dependent on the quality of the 3D input and the primitive segmentation results. When the input data contains occlusion, noise, or missing local details, it can easily affect the subsequent primitive fitting results.
[0004] Existing neural radiation field and 3D Gaussian sputtering methods can directly obtain good appearance reconstruction results from multi-view images. However, their network parameters, density fields, or freely distributed Gaussian units often lack a clear correspondence with CAD geometric primitives and manufacturing features. Therefore, when it is necessary to edit geometric parameters such as aperture, slot width, and boss height in the reconstruction results, there may be a lack of stable correlation between the appearance representation and the geometric structure, making it difficult to directly obtain a CAD representation with clear construction semantics that is easy to parametrically edit.
[0005] To improve the interpretability and editability of 3D models, existing technologies have proposed using geometric primitives such as cuboids, cylinders, and spheres to construct target objects through Boolean operations such as union, intersection, and difference. For target objects with subtractive features such as holes, slots, and cavities, using only the positive primitives involved in the construction usually requires a large number of primitives for approximate representation, while using negative primitives to subtract from the main structure can more directly express the corresponding structure. However, if positive and negative primitives are paired in a fixed manner, redundant primitives may be introduced into regions where subtractive features do not exist, and the degree of coupling in the parameter optimization process may increase.
[0006] Furthermore, when jointly optimizing positive and negative primitives using multi-view images, relying solely on image-level rendering errors or overall geometric errors may result in redundant coverage of the same area by multiple positive primitives, or negative primitives located outside the main structure without actual subtraction, or negative primitives excessively intruding into the main structure and disrupting the original geometry. Therefore, while ensuring that negative primitives can effectively represent subtractive features such as holes, slots, and recesses, it is also necessary to consider the integrity of the main structure.
[0007] The number of geometric primitives required varies depending on the target object. Existing primitive reconstruction methods can reduce redundant primitives through sparse constraints, filtering, pruning, or primitive merging. However, applying the same compaction strategy to primitives that perform different structural functions may alter the original structural relationships while reducing the number of primitives. For example, multiple nested or continuously interacting subtractive primitives may collectively form holes, slots, or recesses with hierarchical structures. Direct merging may result in the loss of the geometric hierarchy of the corresponding subtractive structure, thus affecting the subsequent recovery of CAD features.
[0008] Furthermore, while some existing 3D reconstruction methods can obtain parametric geometric units or boundary representations, the spatial relationships between these geometric units do not necessarily correspond to the feature semantics in CAD. Without further determining the coaxiality, coplanarity, adjacency, construction, and subtraction relationships between the primitives, it is difficult to directly identify CAD features such as through holes, blind holes, slots, and bosses based on the reconstructed primitive combinations. It also hinders the conversion of editing operations on CAD features into updates of corresponding geometric parameters.
[0009] Therefore, when performing CAD reconstruction based on parametric primitives, several technical problems remain to be solved: how to ensure that negative primitives actually form the required subtractions while limiting excessive subtraction of the main structure; how to reduce redundant primitives while avoiding damage to the composite subtractive structure formed by multiple negative primitives and its construction relationships; and how to utilize the retained primitive types and relationships to further determine CAD features. Furthermore, when implementing parametric editing of CAD features, it is also necessary to maintain the association between the appearance representation and the corresponding geometric primitives so that the corresponding appearance representation can be adjusted synchronously after the geometric structure is updated. Summary of the Invention
[0010] This application provides a CAD reconstruction method and apparatus based on constructing subtractive primitives and Gaussian attachment, in order to solve the problems that negative primitives may not form effective subtraction or may cause excessive subtraction of the main structure in the existing primitive-based CAD reconstruction process, and that primitive compaction may destroy the composite subtractive structure and its construction relationship, thereby affecting CAD feature recovery and parametric editing.
[0011] In a first aspect, this application provides a CAD reconstruction method based on subtractive material building blocks and Gaussian attachment, characterized by comprising: Obtain multi-view images of the target object and the corresponding camera parameters; Initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object. The set of typed differentiable primitives includes positive primitives and negative primitives, and there is no pre-defined one-to-one correspondence between the negative primitives and the positive primitives. Based on the differentiable occupancy function of each typed differentiable basic unit, construct the entity geometry combination to obtain the differentiable constructed entity geometry occupancy of the target object; For each type of differentiable primitive, a corresponding primitive local surface template is established, and multiple Gaussian units are attached to the primitive local surface template to form a structured Gaussian attachment that is related to the primitive pose and scale. The Gaussian unit is rendered based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; a rendering loss is determined based on the difference between the rendered image and the corresponding multi-view image, and a structure regularization loss is determined based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitive to constrain the typed differentiable primitive; the parameters of the typed differentiable primitive and the parameters of the Gaussian unit are jointly optimized based on the rendering loss and the structure regularization loss; wherein, the structure regularization loss includes a Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives; The jointly optimized typed differentiable primitives are screened, pruned, and / or merged to obtain a compact combination of positive and negative primitives; Editable CAD representations are output based on a compact combination of positive and negative primitives.
[0012] A second aspect of this application provides a CAD reconstruction device based on subtractive material units and Gaussian attachment, comprising: An image acquisition module is used to acquire a multi-view image of the target object and camera parameters corresponding to the multi-view image; A typed primitive construction module is used to initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object. The set of typed differentiable primitives includes positive primitives and negative primitives, and there is no pre-defined one-to-one correspondence between the negative primitives and the positive primitives. A solid geometry combination module is used to construct solid geometry combinations according to the differentiable occupancy functions of each typed differentiable basic unit, so as to obtain the differentiable constructed solid geometry occupancy of the target object. The structured Gaussian attachment module is used to establish a corresponding local surface template for each type of differentiable primitive, and to attach multiple Gaussian units on the local surface template to form a structured Gaussian attachment that is associated with the primitive pose and scale. A joint optimization module is used to render the Gaussian unit based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; determine a rendering loss based on the difference between the rendered image and the corresponding multi-view image, and determine a structure regularization loss for constraining the typed differentiable primitives based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitives; and jointly optimize the parameters of the typed differentiable primitives and the parameters of the Gaussian unit based on the rendering loss and the structure regularization loss; wherein, the structure regularization loss includes a Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives; A compactification module is used to filter, prune, and / or merge the jointly optimized typed differentiable primitives to obtain a compact combination of positive and negative primitives. The output module is used to output an editable CAD representation based on the compact combination of positive and negative primitives.
[0013] Compared with the prior art, this application has at least the following beneficial effects: This application employs Boolean difference set protection regularization loss in joint optimization, constrains the effective subtraction of negative primitives based on the overlapping of negative and positive primitives, and limits excessive subtraction of negative primitives based on the retention of the core region of the main structure. This allows negative primitives to participate in the expression of subtractive features such as holes and slots, while reducing the impact of negative primitives not forming actual subtraction or excessive intrusion of the main structure on the reconstruction results. This approach is beneficial for balancing the expression of subtractive features and the integrity of the main structure.
[0014] This application reduces redundant primitives while preserving the structural relationships required for composite subtractive features by screening, pruning, and / or merging optimized typified differentiable primitives and employing different compaction methods for positive and negative primitives.
[0015] This application uses structured Gaussian attachment to maintain the pose and scale of Gaussian elements with the corresponding typed differentiable primitives, and outputs an editable CAD representation based on a compact combination of positive and negative primitives. This is beneficial for maintaining the correspondence between the appearance representation and the geometric structure during parametric geometry editing, and improves the editability of the reconstruction results. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the overall process of the CAD reconstruction method provided in the embodiments of this application; Figure 2 A schematic diagram illustrating the parameter composition and candidate primitive types of the typed differentiable primitives provided in the embodiments of this application; Figure 3 A schematic diagram illustrating positive primitive soft union occupancy, negative primitive soft union occupancy, and difference set combination provided in the embodiments of this application; Figure 4 A schematic diagram of local Gaussian attachment of primitives and local-to-world coordinate transformation provided for embodiments of this application; Figure 5 A schematic diagram illustrating the process of differentiating and compacting positive and negative primitives provided in the embodiments of this application; Figure 6 The primitive relationship diagram provided for the embodiments of this application; Figure 7 This is a schematic diagram illustrating the determination of CAD features provided in an embodiment of this application. Figure 8 This is a schematic diagram of the CAD reconstruction device provided in an embodiment of this application. Detailed Implementation
[0017] The technical solution of this application will be further described below with reference to the accompanying drawings and specific embodiments.
[0018] In this embodiment, a primitive refers to a three-dimensional geometric entity that can be described by a finite number of parameters; a typed differentiable primitive refers to a geometric primitive with a corresponding primitive type that can participate in differentiable calculations through continuous parameters. The typed differentiable primitives include positive primitives and negative primitives. Positive primitives are used to construct the main structure of the target object, while negative primitives are used to subtract corresponding regions from the main structure to form holes, slots, recesses, or other subtractive features. There is no pre-defined one-to-one correspondence between the negative and positive primitives, allowing the negative primitives to independently participate in subsequent difference set combinations based on the actual subtractive features of the target object. This avoids pre-setting corresponding negative primitives for regions without subtractive features due to fixed positive-negative primitive pairings.
[0019] In this embodiment, structured Gaussian attachment refers to establishing a corresponding local surface template for a typed differentiable basic unit, and attaching multiple Gaussian units to the local surface template, so that the local parameters of the Gaussian units are associated with the corresponding typed differentiable basic unit.
[0020] Example 1 like Figure 1 As shown, this embodiment provides a CAD reconstruction method based on subtractive building blocks and Gaussian attachment, including steps S101 to S107, wherein: S101, acquire the multi-view image of the target object and the camera parameters corresponding to the multi-view image.
[0021] Specifically, multi-view images can be acquired by multiple cameras arranged around the target object, or by moving a camera from different perspectives; for scenes with existing 3D models, they can also be obtained by multi-view rendering of the 3D model. The camera parameters include camera intrinsic parameters and camera extrinsic parameters, wherein the camera intrinsic parameters are used to characterize the camera's imaging parameters, and the camera extrinsic parameters are used to characterize the relative pose relationship between the camera and the target object in the corresponding view.
[0022] In the subsequent joint optimization process, the multi-view images, serving as multi-view observations of the target object, are used to match the rendered images formed by Gaussian units in the corresponding views. The camera parameters are used to determine the view correspondence between the 3D Gaussian units and each multi-view image, thereby generating a rendering result corresponding to the respective multi-view image. The subsequently initialized set of typed differentiable primitives is used to form the parameterized geometric representation of the target object, and together with the Gaussian units attached to the typed differentiable primitives, serves as the object to be optimized. Thus, the multi-view images and camera parameters provide observation information of the target object, while the set of typed differentiable primitives provides the geometric representation to be optimized; the two establish a correspondence through subsequent joint optimization.
[0023] S102, initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object. The set of typed differentiable primitives includes positive primitives and negative primitives, and there is no pre-defined one-to-one correspondence between the negative primitives and the positive primitives.
[0024] Specifically, when initializing the set of typed differentiable primitives, multiple typed differentiable primitives are established, and initial primitive type, Boolean symbol, gating value, center, rotation, scale, and boundary sharpness are set for each typed differentiable primitive. In an optional implementation, when the primitive type of the typed differentiable primitive cannot be determined during the initialization stage, soft type selection can be enabled. When soft type selection is enabled, corresponding type logic values can also be set. Based on the Boolean symbol, the typed differentiable primitives are divided into positive primitives and negative primitives, wherein the negative primitives are set independently without pre-establishing a one-to-one correspondence with any specific positive primitive.
[0025] The parameters of the typified differentiable primitives include primitive type, Boolean sign, gating value, center, rotation, scale, and boundary sharpness. The primitive type includes at least one of cuboid, cylinder, sphere, right triangular prism, and regular hexagonal prism, used to determine the geometric category of the corresponding typified differentiable primitive. The Boolean sign is used to characterize the construction or subtraction attributes of the corresponding typified differentiable primitive in subsequent geometric combinations of constructed entities. The center, rotation, and scale are used to determine the position, orientation, and geometric dimensions of the corresponding typified differentiable primitive in three-dimensional space. The boundary sharpness is used to adjust the degree of change near the primitive boundary when soft occupancy is determined by a signed boundary function. The gating value is used to adjust the degree to which the corresponding typified differentiable primitive participates in subsequent geometric combinations and compaction processing. By using the above parameters to uniformly characterize different types of positive and negative primitives, a parameter basis can be provided for the determination of subsequent differentiable occupancy functions, the geometric combination of constructed entities using positive and negative primitives, and primitive selection.
[0026] Based on the Boolean notation, typed differentiable primitives can be divided into positive and negative primitives. Positive primitives participate in the construction of the main structure or added structures of the target object, while negative primitives participate in the formation of subtractive regions such as holes, slots, and recesses. Each negative primitive is set independently without pre-establishing a one-to-one correspondence with a specific positive primitive. This allows subsequent optimization processes to retain or suppress corresponding negative primitives based on the actual subtractive structure of the target object, without needing to pre-set fixed pairs of negative primitives for each positive primitive. This reduces unnecessary negative primitives introduced by fixed positive-negative primitive pairings and lowers unnecessary parameter coupling between different positive and negative primitives.
[0027] Furthermore, such as Figure 2 As shown, the typed differentiable primitive 200 includes primitive type 201, Boolean symbol 202, gate value 203, center 204, rotation 205, scale 206, boundary sharpness 207, and type logic value 208 used when soft type selection is enabled. Figure 2 The five geometric icons surrounding the typed differentiable primitive 200 are used to indicate candidate primitive types such as cuboid, cylinder, sphere, regular hexagonal prism and right triangular prism. Each geometric icon is only used to represent the geometric shape of the candidate primitive and does not limit the specific size, orientation and number of the corresponding primitive.
[0028] No. i A typed differentiable primitive can be represented as:
[0029] in, i Indexes representing typed differentiable primitives; Indicates the first i A primitive type of a typed differentiable primitive; Represents Boolean symbols; Indicates the gate value, the gate value The value range is [0,1]. The closer the gate value is to 1, the closer the corresponding typed differentiable primitive is to the active state; the closer the gate value is to 0, the closer the corresponding typed differentiable primitive is to the inactive state. Indicates the center; Indicates rotation; Indicates scale; Indicates the sharpness of the boundary; This indicates the type logic value used when soft type selection is enabled. Candidate primitive types include cuboid, cylinder, sphere, right triangular prism, and regular hexagonal prism. This type logic value is an optional parameter; it can be left unset when the primitive type is fixed.
[0030] Among them, Boolean symbols can be used. Distinguish between positive and negative primitives. In one implementation, the Boolean sign of a positive primitive is +1, used to form the body, boss, shaft, reinforcing rib, or other added structure of the target object; the Boolean sign of a negative primitive is... 1. Used to form holes, grooves, cavities, countersunk holes or other subtractive features from the main structure.
[0031] For any spatial point, it can be transformed from the world coordinate system to the local coordinate system of the corresponding typed differentiable primitive based on the center and rotation of the primitive. This spatial point serves as the evaluation location for the differentiable occupancy function, used to determine the degree of occupancy of the corresponding typed differentiable primitive at that spatial location.
[0032] For different primitive types, signed boundary functions corresponding to the geometric boundaries of the corresponding primitives are set. These signed boundary functions are determined based on the position of a spatial point in the local coordinate system of the corresponding typed differentiable primitive and the scale of the typed differentiable primitive, and are used to continuously characterize the relative positional relationship between the spatial point and the boundary of the corresponding primitive. In one embodiment, the signed boundary function takes a positive value inside the corresponding primitive and a negative value outside the corresponding primitive.
[0033] After obtaining the signed boundary function corresponding to the primitive type, the soft occupancy value of the differentiable occupancy function at the spatial point is determined by the Sigmoid function based on the signed boundary function and the boundary sharpness of the corresponding typed differentiable primitive. The soft occupancy value is the function value of the differentiable occupancy function with respect to the spatial point, used to characterize the degree to which the spatial point belongs to the interior of the corresponding typed differentiable primitive in a continuous form; the boundary sharpness is used to adjust the degree of change in the soft occupancy value near the primitive boundary.
[0034] Since the soft occupancy value can continuously change with parameters such as the center, rotation, scale, and boundary sharpness of the typed differentiable primitives, the geometric occupancy of the corresponding constructed entities can also continuously change with the primitive parameters when performing soft union and difference combination on positive and negative primitives. This provides a basis for the typed differentiable primitive parameters to participate in subsequent differentiable joint optimization.
[0035] For any spatial point , using the i The center and rotation of a typed differentiable primitive transform the spatial point to the first... i Given a local coordinate system for each typed differentiable basis element, we obtain:
[0036] in, Represents a point in space within the world coordinate system; Indicates the first i The center of a typed differentiable primitive; Indicates the first i Rotational quaternions of a typed differentiable basis; Represents the result of rotation quaternions The resulting rotation matrix; Indicates that the spatial point is at the th i Coordinates in the local coordinate system of a typed differentiable primitive. , and These represent the components of the local coordinates along the three coordinate axes.
[0037] Furthermore, let the first i The scale of a typed differentiable primitive is: , , ) in, , and These represent the scales of the typed differentiable primitives along their respective local coordinate axes. For different candidate primitive types, corresponding signed boundary functions are established. ,in, t Indicates the candidate primitive type.
[0038] For cuboid types, the following can be used:
[0039] For cylinders with local z-axis alignment, the following can be used:
[0040] in, The radial boundary term characterizes the positional relationship of a spatial point relative to the radial boundary of the cylinder. This is the axial boundary term, used to characterize the positional relationship of a spatial point relative to the local axial boundary of the cylinder.
[0041] For spheres, let: Then we can use:
[0042] in, r This represents the sphere's scale parameters determined based on the scale components. Let represent the L2 norm of the local coordinate vector u.
[0043] For the right triangular prism type, let , , and define , , Then the following formula can be used:
[0044] The scale parameters include dimensional parameters along the local coordinate axis. , and For right triangular prisms, let h = = ,in, h Indicates a right triangular prism along a local area z Half-height in the axial direction.
[0045] For a regular hexagonal prism, let: , as well as ,
[0046] And order: Then the signed boundary function corresponding to the regular hexagonal prism can be expressed as:
[0047] in, Indicates by local x Axial dimension and local y The transverse dimensional parameters of a hexagonal prism determined by its axial dimensions; h Indicates a hexagonal prism along a local area z Dimensions along the axial direction; Indicates the first d Unit direction vectors corresponding to each planar direction; Indicates local coordinates at xy Two-dimensional coordinate vectors in a plane.
[0048] In obtaining candidate primitive types t After the corresponding signed boundary function, the sigmoid function is used to convert the signed boundary function into a continuous soft occupancy. For the first... i Candidate primitive types of categorized differentiable primitives t The corresponding soft occupancy is:
[0049] in, Representing a spatial point x In the i Each typed differentiable primitive adopts a candidate primitive type. t The soft occupancy of time; Indicates the first i Boundary sharpness of a typed differentiable primitive; z This represents the input variables for the Sigmoid function.
[0050] When the i When the type of a categorized differentiable primitive is fixed, the primitive type is used in accordance with that fixed primitive type. The corresponding soft occupancy value is used as the function value of the differentiable occupancy function, that is:
[0051] When soft type selection is enabled, the type weight is determined based on the type logic value and type selection temperature corresponding to each candidate primitive type, and the soft occupancy value corresponding to each candidate primitive type is weighted according to the type weight to obtain the differentiable occupancy of the typed differentiable primitive. According to the i For each typed differentiable primitive, the type logical value of each candidate primitive type and the type selection temperature are used to calculate the corresponding type weight:
[0052] in, Indicates the first i A categorized differentiable primitive for candidate primitive types t The type of logical value; Indicates the type selection is temperature; Represents the set of candidate primitive types; This represents the summation index in the set of candidate primitive types; Indicates the first i Each typed differentiable primitive adopts a candidate primitive type. t Type weights.
[0053] Furthermore, based on the type weights corresponding to each candidate primitive type, the soft occupancy of different candidate primitive types is weighted to obtain the first... i Differentiable occupancy of a typed differentiable primitive:
[0054] Soft type selection is used to provide continuous optimization weights when the primitive type is not yet determined, and can be fixed as a discrete type once the type is determined.
[0055] S103, construct entity geometry combination according to the differentiable occupancy function of each typed differentiable basic unit to obtain the differentiable constructed entity geometry occupancy of the target object.
[0056] Specifically, based on the Boolean symbols of each type of differentiable primitive, type-differentiable primitives with positive Boolean symbols are assigned to the positive primitive set, and type-differentiable primitives with negative Boolean symbols are assigned to the negative primitive set. For any spatial point, the soft occupancy value of the differentiable occupancy function of each type of differentiable primitive at the spatial point is determined according to step S102, and the soft occupancy values in the positive primitive set and the negative primitive set are soft-unioned to obtain the soft union occupancy of the positive primitives and the soft union occupancy of the negative primitives at the spatial point. In one embodiment, the contribution of the corresponding primitive to the soft union occupancy can also be adjusted by combining the gating value of each type of differentiable primitive.
[0057] For a set of positive primitives, the soft union of the differentiable occupancy of each positive primitive with its corresponding gate value is obtained:
[0058] in, Representing a spatial point x The corresponding positive primitive soft union occupies; Indicates the first i The gate values of a typed differentiable primitive; Represents the set of positive primitives; This indicates that the first step determined by the aforementioned steps i A type of differentiable primitive at a point in space x Differentiable occupancy at a given point.
[0059] Accordingly, the differentiable occupancy of each negative primitive is combined with its corresponding gate value to form a soft union, resulting in the soft union occupancy of the negative primitives:
[0060] in, Representing a spatial point x The corresponding negative primitive soft union occupies; This represents the set of negative primitives.
[0061] Furthermore, subtracting the negative primitive soft union occupancy from the positive primitive soft union occupancy yields the differentiable constructed entity geometric occupancy of the target object at the spatial point:
[0062] in, This represents the geometrical occupancy of a differentiable constructed entity of the target object at point x in space.
[0063] Therefore, positive primitives are used to determine the construction regions that need to be retained, while negative primitives are used to determine the regions to be subtracted from the construction regions, allowing added structures and subtractive structures such as holes, slots, and recesses to be expressed within the same construction entity's geometric occupancy. Since negative primitives first form independent soft union occupancy before participating in the difference set combination as a whole, a negative primitive can perform a subtraction operation with one or more positive primitives based on actual geometric relationships, without needing to predefine a one-to-one correspondence between negative primitives and specific positive primitives.
[0064] By combining positive and negative primitive soft unions and their differences using continuous soft occupancy values, the resulting differentiable constructible entity geometric occupancy continuously varies with parameters such as the center, rotation, scale, boundary sharpness, and gating value of the typed differentiable primitives. Therefore, the construction and subtraction relationships between the positive and negative primitives can participate in subsequent gradient-based joint optimization. Furthermore, the differentiable constructible entity geometric occupancy can serve as a basis for subsequent geometric constraints and for determining whether negative primitives form effective subtractions.
[0065] For example, such as Figure 3 As shown, 300 represents a set of positive primitives, which is combined by soft union to form a soft union of positive primitives occupying 320; 310 represents a set of negative primitives, which is combined by soft union to form a soft union of negative primitives occupying 330; the difference set combination of the soft union of positive primitives occupying 320 and the soft union of negative primitives occupying 330 is performed to obtain a differentiable constructible solid geometry occupying 340. Figure 3 The geometric shapes in the diagram are used to illustrate the combination relationship between positive and negative primitives, without limiting the specific number, type, or size of the primitives. A positive cuboid can be used to represent the base of the target object, and a positive cylinder can be used to represent the boss located on the base; a negative cylinder can be used to subtract material from the corresponding positive primitive region to form a through hole, and an elongated negative cuboid can be used to form a groove. Thus, by combining the difference between the soft union occupancy of positive and negative primitives, a target object that simultaneously includes both additive and subtractive features can be represented using fewer parameterized primitives.
[0066] S104, establish a corresponding local surface template for each typed differentiable primitive, and attach multiple Gaussian units to the local surface template to form a structured Gaussian attachment associated with the primitive pose and scale.
[0067] Specifically, for different types of typed differentiable primitives, a local surface template is established in the local coordinate system of the corresponding primitive, and multiple Gaussian elements are set on the local surface template. The local surface template is used to characterize the surface position of the corresponding typed differentiable primitive in its local coordinate system, providing the Gaussian elements with local attachment positions relative to the corresponding primitive. Thus, the Gaussian elements are not set as free space units independent of the geometric primitives, but rather use the corresponding typed differentiable primitive as their local geometric reference.
[0068] For attachment to the first i The first type of differentiable basic element k A Gaussian element can be described in its spatial distribution within the local coordinate system of the corresponding primitive using local mean, local rotation, and local scale. The local parameters of the Gaussian element are then converted into world coordinate parameters based on the center, rotation, and scale of the typed differentiable primitive. Specifically, the world coordinate mean of the Gaussian element is determined based on its local mean and the center, rotation, and scale of the corresponding typed differentiable primitive; the local covariance is determined based on the local rotation and local scale of the Gaussian element, and the world coordinate covariance is determined by combining the rotation and scale of the corresponding typed differentiable primitive.
[0069] Order No. i The local-to-world coordinate linear transformation matrix corresponding to each typed differentiable primitive is:
[0070] in, Indicates the first i Local-to-world coordinate linear transformation matrix corresponding to a typed differentiable primitive; Indicates by the first i Rotation quaternions of typed differentiable primitives The resulting rotation matrix; Represented by scale vector The components form a diagonal matrix with each component as a diagonal element.
[0071] Let the first i The first type of differentiable basic element k The mean value of each Gaussian element in the local coordinate system of the primitive is The mean world coordinates of the Gaussian unit are:
[0072] Where k represents the attachment to the first i Gaussian unit index of typed differentiable primitives; Indicates the first k Local mean of Gaussian cells; This represents the corresponding world coordinate mean; Indicates the first i The center of a typed differentiable primitive.
[0073] Furthermore, for the first i The first type of differentiable primitive attached to the first k A Gaussian element, whose local covariance is determined based on the local rotation and local scale of the Gaussian element:
[0074] in, Indicates the first i On a typed differentiable primitive, the first k The local covariance matrix of a Gaussian element in the local coordinate system of the primitive; This represents the local rotation matrix of the Gaussian element; The local scale matrix of the Gaussian unit is represented by ; the superscript T indicates matrix transpose.
[0075] Accordingly, using the first i A local-to-world coordinate linear transformation matrix of a typed differentiable primitive is used to convert the local covariance into the world coordinate covariance:
[0076] in, Indicates the first i The first type of differentiable basic element k World coordinate covariance of Gaussian units.
[0077] Since the world coordinate mean and world coordinate covariance of the Gaussian element are jointly determined by its local parameters and the geometric parameters of the corresponding typed differentiable primitive, when the center, rotation, or scale of the corresponding typed differentiable primitive is updated, the world coordinate mean and world coordinate covariance of the corresponding Gaussian element can be re-determined based on the updated primitive parameters. This allows the Gaussian element to adjust synchronously with the translation, rotation, or scale changes of the corresponding typed differentiable primitive. Therefore, the correlation between the spatial distribution of the Gaussian element and the corresponding parametric geometry can be maintained, reducing the possibility of spatial separation between the Gaussian element and the corresponding geometric surface after changes in primitive geometric parameters. This also provides a basis for synchronously adjusting the appearance representation during subsequent geometric editing based on CAD features.
[0078] Furthermore, each Gaussian unit may also include opacity and a color coefficient, wherein the color coefficient is used to characterize the appearance information of the corresponding Gaussian unit. In one embodiment, the gating value of the typed differentiable primitive can also be used to adjust the degree to which the Gaussian units attached to that primitive participate in rendering, so that when the corresponding primitive is suppressed, the contribution of its attached Gaussian units to the rendering result is correspondingly reduced. The color coefficient may be a spherical harmonic coefficient, or other parameters used to represent view-dependent colors.
[0079] Let the first i The first type of differentiable basic element k The opacity of each Gaussian unit is The effective opacity of the Gaussian unit participating in rendering can then be expressed as:
[0080] in, Indicates the first k Effective opacity of Gaussian units; This represents the gate value of the corresponding typed differentiable primitive. Thus, when the gate value of the corresponding typed differentiable primitive decreases, the contribution of its attached Gaussian unit to the rendering result decreases accordingly; when the corresponding typed differentiable primitive is determined to be an inactive primitive, the corresponding Gaussian unit can also be suppressed.
[0081] like Figure 4 As shown, 400 represents the local coordinate system of the corresponding typed differentiable primitive, 410 represents the local surface template of the primitive, 420 represents the local Gaussian unit attached to the local surface template 410, 430 represents the process of transforming from local coordinate parameters to world coordinate parameters, 440 represents the world coordinate Gaussian unit obtained after the transformation, and 450 represents the effective opacity of the Gaussian unit participating in rendering; the gate value 203 is used to adjust the effective opacity 450. Figure 4 In x shaft and z The axes are used to indicate the local coordinate direction of the primitives, and the elliptical shape is used to indicate the spatial distribution of the Gaussian elements in the local or world coordinate system. Specifically, the local mean and local covariance of the local Gaussian element 420 are transformed from local to world coordinates 430 to obtain world coordinate parameters; the gate value 203 does not participate in the coordinate transformation, but rather, together with the opacity of the Gaussian element itself, determines the effective opacity 450.
[0082] In one implementation, for an inserted typed differentiable primitive, a corresponding Gaussian unit can be created on its local surface template; for a deleted or deactivated typed differentiable primitive, the attached Gaussian unit can be removed or suppressed simultaneously.
[0083] S105, the Gaussian unit is rendered based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; a rendering loss is determined based on the difference between the rendered image and the corresponding multi-view image, and a structure regularization loss is determined based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitive to constrain the typed differentiable primitive; based on the rendering loss and the structure regularization loss, the parameters of the typed differentiable primitive and the parameters of the Gaussian unit are jointly optimized; wherein, the structure regularization loss includes a Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives.
[0084] The structural regularization loss is used to constrain the geometry, subtraction behavior, and activity state of typed differentiable primitives, and may include covering regularization loss, overlapping regularization loss, Boolean difference set protection regularization loss, sparse regularization loss, and gated regularization loss.
[0085] Specifically, during the joint optimization process, based on the Gaussian units obtained in step S104 and the camera parameters acquired in step S101, differentiable rendering can be performed on the Gaussian units to obtain rendered images corresponding to each multi-view image. The rendering loss is then determined based on the difference between the rendered image and the corresponding multi-view image to constrain the local and appearance parameters of the Gaussian units. Simultaneously, the geometric occupancy of the differentiable constructed entity obtained in step S103 is used to constrain the geometric structure formed by the typed differentiable primitives, and the parameters of the typed differentiable primitives are optimized. Thus, the multi-view images provide appearance rendering supervision for structured Gaussian attachment, and the differentiable constructed entity geometry occupancy provides geometric constraints for the typed differentiable primitives, enabling the appearance representation and primitive geometry to be adjusted in the same optimization process.
[0086] Each loss constrains the joint optimization process from different aspects. The Boolean difference set protection regularization loss is used to constrain the subtraction behavior of negative primitives in the difference set combination, so that negative primitives actually form subtraction when participating in the subtractive feature expression, and limit them from over-subtracting the main geometry that needs to be retained.
[0087] The effective subtraction constraint term is determined based on the occupancy overlap between negative and positive primitives, and is used to constrain the parameter update of the negative primitives during the joint optimization process, so as to cause the negative primitives to form a subtraction overlap with the region constructed by the positive primitives.
[0088] For negative primitives located outside the construction region of positive primitives or lacking sufficient overlap with positive primitives, it is difficult for them to produce actual geometric subtraction when participating in the difference set combination of positive and negative primitives. Therefore, the corresponding negative primitives can be constrained according to the overlap between positive and negative primitives to ensure that the negative primitives that need to express subtractive features form an effective overlap with the construction region of the corresponding positive primitives. This can reduce the situation where negative primitives are active but do not produce an actual subtraction effect on the target object.
[0089] When the intrusion of a negative primitive into the region constructed by a positive primitive is too large, although subtraction can be achieved, the main body region that needs to be retained in the target object may also be subtracted. Therefore, based on the retention status of the core region of the main structure after the negative primitive participates in the difference set combination, negative primitives that exceed the reasonable subtraction range can be penalized, so that the negative primitives can reduce the damage to the geometric region of the main body while forming the subtractive feature.
[0090] The negative primitive core sampling region constraint term is used to constrain the core sampling region of the negative primitive; in the implementation of obtaining multi-view foreground information, the negative primitive center constraint term and the negative primitive core sampling region constraint term can also be determined in combination with foreground mask consistency.
[0091] Through the above constraints, the Boolean difference set protected regular loss constrains negative primitives from two aspects: whether the negative primitives form effective subtraction and whether the subtraction range excessively intrudes into the main structure. This ensures that negative primitives form actual subtraction during joint optimization while reducing unreasonable damage to the main structure, thus providing a constrained basis for the expression of subtractive features such as holes, slots, and recesses.
[0092] Furthermore, the rendering loss may include pixel difference loss and structural similarity loss to constrain the rendering results from the aspects of pixel values and local image structure, respectively. Through this rendering loss, the appearance representation formed by Gaussian units attached to typed differentiable primitives can be gradually matched with multi-view observations of the target object.
[0093] Given a rendered image obtained by Gaussian units and the corresponding multi-view input image The rendering loss can be expressed as:
[0094]
[0095] in, Indicates rendering loss; This represents the rendered image generated based on Gaussian units; This represents the input image corresponding to the rendered image; Represents the L1 norm; SSIM Structural Similarity (SSIM) calculation is represented. This represents the structural difference loss determined based on structural similarity. This represents the weighting parameter between L1 loss and structural difference loss.
[0096] In one implementation, a foreground mask corresponding to the multi-view image can also be obtained, and a coverage regularization loss can be set based on the foreground mask. Specifically, for a camera ray corresponding to an image pixel, multiple spatial points can be sampled along the camera ray, and the ray-level occupancy of the corresponding ray can be determined according to the differentiable constructed entity geometry occupancy obtained in step S103; the coverage regularization loss is determined based on the consistency between the ray-level occupancy and the foreground label corresponding to the foreground mask. Thus, the three-dimensional constructed entity geometry occupancy can be constrained by two-dimensional foreground observation, so that the reconstructed geometry maintains a correspondence with the foreground region of the target object in different views.
[0097] To match the 3D geometric occupancy with the foreground region of the multi-view view, for the camera ray corresponding to the image pixel... γ Sampling along the camera ray K One spatial point:
[0098] Based on the aforementioned differentiable entity geometry occupancy, the ray-level occupancy of the camera ray is determined by max pooling:
[0099] in, γ Indicates the camera ray index; K This indicates the number of spatial points sampled along the camera ray; Indicates the spatial point index on the ray; Indicates camera ray γ The first A spatial point; This indicates that the geometry of a differentiable construct occupies points in space. The value at; Indicates camera ray γ The corresponding ray level occupies.
[0100] Coverage regularization loss, comprising foreground coverage, background suppression, and ray binary cross-entropy, can be expressed as:
[0101] The foreground coverage term can be represented as:
[0102] The background suppression term can be expressed as:
[0103] The ray binary cross-entropy term can be expressed as:
[0104] in, Indicates the coverage regularization loss; Indicates foreground coverage items; Indicates the background suppression term; Represents the binary cross-entropy term of a ray; , and These represent the weights of the corresponding loss terms. Represents the set of foreground rays. Let Ω represent the set of background rays, and let |·| represent the set of rays participating in the coverage constraint; |·| represents the number of elements in the corresponding set. This indicates the occupancy threshold of the foreground ray. Indicates the occupancy threshold of the background rays; This indicates taking the non-negative part; Indicates camera ray r Corresponding foreground tags; This indicates that the ray level will occupy Cut off to interval [ ε ,1 ε The value after [] is used to avoid numerical anomalies during logarithmic calculations. For example, we can take .
[0105] The overlap regularization loss is used to limit excessive repetitive coverage of the same main body region by multiple positive primitives. In one implementation, sampling points can be set in the region where positive and negative primitives interact, and the degree of overlap is determined based on the cumulative occupancy of multiple positive primitives at corresponding spatial points; when the cumulative occupancy exceeds the allowable overlap range, the excess portion is constrained. By allowing a certain degree of local overlap between adjacent positive primitives, the continuity between regions constructed by multiple positive primitives can be maintained; at the same time, by limiting large-scale repetitive coverage, redundant representation of the same main body structure by multiple positive primitives can be reduced.
[0106] Set up a sampling point set within the region where positive and negative primitives interact. And determine the cumulative positive occupation based on the differentiable occupation and gate value of each positive primitive:
[0107] Furthermore, the overlap regularization loss can be expressed as:
[0108] in, Representing a spatial point x The cumulative positive occupancy of multiple positive primitives; This represents the set of sampling points used to calculate the degree of overlap of positive primitives; Indicates the allowed overlap threshold; This represents the overlap regularization loss.
[0109] The sparse regularization loss is used to constrain the overall activity level of the categorized differentiable primitives, thereby reducing unnecessary active primitives during the joint optimization process. The gating regularization loss is used to constrain the gating values of each categorized differentiable primitive, making the gating values approach the values used to characterize active or inactive states. Thus, in the stage of maintaining continuous differentiability in the joint optimization process, the degree of participation of each primitive in the optimization can be adjusted using continuous gating values. In the subsequent compaction process, the primitives can be further discretely filtered according to the gating values, thereby providing a basis for obtaining a compact combination of positive and negative primitives.
[0110] The Boolean difference set protected regularization loss can be expressed as:
[0111] in, This represents the negative primitive center constraint term, used to constrain the center position of the negative primitive; This represents the core sampling region constraint term for negative primitives, used to constrain the core sampling region of negative primitives; This indicates a valid subtraction constraint term, used to induce a valid subtraction of negative primitives based on the overlapping occupancy of negative and positive primitives. This indicates an excessive subtraction penalty term, used to limit the scope of negative primitives' subtraction of the main structure based on the retention of the core area of the main structure. , , and These represent the weights corresponding to the four constraints mentioned above.
[0112] The sparse regularization loss can be expressed as:
[0113] The gated regularization loss can be expressed as:
[0114] in, Represents the set of indices for all typed differentiable primitives. Indicates sparse regularized loss; This indicates the gated regularization loss.
[0115] The above-mentioned losses can be combined to form a joint optimization objective function:
[0116] in, , , , and These represent the weights of the covering regularization loss, overlapping regularization loss, Boolean difference set protection regularization loss, sparse regularization loss, and gated regularization loss in the comprehensive objective function, respectively.
[0117] Based on the aforementioned comprehensive objective function, the center, rotation, scale, gating value, and optional type parameters of the typed differentiable primitives, as well as the local and appearance parameters of the Gaussian elements, can be jointly updated. In implementations where camera extrinsic parameters have errors, these parameters can also be updated as optional optimization variables. For multi-view... Figure 1 For camera views with poor consistency, the corresponding view can be filtered or its weight in joint optimization can be reduced based on foreground coverage error or rendering residual.
[0118] In the specific optimization process, a comprehensive objective function for joint optimization can be formed based on the rendering loss and the structure regularization loss. The gradient is calculated based on the comprehensive objective function, and the parameters of the typed differentiable primitives and the Gaussian units are updated. The corresponding loss calculation and parameter update are repeated based on the updated parameters.
[0119] S106, the jointly optimized typed differentiable primitives are screened, pruned and / or merged to obtain a compact combination of positive and negative primitives.
[0120] Specifically, after completing the joint optimization in step S105, the positive and negative primitives are compacted according to their different roles in the geometric representation of the target object. The filtering process determines the typified differentiable primitives to be retained based on their activity state or the subtraction result after joint optimization. Deleting inactive or invalid primitives based on the filtering result can be considered pruning. For primitives that meet preset geometric conditions and have repetitive expressive roles, the number of primitives can be reduced by merging. Therefore, compaction is not simply about reducing all primitives, but rather about reducing primitives that do not participate in effective geometric representation or have redundant expressions while preserving the target object's construction and subtraction relationships.
[0121] like Figure 5As shown, the jointly optimized set of typed differentiable primitives enters the positive primitive processing branch and the negative primitive processing branch, respectively. For positive primitives, inactive positive primitives are screened based on the gating value, and positive primitives of the same type and spatially adjacent are judged to see if they meet the geometric merging condition. If the geometric merging condition is met, merging is performed. For negative primitives, screening is performed based on the subtraction overlap between the jointly optimized negative primitives and positive primitives and / or the actual volume reduction generated by the negative primitives participating in the difference set combination. It is also judged whether multiple negative primitives are nested or continuously form a composite subtractive feature. When multiple negative primitives form the composite subtractive feature, they are not merged but are retained separately. After the above positive primitive processing branch and negative primitive processing branch, a compact combination of positive and negative primitives is obtained.
[0122] For positive primitives, the activity state of the corresponding positive primitives is determined based on the gating values of each type of differentiateable primitive, and positive primitives whose gating values indicate an inactive state are filtered out. In one embodiment, when the gating value of a positive primitive is lower than a preset gating threshold, the positive primitive is identified as an inactive positive primitive and filtered out. Since the gating value is used to adjust the degree to which the corresponding primitive participates in geometric combination during the joint optimization process in step S105, positive primitives with lower gating values contribute relatively little to the final construction result and can be filtered out during the compaction stage, thereby reducing the number of positive primitives that do not participate in the construction of the effective main structure.
[0123] The aforementioned effective subtraction constraint term, as part of the joint optimization synthesis objective function, constrains the parameter updates of negative primitives based on the overlap between negative and positive primitives, thereby prompting negative primitives to form corresponding subtraction overlaps during the joint optimization process. After the joint optimization in step S105 is completed, the negative primitive parameters are no longer updated through the effective subtraction constraint term. Instead, for the optimized negative primitives, the subtraction overlap between them and positive primitives and / or the actual volume reduction generated by their participation in difference set combinations are calculated. Negative primitives are then screened based on the comparison between the subtraction overlap and / or the actual volume reduction and a preset subtraction threshold. When the corresponding subtraction result is lower than the preset subtraction threshold, the corresponding negative primitive is identified as an invalid negative primitive and removed. Thus, the effective subtraction constraint term is used for updating negative primitive parameters during the joint optimization phase, while the screening in this step is used to determine whether to retain the corresponding negative primitive based on the actual subtraction result after the joint optimization is completed.
[0124] Furthermore, for positive primitives of the same type and spatially adjacent, it can be determined whether they meet preset geometric merging conditions based on their spatial position, orientation, and scale. If the geometric merging conditions are met, the corresponding positive primitives are merged. In one specific embodiment, the geometric merging conditions may include that the included angle of the principal axes of the corresponding positive primitives meets a preset alignment condition, and that the volume change resulting from replacing multiple positive primitives with a single positive primitive of the same type is less than a preset volume change threshold. By merging adjacent positive primitives of the same type when the geometric consistency condition is met, redundant representation of the same continuous main structure by multiple positive primitives can be reduced, while also reducing the possibility of altering the original geometric shape of the main structure due to arbitrary merging.
[0125] For multiple negative primitives that nest or continuously form composite subtractive features, these multiple negative primitives are not merged. Although different negative primitives may be spatially adjacent, overlapping, or of the same type, their respective subtraction ranges can collectively define different apertures, depths, or subtraction levels in the composite subtractive structure. If the multiple negative primitives are merged solely based on spatial proximity or similarity, the original subtraction range of each negative primitive may be altered, and the structural hierarchy formed by multiple subtraction actions may be lost. Therefore, multiple negative primitives that jointly form composite subtractive features are retained individually, so that the subsequent compact positive and negative primitive combinations can still maintain the geometric hierarchy and construction-subtraction relationship of the composite subtractive feature.
[0126] For example, in a countersunk hole structure formed by two coaxial negative cylindrical units, the larger negative cylindrical unit can be used to form the larger diameter subtraction region at the top of the countersunk hole, while the smaller negative cylindrical unit can be used to form the smaller diameter hole region that is continuous with it. If the two negative cylindrical units are directly merged into a single negative unit, it may not be possible to express different hole diameters and subtraction depths separately. Therefore, retaining the two negative units separately during the compaction process can maintain the layered subtraction structure of this composite subtractive material feature.
[0127] Therefore, the construction hierarchy required for composite subtractive features can be retained while reducing invalid or redundant primitives, providing a compact combination of positive and negative primitives for subsequent CAD feature determination.
[0128] In one alternative implementation, the process of fitting the initialized typed differentiable primitives to obtain a compact combination of positive and negative primitives can be carried out in stages, including a geometric initial fitting stage, a joint optimization stage of typed differentiable primitives and Gaussian units, and a compaction stage.
[0129] The first stage is the initial geometric fitting stage. In this stage, the initialized typed differentiable primitives are fitted using multi-view foreground information, and the geometric parameters of the typed differentiable primitives are adjusted so that the typed differentiable primitives form an initial geometric representation corresponding to the foreground region of the target object, providing a geometric basis for the subsequent joint optimization of typed differentiable primitives and Gaussian units.
[0130] The second stage is the joint optimization stage of typed differentiable primitives and Gaussian units. In this stage, based on the multi-view image and the corresponding structural constraints, the parameters of the typed differentiable primitives and the parameters of the Gaussian units are jointly adjusted so that the geometric representation formed by the typed differentiable primitives and the appearance representation formed by the Gaussian units are respectively constrained by the corresponding observation information. The specific joint optimization method of the second stage can be found in step S105.
[0131] The third stage is the compaction stage. In this stage, based on the aforementioned geometric and appearance fitting results, the typed differentiable primitives are further constrained through sparse regularization loss, gated regularization loss, and overlap regularization loss. Combined with the gate values of the typed differentiable primitives, the subtraction results of negative primitives, and the geometric relationships between positive primitives, the typed differentiable primitives are screened, pruned, and / or merged to reduce invalid or redundant primitives, resulting in a compact combination of positive and negative primitives. The screening, pruning, and merging methods in the third stage can be found in step S106.
[0132] The above three stages are one optional processing method. In other embodiments, other processing methods that can achieve typed differentiable primitive fitting, typed differentiable primitive and Gaussian unit parameter adjustment, and primitive compaction can also be used, and this application does not limit them.
[0133] S107 outputs editable CAD representations based on a compact combination of positive and negative primitives.
[0134] Specifically, after obtaining the compact combination of positive and negative primitives in step S106, a primitive relationship graph can be established based on the spatial position, orientation, scale, boundary overlap, and difference interaction relationship between the positive and negative primitives of each type of differentiable primitive. The nodes in the primitive relationship graph correspond to the typed differentiable primitives retained after compaction and represent the primitive type and Boolean symbol of the corresponding primitive; the edges in the primitive relationship graph are used to represent the geometric relationships and construction-subtraction relationships between different primitives.
[0135] In this system, the primitive type represents the geometric shape of the corresponding typed differentiable primitive, and the Boolean symbol represents the constructive or subtractive role played by the corresponding primitive in the construction of the target object. The geometric relationship represents the spatial organization relationship between different primitives, and the construct-subtractive relationship represents the subtractive effect of a negative primitive relative to a positive primitive. Therefore, the primitive relationship diagram not only preserves the geometric attributes of each primitive itself but also the association between different primitives when forming the structure of the target object, providing an information foundation for further determining CAD features from the primitive-level geometric representation.
[0136] In one embodiment, the geometric relationship may include at least one of parallel, perpendicular, coplanar, coaxial, concentric, symmetrical, adjacent, and located on a surface; the construction-subtraction relationship may include at least one of effective subtraction, through cut, and blind cut. The corresponding relationship can be determined based on the axial direction of the primitive, the reference plane, the center position, the scale, the boundary overlap, and the difference set combination result; the position distance threshold or direction angle threshold used for relationship judgment can be normalized according to the scale of the target object. For positive and negative primitives, the through cut relationship or blind cut relationship between the negative primitive and the positive primitive can also be determined based on whether the negative primitive penetrates the main body region constructed by the positive primitive along the corresponding direction.
[0137] Furthermore, CAD features are determined based on the primitive type, Boolean symbol, and edge representation of the nodes in the primitive relationship diagram. Since a single primitive geometry is insufficient to uniquely represent its engineering structural meaning within the target object, feature judgment can be made for corresponding primitive combinations by combining the primitive's own geometric type, its construction or subtraction attributes, and its spatial and subtraction relationships with other primitives. For example, when a negative cylindrical primitive forms a through-cut relationship with the main body region constructed by a positive primitive, the corresponding primitive combination can be identified as having a through-hole feature; when a negative cylindrical primitive forms a blind cut relationship, the corresponding primitive combination can be identified as having a blind hole feature. In other embodiments, a positive hexagonal prism primitive with a negative Boolean symbol forming a subtraction relationship with the main body can be identified as having a hexagonal countersunk hole feature; a slender negative cuboid forming a subtraction relationship with the main body can be identified as having a groove feature; a positive primitive adjacent to the main body can be identified as having a boss feature; multiple positive cylinders with different radii and coaxiality can be identified as having a stepped shaft feature; and a slender positive primitive adjacent to the main body or located on the surface of the main body can be identified as having a reinforcing rib feature.
[0138] like Figure 6 As shown, Figure 6This is a primitive relation diagram, where each node corresponds to a compacted, typed, differentiable primitive. Each node represents a compacted, typed, differentiable primitive, and the terms "positive primitive" or "negative primitive" in the node indicate the Boolean attribute of the corresponding primitive. Lines connecting nodes represent relationships between primitives, and text near the lines is used to label relationships such as adjacency, coaxiality, surface location, effective subtraction, through cut, or blind cut.
[0139] like Figure 7 As shown, Figure 7 This diagram illustrates the definition of CAD features. The left column represents the combinations of primitives involved in feature definition and their relationships, while the right column represents the CAD features defined based on the corresponding primitive types, Boolean symbols, and relationships. This diagram is intended to illustrate only one CAD feature mapping method and does not limit the unique primitive combinations for various types of CAD features.
[0140] Through the above processing, the primitive relationship diagram combines the geometric properties of the typed differentiable primitives with the structural relationships between the primitives. This allows the compacted combination of positive and negative primitives to no longer merely represent independent geometric entities, but to correspond to CAD features with defined structural meanings. Therefore, an editable CAD representation can be formed based on the defined CAD features.
[0141] In one implementation, the editable CAD representation may include compacted typed differentiable primitive parameters, construction-subtraction relationships between primitives, a primitive relationship graph, defined CAD features, and structured Gaussian parameters corresponding to each typed differentiable primitive. Furthermore, corresponding construction entity geometric expressions can be generated based on combinations of positive and negative primitives, and further organized into a hierarchical construction entity geometric tree based on spatial inclusion relationships and local feature relationships between primitives. The editable CAD representation can be stored as an intermediate data structure and converted into a parametric representation that can be read by the CAD system through a corresponding conversion module.
[0142] Furthermore, the editable CAD representation can also be used to perform CAD feature-level editing. Specifically, upon receiving an editing instruction for the CAD feature, one or more typed differentiable primitives corresponding to the CAD feature are determined based on the primitive relationship diagram, and the editing instruction is converted into parameter updates for the corresponding typed differentiable primitives. Since the CAD feature has already established a correspondence with the corresponding typed differentiable primitives through the primitive relationship diagram, editing operations for CAD features can be implemented at the primitive parameters related to the feature, without directly modifying dense mesh vertices or a large number of freely distributed Gaussian cells.
[0143] For example, editing the aperture can update the radial dimension of a negative cylinder, editing the slot length can update the axial dimension of the corresponding negative primitive, and editing the boss height can update the axial dimension of the corresponding positive primitive. The above editing methods are used to illustrate a correspondence between CAD features and typed differentiable primitive parameters, and do not limit each CAD feature to using a unique parameter update method.
[0144] When the parameter update includes updating the center, rotation, or scale of the typed differentiable primitive, the world coordinate parameters of the Gaussian unit attached to the corresponding typed differentiable primitive are synchronously determined using the updated primitive center, rotation, or scale, based on the structured Gaussian attachment relationship established in step S104. Since the world coordinate parameters of the Gaussian unit are jointly determined by its local parameters and the geometric parameters of the corresponding primitive, after the geometric primitive completes the position, orientation, or size editing, the Gaussian unit to which it is attached can undergo the corresponding spatial transformation, thereby maintaining the spatial correspondence between the edited appearance representation and the updated primitive geometry.
[0145] When the primitive relationship diagram represents the coaxial, symmetrical or other geometric relationships between multiple CAD features, the parameters of the associated primitives can also be updated according to the corresponding relationship constraints during the parameter update process, so as to maintain the geometric relationships that existed before editing.
[0146] After updating the parameters of the typed differentiable primitives, local optimization can be performed on the Gaussian units corresponding to the CAD features to restore the appearance of the edited area. Specifically, while keeping the updated primitive geometric parameters unchanged, the appearance-related parameters of the corresponding Gaussian units can be locally adjusted so that the rendered appearance of the edited area matches the changed geometry. Thus, without having to perform a complete reconstruction of the entire target object, the appearance representation can be further adjusted for the local areas affected by the editing.
[0147] Therefore, CAD feature-level editing can be converted into parameter updates of corresponding primitives, and the correspondence between the edited geometry and appearance representation can be maintained through structured Gaussian attachment and local optimization.
[0148] Example 2 Embodiment 2 of this application provides a CAD reconstruction device based on subtractive material building blocks and Gaussian attachment. For example... Figure 8 As shown, the device includes an image acquisition module 810, a typed primitive construction module 820, a solid geometry combination construction module 830, a structured Gaussian attachment module 840, a joint optimization module 850, a compaction module 860, and an output module 870.
[0149] Image acquisition module 810 is used to acquire multi-view images of the target object and camera parameters corresponding to the multi-view images; typed primitive construction module 820 is used to initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object, the set of typed differentiable primitives includes positive primitives and negative primitives, and there is no preset one-to-one correspondence between the negative primitives and the positive primitives; solid geometry combination construction module 830 is used to construct solid geometry combination according to the differentiable occupancy function of each typed differentiable primitive to obtain the differentiable constructed solid geometry occupancy of the target object; structured Gaussian attachment module 840 is used to establish corresponding primitive local surface templates for each typed differentiable primitive, and attach multiple Gaussian units on the primitive local surface templates to form structured Gaussian attachment associated with the primitive pose and scale.
[0150] The joint optimization module 850 is used to render the Gaussian unit based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; determine the rendering loss based on the difference between the rendered image and the corresponding multi-view image, and determine the structure regularization loss for constraining the typed differentiable primitive based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitive; jointly optimize the parameters of the typed differentiable primitive and the parameters of the Gaussian unit based on the rendering loss and the structure regularization loss; wherein, the structure regularization loss includes Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives; the compaction module 860 is used to filter, prune and / or merge the jointly optimized typed differentiable primitives to obtain a compact combination of positive and negative primitives; the output module 870 is used to output an editable CAD representation based on the compact combination of positive and negative primitives.
[0151] The specific processing methods for each module can be found in the relevant descriptions of steps S101 to S107 in Embodiment 1, and will not be repeated here. The above modules can be implemented by software, hardware, or a combination thereof.
[0152] Example 3 To verify the reconstruction effect of the CAD reconstruction method based on subtractive primitives and Gaussian attachment provided in the above embodiments, in an exemplary embodiment, a multi-view reconstruction experiment can be performed on a CAD model composed of basic geometric primitives and common mechanical features. The experiment is used to illustrate the effectiveness of the method in geometric reconstruction, appearance reconstruction, primitive compaction, and subtractive feature recovery. The following experimental settings and results are only a specific example and are not intended to limit the scope of protection of this application.
[0153] In this embodiment, for each CAD model to be reconstructed, 48 RGB (Red Green Blue, RGB) images are rendered, and each image has a resolution of 256×256 pixels.
[0154] Of the 48 images, 42 are views obtained by uniformly sampling the spherical surface around the target object, and the other 6 are views from typical orthogonal directions, thus acquiring the appearance and contour information of the target object from multiple different viewing directions. Camera parameters are also obtained for each view, and the foreground mask used for coverage constraints can be obtained as described above.
[0155] In one specific configuration, the boundary sharpness of the typed differentiable primitive can be fixed at 80. This boundary sharpness is used in the aforementioned Sigmoid soft occupancy calculation to adjust the degree of change in the transition from a signed boundary function to soft occupancy near the primitive boundary.
[0156] The 48 images, 256×256 pixel resolution, 42 spherical uniform sampling views, 6 typical orthogonal orientation views, and the fixed boundary sharpness of 80 mentioned above are all exemplary experimental configurations and do not constitute a limitation on the actual number of input views, image resolution, or boundary sharpness.
[0157] The reconstruction results can be evaluated from aspects such as geometric reconstruction quality, appearance reconstruction quality, element compactness, and recovery of subtractive features.
[0158] The geometric reconstruction quality can be evaluated using Chamfer Distance (CD) and Hausdorff Distance. In this embodiment, the 95th-percentile Hausdorff Distance (HD95) is used as the relevant evaluation index for Hausdorff Distance. The appearance reconstruction quality can be evaluated using Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index Measure (SSIM), and Learned Perceptual Image Patch Similarity (LPIPS).
[0159] Precision, recall, and F1 score can also be used to evaluate the reconstruction results. The F1 score is used to comprehensively reflect precision and recall. The average number of positive primitives, the average number of negative primitives, and the average total number of primitives are used to evaluate the primitive compactness of the reconstruction results. For target objects containing pore structures, the pore structure recovery rate can be used to further evaluate the recovery of subtractive features.
[0160] Generally speaking, smaller CD and HD95 indicate less difference between the reconstructed geometry and the reference geometry; higher PSNR and SSIM indicate higher consistency between the rendered result and the corresponding input or reference image; and the average number of primitives is used to reflect the primitive scale required to complete the representation of the target object.
[0161] To verify the effectiveness of the proposed method, this application uses a comprehensive evaluation based on metrics such as Chamfer distance (CD), Hausdorff distance, PSNR, SSIM, LPIPS, precision, recall, F1 score, and pore structure recovery rate. Experiments were conducted on a computing platform equipped with an NVIDIA RTX 4090 graphics processing unit (GPU) and an Intel Xeon Gold 6133 central processing unit (CPU, clock speed of 2.50 GHz). The runtime metric is the average processing time of 65 test models.
[0162] Precision, recall, and F1 scores were used to evaluate the structural consistency between the reconstructed CAD model and the Ground Truth (GT) model. These metrics were calculated using publicly available formulas, and the results were the average of 65 test models. Hole structure recovery rate was used to evaluate the recovery of through-hole structures. A model was considered successfully recovered when the number of through-holes in the reconstructed model matched the number in the GT model. The proportion of successfully recovered models among the 65 test models was statistically analyzed. Blind holes were not considered in the experiment. Hole position, axial direction, and diameter errors were comprehensively evaluated using CD, HD95, precision, recall, and F1 scores. The following experimental results were obtained.
[0163]
[0164] The above results show that, under this example configuration, typed positive and negative primitives and structured Gaussian attachment can simultaneously form parametric geometric representations and corresponding appearance representations. At the same time, after gating, invalid negative primitive removal, and positive primitive condition merging, a relatively small number of positive and negative primitives can be used to represent the main structure of the target object and subtractive structures such as holes and slots.
[0165] The ablation results show that removing negative primitives, merging and filtering mechanisms, multi-type primitives, or overlapping losses increase geometric errors or the number of primitives, indicating that the above components have corresponding effects on the representation of subtractive features and compact geometric reconstruction.
[0166] In one embodiment, the method can also be applied to real-scene multi-view images acquired by smartphones or other image acquisition devices. For real-scene input, camera calibration and foreground segmentation can be performed on the multi-view images first to obtain the corresponding camera parameters and foreground regions. Then, an editable CAD representation can be obtained according to the typified differentiable primitive initialization, entity geometry construction, structured Gaussian attachment, joint optimization, compaction, and CAD feature determination processes described in the foregoing embodiments.
[0167] If there are certain errors in the camera calibration results, the impact of erroneous camera parameters on primitive reconstruction can be reduced by using the aforementioned camera view filtering, reducing the weight of abnormal views, or jointly updating camera extrinsic parameters.
[0168] When the target object contains subtractive features that are small in size or have poor viewing conditions, the recovery effect of the corresponding features may be affected by the visibility of multiple views.
[0169] For example, when a via occupies only a small area in the input image, or when the via is occluded in most input views, the corresponding negative primitive may be suppressed by the gating mechanism due to insufficient multi-view supervision, or the negative primitive may be inaccurately positioned, resulting in missing or incomplete restoration of the corresponding hole structure.
[0170] The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit the scope of protection of this application. It should be understood that those skilled in the art can make appropriate adjustments or combinations to the above embodiments without departing from the technical concept of this application. For example, different numbers and types of typified differentiable primitives can be selected according to the geometric structure of the target object to be reconstructed; the camera ray sampling method can be adjusted according to the number, resolution, and observation range of the input multi-view images; and the primitive relationship determination conditions and corresponding thresholds in the compaction process can be adjusted according to the geometric scale of the target object.
[0171] The technical features in the different embodiments described above can be combined with each other where there is no conflict. Any equivalent substitutions, simple modifications, or other adjustments made by those skilled in the art based on the disclosure of this application that do not depart from the technical concept of this application should fall within the scope of protection claimed in this application.
Claims
1. A CAD reconstruction method based on subtractive material building blocks and Gaussian attachment, characterized in that, include: Obtain multi-view images of the target object and the corresponding camera parameters; Initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object. The set of typed differentiable primitives includes positive primitives and negative primitives, and there is no pre-defined one-to-one correspondence between the negative primitives and the positive primitives. Based on the differentiable occupancy function of each typed differentiable basic unit, construct the entity geometry combination to obtain the differentiable constructed entity geometry occupancy of the target object; For each type of differentiable primitive, a corresponding primitive local surface template is established, and multiple Gaussian units are attached to the primitive local surface template to form a structured Gaussian attachment that is related to the primitive pose and scale. The Gaussian unit is rendered based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; The rendering loss is determined based on the difference between the rendered image and the corresponding multi-view image, and the structure regularization loss for constraining the typed differentiable primitives is determined based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitives. Based on the rendering loss and the structure regularization loss, the parameters of the typed differentiable primitives and the parameters of the Gaussian unit are jointly optimized. The structure regularization loss includes Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives. The jointly optimized typed differentiable primitives are screened, pruned, and / or merged to obtain a compact combination of positive and negative primitives; Editable CAD representations are output based on a compact combination of positive and negative primitives.
2. The CAD reconstruction method based on subtractive material elements and Gaussian attachment according to claim 1, characterized in that, The parameters of the typed differentiable primitive include primitive type, Boolean symbol, gating value, center, rotation, scale, and boundary sharpness; the primitive type includes at least one of cuboid, cylinder, sphere, right triangular prism, and regular hexagonal prism.
3. The CAD reconstruction method based on subtractive material elements and Gaussian attachment according to claim 2, characterized in that, The determination of the differentiable occupancy function includes: For a spatial point, transform the spatial point to the local coordinate system of the corresponding typed differentiable primitive; The corresponding signed boundary function is determined based on the primitive type, and the soft occupancy value of the differentiable occupancy function at the spatial point is determined by the Sigmoid function based on the signed boundary function and the boundary sharpness.
4. The CAD reconstruction method based on subtractive material units and Gaussian attachment according to claim 1, characterized in that, The formation of the structured Gaussian adhesion includes: Based on the local mean, local rotation, and local scale of the Gaussian unit attached to the local surface template of the primitive, as well as the center, rotation, and scale of the corresponding typed differentiable primitive, the world coordinate mean and world coordinate covariance of the Gaussian unit are determined, and the world coordinate mean and world coordinate covariance are updated synchronously when the center, rotation, or scale of the corresponding typed differentiable primitive is updated.
5. The CAD reconstruction method based on subtractive material elements and Gaussian attachment according to claim 1, characterized in that, The Boolean difference set protected regularization loss includes a negative primitive center constraint term, a negative primitive core sampling region constraint term, an effective subtraction constraint term, and an over-subtraction penalty term. The effective subtraction constraint term is determined based on the occupancy overlap between negative and positive primitives and is used to constrain the parameter update of the negative primitives during the joint optimization process to promote the formation of subtraction overlap between the negative primitives and the regions constructed by the positive primitives. The over-subtraction penalty term is determined based on the retention of the core region of the main structure constructed by the positive primitives.
6. The CAD reconstruction method based on subtractive material building blocks and Gaussian attachment according to claim 1, characterized in that, The structure regularization loss also includes covering regularization loss, overlapping regularization loss, sparse regularization loss, and gated regularization loss.
7. The CAD reconstruction method based on subtractive material elements and Gaussian attachment according to claim 1, characterized in that, The process of filtering, pruning, and / or merging the jointly optimized typed differentiable primitives includes: Non-active positive primitives are screened based on the gating values of each of the described typed differentiable primitives; After the joint optimization is completed, the amount of overlap between negative primitives and positive primitives and / or the actual volume reduction generated by the negative primitives participating in the difference set combination are calculated, and negative primitives with the amount of overlap reduction and / or the actual volume reduction are screened out. Positive primitives of the same type, spatially adjacent and satisfying geometric merging conditions are merged, while multiple negative primitives that are nested or continuously form composite subtractive features are not merged.
8. The CAD reconstruction method based on subtractive material elements and Gaussian attachment according to claim 1, characterized in that, The editable CAD representation output based on a compact combination of positive and negative primitives includes: A primitive relation graph is established based on the compact combination of positive and negative primitives, wherein the nodes of the primitive relation graph correspond to typed differentiable primitives and represent the primitive type and Boolean symbol of the corresponding primitives, and the edges of the primitive relation graph represent the geometric relationship and construction-subtraction relationship between primitives; The CAD features are determined based on the primitive type, the Boolean symbol, and the relationship between the edge representation, and the editable CAD representation is output based on the CAD features.
9. The CAD reconstruction method based on subtractive material units and Gaussian attachment according to claim 8, characterized in that, The editing of the editable CAD representation includes: Receive editing instructions for the CAD feature, and convert the editing instructions into parameter updates for the corresponding typed differentiable primitives according to the primitive relationship diagram; When the parameter update includes an update of the center, rotation, or scale, the world coordinate parameters of the Gaussian unit attached to the corresponding typed differentiable primitive are updated synchronously according to the updated center, rotation, or scale. After the parameter update is completed, the Gaussian cells corresponding to the CAD features are locally optimized to restore the appearance of the editing area.
10. A CAD reconstruction device based on subtractive material building blocks and Gaussian attachment, characterized in that, include: An image acquisition module is used to acquire a multi-view image of the target object and camera parameters corresponding to the multi-view image; A typed primitive construction module is used to initialize a set of typed differentiable primitives used to characterize the geometric structure of the target object. The set of typed differentiable primitives includes positive primitives and negative primitives, and there is no pre-defined one-to-one correspondence between the negative primitives and the positive primitives. A solid geometry combination module is used to construct solid geometry combinations according to the differentiable occupancy functions of each typed differentiable basic unit, so as to obtain the differentiable constructed solid geometry occupancy of the target object. The structured Gaussian attachment module is used to establish a corresponding local surface template for each type of differentiable primitive, and to attach multiple Gaussian units on the local surface template to form a structured Gaussian attachment that is associated with the primitive pose and scale. The joint optimization module is used to render the Gaussian unit based on the camera parameters to obtain a rendered image corresponding to each of the multi-view images; The rendering loss is determined based on the difference between the rendered image and the corresponding multi-view image, and the structure regularization loss for constraining the typed differentiable primitives is determined based on the geometric occupancy of the differentiable constructed entity and the parameters of the typed differentiable primitives. Based on the rendering loss and the structure regularization loss, the parameters of the typed differentiable primitives and the parameters of the Gaussian unit are jointly optimized. The structure regularization loss includes Boolean difference set protection regularization loss, which is used to constrain the formation of effective subtraction of negative primitives and limit the excessive subtraction of negative primitives. A compactification module is used to filter, prune, and / or merge the jointly optimized typed differentiable primitives to obtain a compact combination of positive and negative primitives. The output module is used to output an editable CAD representation based on the compact combination of positive and negative primitives.
