Sketch CAD model generation method based on unit structure

Through the sketch CAD model generation method based on unit structure, and using technologies such as CLIPascene and corner point detection, the problem of difficulty for ordinary users to complex model is solved, the generation and editing of complex models is realized, and the robustness and user experience of the model are improved.

CN120337788AActive Publication Date: 2025-07-18ZHEJIANG UNIV +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510812606.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-07-18
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

The prior art is difficult to implement complex modeling through sketches, especially for ordinary users, and the generated model is not editable, has low reusability, and is difficult to connect with downstream applications.

Method used

The sketch CAD model generation method based on unit composition is adopted, sketches are generated through CLIPascene, sketch data set is constructed, and sketch categories and parameters are extracted using classification and parameters. The initialization CAD model is optimized by using the coarse-to-fine strategy, and the parameter optimization is combined with corner detection and random search.

Benefits of technology

It realizes the generation and editing of complex modeling, improves the robustness and editability of the model, broadens the user base, and lowers the technical threshold of professional software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337788A_ABST
    Figure CN120337788A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of CAD (Computer Aided Design) modeling, in particular to a sketch CAD model generation method based on a unit group structure, which comprises the following steps of: generating a sketch through a CLIPascene method based on different unit CAD models, and constructing a sketch data set; performing network training by using the sketch data set to obtain a modeling category and corresponding parameters of the sketch; generating an initialized CAD model according to the modeling category and the corresponding parameters of the sketch; and carrying out parameter optimization on the initialized CAD model by adopting a core-to-fine strategy, so as to obtain a reconstructed CAD model. Compared with the prior art, the method has the advantages that the sketching data set which contains different drawing styles and multiple modeling operation semantics is constructed, complex modeling types which cannot be reconstructed by an existing method are realized, and better robustness is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAD modeling, and specifically, to a method for generating a sketch CAD model based on unit composition. Background Art

[0002] As a tool for quickly expressing ideas and concepts, with the rise of AR / VR technology, sketches have become an effective way for interaction and creation on multimedia platforms. Spatial drawing and modeling software such as Gravity Sketch and Sketchbox, as well as application programs such as Shapr3D that combine sketches for CAD modeling, are all driving this trend. However, these software are usually targeted at professional designers. For ordinary users without modeling experience, they can often only do some simple doodles or rely on pre-designed models for splicing, similar to assembling Lego bricks. If an algorithm can be designed to achieve basic modeling even through rough sketching, this will effectively lower the technical threshold of professional software and allow ordinary users to also participate in the modeling process. Such an innovation can not only broaden the user group of modeling software but also help transform sketch modeling into a more common creation tool.

[0003] Early research focused on complementing the depth information of sketches, using dilation methods to complement depth information, or solving optimization problems based on the implicit constraints in sketches. However, these methods often require relatively clean and regular sketch inputs, and the generated models are often non-editable models without a model generation process. Such models have low reusability and are difficult to connect with downstream applications such as secondary editing and manufacturing. Summary of the Invention

[0004] To solve the above technical problems existing in the prior art, the present invention proposes a method for generating a sketch CAD model based on unit composition, and its specific technical solution is as follows: A method for generating a sketch CAD model based on unit composition includes: Generating a sketch through the CLIPascene method based on different CAD models and constructing a sketch dataset; Training a modeling operation classification network and a template parameter extraction network using the sketch dataset to obtain the modeling category and corresponding parameters of the sketch; Generating an initial CAD model according to the modeling category and corresponding parameters of the sketch; Adopting a coarse-to-fine strategy to optimize the parameters of the initial CAD model to obtain a reconstructed CAD model.

[0005] Further, by sampling different modeling operation parameters, different CAD models are generated using a CAD automatic generation algorithm, and duplicate removal processing is performed.

[0006] Further, the duplicate removal processing specifically generates CAD model projection pictures from multiple perspectives based on pythonOCC, uses a hash algorithm for image duplicate removal, and deletes invalid wireframe diagrams.

[0007] Further, in the CLIPascene method, the output of the 11th layer of the CLIP-ViT encoder is used as features to extract semantic information, so that the generated sketch retains semantic information.

[0008] Further, corner detection is performed on the sketch, and the corner detection results are fused with the sketch initialization results calculated based on the attention weights extracted by the Clip-ViT encoder, and the points with the sparsest distribution are selected as the initialization control points.

[0009] Further, a modeling operation classification network based on inception-V3 as the backbone network is trained to obtain the modeling category of the sketch.

[0010] Further, according to the modeling category and corresponding parameters of the sketch, a CAD generation script is executed in CAD software to generate an initial CAD model.

[0011] Further, the optimized parameters include the size, position, and angle of the CAD model, and parameter optimization uses a method of random search assisted by MCMC to sample in the parameter space.

[0012] Further, the method of using random search assisted by MCMC to sample in the parameter space is specifically as follows: First, the generated initial CAD model is rendered to generate a projection map, then the input sketch is back-projected into the CAD model space, the center point is calculated based on the projection result and used as the initial value of the CAD model position, then the OBB of the input sketch contour and the OBB of the CAD model contour calculated from the rendered projection map are calculated, and then the overlap degree IoU of the two OBBs and the angle difference of the main axes are calculated. Random search is performed near the initial value, and MCMC is assisted for refinement to obtain the optimal solution.

[0013] Further, after generating the unit cell CAD model, the user can drag the generated model by hand through the sketch and intersect it with another already generated model; the system will pop up options to select "merge", "intersect", "subtract", and the user can perform boolean operations of union, intersection, and difference on the generated model by selecting different options to obtain a new CAD model.

[0014] Compared with the prior art, the present invention constructs a sketch dataset containing different drawing styles and various modeling operation semantics, realizes complex modeling types that cannot be reconstructed by existing methods, and achieves better robustness. Description of the Drawings

[0015] Figure 1 is the overall flowchart of a method for generating a sketch CAD model based on unit composition in this embodiment; Figure 2 is a schematic diagram of a randomly generated CAD model in this embodiment; Figure 3 is a wireframe diagram generated based on the CAD model in this embodiment; Figure 4 is the hand-drawn sketch generated in this embodiment. Detailed Embodiment

[0016] In order to make the objectives, technical solutions, and technical effects of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings in the specification and embodiments.

[0017] As Figure 1 shown, a method for generating a sketch CAD model based on unit composition in this embodiment includes the following: Sketch Dataset Construction: Design a model instantiation module. By sampling different modeling operation parameters, use the CAD automatic generation algorithm to generate different CAD models, such as Figure 2 shown. After obtaining diverse CAD models, generate model projection images from 24 perspectives based on pythonOCC, use the hash algorithm to remove duplicate images, and delete invalid wireframe diagrams. As Figure 3 shown, since there is a large domain difference between regular wireframe diagrams and real hand-drawn sketches, it is difficult for the sketch classification module trained on wireframe diagrams to be directly transferred to hand-drawn applications. To improve the robustness of the sketch classification module, inspired by the work of CLIPascene, this embodiment generates simulated hand-drawn sketches of different types and abstraction levels based on CLIP, such as Figure 4 shown.

[0018] The design sketch generation module adopts the idea of generating sketches using CLIPascene. Based on the feature outputs of CLIP encoding for the sketches and reference images, it optimizes the control points of the Bezier curves of the sketches, thereby generating abstract sketches that retain semantic information. When the input image is a sparse sketch, using CLIPascene will generate an image that is basically the same as the original image. In order to make the generated sketch significantly different from the original image, the output of the 11th layer of the CLIP-ViT encoder model is used as the feature to extract semantic information, so that the sketch content has less geometric and structural fidelity to the original image but is semantically consistent.

[0019] In addition, the method of initializing the sketch strokes is optimized. Since the method of generating sketches is based on iterative optimization of the objective function and the objective function is non-convex, a good initial solution is very important for the optimization process and the final result. The original initialization method is to extract the features and attention weights of the input image based on the CLIP-ViT encoder, calculate the attention saliency map (Saliency Map), multiply the result of the saliency map by the result of edge extraction, obtain a probability map, and then sample the initial stroke control points based on the probability map. This method performs well on textured images, but for sparse sketches, the generation effect is poor, and problems such as control points clustering in one place and missing key corner points will occur. Such initialization results will cause the subsequent optimization results to easily fall into local optimal solutions.

[0020] Therefore, in this implementation, corner detection is performed on the input sketch, the corner detection results are fused with the initialization results extracted based on attention weights, and the points with the sparsest distribution are selected as the initial control points. Such an initialization method can generate a more reasonable control point layout and can reach convergence faster, greatly improving the efficiency of generating the sketch dataset and making the final generated effect better.

[0021] In order to generate more complex and diverse models and train a modeling system that is robust to different sketch styles in the embodiments of the present invention, a sketch dataset containing different drawing styles and multiple modeling operation semantics is constructed, such as modeling operations like helical lines, pyramids, and spheres that cannot be generated by existing methods.

[0022] Classification and parameter regression network training: After constructing a sketch dataset containing multiple modeling categories and multiple hand-drawn styles, train a modeling operation classification network based on inception-V3 as the backbone network, and a template parameter extraction network, that is, a parameter regression network.

[0023] CAD model generation and parameter optimization.

[0024] The overall optimization process of CAD model parameters is as follows: First, perform random search near the initial value, and then perform MCMC optimization based on the optimal solution of the random search. Among them, after obtaining the global parameters of the CAD model, further optimize the detailed modeling parameters. With the position and pose fixed, extract the fine contours of the input sketch and the projection drawing, calculate the IoU loss between the contours of the sketch and the model projection drawing, perform random search within a certain range of the parameter initial value, and assist MCMC for refinement to obtain the optimal solution.

[0025] More specifically, after obtaining the modeling category and corresponding parameters based on the modeling operation classification network and the template parameter extraction network, execute the CAD script in the CAD software, and then render to generate the projection image Ip of the CAD. Subsequently, optimize the pose of the CAD model based on the input sketch Is: position and angle, as well as specific modeling parameters. Specifically, adopt the coarse-to-fine strategy, first optimize the specific dimensions, position, and angle of the CAD model, and then optimize the detailed parameters. Since the entire optimization and update process needs to rely on the reconstruction and rendering functions of the CAD software, it is non-convex and difficult to calculate the gradient. Therefore, a method of using random search to assist MCMC is adopted to sample in the parameter space. First, generate an initial CAD model based on the modeling operation parameters, then back-project the input sketch into the model space, calculate the center point according to the projection result and use it as the initial value of the CAD model position; then calculate the OBB of the input sketch contour, and calculate the OBB of the CAD model contour from the rendered projection drawing, and then calculate the overlap degree IoU of the two OBBs and the angle difference of the main axes.

[0026] The present invention first classifies the modeling operations, then calls the corresponding template parameter extraction module based on the classification results, regresses the corresponding parameters, and then assists the coarse-to-fine parameter optimization algorithm to optimize the global and detailed parameters of the CAD model, realizing complex modeling types that cannot be reconstructed by existing methods and obtaining better robustness.

[0027] The above is only the preferred embodiment of the present invention, and does not impose any form of limitation on the present invention. Although the implementation process of the present invention has been described in detail above, for those familiar with the field, they can still modify the technical solutions recorded in the foregoing examples, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating a sketch CAD model based on a unit composition structure, characterized in that Including: Based on different unit CAD models, generate sketches through the CLIPascene method and construct a sketch dataset; Use the sketch dataset to train the modeling operation classification network and the template parameter extraction network to obtain the modeling category and corresponding parameters of the sketch; Generate an initial CAD model according to the modeling category and corresponding parameters of the sketch; Adopt a coarse-to-fine strategy to optimize the parameters of the initial CAD model to obtain a reconstructed CAD model.

2. The sketch CAD model generation method according to claim 1, wherein Generate the different unit CAD models through the CAD automatic generation algorithm by sampling different modeling operation parameters and perform duplicate removal processing.

3. The sketch CAD model generation method according to claim 2, wherein The duplicate removal processing is specifically to generate CAD model projection pictures from multiple perspectives based on pythonOCC, use the hash algorithm for image duplicate removal, and delete invalid wireframe diagrams.

4. The sketch CAD model generation method according to claim 1, wherein In the CLIPascene method, use the output of the 11th layer of the CLIP-ViT encoder as features to extract semantic information, so that the generated sketches retain semantic information.

5. The sketch CAD model generation method according to claim 4, wherein, Perform corner detection on the sketch, fuse the corner detection results with the sketch initialization results calculated based on the attention weights extracted by the Clip-ViT encoder, and select the point with the sparsest distribution as the initial control point.

6. The sketch CAD model generation method according to claim 1, characterized in that Train the modeling operation classification network based on inception-V3 as the backbone network to obtain the modeling category of the sketch.

7. The sketch CAD model generation method according to claim 1, wherein, According to the modeling category and corresponding parameters of the sketch, execute the CAD generation script in the CAD software to generate an initial CAD model.

8. The sketch CAD model generation method according to claim 1, wherein The optimized parameters include the size, position, and angle of the CAD model. The parameter optimization uses the method of random search assisted by MCMC to sample in the parameter space.

9. The sketch CAD model generation method according to claim 8, wherein, The method of using random search assisted by MCMC to sample in the parameter space is specifically as follows: first render the generated initial CAD model to generate a projection map, then back-project the input sketch into the CAD model space, calculate the center point according to the projection result and use it as the initial value of the CAD model position, then calculate the OBB of the input sketch contour and the OBB of the CAD model contour calculated from the rendered projection map, then calculate the overlap degree IoU of the two OBBs and the angle difference of the main axes, perform random search near the initial value, and assist MCMC for refinement to obtain the optimal solution.

10. The sketch CAD model generation method according to claim 1, characterized in that, Perform boolean operations of union, intersection, and difference on the reconstructed CAD model to obtain a new CAD model.

Citation Information

Patent Citations

  • Automatic generation and identification method for abstract sketch of mechanical part

    CN117649456A

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

    CN117725966A

  • CAD sketch generation method and system based on freehand sketch

    CN120124127A

  • Optimal design support apparatus and optimal design support method, and program therefor

    JP2004133659A

  • CAD model analysis method and apparatus, device and storage medium

    US20250036829A1