A parametric design method, system, device and medium of a three-dimensional model software

CN122548919APending Publication Date: 2026-08-11CHENGDU HENGRUI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-13
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0006]本发明的主要目的在于提供一种三维模型软件的参数化设计方法、系统、设备及介质,旨在解决现有的三维参数化设计工具难以对规则参数进行有效闭环校验,并将重构后的尺寸标注准确排布至无遮挡的空间位置,影响模型重构稳定性与图纸输出质量的问题

Benefits of technology

本发明通过提取三维模型文件中的驱动特征变量,利用包含界面控件名与特征变量名的规则表达式建立输入参数与模型变量之间的关联关系,并在正则表达式验证和双向核对关联正确后生成合法参数,再以该合法参数驱动三维实体模型重构,同时基于重构后实体的最小外接三维包围盒、几何中心坐标、空间包络半径以及尺寸标注原始三维坐标,计算尺寸标注相对于模型中心的归一化单位方向向量,并通过空间外扩逻辑确定尺寸标注的设计尺寸位置,解决了现有三维模型参数化设计中规则参数容易错配、模型重构后尺寸标注仍沿用原位置而导致遮挡、重叠或难以核对的问题,基于上述处理,参数在写入模型前能够经过格式和关联关系校验,降低了因表达式错误或目标变量错误导致重构失败的风险;模型重构后,尺寸标注能够随实体外形变化自动调整至更适合显示的位置,使输出图纸中的尺寸信息更加清楚,便于设计人员在多规格模型更新后快速核对参数写入结果和模型重构状态,提高参数化设计过程的稳定性、可视化确认效率和图纸输出质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122548919A_ABST
    Figure CN122548919A_ABST
Patent Text Reader

Abstract

This invention relates to the field of data processing technology, and in particular to a parametric design method, system, device, and medium for 3D modeling software. The method allows parameters to be validated for format and relationships before being written into the model, reducing the risk of reconstruction failure due to incorrect expressions or target variables. After model reconstruction, dimensions can automatically adjust to more suitable display positions as the entity's shape changes, making the dimensional information in the output drawings clearer. This facilitates designers in quickly verifying parameter writing results and model reconstruction status after updating multiple model specifications, improving the stability of the parametric design process, the efficiency of visual confirmation, and the quality of drawing output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a parametric design method, system, device, and medium for three-dimensional modeling software. Background Technology

[0002] In the mechanical design and non-standard automation industries, parametric design using 3D modeling software is the foundation for achieving rapid product iteration.

[0003] Conventional parametric design typically relies on designers manually searching for and adding geometric constraints in sketches, annotating driving dimensions one by one, and establishing the relationship logic between dimensions by writing equations or importing external Excel spreadsheets, thereby enabling the driving and updating of parameters for multi-specification assembly models.

[0004] However, existing parametric configuration methods suffer from lengthy processes and are prone to failure. Specifically, when dealing with complex multi-level assemblies, designers need to manually extract the underlying dimensions, which is a huge workload. At the same time, external parameter tables rely heavily on manual text matching of dimension IDs, and the system only provides a single numerical input interface, lacking a pre-closed-loop verification mechanism for rule expressions. This approach is highly susceptible to errors and crashes in model reconstruction due to non-standard input or parameter mismatch.

[0005] In addition, existing tools lack intuitive and clear means of visualizing and previewing model dimensions. When driving the reconstruction of complex models and needing to view the configuration results, due to the lack of dynamic avoidance and arrangement logic in 3D space for dimension annotations, the automatically generated dimensions often cause severe spatial occlusion or overlap with the 3D solid model. This makes it impossible for users to intuitively and clearly see the corresponding dimension information annotated on the model. Summary of the Invention

[0006] The main objective of this invention is to provide a parametric design method, system, device, and medium for 3D model software, aiming to solve the problem that existing 3D parametric design tools are unable to effectively close the loop for regular parameters and accurately arrange the reconstructed dimension annotations in an unobstructed spatial position, which affects the stability of model reconstruction and the quality of drawing output.

[0007] To achieve the above objectives, the present invention provides a parametric design method for 3D modeling software, the method comprising the following steps: Extract the driving feature variables from the 3D model file and obtain the regular expression containing the interface control name and feature variable name; The symbol matching specification of the rule expression is verified according to the regular expression, and after the two-way verification of the association is correct, the legal parameters for reconstructing the model are generated. The three-dimensional solid model is reconstructed based on the legal parameters, the minimum bounding box of the reconstructed entity is obtained, and the geometric center coordinates and spatial envelope radius of the three-dimensional bounding box are obtained. Obtain the original three-dimensional coordinates of the dimension to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius, the design dimension position of the dimension annotation is obtained through spatial expansion logic; Move the dimension annotation to the design dimension position and generate a view output drawing.

[0008] Optionally, the extraction of driving feature variables from the 3D model file includes: Traverse the feature tree of the 3D model file and record the model file, configuration, and node hierarchy path of each node in the feature tree; Obtain the type information, node name, node identifier, current parameter value, and interface access identifier of each node in the feature tree; Based on the type information, determine whether each node belongs to a size node, feature node, or array node, and retain size nodes, feature nodes, and / or array nodes, while filtering out the remaining nodes; The retained size nodes, feature nodes, and / or array nodes are used to generate size information, feature information, and array information respectively, and the driving feature variables are formed according to the model file, configuration, variable name, variable type, current parameter value, and interface access identifier.

[0009] Optionally, the step of verifying the symbol matching specification of the regular expression according to the regular expression, and parsing and generating legal parameters for reconstructing the model after verifying the correct association in both directions, includes: searching whether the regular expression contains a complete closed feature tag according to the regular expression; Extract the string fields inside the feature markers, and query the string fields in the control information table and the driving feature variable table respectively; When the string field matches the name of the interface control in the control information table, the corresponding control value and control data type are obtained; When the string field matches the feature variable name in the driver feature variable table, obtain the corresponding variable type, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier. Based on the type correspondence between the control data type and the variable type, and the write object correspondence between the feature variable name, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier, a two-way matching and verification is performed; When the matching results of the two-way matching check are completely consistent, the string field in the rule expression is replaced with the corresponding control value or the current parameter value, and the replaced rule expression is parsed and solved according to the preset operation priority to generate legal parameters for reconstructing the model; The valid parameters are stored in the database according to the rule expression identifier, interface control name, feature variable name, parameter value, parameter type, model file, configuration, and interface access identifier.

[0010] Optionally, obtaining the minimum bounding box of the reconstructed entity and obtaining the geometric center coordinates and spatial envelope radius of the bounding box includes: Obtain the minimum and maximum limit coordinate values ​​of each coordinate axis of the reconstructed entity in the three-dimensional coordinate system; The minimum and maximum limit coordinate values ​​of each coordinate axis are obtained separately, and the average values ​​are combined to obtain the coordinates of the geometric center. Obtain the spatial straight-line distance from the geometric center coordinates to the boundary vertex point, and use the spatial straight-line distance as the spatial envelope radius.

[0011] Optionally, calculating the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates includes: The differences between the original three-dimensional coordinates and the geometric center coordinates on each coordinate axis are obtained respectively; Obtain the spatial span distance from the original three-dimensional coordinates to the geometric center coordinates; The differences on each coordinate axis are normalized with the spatial span distance to obtain the normalized unit direction vector.

[0012] Optionally, obtaining the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius includes: Multiply the components of the unit direction vector on each coordinate axis by the spatial envelope radius to obtain the outward displacement compensation value for each axis. The outward displacement compensation values ​​of each axis are respectively superimposed onto the axial coordinate values ​​of the geometric center coordinates to obtain the design dimension position of the dimension annotation.

[0013] Optionally, moving the dimension annotation to the design dimension position and generating the view output drawing includes: Call the underlying interface of the 3D modeling software to switch to the preset view and perform overall adaptive scaling; Call the annotation object position setting interface to move the display position of the dimension annotation to the design dimension position; Adjust the size text style and generate a view output drawing.

[0014] To achieve the above objectives, the present invention also provides a parametric design system for three-dimensional modeling software, the system comprising: The feature capture module is used to extract driving feature variables from 3D model files and obtain regular expressions containing interface control names and feature variable names; The rule configuration module is used to verify the symbol matching specification of the rule expression according to the regular expression, and after the two-way verification of the association is correct, parse and generate legal parameters for reconstructing the model; The 3D reconstruction module is used to drive the reconstruction of the 3D solid model according to the legal parameters, obtain the minimum bounding box of the reconstructed entity, and obtain the geometric center coordinates and spatial envelope radius of the 3D bounding box. Configure the settlement module to obtain the original three-dimensional coordinates of the dimension annotation to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Configure an expansion module to obtain the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector and the spatial envelope radius; The view output module is used to move the dimension annotation to the design dimension position and generate a view output drawing.

[0015] To achieve the above objectives, the present invention also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the parametric design method of the three-dimensional model software.

[0016] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, wherein a processor executes the computer program to implement the parametric design method of a three-dimensional model software.

[0017] The beneficial effects that this invention can achieve are as follows: This invention extracts driving feature variables from 3D model files, establishes the association between input parameters and model variables using regular expressions containing interface control names and feature variable names, and generates valid parameters after regular expression verification and two-way verification of the association. These valid parameters then drive the reconstruction of the 3D solid model. Simultaneously, based on the minimum bounding box, geometric center coordinates, spatial envelope radius, and original 3D coordinates of the dimensions of the reconstructed entity, the normalized unit direction vector of the dimensions relative to the model center is calculated. The design dimension position of the dimensions is determined through spatial expansion logic. This solves the problems of mismatched regular parameters and the continued use of original dimensions after model reconstruction in existing parametric design of 3D models, leading to occlusion, overlap, or difficulty in verification. Based on the above processing, parameters undergo format and association verification before being written to the model, reducing the risk of reconstruction failure due to expression errors or target variable errors. After model reconstruction, dimensions automatically adjust to a more suitable display position according to changes in the entity's shape, making the dimension information in the output drawings clearer. This facilitates designers' rapid verification of parameter writing results and model reconstruction status after updating multiple specifications of the model, improving the stability of the parametric design process, the efficiency of visual confirmation, and the quality of drawing output. Attached Figure Description

[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0019] Figure 1 This is a flowchart illustrating the method in Embodiment 1 of the present invention; Figure 2 This is a structural block diagram of the system in Embodiment 2 of the present invention.

[0020] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0022] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a specific posture. If the specific posture changes, the directional indication will also change accordingly.

[0023] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral part; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0024] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the meaning of "and / or" throughout the text includes three parallel solutions; for example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0025] Example 1 Reference Figure 1 This embodiment provides a parametric design method for 3D modeling software, the method comprising the following steps: Extract the driving feature variables from the 3D model file and obtain the regular expression containing the interface control name and feature variable name; The symbol matching specification of the rule expression is verified according to the regular expression, and after the two-way verification of the association is correct, the legal parameters for reconstructing the model are generated. The three-dimensional solid model is reconstructed based on the legal parameters, the minimum bounding box of the reconstructed entity is obtained, and the geometric center coordinates and spatial envelope radius of the three-dimensional bounding box are obtained. Obtain the original three-dimensional coordinates of the dimension to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius, the design dimension position of the dimension annotation is obtained through spatial expansion logic; Move the dimension annotation to the design dimension position and generate a view output drawing.

[0026] It is understandable that the parametric design method for 3D modeling software provided in this embodiment is primarily applied to industrial manufacturing scenarios where specifications and parameters need to be frequently changed, such as the design of non-standard automated equipment, complex molds, automotive parts tooling, mechanical equipment, and serialized products. For example, in the design of non-standard automated equipment, the same type of equipment may differ only in parameters such as conveyor width, clamping stroke, mounting hole spacing, guide rail length, cylinder stroke, sheet metal thickness, or array quantity. If designers still rely on manually modifying each part, assembly, sketch, and engineering drawing, it is easy to miss dimensions, make incorrect equation references, cause configuration failures, and lead to assembly interference. Furthermore, when generating preview images or outputting drawings, the automatically displayed dimension annotations may obscure, intersect, or overlap with the reconstructed 3D entity, making it impossible for designers to intuitively confirm whether the current parameters have been correctly applied to the model.

[0027] This embodiment extracts driveable feature variables in advance during the model parameter configuration stage, performs pre-verification of the expression relationship between interface controls and model features during the rule configuration stage, and recalculates the display position of dimension annotations based on the 3D bounding box after model reconstruction. This makes parameter input, parameter parsing, entity reconstruction and drawing output form a continuous closed loop, which is more suitable for rapid configuration, batch updating and visual verification of multi-specification models in actual engineering.

[0028] In this embodiment, the 3D model file can be a part file, assembly file, or a main model file composed of multiple part files in 3D modeling software, especially a part, sub-assembly, or overall assembly file in the SolidWorks environment.

[0029] Driving feature variables refer to variable objects that can be driven by parameter values ​​and affect the model reconstruction results. They can include size information, feature information, and array information. Size information is preferably sketch size, extrusion depth, hole spacing, chamfer size, part thickness, or assembly constraint size. Feature information is preferably objects that can change the structural state of the model, such as extrusion, cut, hole features, compression features, and restoration features. Array information is preferably objects that affect the distribution of repeating structures, such as the number of linear arrays, array spacing, or array direction.

[0030] For example, in an alternative implementation, the feature tree of the 3D model file is traversed through the underlying interface of the 3D model software, and the model file to which each node belongs, the configuration to which it belongs, and the node hierarchy path are recorded during the traversal. Further, the system reads the type information, node name, node identifier, current parameter value, and interface access identifier of each node, and determines whether the node belongs to a size node, feature node, or array node based on the type information. For objects determined to be size nodes, feature nodes, and / or array nodes, the system retains them and generates size information, feature information, and array information respectively. For other nodes, they are not included in the subsequent rule configuration and model reconstruction process. Thus, subsequent rule expressions can accurately locate specific model files, specific configurations, and specific model nodes based on driving feature variables, reducing configuration errors caused by manually searching for underlying dimensions or misselecting model objects.

[0031] In this embodiment, the interface control name refers to the control identifier that allows users to input or select parameters in the parameter input interface. For example, it can correspond to business-oriented input items such as device width, guide rail length, number of mounting holes, plate thickness, stroke, and model specifications. The feature variable name refers to the model variable identifier that is extracted from the 3D model file and can be written or modified by the API. For example, a sketch dimension name, an extrusion feature name, a linear array quantity name, or a modifiable item name under a certain configuration.

[0032] The rule expressions are used to establish the calculation relationship between interface control names and feature variable names. These rule expressions are not just simple numerical substitution relationships, but can express the linkage relationship between an interface input value and one or more model variables. For example, the total width control of the equipment can be converted into the distance between the left and right side plates, the length of the crossbeam, and the hole array spacing through rule expressions; the cylinder stroke control can be converted into the effective stroke of the slide and the limit installation position through rule expressions. In this way, users only need to input specification values ​​that conform to business habits in the parameterized interface, and the system can calculate the feature parameters that actually need to be written into the model according to the pre-configured rule expressions, reducing the probability of errors when directly manipulating the underlying dimension numbers or complex equations.

[0033] In order to ensure that the rule expression can stably participate in the model reconstruction, this embodiment pre-establishes a control information table corresponding to the interface input items and a driving feature variable table corresponding to the driving feature variables before parsing the rule expression.

[0034] The control information table records the interface control name, control value, and control data type. The driving feature variable table records the feature variable name, variable type, associated model file, associated configuration, current parameter value, and interface access identifier. Based on this, before parsing the rule expression, the system can first determine whether the fields in the expression have a real input source and a real writing object, and then evaluate the expressions that pass the verification.

[0035] In this embodiment, verifying the symbol matching specification of the regular expression based on the regular expression mainly involves performing a syntactic pre-check on the feature markers, parentheses, operators, field boundaries, and reference formats in the regular expression.

[0036] In a preferred embodiment, feature markers are preferably represented by paired closed markers, such as using fully closed curly braces to reference control names or feature variable names. After reading the rule expression, the system first uses regular expressions to determine whether there are unclosed markers, illegal characters, incorrect nesting, or fields that do not conform to the preset format in the expression. Then, it extracts the string fields inside the feature markers and performs bidirectional matching and verification between the string fields and the interface control names in the control information table and the feature variable names in the driver feature variable table.

[0037] The correct bidirectional verification and association mentioned here means that the fields referenced in the rule expression can find a unique corresponding object in the control information set or feature variable information set. At the same time, the written target feature variable can also be traced back to the real driveable object in the 3D model file. This avoids situations where fields in the expression seem to exist but cannot actually be written into the model, or where model variables exist but the interface control is not configured with an input source. Only when the field reference, expression format, and target variable mapping are all verified, will the system parse and solve the rule expression and save the obtained numerical value, Boolean state, array number, or feature compression state as a valid parameter for reconstructing the model to the database.

[0038] In this embodiment, the legitimate parameters are parameter results that can be written into the underlying objects of the 3D modeling software after being parsed by rule expressions, matched by fields, and verified by model object mapping. These differ from the raw interface values ​​directly input by the user, which may be product specifications, order parameters, or design constraints. Legitimate parameters are reconstructed parameters that have been converted into a form recognizable by the model. For example, the user-inputted equipment width can be parsed as the beam length, the base plate hole spacing, and the guide rail mounting spacing; the user's selection of whether to enable a certain accessory can be parsed as the compression or restoration state of the corresponding feature; the user-inputted number of workstations can be parsed as the number of linear arrays and the array spacing. By storing the legitimate parameters in the database, the subsequent model reconstruction plugin can directly call the parameter results from the database when opening the main model file and write them into the target modification items in the corresponding configuration, part, or assembly level through the 3D modeling software API, achieving parameter linkage updates across parts and assemblies.

[0039] It should be noted that the rule expression identifier in the valid parameter table is used to trace which rule expression the valid parameter was parsed from; the interface control name is used to trace the input source of the valid parameter; the feature variable name is used to determine the model variable corresponding to the valid parameter; the parameter value and parameter type are used to determine the specific parameter content used when writing to the model; and the model file, configuration, and interface access identifier are used to determine the model location where the valid parameter should be written. Therefore, during the model reconstruction stage, the system can directly locate the target size node, feature node, or array node based on the records in the valid parameter table, reducing reconstruction errors caused by the separation of parameter values ​​from the written object.

[0040] In this embodiment, driving the reconstruction of the three-dimensional solid model according to the legal parameters means writing legal parameters into the size, feature or array object of the three-dimensional solid model through the underlying interface of the three-dimensional model software, and triggering the model to be regenerated so that the solid structure of the model is updated according to the current parameter combination.

[0041] In a preferred embodiment, during actual execution, the system opens the main model file and, based on the project path, model level, configuration name, target feature variables, and valid parameter values ​​recorded in the database, writes different parameters into the corresponding part file or assembly file. For assembly models, since a product specification often simultaneously affects the length, hole positions, array quantity, and assembly relationships of multiple parts, this embodiment is not limited to parameter modification within a single part. Instead, parameters can be written into multiple associated files along the model hierarchy, enabling the same specification parameters to simultaneously drive multiple components to complete reconstruction. After model reconstruction is completed, the minimum bounding box of the reconstructed entity is obtained to determine the overall occupancy range of the current entity in three-dimensional space.

[0042] In this embodiment, the minimum bounding box refers to the spatial boundary box that can enclose the reconstructed entity in a three-dimensional coordinate system.

[0043] Specifically, the minimum and maximum bounding coordinates of the reconstructed entity in the X, Y, and Z axes can be obtained, for example, minX, maxX, minY, maxY, minZ, and maxZ, respectively. These coordinates together determine the outer boundary range of the model in three-dimensional space.

[0044] The geometric center coordinates are the center position of the bounding box calculated based on the minimum and maximum bounding coordinate values ​​on each coordinate axis. They can be expressed as cx=(minX+maxX) / 2, cy=(minY+maxY) / 2, cz=(minZ+maxZ) / 2.

[0045] Understandably, these geometric center coordinates are used to approximate the spatial center region of the reconstructed model, rather than to represent the centroid or mass center of a specific part. Therefore, they do not rely on material density, mass properties, or complex solid integral calculations, making them more suitable for quickly completing dimensioning and layout calculations after model reconstruction.

[0046] It can also be understood that the spatial envelope radius refers to the straight-line distance in space extending from the geometric center coordinates to the top corner of the bounding box, which can be calculated by three-dimensional Euclidean distance. It is used to characterize the outward expansion scale of the model entity in the current view or the current spatial range. Through this spatial envelope radius, the dimension annotation can be provided with an outward displacement distance that matches the overall size of the model, so that the dimension annotation no longer stays inside the entity or close to the surface of the entity.

[0047] In this embodiment, the dimension annotation to be adjusted refers to the dimension annotation object that needs to be displayed in the preview image, output drawing, or configuration viewing interface. It can correspond to a dimension object selected from the driving feature variables, or it can be a dimension description applied to display the parametric configuration results. The original three-dimensional coordinates refer to the original annotation display position of the dimension annotation in the 3D modeling software, rather than the actual design coordinates of the annotated entity edge or the measured geometric element. In actual engineering, after the model is parametrically reconstructed, the entity shape may be enlarged, reduced, extended, arrayed, or local structures may be opened or closed. The dimension annotation that was originally in a reasonable position may move into the entity, closer to the outer contour, or overlap with other annotations. Therefore, in this embodiment, after obtaining the original three-dimensional coordinates of the dimension annotation, the position is not directly used. Instead, the directional relationship of the original three-dimensional coordinates relative to the geometric center coordinates is calculated to determine which spatial direction the annotation was originally located in at the center of the model.

[0048] In this embodiment, when calculating the normalized unit direction vector, the differences between the original 3D coordinates and the geometric center coordinates along each coordinate axis are obtained first. For example, if the original 3D coordinates of the dimension annotation are x, y, z, and the geometric center coordinates are cx, cy, cz, then dx = x - cx, dy = y - cy, and dz = z - cz can be obtained. Then, the spatial span distance from the original 3D coordinates to the geometric center coordinates is calculated based on dx, dy, and dz.

[0049] The normalized unit direction vector is obtained by dividing the difference between each coordinate axis by the spatial span distance. Its function is to retain only the spatial direction of the dimension annotations relative to the model center, while weakening the influence of the distance between the original annotation position and the model center on the subsequent expansion results. In other words, regardless of whether a dimension annotation was originally closer or farther from the model center, as long as it is located in a direction close to the model center, it can be pushed to the model's outer perimeter area corresponding to that direction. This avoids the direct use of the original coordinates, which would cause some annotations to remain inside the model, and also avoids the original coordinates becoming invalid after model specifications changes, thus affecting the readability of the preview image.

[0050] In this embodiment, the spatial expansion logic refers to the processing logic that pushes the dimension annotation to the outer region of the model bounding box based on the geometric center coordinates of the reconstructed entity and along the unit direction vector of the original position of the dimension annotation relative to the geometric center coordinates.

[0051] For example, in an alternative implementation, the components of the unit direction vector in the X, Y, and Z axes can be multiplied by the spatial envelope radius to obtain the outward displacement compensation value for each axis. This outward displacement compensation value is then superimposed onto the corresponding axial coordinate value of the geometric center coordinates to obtain the design dimension position of the dimension annotation. In this embodiment, the design dimension position does not refer to the design dimension value of the model entity, nor to the geometric dimension of the measured structure, but rather to the target position that the dimension annotation should display in three-dimensional space after outward calculation. This target position is related to the outer envelope range after model reconstruction and remains consistent with the original direction of the dimension annotation. Therefore, while preserving the semantic meaning of the annotation direction, the annotation object can be moved to the periphery of the model, reducing the probability of occlusion, interpenetration, or overlap between dimension text, dimension arrows, or dimension leaders and the entity surface.

[0052] In practical applications of complex molds or non-standard equipment, a model file usually contains a large number of dimensions such as hole spacing, plate thickness, stroke, array quantity and installation position. If all dimensions are displayed only in the default position of the 3D model software, they are easy to be concentrated on one side of the model or fall directly into the solid contour after reconstruction.

[0053] This embodiment employs an outward projection method from the geometric center towards the original annotation direction, allowing annotations in different directions to naturally disperse to different spatial orientations around the model. For dimensions originally located above, to the side, in front, or diagonally on the model, the corresponding spatial orientation is maintained after expansion. Designers can quickly determine the model area corresponding to the dimension when viewing the preview. For assemblies with dense dimensions, it reduces the reading difficulties caused by dimensions being concentrated in the same projection area. Thus, this embodiment not only completes the automatic reconstruction of model parameters but also further solves the problem that the reconstruction results are difficult to clearly confirm through drawings or previews, making parametric design tools more in line with the review habits in actual engineering design.

[0054] In this embodiment, moving the dimension annotation to the design dimension position can be achieved by calling the annotation object position setting interface of the 3D modeling software.

[0055] For example, in an alternative implementation, specifically using the SolidWorks environment, the display position of the dimension annotation can be modified to the newly calculated coordinate position via the position setting interface corresponding to the Annotation object. This causes the dimension text, leader lines, or annotation objects to move to the outer area of ​​the model. Before moving the dimension annotation, the model configuration switching interface can be called to switch to a specified configuration, and the view direction switching interface can be called to switch to a preset view direction. Then, overall adaptive scaling is performed to display the current model in the view window at a scale suitable for output. It is understood that the preset view here can be the front view, top view, left view, isometric view, or other view directions preset according to the project configuration; the overall adaptive scaling is used to ensure that the reconstructed model entities and the moved dimension annotations are both within the visible range, avoiding the problem of entities being clipped or annotations exceeding the view boundaries during drawing output.

[0056] In this embodiment, adjusting the dimension text style and generating a view output drawing refers to processing the text content, display style, annotation direction, or visualization effect of the dimension annotations after the dimension annotation position is updated, and outputting a drawing result that can be viewed, saved, or reviewed by the user. The dimension text style may include dimension value display, dimension name display, parameter name display, font size, annotation color, arrow style, or annotation description, etc. In actual execution, the dimension annotation text is added and the display style is set by calling the dimension attribute editing interface, and then the current view is exported to the specified project folder through the screenshot export interface or drawing output interface.

[0057] The output drawing can be used as a size preview during the parametric configuration process, or as a configuration view after model reconstruction. It can be used in subsequent model reconstruction plugins to automatically read and display according to project, model file, configuration name and view direction. In this way, when users fill in parameters or view configuration results, they can not only see the parameter values ​​in the input interface and the backend configuration rules, but also intuitively see the display position and related area of ​​the corresponding dimensions on the model through the output drawing.

[0058] Through the above processing, errors caused by manually searching for dimensions, manually maintaining equations, and manually matching dimension numbers are reduced in the parametric design stage; in the model reconstruction stage, multi-level models can be uniformly updated through valid parameters; and in the drawing output stage, the position of dimension annotations can be dynamically adjusted according to the actual spatial envelope of the reconstructed entity, making the dimension annotations more stably distributed in the outer area of ​​the model. Thus, this embodiment improves the automation level and reconstruction stability of parametric design in 3D model software, and improves the readability of the reconstructed dimension preview and output drawings. It is especially suitable for practical application scenarios such as rapid design of multi-specification mechanical products, order-based variant design, and batch parameter updates of assemblies.

[0059] In this embodiment, extracting the driving feature variables from the 3D model file includes: Traverse the feature tree of the 3D model file and record the model file, configuration, and node hierarchy path of each node in the feature tree; Obtain the type information, node name, node identifier, current parameter value, and interface access identifier of each node in the feature tree; Based on the type information, determine whether each node belongs to a size node, feature node, or array node, and retain size nodes, feature nodes, and / or array nodes, while filtering out the remaining nodes; The retained size nodes, feature nodes, and / or array nodes are used to generate size information, feature information, and array information respectively, and the driving feature variables are formed according to the model file, configuration, variable name, variable type, current parameter value, and interface access identifier.

[0060] Understandably, the feature tree reflects the modeling order, assembly hierarchy, and feature dependencies within the 3D model file. When traversing the feature tree, the system prioritizes starting from the root node of the main model file, sequentially accessing parts, sub-assemblies, and their internal feature nodes according to the parent-child hierarchy, and recording the model file, configuration, and hierarchical path of each node. The associated model file represents the part file, sub-assembly file, or overall assembly file corresponding to the node; the associated configuration represents the model configuration where the node resides; and the node hierarchical path represents the node's position in the feature tree, enabling subsequent model reconstruction by returning to the corresponding node based on valid parameters.

[0061] It can also be understood that the type information is used to distinguish whether a node belongs to a size node, feature node, array node, or other node; the node name and node identifier are used to identify the node within the model; the current parameter value is used to record the parameter state of the node before model reconstruction; the interface access identifier is used to locate and access the node through the underlying interface of the 3D model software during the subsequent model reconstruction process. The system retains size nodes, feature nodes, and / or array nodes according to the type information, and filters out the remaining nodes, so that the objects entering the subsequent rule configuration process are all model objects that can participate in parametric design.

[0062] Specifically, dimension nodes correspond to objects whose shape can be affected by numerical adjustments, such as sketch dimensions, hole spacing, extrusion depth, part thickness, or assembly constraint dimensions; feature nodes correspond to objects that can change the structural state of the model, such as extrusion, cut, hole features, compression state, or restoration state; and array nodes correspond to objects used to control the distribution of repeating structures, such as array number, array spacing, or array direction.

[0063] The system organizes the retained dimension nodes, feature nodes, and / or array nodes into dimension information, feature information, and array information, respectively, and forms driving feature variables according to their respective model files, configurations, variable names, variable types, current parameter values, and interface access identifiers. Therefore, the driving feature variables not only contain the objects in the model that need to be driven by parameters, but also the positioning information required for subsequent regular expression parsing and writing of valid parameters, further improving the accuracy and stability of parametric reconstruction of complex assemblies.

[0064] In this embodiment, the step of verifying the symbol matching specification of the regular expression according to the regular expression, and after two-way verification of the correct association, parsing and generating legal parameters for reconstructing the model, includes: Based on the regular expression, retrieve whether the rule expression contains a completely closed feature tag; Extract the string fields inside the feature markers, and query the string fields in the control information table and the driving feature variable table respectively; When the string field matches the name of the interface control in the control information table, the corresponding control value and control data type are obtained; When the string field matches the feature variable name in the driver feature variable table, obtain the corresponding variable type, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier. Based on the type correspondence between the control data type and the variable type, and the write object correspondence between the feature variable name, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier, a two-way matching and verification is performed; When the matching results of the two-way matching check are completely consistent, the string field in the rule expression is replaced with the corresponding control value or the current parameter value, and the replaced rule expression is parsed and solved according to the preset operation priority to generate legal parameters for reconstructing the model; The valid parameters are stored in the database according to the rule expression identifier, interface control name, feature variable name, parameter value, parameter type, model file, configuration, and interface access identifier.

[0065] Understandably, feature tags are used to define the range of fields that need to be identified in a rule expression. For example, they are used to identify reference fields for UI control names or feature variable names. If a feature tag is not fully closed, or if the string field inside the feature tag does not conform to the preset naming format, the rule expression will not enter the subsequent parsing process. After extracting the string field inside the feature tag, the system first compares the string field with the UI control name in the control information table. When a corresponding record exists, it means that the field can be used as the input source for the rule expression, and the system reads the control value and control data type corresponding to the UI control name. The system also compares the string field with the feature variable name in the driving feature variable table. When a corresponding record exists, it means that the field can be used as the writing target or participating variable in the rule expression, and the system reads the variable type, the model file it belongs to, the configuration it belongs to, and the interface access identifier corresponding to the feature variable name.

[0066] It is also understood that, in some specific implementations, the two-way matching check includes field name checking, data type checking, and write object checking. Field name checking is used to determine whether the string field in the regular expression can be uniquely matched in the control information table or the driving feature variable table. Data type checking is used to determine whether the control data type is consistent with the variable type or whether it can be converted. For example, numeric control values ​​correspond to size parameters or array parameters, and status control values ​​correspond to feature compression status or restoration status. Write object checking is used to determine whether the model file, configuration, and interface access identifier corresponding to the feature variable name are complete, so that the valid parameters can be written to the specific model object in the subsequent model reconstruction process. If no corresponding record is found for the string field, multiple corresponding records are found, the control data type does not correspond to the variable type, or the write object lacks the corresponding model file, configuration, or interface access identifier, then the two-way matching check is deemed to have failed.

[0067] In this embodiment, the evaluation algorithm used to parse and solve the expression is an expression evaluation algorithm based on token sequence splitting, field value replacement, and preset operation priority. Specifically, the system first splits the regular expression into a token sequence composed of feature markers, numeric constants, operators, and parentheses, and replaces the string fields that have been verified by bidirectional matching with the corresponding control values ​​or current parameter values. For numerical regular expressions, the system evaluates them according to the preset operation priority of parentheses first and multiplication and division first over addition and subtraction to obtain valid numerical parameters. For state-type regular expressions, the system generates compressed or restored states of feature nodes based on the expression evaluation results. For array-type regular expressions, the system converts the evaluation results into parameter values ​​corresponding to the array quantity, array spacing, or array direction.

[0068] More specifically, if a field is missing, data type cannot be converted, operator does not conform to the rules, or the target variable lacks an interface access identifier during the evaluation process, the generation of valid parameters will stop, and a rule exception message will be output. For example, when a rule expression is used to calculate the length of a beam based on the device width, the rule expression can be expressed as "beam length = device width - reserved distance on both sides × 2". The system first replaces "device width" and "reserved distance on both sides" with the corresponding control values, then calculates the beam length according to the order of multiplication over subtraction, and uses this result as a valid dimension parameter.

[0069] In this embodiment, the database includes a control information table, a driving feature variable table, a rule expression table, and a valid parameter table. The control information table includes at least a control identifier, an interface control name, a control value, and a control data type. The driving feature variable table includes at least a variable identifier, a feature variable name, a variable type, a model file to which it belongs, a configuration to which it belongs, a current parameter value, and an interface access identifier. The rule expression table includes at least a rule expression identifier, a rule expression content, a source interface control name, and a target feature variable name. The valid parameter table includes at least a parameter identifier, a rule expression identifier, an interface control name, a feature variable name, a parameter value, a parameter type, a model file to which it belongs, a configuration to which it belongs, and an interface access identifier.

[0070] Among them, the control information table establishes an association between the interface control name and the source interface control name in the rule expression table; the driving feature variable table establishes an association between the feature variable name and the target feature variable name in the rule expression table; the rule expression table establishes an association with the legal parameter table through the rule expression identifier; and the legal parameter table then locates the dimension nodes, feature nodes, or array nodes in the 3D model file through the model file to which it belongs, the configuration to which it belongs, and the interface access identifier.

[0071] Therefore, after the valid parameters are stored in the database, the subsequent model reconstruction process can write the parameters into the corresponding size node, feature node or array node according to the model file, configuration and interface access identifier.

[0072] In this embodiment, obtaining the minimum bounding box of the reconstructed entity and obtaining the geometric center coordinates and spatial envelope radius of the bounding box includes: Obtain the minimum and maximum limit coordinate values ​​of each coordinate axis of the reconstructed entity in the three-dimensional coordinate system; The minimum and maximum limit coordinate values ​​of each coordinate axis are obtained separately, and the average values ​​are combined to obtain the coordinates of the geometric center. Obtain the spatial straight-line distance from the geometric center coordinates to the boundary vertex point, and use the spatial straight-line distance as the spatial envelope radius.

[0073] Understandably, the minimum bounding box (MBC) is used to characterize the overall spatial occupancy of the model after parameter-driven reconstruction, rather than representing the size range of a specific local structure. Furthermore, the system averages the minimum and maximum bounding coordinate values ​​on each coordinate axis and combines these averages to obtain the geometric center coordinates of the 3D bounding box. These geometric center coordinates serve as the reference center for subsequent spatial expansion calculations and can be updated synchronously as the model specifications change.

[0074] Furthermore, the system obtains the straight-line distance between the geometric center coordinates and the top corner of the bounding box, and uses this straight-line distance as the spatial envelope radius. This spatial envelope radius is used to reflect the overall expansion scale of the reconstructed model, so that the subsequent adjustment of the dimension annotation position can be based on the actual spatial range of the current entity, rather than using the fixed annotation position before reconstruction.

[0075] In this embodiment, calculating the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates includes: The differences between the original three-dimensional coordinates and the geometric center coordinates on each coordinate axis are obtained respectively; Obtain the spatial span distance from the original three-dimensional coordinates to the geometric center coordinates; The differences on each coordinate axis are normalized with the spatial span distance to obtain the normalized unit direction vector.

[0076] It is understood that the original three-dimensional coordinates are used to represent the display position of the dimension annotation before the position adjustment after the model reconstruction, and the geometric center coordinates are used to represent the spatial center reference of the reconstructed entity. The difference on each coordinate axis can reflect the spatial offset direction of the dimension annotation relative to the center of the model.

[0077] Furthermore, the system obtains the spatial span distance from the original 3D coordinates to the geometric center coordinates based on the differences on each coordinate axis, and uses this spatial span distance as a normalization benchmark to normalize the differences on each coordinate axis, thereby obtaining a normalized unit direction vector. This avoids the direct use of the original coordinates, which would cause the annotation position to deviate from the display area due to changes in model specifications. This provides a stable directional basis for subsequent dimension annotation expansion and positioning based on the spatial envelope radius.

[0078] In this embodiment, obtaining the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius includes: Multiply the components of the unit direction vector on each coordinate axis by the spatial envelope radius to obtain the outward displacement compensation value for each axis. The outward displacement compensation values ​​of each axis are respectively superimposed onto the axial coordinate values ​​of the geometric center coordinates to obtain the design dimension position of the dimension annotation.

[0079] It is understood that the unit direction vector is used to characterize the outward expansion direction of the dimension annotation relative to the geometric center of the reconstructed entity, and the spatial envelope radius is used to characterize the overall spatial scale of the reconstructed entity. Therefore, the outward expansion displacement compensation value of each axis can make the dimension annotation shift outward according to the current shape range of the model. It is also understood that the system superimposes the outward expansion displacement compensation value of each axis onto the corresponding axial coordinate value of the geometric center coordinate to obtain the design dimension position of the dimension annotation. The design dimension position is the target display position of the dimension annotation in three-dimensional space, rather than the dimension value of the model entity. This allows the dimension annotation to be dynamically arranged outside the entity according to the model reconstruction result, reducing the occlusion or overlap between the annotation and the model.

[0080] In this embodiment, moving the dimension annotation to the design dimension position and generating the view output drawing includes: Call the underlying interface of the 3D modeling software to switch to the preset view and perform overall adaptive scaling; Call the annotation object position setting interface to move the display position of the dimension annotation to the design dimension position; Adjust the size text style and generate a view output drawing.

[0081] It should be noted that the system moves the display position of the dimension annotations to the aforementioned design dimension position by calling the annotation object position setting interface. This allows the dimension text, dimension lines, or leader lines to be adjusted synchronously according to the spatial range of the reconstructed model. Subsequently, the system adjusts the dimension text style and generates the view output drawing. The dimension text style can include display attributes such as dimension name, numerical display, font size, or annotation direction, thereby making the dimension annotations in the output drawing clearer and facilitating intuitive verification of the model dimensions and reconstruction results after parametric configuration.

[0082] Example 2: As attached Figure 2 As shown, this embodiment provides a parametric design system for 3D modeling software, the system comprising: The feature capture module is used to extract driving feature variables from 3D model files and obtain regular expressions containing interface control names and feature variable names; The rule configuration module is used to verify the symbol matching specification of the rule expression according to the regular expression, and after the two-way verification of the association is correct, parse and generate legal parameters for reconstructing the model; The 3D reconstruction module is used to drive the reconstruction of the 3D solid model according to the legal parameters, obtain the minimum bounding box of the reconstructed entity, and obtain the geometric center coordinates and spatial envelope radius of the 3D bounding box. Configure the settlement module to obtain the original three-dimensional coordinates of the dimension annotation to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Configure an expansion module to obtain the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector and the spatial envelope radius; The view output module is used to move the dimension annotation to the design dimension position and generate a view output drawing.

[0083] It should be noted that each functional module in this embodiment is used to execute the corresponding method steps in the foregoing embodiments, and can be implemented in the form of a software program, a plug-in functional unit, or a functional component that works in conjunction with the underlying interface of the 3D model software.

[0084] Specifically, the feature capture module is used to traverse the feature tree of the 3D model file, record the model file to which each node belongs, its configuration, and the node hierarchy path, and obtain the type information, node name, node identifier, current parameter value, and interface access identifier of each node. The feature capture module is also used to determine whether each node belongs to a size node, feature node, or array node based on the type information, and retain size nodes, feature nodes, and / or array nodes, while filtering out the remaining nodes to form driving feature variables.

[0085] The rule configuration module is used to retrieve whether the feature markers in the rule expression are completely closed based on the regular expression, and to query the string fields inside the feature markers in the control information table and the driving feature variable table respectively, so as to perform bidirectional matching and verification based on the field name, data type and written object; the rule configuration module is also used to replace the string fields in the rule expression with the corresponding control value or the current parameter value after the bidirectional matching and verification is successful, and to parse and solve the rule expression according to the preset operation priority, generate valid parameters and store them in the database.

[0086] The 3D reconstruction module is used to drive the solid model to complete reconstruction based on valid parameters and obtain the spatial envelope information of the reconstructed entity; the configuration settlement module and the configuration expansion module are used to calculate the design dimension position based on the original position of the dimension annotation, the coordinates of the geometric center, and the spatial envelope radius; the view output module is used to move the dimension annotation to the design dimension position and generate the view output drawing. Thus, the modules work together in the order of parameter extraction, rule verification, model reconstruction, annotation positioning, and drawing output, enabling the system to achieve automated processing of model reconstruction and dimension preview in actual parametric design scenarios.

[0087] Example 3: To make the technical solution in this invention clearer, this embodiment uses the SolidWorks environment as an example for more specific illustration, wherein: After SolidWorks loads the parametric design plugin corresponding to this embodiment, the system reads the project database file and opens the main model file to be configured. It then traverses the feature tree of the main model file and its associated part files through the SolidWorks underlying interface, recording the model file to which each node belongs, its configuration, and its node hierarchy path. Further, the system obtains the type information, node name, node identifier, current parameter value, and interface access identifier for each node, and determines whether each node belongs to a dimension node, feature node, or array node based on the type information.

[0088] For dimension nodes, feature nodes, and / or array nodes, the system generates dimension information, feature information, and array information respectively, and forms driving feature variables according to the model file to which they belong, the configuration to which they belong, the variable name, the variable type, the current parameter value, and the interface access identifier. For other nodes, they do not enter the subsequent rule expression configuration and legal parameter writing process. Thus, each driving feature variable can correspond to a specific model file, a specific configuration, and a specific model node, so that the subsequent rule expressions can accurately point to the specific model modification object. The main model file can be a general assembly file or a model file containing multiple parts and sub-assemblies.

[0089] After extracting the driving feature variables, the system obtains the corresponding rule expressions based on the interface control names maintained in the control information table of the interface design module. The interface control names specifically represent the device width, the number of mounting holes, the guide rail spacing, or whether a certain structure is enabled. The feature variable names specifically represent the written dimensions, features, or array objects. It can be understood that the rule expressions are used to establish the calculation relationship between the interface input items and the model driving objects. They are not simply writing the table values ​​directly into the dimension codes, but rather converting the business parameters input by the user into reconstruction parameters that the model can recognize.

[0090] In practice, the system first uses regular expressions to search for fully closed feature tags in the rule expression. If unclosed tags, illegal fields, or content that does not conform to the preset reference format are found, the parsing of the rule expression is stopped. Further, the system extracts the string fields within the feature tags and queries them in the control information table and the driving feature variable table. When a string field matches a UI control name in the control information table, the system reads the control value and data type corresponding to that UI control name. When a string field matches a feature variable name in the driving feature variable table, the system reads the variable type, the associated model file, the associated configuration, and the interface access identifier corresponding to that feature variable name. The system then performs a bidirectional matching check on the rule expression based on whether the field names are uniquely matched, whether the control data type corresponds to the variable type, and whether the interface access identifier points to a specific SolidWorks model object.

[0091] After the two-way matching verification is successful, the system replaces the string fields in the rule expression with the corresponding control values ​​or current parameter values, and performs parsing and evaluation according to the preset operation priority of parentheses first, and multiplication and division first over addition and subtraction. For example, when the control value corresponding to the equipment width needs to be converted into the beam length or hole array spacing, the system replaces the equipment width field with the corresponding control value and then performs numerical evaluation; when the control value of whether a certain structure is enabled is used to control the feature state, the system converts the evaluation result into the compressed state or restored state of the corresponding feature; when the number of workstations is used to control array objects, the system converts the evaluation result into the array number or array spacing. The parsed numerical parameters, feature on / off states, or array control parameters are stored as valid parameters in the valid parameter table. The valid parameter table records at least the rule expression identifier, interface control name, feature variable name, parameter value, parameter type, model file, configuration, and interface access identifier, and is used for calling during the model reconstruction stage.

[0092] During the model reconstruction phase, the system calls the SolidWorks API to write valid parameters into the corresponding dimensions, features, or array objects and triggers model regeneration. For example, when the device width and number of workstations are entered in the interface, the system generates valid parameters such as beam length, mounting hole spacing, and number of linear arrays according to rule expressions and writes them into the corresponding model variables. When a structure is enabled or disabled in the interface, the system can convert it into the compressed or restored state of the corresponding feature. In this way, the model reconstruction process relies on valid parameters that have been validated and verified through rule checks, reducing the risk of model reconstruction failure due to field mismatches, expression errors, or missing target variables.

[0093] After the model is reconstructed, the system obtains the smallest bounding box of the reconstructed entity in the 3D coordinate system and calculates the geometric center coordinates based on the minimum and maximum bounding coordinate values ​​of each coordinate axis. Simultaneously, it obtains the spatial straight-line distance from the geometric center coordinates to the boundary vertex point as the spatial envelope radius. Subsequently, the system reads the original 3D coordinates of the dimension annotation to be adjusted in SolidWorks, calculates the normalized unit direction vector of these original 3D coordinates relative to the geometric center coordinates, and forms the candidate design dimension positions for the dimension annotation based on the unit direction vector and the spatial envelope radius. It should be understood that the candidate design dimension positions represent the initial display positions of the dimension annotation after expanding outward according to the entity's current envelope scale, rather than the actual design dimension values ​​of the model entity.

[0094] In actual assembly models, multiple dimension annotations may be concentrated near the same side plate, the same mounting surface, or the same array area. If only one outward expansion is performed based on the geometric center, unit direction vector, and spatial envelope radius, although the annotations can be moved away from the entity outline, multiple annotations in the same direction may still result in text overlap, leader line intersection, or local congestion in the output view. To solve this problem, in a preferred embodiment, after obtaining the positions of candidate design dimensions, the system further groups the dimension annotations to be adjusted according to the angle between unit direction vectors or the similarity of principal axis directions. For multiple dimension annotations within the same direction group, the system obtains the text occupancy range and leader line occupancy range of each dimension annotation, and determines whether there is an occupancy conflict between the positions of each candidate design dimension in conjunction with the preset view direction.

[0095] When there is no conflict of occupancy, the system directly uses the candidate design dimension position as the design dimension position of the dimension annotation; when there is a conflict of occupancy, the system generates at least one layered expansion position along the expansion direction corresponding to the unit direction vector without changing the association between the dimension annotation and the original annotated model object, or adds offset compensation in the tangential direction perpendicular to the expansion direction, so that the dimension annotations in the same direction group form an internal and external layered or left and right misaligned display effect.

[0096] The layered outward expansion position is determined based on the spatial envelope radius and the preset annotation spacing. The tangential offset compensation can be determined based on the number of annotations in the same group, the text width, and the preset minimum interval. Thus, the design dimension position obtained by the system is no longer just a single radial outward shift point, but the final display position after being constrained by the entity envelope and the annotation occupancy relationship.

[0097] When generating the view output drawing, the system calls the SolidWorks underlying interface to switch to the preset view and performs overall adaptive scaling to ensure that the reconstructed solid model and the dimensions after layered expansion are both within the appropriate display range for output. Subsequently, the system calls the annotation object position setting interface to move the display position of the dimensions to the finally determined design dimension position, and adjusts the dimension text style according to the project configuration. Finally, the view output drawing is generated. The dimension text style can include dimension name, dimension value, font size, annotation direction, and leader display method, so that the output drawing can reflect the parameter results after model reconstruction while maintaining the readability of the dimensions.

[0098] It is understood that this embodiment does not simply batch assign SolidWorks dimensions through external databases or tables, nor does it merely synchronously modify parameters in 3D and 2D plots. Instead, before writing parameters, it ensures the reliability of legitimate parameter sources through symbol verification of regular expressions and bidirectional correlation checks. After model reconstruction, it redetermines the spatial display position of dimension annotations by combining the 3D bounding box, geometric center coordinates, spatial envelope radius, unit direction vector, and occupancy relationship of same-direction annotations. This embodiment simultaneously improves the stability of parametric reconstruction and the readability of the output view drawings, making it particularly suitable for parametric design scenarios of non-standard automated equipment and complex assemblies with dense dimension annotations, frequent specification changes, and the need for rapid generation of preview drawings.

[0099] Example 4: Based on the same inventive concept as the foregoing embodiments, this embodiment provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the parametric design method of a three-dimensional model software.

[0100] Example 5: Based on the same inventive concept as the foregoing embodiments, this embodiment provides a computer-readable storage medium storing a computer program, which is executed by a processor to implement the parametric design method of a three-dimensional model software.

[0101] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0102] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a multimedia terminal device (which may be a mobile phone, computer, television receiver, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0104] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method of parametric design of a three-dimensional model software, characterized in that, The method includes the following steps: Extract the driving feature variables from the 3D model file and obtain the regular expression containing the interface control name and feature variable name; The symbol matching specification of the rule expression is verified according to the regular expression, and after the two-way verification of the correct association, the legal parameters for reconstructing the model are generated. The three-dimensional solid model is reconstructed based on the legal parameters, the minimum bounding box of the reconstructed entity is obtained, and the geometric center coordinates and spatial envelope radius of the bounding box are obtained. Obtain the original three-dimensional coordinates of the dimension to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius, the design dimension position of the dimension annotation is obtained through spatial expansion logic; Move the dimension annotation to the design dimension position and generate a view output drawing.

2. The method of claim 1, wherein, The extraction of driving feature variables from the 3D model file includes: Traverse the feature tree of the 3D model file and record the model file, configuration, and node hierarchy path of each node in the feature tree; Obtain the type information, node name, node identifier, current parameter value, and interface access identifier of each node in the feature tree; Based on the type information, determine whether each node belongs to a size node, feature node, or array node, and retain size nodes, feature nodes, and / or array nodes, while filtering out the remaining nodes; The retained size nodes, feature nodes, and / or array nodes are used to generate size information, feature information, and array information respectively, and the driving feature variables are formed according to the model file, configuration, variable name, variable type, current parameter value, and interface access identifier.

3. The method of claim 1, wherein the parameterized design of the three-dimensional model software is performed by a computer program. The step of verifying the symbol matching specification of the regular expression based on the regular expression, and after two-way verification of the correct association, parsing and generating legal parameters for reconstructing the model, includes: Based on the regular expression, retrieve whether the rule expression contains a completely closed feature tag; Extract the string fields inside the feature markers, and query the string fields in the control information table and the driving feature variable table respectively; When the string field matches the name of the interface control in the control information table, the corresponding control value and control data type are obtained; When the string field matches the feature variable name in the driver feature variable table, obtain the corresponding variable type, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier. Based on the type correspondence between the control data type and the variable type, and the write object correspondence between the feature variable name, the model file to which it belongs, the configuration to which it belongs, and the interface access identifier, a two-way matching and verification is performed; When the matching results of the two-way matching check are completely consistent, the string field in the rule expression is replaced with the corresponding control value or the current parameter value, and the replaced rule expression is parsed and solved according to the preset operation priority to generate legal parameters for reconstructing the model; The valid parameters are stored in the database according to the rule expression identifier, interface control name, feature variable name, parameter value, parameter type, model file, configuration, and interface access identifier.

4. The parametric design method for 3D modeling software as described in claim 1, characterized in that, The step of obtaining the minimum bounding box of the reconstructed entity and obtaining the geometric center coordinates and spatial envelope radius of the bounding box includes: Obtain the minimum and maximum limit coordinate values ​​of each coordinate axis of the reconstructed entity in the three-dimensional coordinate system; The minimum and maximum limit coordinate values ​​of each coordinate axis are obtained separately, and the average values ​​are combined to obtain the coordinates of the geometric center. Obtain the spatial straight-line distance from the geometric center coordinates to the boundary vertex point, and use the spatial straight-line distance as the spatial envelope radius.

5. The parametric design method for 3D modeling software as described in claim 1, characterized in that, The calculation of the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates includes: The differences between the original three-dimensional coordinates and the geometric center coordinates on each coordinate axis are obtained respectively; Obtain the spatial span distance from the original three-dimensional coordinates to the geometric center coordinates; The differences on each coordinate axis are normalized with the spatial span distance to obtain the normalized unit direction vector.

6. The parametric design method for 3D modeling software as described in claim 1, characterized in that, The step of obtaining the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector, and the spatial envelope radius includes: Multiply the components of the unit direction vector on each coordinate axis by the spatial envelope radius to obtain the outward displacement compensation value for each axis. The outward displacement compensation values ​​of each axis are respectively superimposed onto the axial coordinate values ​​of the geometric center coordinates to obtain the design dimension position of the dimension annotation.

7. The parametric design method for 3D modeling software as described in claim 1, characterized in that, The step of moving the dimension annotation to the design dimension position and generating a view output drawing includes: Call the underlying interface of the 3D modeling software to switch to the preset view and perform overall adaptive scaling; Call the annotation object position setting interface to move the display position of the dimension annotation to the design dimension position; Adjust the size text style and generate a view output drawing.

8. A parametric design system for 3D modeling software, characterized in that, The system includes: The feature capture module is used to extract driving feature variables from 3D model files and obtain regular expressions containing interface control names and feature variable names; The rule configuration module is used to verify the symbol matching specification of the rule expression according to the regular expression, and after the two-way verification of the association is correct, parse and generate legal parameters for reconstructing the model; The 3D reconstruction module is used to drive the reconstruction of the 3D solid model according to the legal parameters, obtain the minimum bounding box of the reconstructed entity, and obtain the geometric center coordinates and spatial envelope radius of the 3D bounding box. Configure the settlement module to obtain the original three-dimensional coordinates of the dimension annotation to be adjusted, and calculate the normalized unit direction vector of the original three-dimensional coordinates relative to the geometric center coordinates; Configure an expansion module to obtain the design dimension position of the dimension annotation through spatial expansion logic based on the geometric center coordinates, the unit direction vector and the spatial envelope radius; The view output module is used to move the dimension annotation to the design dimension position and generate a view output drawing.

9. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a parametric design method for a three-dimensional model software as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the parametric design method of the three-dimensional model software as described in any one of claims 1-7.