Programmed three-dimensional model generation method and system based on visual language model closed loop comparison
By establishing component structure contracts and multi-view comparisons, the problem of unclear script execution boundaries in procedural 3D modeling was solved, enabling component-level modifications and assembly-level reviews, thus ensuring the stability and accuracy of the generated results.
Patent Information
- Application Number
- CN202611275765.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-20
AI Technical Summary
In existing procedural 3D modeling techniques, the execution boundaries of scripts are unclear, the generated results are difficult to modify according to components, single-view matching may result in thin-film models, and subsequent iterations are prone to destroying already qualified structures.
By acquiring reference information of the target object, a component structure contract containing named parts is established. A procedural modeling script is generated using a visual language model. Candidate review results are formed through multi-view comparison and assembly-level review. Items that fail the review are located and the script is iteratively modified until the preset generation requirements are met.
It achieves the ability to limit script execution boundaries, suppress single-view thin-film results, identify component assembly defects, and reduce the rollback of qualified results in subsequent iterations while retaining procedural scripts and component editing capabilities.
Smart Images

Figure CN123141702A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of procedural 3D modeling and automatic 3D model generation technology, and in particular to a procedural 3D model generation method and system based on closed-loop comparison of visual language models. Background Technology
[0002] Procedural 3D modeling constructs 3D objects by pre-setting modeling primitives, parameters, and combination rules. The generated results can usually be modified and are suitable for objects with clearly defined components or parametric structures, such as furniture, buildings, vehicles, vegetation, and rocks. With the development of image understanding and code generation capabilities of visual language models, existing solutions can generate modeling software scripts based on reference images or text descriptions, or directly generate 3D representations such as meshes, voxels, and implicit fields.
[0003] While directly outputting baked meshes or implicit representations can produce visual results, the semantics, parameters, and generation process of the components are usually not preserved, making it difficult to subsequently modify specific components such as handrails, casters, and window frames. Using general-purpose scripts can retain some editing capabilities, but the generated scripts have access to many host objects and interfaces, making execution time, recursion scale, and random results difficult to control. Furthermore, when the script fails, it is difficult to accurately pinpoint the problem to a specific component.
[0004] In automatic evaluation based on reference images, comparing only one reference viewpoint can easily lead to candidate models having high contour similarity for that viewpoint, while lacking the necessary thickness in side or top views, resulting in 3D results that resemble thin sheets. Performing geometric quality checks on only a single mesh also makes it difficult to simultaneously identify issues such as suspension, gaps, overlapping surfaces across components, seal failures, and incorrect connection relationships between multiple named parts.
[0005] Furthermore, 3D objects typically require gradual refinement, starting with the main body block, structural connections, shape details, materials, and appearance. If there are no executable stage constraints between generation rounds, subsequent modifications to improve local details or color similarity may cause the already achieved main body outline, proportions, or assembly relationships to regress. Therefore, how to limit script execution boundaries while retaining procedural scripting and component editing capabilities, forming locatable feedback through multi-view comparison and assembly-level review, and ensuring the stability of approved structural indicators in subsequent iterations, is a technical problem that needs to be solved in this field. Summary of the Invention
[0006] The purpose of this invention is to provide a procedural 3D model generation method and system based on closed-loop comparison of visual language models, in order to solve the problems of unclear script execution boundaries, difficulty in modifying the generated results by component, the possibility of forming thin-film models by single-view matching, and the easy destruction of qualified structures by subsequent iterations in the existing procedural 3D model automatic generation process.
[0007] To achieve the above objectives, the present invention adopts the following technical solution.
[0008] In a first aspect, the present invention provides a procedural 3D model generation method based on closed-loop comparison of visual language models, comprising: Obtain reference information for the target object and establish a component structure contract containing named components; A procedural modeling script is generated based on the component structure contract using a visual language model; The procedural modeling script is executed to obtain candidate 3D models, and the candidate 3D models are reviewed based on the reference information to form candidate review results; The failed items in the candidate review results are located to the corresponding named components and script modification feedback is generated; Based on the script modification feedback, iterate the procedural modeling script until the candidate 3D model meets the preset generation requirements, and output the final procedural modeling script and the final 3D model.
[0009] Optionally, the step of obtaining reference information of the target object and establishing a component structure contract includes: the reference information includes a reference image, a text description, or a combination of a reference image and a text description; when the reference information includes a reference image, the reference image is cropped, centered, and scaled, and a reference viewpoint is determined; based on the reference information and the reference image processing result obtained when the reference information includes a reference image, the visual language model is used to obtain structured component information for establishing the component structure contract.
[0010] Optionally, the step of establishing a component structure contract includes: registering semantic names, geometric attributes, parent component identifiers, connection methods, required markers, and quantity requirements for each named component, and constructing an assembly drawing based on the parent component identifier and the connection method; setting an attachment contract for named components with parent-child relationships, wherein the attachment contract includes allowed connection types and allowed gaps.
[0011] Optionally, the step of generating a procedural modeling script includes: setting generation stage constraints and a preset set of closed-vocabulary primitives; inputting the component structure contract and the generation stage constraints into the visual language model, and having the visual language model select modeling primitives from the preset set of closed-vocabulary primitives to generate a restricted domain-specific language script; the restricted domain-specific language script associating named components with corresponding meshes through component declarations.
[0012] Optionally, the step of executing the procedural modeling script includes: executing the restricted domain-specific language script in a restricted sandbox, wherein the restricted sandbox only opens the preset closed vocabulary primitive set, the deterministic random number interface, and the operation count guard, and restricts calls to the file system, network, and dynamic code construction interfaces; setting an operation budget and execution timeout for the restricted domain-specific language script; and generating a deterministic pseudo-random number for the restricted domain-specific language script to call based on the user seed.
[0013] Optionally, the reference information includes a reference image, and the step of forming a candidate review result includes: determining a reference viewpoint based on the reference image, and rendering the candidate 3D model from the reference viewpoint and at least one auxiliary viewpoint to obtain a candidate view set; calculating a view matching index based on the candidate view set and the reference image, and determining a cross-view stereoscopic index based on the foreground footprint under different viewpoints.
[0014] Optionally, the step of forming candidate review results further includes: performing assembly relationship detection on the candidate 3D model based on the component structure contract; identifying suspended components according to the contact relationship between named components; identifying assembly-level overlapping surfaces according to the approximately coplanar surfaces belonging to different named components and having projected overlap; and writing the assembly relationship detection results into the candidate review results.
[0015] Optionally, the step of generating script modification feedback and iterating the procedural modeling script includes: setting multiple preset generation stages in a coarse-to-fine order, and recording the pass threshold, locking index, rollback tolerance, and allowable modification range of each preset generation stage through a stage contract; performing stage gating on candidate 3D models according to the stage contract, saving candidate 3D models that pass the stage gating as the current optimal model, and determining the locking index that the current optimal model has met as the locked index; for subsequent candidate 3D models in any preset generation stage, passing the stage gating only when the pass threshold of the preset generation stage is reached and the reduction of the locked index does not exceed the rollback tolerance corresponding to the preset generation stage; when a subsequent candidate 3D model fails the stage gating, locating the failed item in its candidate review result to the script parameter of the corresponding named component to form a feedback instruction as the script modification feedback, the feedback instruction being used to modify the procedural modeling script corresponding to the current optimal model.
[0016] Secondly, the present invention provides a programmatic 3D model generation system based on closed-loop comparison of visual language models, comprising: A reference processing module is used to obtain reference information of the target object; a structural contract generation module is used to establish a component structural contract containing named components based on the reference information. The script generation module is used to generate a procedural modeling script based on the component structure contract using a visual language model; The execution module is used to execute the procedural modeling script to obtain candidate 3D models; The closed-loop review module is used to review the candidate 3D model based on the reference information and form a candidate review result. The feedback and output module is used to locate the failed items in the candidate review results to the corresponding named components, form script modification feedback and provide it to the script generation module to iterate the procedural modeling script, and output the final procedural modeling script and the final 3D model when the candidate 3D model meets the preset generation requirements.
[0017] Optionally, the execution module executes the procedural modeling script in a constrained execution environment; the system further includes a rendering module and a stage control module, the rendering module performs multi-view rendering of the candidate 3D model and obtains multi-view rendering results, the closed-loop review module performs view comparison based on the reference information and the multi-view rendering results, and performs assembly relationship detection based on the component structure contract, the stage control module performs stage gating according to the candidate review results; the feedback and output module converts the failed items in the candidate review results into structured feedback instructions containing component semantic names and target parameters, and provides the structured feedback instructions as script modification feedback to the script generation module.
[0018] The present invention has achieved the following beneficial effects: This invention establishes a component-level correspondence between reference information, procedural modeling scripts, and candidate 3D models through a component structure contract that includes named components. Based on the candidate review results, failed items are located to their corresponding named components, forming script modification feedback. This allows the visual language model to perform closed-loop iterations around locatable components, reducing redundant reconstruction of irrelevant parts. Furthermore, through restricted execution, multi-view review, assembly relationship detection, and stage gating, the script execution boundaries can be limited, single-view thinning results can be suppressed, component assembly defects can be identified, and the rollback of already successful results in subsequent iterations can be reduced. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the overall process of a procedural 3D model generation method provided in an embodiment of the present invention. Figure 2 The flowchart for structuring reference information and generating component structure contracts is provided for embodiments of the present invention. Figure 3 This is a schematic diagram of the restricted domain-specific language script generation and sandbox execution structure provided in an embodiment of the present invention; Figure 4A flowchart of multi-view comparison and assembly-level review provided for embodiments of the present invention; Figure 5 A flowchart of staged contract locking and candidate gating provided for embodiments of the present invention; Figure 6 This is a schematic diagram of the structure of a programmatic 3D model generation system provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will now be described in conjunction with the accompanying drawings. The embodiments described are for illustrating the implementation of the present invention and are not intended to limit the scope of protection of the present invention. Where there is no conflict, the following embodiments and their technical features can be combined with each other.
[0021] In this embodiment, the target object refers to furniture, buildings, vehicles, vegetation, rocks, or other three-dimensional objects that can be decomposed into several parts and expressed parametrically, which need to be generated based on reference information. The reference information can be one or more reference images, text descriptions, or a combination of both. A candidate 3D model refers to a 3D model formed after a script execution and awaiting review; the current optimal model refers to a candidate 3D model that has passed the candidate gating and has been saved as the benchmark for the next round of comparison. The candidate gating is a candidate pass / rejection judgment mechanism in the stage gating, that is, determining whether a newly generated candidate can be accepted based on the candidate review results and the current stage contract; the specific rules are explained in step S104.
[0022] For ease of understanding of the following steps, the "contract" in this specification is not a legal contract, but rather a set of rules and constraints that can be read and executed by the program, specifying the fields and conditions that components, stages, or connections must satisfy. A component structure contract is a data structure used to describe the named components, geometric attributes, and assembly requirements expected to be included in the target object. Each target component registered in the component structure contract is referred to below as a "contract component." Contract components can be distinguished as required or non-required components by "requirement tags," where required components represent contract components that the candidate model must generate and pass the matching check.
[0023] Corresponding to the pre-registered contract components, the procedural modeling script will actually generate several component meshes after execution. The script associates explicit semantic names with these meshes through component declarations; these actually generated components are referred to below as "candidate named components." Therefore, "contract components" represent the target requirements specified before generation, while "candidate named components" represent the actual results after generation. Subsequent matching of candidate named components with contract components involves checking the actual generated results against the preset target requirements one by one to determine whether components are missing, whether the quantity is met, and whether the position, size, and assembly relationships meet the requirements.
[0024] Stage constraints are carried out by stage contracts corresponding to the current generation stage. The stage contract records the evaluation metrics required for that stage, the pass threshold, locked metrics, allowed rollback range, and the range of parameters allowed for modification in the next round. The preset generation requirements in this specification refer to pre-defined conditions used to determine whether a candidate 3D model can be used as the output result. These can consist of one or more candidate review metrics, structural conditions, or stage pass conditions. In the staged implementation described later, a candidate 3D model is considered to meet the preset generation requirements if it passes all preset generation stages. The procedural modeling script is an executable or interpretable script that calls modeling primitives and constructs named components. This embodiment uses a restricted domain-specific language script, abbreviated as a restricted DSL script; the restricted execution environment uses a restricted sandbox. Candidate review results can be carried out by a candidate review report. The visual language model is used to understand the reference image and text requirements and generate or modify the procedural modeling script according to the specified output mode.
[0025] The “normalized reference image” mentioned later is an image formed after the original reference image has been processed by subject extraction, cropping, centering and scaling. The specific processing procedure is explained in step S101. The “object category candidate” is one or more possible object categories that the system initially judges based on the reference information.
[0026] This invention uses a trained visual language model as a component for image-text understanding and structured script generation. The model training process is not part of the processing flow of this invention. The data fed into the model is organized according to fixed fields, including task identifier, object category candidates, normalized reference image and its additional channels, component structure contract, current stage number, stage contract, current optimal script, locked indicators, and feedback instructions from the previous round. When generating the model for the first time, there are no historical scripts available for modification; therefore, the current optimal script and feedback fields are set to empty.
[0027] The output of the visual language model also adopts a constrained structured form. Specifically, the abstract syntax tree is used to represent the modeling operations in the script and their sequence by nodes; component declarations are used to associate semantic component names with the actual generated mesh objects; and the parameter update table records which parameter of which component needs to be modified later, along with the values before and after the modification. Component identifiers in the output must correspond to contract components already registered in the component structure contract, or to components explicitly required to be added by feedback instructions. Before performing geometry operations, the parser checks field integrity, data type, value range, and reference relationships; if the checks fail, it only returns the error fields and allowed value ranges and requires regeneration, without performing geometry operations.
[0028] Reference Figure 1As shown, this embodiment is implemented in the following order, specifically including: Step S101, obtaining reference information of the target object and establishing a component structure contract containing named components; Step S102, generating a procedural modeling script based on the component structure contract using a visual language model; Step S103, executing the procedural modeling script to obtain candidate 3D models, and reviewing the candidate 3D models based on the reference information to form candidate review results; Step S104, locating the failed items in the candidate review results to the corresponding named components and forming script modification feedback; Step S105, iterating the procedural modeling script according to the script modification feedback until the candidate 3D models meet the preset generation requirements, and outputting the final procedural modeling script and the final 3D model. The above steps revolve around the same set of named components to pass reference information, scripts, candidate models, review results, and modification feedback, so that the candidate review results can be mapped to specific components in the procedural modeling script.
[0029] Step S101 is further refined. The step of obtaining reference information of the target object and establishing a component structure contract includes reference information normalization and structured component information generation. Specifically, the system receives a reference image, text description, or a combination of reference image and text description. For the reference image, the main body mask of the target object is first extracted. Based on the main body mask, the main body bounding box is determined. After cropping to the main body bounding box, the main body is centered and scaled proportionally to a preset square canvas along its long side. The main body mask can be obtained through color saturation, brightness difference, semantic segmentation, or interactive annotation. When the main body in the reference image has a distinct color while the background and ground are close to gray, an initial mask can be generated using a saturation threshold, and then the main body region can be preserved through connected component filtering and morphological closing operations. In this paper, the process of extracting the main body mask and cropping, centering, and scaling the main body region proportionally is collectively referred to as reference image normalization processing. The image obtained after this processing is called a normalized reference image.
[0030] When generating the initial mask using a saturation threshold, the image is first converted to the HSV color space, and a border strip with a width of 5% of the short side of the canvas is selected as the background sampling area. To enable the threshold to adapt to fluctuations in background color, the saturation threshold is determined using the following formula: ; Among them, the median background saturation Median saturation of each pixel within the background sampling area; absolute deviation of median background saturation. This indicates the background sampling area saturation relative to the median of the background saturation. Median absolute deviation; saturation threshold This represents the saturation threshold used to distinguish candidate foreground from background; clip(·) restricts the calculation results to a given upper and lower limit range.
[0031] Using the above saturation threshold During initial segmentation, the absolute difference between the median brightness of candidate foreground pixels and the background is required to be no less than 0.08 to avoid misclassifying the background as foreground based on slight color fluctuations. Connected components with an area less than 0.1% of the canvas area are deleted. The radius of the closing structuring element is set to 0.3%–1.0% of the shorter side of the subject's bounding box to remove scattered noise and close small gaps within the subject. If the initial foreground area is less than 1% of the canvas area or greater than 95%, the color thresholding method is deemed unsuitable for the current image, and semantic segmentation or interactive annotation is used instead to avoid forcibly applying color rules to low-saturation objects or complex backgrounds.
[0032] After the above reference image normalization process, the resulting normalized reference image can reduce the impact of the original image's white space ratio and resolution differences on subsequent silhouette scoring. Based on this, the system also estimates the apparent camera viewpoint according to the pixel quality distribution of the subject mask in the vertical and horizontal directions. For example, when the horizontal quality distribution is approximately symmetrical and the vertical contour perspective changes are small, it can be marked as a frontal, level view; when one side's area increases significantly, a left-forward or right-forward oblique view cue can be generated. These viewpoint cuees, along with the normalized reference image, are input into the visual language model to reduce ambiguity regarding the object's orientation.
[0033] To transform the aforementioned perspective cues (frontal view, left frontal view, or right frontal view) into repeatable judgment rules, the system first uses the area difference between the left and right sides of the main body mask to describe the degree of horizontal asymmetry. The main body mask is divided into left and right halves along the vertical centerline, and the left-right asymmetry is calculated using the following formula: ; Among them, left-right asymmetry This indicates the degree of asymmetry in the foreground area on the left and right sides of the subject mask; the number of foreground pixels in the left half of the region. This indicates the number of foreground pixels to the left of the vertical center line; and the number of foreground pixels in the right half of the region. This indicates the number of foreground pixels to the right of the vertical center line.
[0034] Left-right asymmetry In addition, the system divides the main body's bounding box into eight equal strips along its height. The vertical perspective is obtained by dividing the difference between the average foreground width of the top two strips and the bottom two strips by the maximum width of the main body. When the left and right asymmetry Not greater than 0.08 and vertical perspective When the value is no greater than 0.12, it indicates that the main subject is relatively evenly distributed horizontally and has little vertical perspective variation, therefore it is marked as a frontal, level view; when the horizontal asymmetry is less than 0.12, it indicates that the main subject is relatively evenly distributed horizontally and has little vertical perspective variation, therefore it is marked as a frontal, level view; When the value is greater than 0.08, a corresponding left or right anterior strabismus prompt is generated based on the side with the larger foreground area. The judgment thresholds of 0.08 and 0.12 mentioned above can be calibrated using manually confirmed samples of similar objects within the range of 0.05-0.15, and remain unchanged after the start of the same generation task to avoid changes in the perspective judgment caliber during iteration.
[0035] After completing reference image normalization and apparent camera viewpoint estimation, the system can also use additional channels corresponding to the reference image to distinguish between geometric and material variations. For example... Figure 2 As shown, when the reference image has a material map, normal map, depth map, or corresponding channels that can be obtained through conventional image processing, the system aligns each channel with the normalized reference image. The material channel reflects color and texture variations, the normal channel reflects local surface orientation, and the depth channel reflects relative distance. If a feature appears only in the material channel, but the normal and depth channels do not show corresponding changes, it is preferentially marked as a surface texture feature; if both the normal and depth channels show changes, it is preferentially marked as a convexity, depression, or thickness variation that needs to be expressed by geometry. For reference images without additional channels, the corresponding fields are marked as unknown, and the lack of additional channels is not used as a condition for rejection of generation.
[0036] To ensure that features in the additional channels correspond to the same spatial location in the normalized reference image, the material, normal, and depth channels use the same cropping frame, scaling ratio, and pixel coordinate transformation as the main image. For any candidate feature region, it is marked as a geometric feature if the median depth change reaches 2% of the effective depth span of the target object, or if at least 50% of the pixels within the region have a normal angle of 8° with the surrounding region; if the color or texture changes but neither of the above conditions is met, it is marked as a surface texture feature. The depth scaling threshold can be between 1% and 5%, and the normal angle threshold can be between 5° and 15°, calibrated according to the channel noise. This determination only decides whether the restricted DSL should call geometric primitives or material parameters, without changing the reference image itself.
[0037] After completing the reference information normalization, viewpoint estimation, and available channel alignment, step S101 proceeds to the component structure contract establishment process. This step further includes registering geometric attributes and assembly relationships for named components. Specifically, the system provides the visual language model with object category candidates, normalized reference images, viewpoint cues, textual requirements, and available additional channels, and requests it to output a complete list of structured components with preset fields. Each component records its component identifier, semantic name, geometric type, center position, size, orientation, material category, parent component identifier, connection method, required markers, minimum quantity, and matching confidence threshold. The connection method can include embedding, stacking, slot connection, hinge connection, surface contact, axial connection, and suspension connection.
[0038] To ensure consistent comparison of component positions and dimensions across different object sizes, a unified object coordinate system is used in the component structure contract: the center of the target object's bounding box is the origin, the horizontal x-axis corresponds to the horizontal direction of the reference image, the vertical z-axis corresponds to the vertical direction of the reference image, and the depth y-axis is opposite to the reference line of sight. All positions and dimensions are normalized by dividing by the longest side of the target object's bounding box. Depth dimensions that cannot be directly determined from a single image are marked as fields to be optimized. The initial value is taken as the median of the allowable range for the aspect ratio of the corresponding geometric primitive, and is corrected during auxiliary viewpoint review; this initial value is not directly added to the locking index. When the text description explicitly states the number of components, the textual count is used as the minimum number; when the text is not given, the number of instances that can be separated and identified in the reference image is used. When multiple images have occlusion conflicts, the maximum value of the confirmed counts from each viewpoint is used, and the unconfirmed portions are marked as quantities to be reviewed.
[0039] After the visual language model outputs a structured parts list, the system first performs field structure validation. If the validation passes, the list is used to generate a parts structure contract. If a field is missing, the data type is incorrect, the parent part does not exist, or the assembly relationship forms an invalid cycle, the corresponding erroneous field is returned to the visual language model for regeneration. After the field structure validation passes, an assembly drawing is created based on the parent part identifier and connection method, and the assembly drawing and parts list are written together into the parts structure contract. Taking a swivel chair as an example, the parts structure contract can register contract parts such as the seat cushion, backrest, armrests, support columns, five-star base, and casters. The seat cushion and five-star base are marked as required parts, and the minimum number of casters can be determined based on reference images or text requirements.
[0040] In the above relationship, required components are not a separate category of objects alongside contract components, but rather a status marker for contract components. For contract components marked as required, the system combines a minimum number of matches and a matching confidence threshold for judgment. A contract component is considered to meet the required component requirement only when the number of matches reaches the minimum number and the matching confidence reaches the corresponding threshold. In one embodiment, the matching confidence threshold is 0.7. Contract components not marked as required can exist as optional components or attachments. Through the above settings, the review results can pinpoint specific missing contract components, rather than simply outputting an overall insufficient similarity.
[0041] After the script execution generates candidate 3D models, the system enters a matching process of "verifying the actual generated parts against the pre-defined contract parts one by one." At this point, the actual generated parts in the candidate 3D models that have been bound to semantic names through part declarations are "candidate named parts," and the target parts pre-registered in the part structure contract are "contract parts." To determine whether a candidate named part can correspond to a contract part, the system calculates the matching confidence score by comprehensively considering the semantic name, geometric dimensions, normalized position, and assembly relationship. ; Among them, the matching confidence score represents the overall matching degree between the candidate named component and the contract component; the semantic name matching component represents the consistency of the semantic names of the candidate named component and the contract component; the geometric matching component represents the consistency of the geometric type and normalized dimensions of the candidate named component and the contract component; the positional matching component represents the proximity of the center positions of the candidate named component and the contract component; and the assembly relationship matching component represents the completeness of the parent component relationships, connection types, and quantity relationships already satisfied by the candidate named component. In the formula, 0.35, 0.30, 0.20, and 0.15 are the weights of the above four types of matching information, and the sum of the weights is 1.
[0042] Specifically, semantic name matching components The value is 1 if the semantic name of the candidate named component matches the contract name or registration alias, otherwise it is 0; geometric matching component Take the average of the geometric type differences and the relative deviations of each normalized dimension, and limit the result to 0-1. The position matching components are determined according to the following formula: ; Among them, the position matching component Indicates the degree of positional consistency between the candidate named component and the contract component; candidate-contract center distance. Represents the Euclidean distance between the center of the candidate named component and the center of the corresponding contract component; the length of the object's bounding box diagonal. This represents the diagonal length of the overall bounding box of the target object, used for scale normalization of the center distance; max(·) means taking the maximum value from the given values to ensure that the position matching component is not less than 0.
[0043] Assembly relationship matching components The matching process calculates the proportion of parent component relationships, connection types, and quantity relationships already satisfied by the candidate named component, relative to the total number of relationship items registered in the component structure contract for the corresponding contract component. By jointly matching these four types of information, it avoids misidentifying the actual generated component solely based on the same component name, and also avoids ignoring assembly relationships based solely on geometric similarity. The default value for the matching confidence threshold is 0.7, which can be selected within the range of 0.65–0.85. When there are existing manual confirmation records for similar objects, the lowest threshold that can exclude false matches and retain confirmed components should be selected; when no confirmation records have been accumulated, 0.7 should be used.
[0044] For contract components with parent-child relationships in the component structure contract, the system further establishes an appendix contract to constrain their connection relationships. The appendix contract is a set of connection constraints for the relevant parent-child components in the component structure contract, and at least records the allowed connection type, connection surface, target gap, allowed gap, and attitude constraints.
[0045] For gap constraints in the attachment contract, the system uses the minimum signed distance between the parent component surface and the child component connection surface as the actual attachment gap. Actual Attachment Gap A positive value is taken when the two surfaces separate, and a negative value is taken when the two surfaces intersect, representing the maximum penetration depth. To ensure the allowable clearance adapts to both component dimensions and mesh sampling accuracy, the allowable clearance is determined using the following formula: ; Among them, allowable gap This indicates the maximum clearance allowed between the connection surfaces of the parent and child components in the appendix contract; clearance ratio factor. Indicates the allowable clearance ratio relative to the parent component size; minimum size of the parent component. This represents the minimum dimension of the parent component's bounding box in three directions; the mesh surface sampling step size. This represents the spatial step size between adjacent sampling points when performing surface distance detection; max(·) represents the larger value between the gap determined by the component size and the gap determined by the sampling accuracy.
[0046] The gap ratio coefficient The default value is 0.02, which can be set within the range of 0.005 to 0.05 depending on the connection type. The above allowable clearance should be used. This prevents the allowable clearance for small objects from approaching zero as the size scales, while also preventing the allowable clearance from falling below the distance that the mesh can stably resolve. The target clearance for surface contact, stacking, and embedded connections is zero; hinges, axial connections, and suspension connections can have non-zero target clearances and axial directions registered in the appendix contract. Attitude constraints are expressed as the included angle of the connecting axis and the included angle of the connecting surface normal, with a default allowable angular deviation of 5°, adjustable within the range of 3°–10° according to component size and mesh resolution.
[0047] After completing step S101 and obtaining the component structure contract, proceed to step S102. In this embodiment, when refining step S102, further set generation stage constraints corresponding to the current generation stage, and input the component structure contract and generation stage constraints into the visual language model to generate a restricted DSL script and named component declarations. The named component declarations are used to establish a correspondence between the semantic component names in the component structure contract and the mesh objects actually generated by the script, so that subsequent reviews can locate the problem to a specific component. Specifically, the visual language model receives the component structure contract, the current generation stage, the stage contract, the current optimal script, and the feedback instructions from the previous round, and generates the current round script according to the syntax and output mode of the restricted DSL. The current optimal script may not be provided during the first generation; after entering the modification round, the visual language model is required to prioritize modifying the named components and parameters specified by the feedback instructions, and may not reconstruct locked components outside the modification range allowed by the stage contract.
[0048] To ensure the visual language model clearly understands which metrics need to be achieved in the current stage, which content is locked, and which parameters are still modifiable, the stage contract uses a field-based representation. These fields include at least: a stage identifier (stage_id), the required metrics for the current stage, the corresponding pass thresholds (pass_thresholds), the locked metrics (locked_metrics), the allowed rollback tolerances for each locked metric, and the set of mutable paths for parameters that can be modified in this round (mutable_paths). Here, "parameter path" is an address identifier in the script used to uniquely locate a specific modifiable field.
[0049] The parameter update table output by the model corresponds to the allowed modification range mentioned above, recording item by item the part identifier (part_id), the parameter path to be modified (parameter_path), the value before modification (old_value), the value after modification (new_value), and the reason for modification (reason_code). The parameter_path can only point to fields in mutable_paths that are allowed to be modified. When entering a script modification round, the parser first applies the modifications in the parameter update table to the abstract syntax tree of the current optimal script, and then regenerates the restricted DSL script, ensuring that the modification object proposed by the feedback instruction corresponds to a unique parameter position in the script.
[0050] Under the aforementioned stage constraints, such as Figure 3 As shown, the restricted DSL uses a closed-vocabulary primitive set, meaning the script can only call modeling operations pre-registered by the system. This closed-vocabulary primitive set is stored in a primitive registry, which is essentially a list of eligible modeling operations. Basic primitive primitives can include cuboids, spheres, cylinders, cones, tori, icosahedral spheres, and patches; combination and transformation primitives can include merge, translation, rotation, scaling, stretching, subdivision, surface subdivision, Boolean union, Boolean difference, and Boolean intersection; loft and sweep primitives can include sweep, loft, revolutionization, capsule, and rounded cuboids; cutting primitives can include plane cutting, circumcision, and path cutting; scatter primitives can include copy to point and Poisson scatter. For buildings, vegetation, roads, or vehicles, corresponding dedicated primitives can be added to the primitive registry. The visual language model can only select modeling primitives from the primitive registry; unregistered operators are rejected during the parsing phase. The purpose of using a closed vocabulary primitive set is to limit the modeling operations that the visual language model can generate to operators whose parameter types, value ranges, and resource counting methods are all known. This enables subsequent deterministic static verification and resource budgeting, and avoids the model generating arbitrary host code or calling uncontrolled operations.
[0051] While the visual language model selects modeling primitives to generate geometric meshes, the script associates semantic names with specific mesh objects through component declarations. Once this association is complete, the actually generated component can serve as a candidate named component for subsequent reviews. Each component declaration includes at least a semantic name and a mesh reference, and can also record modifiable parameters. For meshes not associated with semantic names through component declarations, the system treats them as unnamed meshes and assigns default names such as mesh_0, mesh_1, etc., according to the generation order. These default names cannot directly match the required components in the component structure contract; therefore, the visual language model needs to set explicit semantic names for the main components that require review and subsequent modification. Through this explicit association of "semantic name—mesh object," the candidate review report can directly indicate the specific component and its modifiable parameters, avoiding the problem of only obtaining "overall model dissimilarity" without being able to determine which mesh should be modified.
[0052] After completing the selection of modeling primitives and the declaration of components, each execution node in the restricted DSL must contain at least a primitive identifier, a component identifier, a parameter mapping, a local transformation, a parent node identifier, and an output mesh identifier. The primitive registry registers the parameter name, data type, allowed range, default value, input / output mesh type, operation counting method, and allowed generation stage for each primitive. Modifiable parameters in the component declaration directly reference the parameter path of the execution node, such as `seat.dimensions.z` or `armrest.transform.z`; target parameter data in the candidate review report is located to a unique execution node. If the same path is written to multiple nodes, static validation determines it as a conflict and rejects execution.
[0053] Before the script enters the restricted sandbox for actual geometric execution, the script generation module performs static validation on the restricted DSL script, checking syntax, primitive names, number of parameters, parameter types, uniqueness of part names, and parent-child part references. If static validation fails, geometric execution is not initiated; instead, the error location, error type, and allowed repair methods are written into a feedback instruction. After static validation passes, the parser organizes the script into a script execution plan consisting of several registered modeling operator nodes. Each node corresponds to a specific modeling operation, target part, and parameters, which are then executed sequentially by the sandbox execution module. By performing the above static validation before geometric execution, illegal primitives, incorrect parameter types, incorrect part references, and parameter path conflicts can be detected in advance, reducing the likelihood of errors being exposed during runtime, leading to difficulties in locating them or repeated execution.
[0054] In summary, step S102 transforms the component structure contract and current stage constraints formed in step S101 into a procedural modeling script with clearly defined semantic components, restricted modeling primitives, and locatable parameter paths. The technical advantages are twofold: firstly, the script can only generate geometric objects within the pre-allowed modeling capabilities; secondly, it preserves the correspondence between "which component is generated by which script parameter," thus providing a traceable basis for the restricted execution of step S103, component-level review, and targeted feedback modifications in step S104.
[0055] Step S102 generates and completes the static verification of the procedural modeling script, which then proceeds to step S103. Step S103 is further refined, comprising restricted execution, multi-view rendering, view index calculation, and assembly-level mesh review. During restricted execution, the sandbox execution module reads the primitive registry node by node according to the aforementioned script execution plan. Only modeling operators already registered in the registry can be executed; if an unregistered operator is encountered, the current script is immediately terminated. When executing each node, only the restricted DSL primitives, deterministic random number interfaces, and operation count guards required to complete the modeling operation are exposed to the script. Execution environment interfaces such as file systems, network access, dynamic code construction, module loading, and asynchronous timing are not exposed to the script, thus ensuring that the script can only run within the pre-defined modeling capabilities and resource limits.
[0056] In addition to restricting the callable interfaces, the restricted sandbox also needs to limit the computational resources that scripts can consume. When a script contains recursive modeling, scatter copying, continuous subdivision, or Boolean operations, the geometry may grow rapidly. Therefore, both operation budgets and timeouts are set: the operation budget limits the total number of geometric operations executed, and the timeout limits the actual time the script occupies the runtime environment. This prevents abnormal scripts from occupying computational resources for a long time from two dimensions.
[0057] The primitive registry records operation counting rules according to the actual geometric expansion scale: each generation or modification of a vertex, edge, or face counts as one basic operation, and each loop iteration, Boolean intersection test, and surface sampling counts as one additional operation. Before script execution, the estimated cost of each node is obtained based on the parameters of each execution node and the expected output scale, and then the estimated total cost of the script is obtained by the following formula: ; Among them, the estimated total cost This indicates the total estimated basic operations consumed by all execution nodes of the script; execution node number. Indicates the node number in the script execution plan; node estimated cost. Indicates the execution node sequence number The expected number of basic operations for each node is calculated based on its parameters and the expected geometric output size. The summation symbol indicates that all execution nodes in the script are summed.
[0058] After obtaining the estimated total cost, a certain margin is reserved for estimation errors and additional operations during runtime, and the operation budget is determined according to the following formula:
[0059] Among them, operating budget This represents the maximum number of basic operations that the current script is allowed to execute cumulatively in the restricted sandbox; the operation budget coefficient. This represents a percentage factor that allows for a margin of safety in the estimated total cost; estimated total cost This represents the total estimated basic operations of the script obtained from the previous formula; ceil(·) represents the floor function. The operation budget coefficients... The value can be selected within the range of 1.2 to 2.0, with a default value of 1.5; the operation budget... Further limit the range to 10,000,000–50,000,000 to avoid resource constraints becoming ineffective when the estimated value is abnormally high or when the budget is insufficient.
[0060] The operation budget limits "how many operations to perform," while the clock timeout limits "how long the actual operation lasts." When the runtime environment starts, registered primitives with stable computational overhead and known output size are selected from the primitive registry as baseline primitives. These baseline primitives are then executed, and the lower bound of the number of basic operations that can be stably completed per unit time is measured and used as the conservative processing rate. The clock timeout is determined according to the following formula: ; Among them, the wall clock timed out. This indicates the maximum actual runtime allowed for the current script from start to forced termination; operation budget. Indicates the maximum number of basic operations that the current script is allowed to execute; conservative processing rate. This represents the minimum stable number of operations processed per unit time obtained from actual measurements using benchmark primitives in the operating environment. The clock timeout is mentioned. The time limit is 2000-5000 milliseconds; the system reads the clock every 4096-32768 cumulative operations, with a default interval of 16383 times. When the actual number of operations exceeds the operation budget... Or the actual execution time exceeds the clock's timeout period. When the script is interrupted, the execution node where the interruption occurred is immediately stopped, thereby controlling high-frequency geometric expansion and handling situations where a single operation takes an unusually long time but the operation count has not yet exceeded the limit.
[0061] In addition to limiting the interfaces that scripts can call and resource consumption, the restricted sandbox also provides scripts with a deterministic pseudo-random number generator to ensure that the same script can repeatedly obtain consistent results under the same conditions. The user seed is first converted into the internal state values required by the pseudo-random number generator through a fixed state expansion algorithm, and then normalized random numbers are generated by a fixed random sequence algorithm. For different recursive modeling parts such as tree trunks, crowns, branches and leaves, rock blocks, or building attachments, the system deterministically derives mutually independent sub-random number streams from the main random number stream. Scripts cannot directly call the system clock or the system random source. Therefore, under the same conditions of runtime version, floating-point precision, primitive implementation, and user seed, multiple executions can obtain consistent random sequences and geometric results, facilitating screenshot comparison and problem review between different rounds.
[0062] To further prevent the random results of different components or recursive subsystems from being affected by the execution order, the system derives its respective random number substreams using a fixed identifier that does not change with the execution order. Specifically, the user seed, subsystem type, component identifier field `part_id`, and recursion level are concatenated and fed into a fixed 64-bit state expansion function. The resulting state serves as the initial state of the corresponding subsystem's random number substream. The state expansion function, random sequence algorithm, and implementation version are all written to the execution log. In this way, the same component always obtains the same random number substream under the same input conditions, and changes in the execution order of other components will not change their random results. If the runtime environment or primitive implementation version changes, the results of different versions are not directly compared for repeatability with the old candidates.
[0063] After completing the aforementioned restricted execution, if the script executes successfully, the sandbox outputs candidate 3D models, a named component parameter table, an execution log, and operation counts for each primitive. The named component parameter table records the actual position, size, orientation, and other modifiable parameters used by each candidate named component. If the script execution fails, it outputs the execution node where the error occurred, the number of operations consumed, the actual execution time, and the error type. For operation budget exhaustion or clock timeout, feedback instructions prioritize reducing recursion depth, decreasing the number of scatter points, reducing subdivision levels, or replacing high-overhead primitives, rather than regenerating components unrelated to the error.
[0064] After the sandbox execution successfully obtains candidate 3D models, step S103 continues with multi-view rendering. The multi-view rendering includes at least a reference view and an auxiliary view. The system first renders a candidate image of the reference view according to the apparent camera view corresponding to the reference image, and then selects an auxiliary view based on the object category. Furniture and vehicles can choose side, top, or oblique views; buildings can choose front, side, and bird's-eye views; vegetation and rocks can choose multiple oblique views distributed around the vertical axis. Each view uses the same canvas size, projection type, and background rules, and outputs a color map, a subject mask, and a depth map or normal map for subsequent geometric determination.
[0065] To enable direct comparison of rendering results from candidate models across different rounds under the same caliber, candidate models are placed in the object coordinate system according to the component structure contract before rendering, maintaining a vertical z-axis and aligning the center of the object's bounding box with the camera's view axis. When the reference image lacks camera intrinsics, orthographic projection is used, scaling the subject's bounding box to occupy 75%–85% of the short side of the canvas (default is 80%). When the reference image has significant perspective, perspective projection with an estimated field of view is used, and the field of view and camera distance are fixed throughout the task. The default auxiliary viewpoints for furniture and vehicles are a side view rotated 90° around the vertical z-axis relative to the reference direction, a top view with 90° pitch, and an oblique view with 45° azimuth and 25° pitch. Buildings, vegetation, and rocks are selected from orthographic directions using the same principles. All candidates use the same camera parameters, canvas size, and cropping rules to avoid gaining false score boosts by changing the lens. The auxiliary viewpoints are preferably side views, top views, and oblique views that are approximately orthogonal to the reference direction or have a large difference in the observation direction. This is to expose the thickness, component gaps, and connection relationships that may be obscured in the reference viewpoint. If the auxiliary viewpoint is too close to the reference viewpoint, it will be difficult to identify the sheet-like results that are similar in outline only in a single direction.
[0066] The aforementioned reference and auxiliary viewpoints serve different purposes: the reference viewpoint is used to determine whether the outline, composition, color, and main details are close to the reference information; the auxiliary viewpoint is used to determine whether the candidate model has actual thickness, whether the parts are floating, and whether there are obvious interpenetration or occlusion errors between different parts. When the auxiliary viewpoint does not require a corresponding real reference image, it can only participate in the judgment of cross-view stereoscopic effect, visibility, and assembly rationality.
[0067] After obtaining candidate views from each perspective, step S103 continues to calculate view metrics used to form the candidate review results. These view metric calculations include multi-view matching metrics and cross-view stereoscopic metrics. For the reference view, the system calculates at least the normalized silhouette intersection-over-union ratio (CIU), canvas silhouette CIU, edge matching metrics, bounding box CIU, center similarity, and color similarity. The normalized silhouette CIU is calculated after translating and scaling the candidate mask and reference mask to ensure their respective bounding boxes occupy a preset canvas proportion, thus reducing the impact of translation and scale differences. The canvas silhouette CIU is calculated in the original canvas coordinates to preserve composition and pose errors. These view metrics are not output independently and then the process ends; instead, they are collectively written into the candidate review results. Some metrics are directly used as passing conditions in the corresponding generation stage in step S104, while others are used to form the comprehensive score and positioning feedback described later, thereby connecting the multi-view rendering results to the gating of subsequent stages.
[0068] To quantitatively represent the degree of overlap between the candidate subject outline and the reference subject outline, the system calculates the silhouette intersection-union ratio using the following formula: ; Wherein, the silhouette intersection-union ratio function I(·,·) represents the ratio of the intersection area of the foreground regions of the candidate subject mask and the reference subject mask to the union area; the candidate subject mask Represents the binary mask of the subject obtained from the candidate render image; reference subject mask. Represents the subject binary mask obtained from the normalized reference image; foreground pixel counting function. Represents the mask variable The number of foreground pixels in the image is counted, where the mask variable... This represents any binary mask being counted. When the candidate subject mask... With reference subject mask When the union of the two sets is empty, the intersection-union ratio of the silhouettes is 0.
[0069] When calculating the normalized silhouette intersection-union ratio, candidate subject masks are taken respectively. and reference subject mask The axis-aligned bounding boxes are moved to the same center of the canvas and scaled proportionally to 80% of the canvas's short side, primarily for comparing outline shapes while minimizing the impact of original translation and scale differences. When calculating the canvas silhouette intersection-over-union ratio, the above translation and scaling are not performed to preserve the subject's compositional position and pose differences within the original canvas. The 80% normalization percentage can be set within the range of 70%–90%, but the same value is used for the reference mask and all candidates for the same task to ensure comparability of scores between different candidates.
[0070] Beyond silhouette area overlap, the system further utilizes edge matching metrics to determine whether candidate contour lines and reference contour lines fall in similar positions. Here, "edge precision" can be understood as "how many candidate contours can find a corresponding position near the reference contour," and "edge recall" can be understood as "how many reference contours can find a corresponding position near the candidate contour." To allow for a small pixel shift during edge extraction, the edge matching tolerance radius is first determined using the following formula: ; Among them, the edge matching tolerance radius This indicates the maximum pixel distance between candidate edge pixels and reference edge pixels, which can still be considered as corresponding pixels; the diagonal length of the canvas pixels. This represents the diagonal length of the current rendering canvas in pixels, used to adjust the tolerance according to the image resolution; round(·) indicates taking the nearest integer; max(·) indicates taking the larger value, thus ensuring that the edge matching tolerance radius is at least 1 pixel. The edge matching tolerance can be calibrated within the range of 0.3% to 1% of the canvas pixel diagonal length based on the edge extraction noise.
[0071] After determining the edge matching tolerance radius, if the distance from a candidate edge pixel to the nearest reference edge pixel is not greater than the tolerance, then the candidate edge pixel is recorded as a match; edge accuracy. The edge recall rate is calculated by dividing the number of matched candidate edge pixels by the total number of candidate edge pixels. Conversely, if the distance from a reference edge pixel to its nearest candidate edge pixel is not greater than this tolerance, then the reference edge pixel is considered covered; edge recall rate. The edge matching metric is calculated by dividing the number of covered reference edge pixels by the total number of reference edge pixels. The edge matching metric is determined by both the number of covered reference edge pixels by the following formula:
[0072] Among them, edge matching index Indicates the overall consistency between the candidate contour and the reference contour within the tolerance range; edge accuracy. Represents the proportion of the candidate contour that corresponds to the reference contour; edge recall rate. This indicates the proportion of the reference contour that is covered by the candidate contour. Edge precision. Marginal recall rate and edge matching metrics The value range is 0-1; when the edge precision Marginal recall When the sum is 0, the edge matching index will be... Set it to 0. Using the harmonic average of the two can prevent the candidate contour from obtaining a high score when it only covers a small number of reference edges or generates a large number of extra irrelevant edges.
[0073] In addition to edge location, the system also uses bounding box intersection and union to evaluate whether the overall area occupied by the subject is consistent, and uses center similarity to evaluate whether the center position of the subject in the canvas is offset. Bounding box intersection and union The intersection-union ratio (IoU) of the candidate subject axis-aligned bounding box and the reference subject axis-aligned bounding box is used; the center similarity is calculated according to the following formula:
[0074] Among them, center similarity Indicates the degree of consistency between the center position of the candidate subject and the center position of the reference subject; candidate bounding box center coordinates. Indicates the center coordinates of the candidate subject's axis aligned with the bounding box; reference bounding box center coordinates. This indicates the center coordinates of the reference subject axis aligned with the bounding box; the length of the canvas pixel diagonal. Used to normalize the center distance; double vertical lines represent the Euclidean distance between the two center coordinates; max(·) is used to ensure that the center similarity is not less than 0. The bounding box intersection and comparison focuses on checking whether the overall position and scale of the subject are consistent, while center similarity is more sensitive to overall translation. Combining the two can reduce the situation where compositional offset is ignored based solely on the similarity of the outline shape.
[0075] In addition to contour, edge, bounding box, and center position, the system also uses color similarity to evaluate whether the overall color distribution of the candidate subject and the reference subject is consistent. Color similarity divides the subject pixels into twelve hue buckets every 30° of hue angle, and sets one achromatic bucket. Pixels with a saturation level below 0.1 or a brightness level below 0.08 are placed in the "no-color bucket." The weights for the remaining pixels within each bucket are the product of their saturation and brightness. After normalizing the candidate color histogram and the reference color histogram, the smaller values are taken from each bucket and summed to obtain the color similarity score between 0 and 1. Using a histogram instead of pixel-by-pixel comparison is to reduce the impact of local texture position changes on overall color judgment. The saturation threshold can be set in the range of 0.08–0.15, and the brightness threshold can be set in the range of 0.05–0.12 according to the exposure of the reference image, and fixed in the same task.
[0076] The aforementioned individual indicators reflect different aspects such as outline, edge, position, and color. To enable these indicators to directly enter the stage gating in step S104, this embodiment forms three types of scores in order from local to comprehensive: the canvas matching score is used to evaluate the overall matching situation under the original canvas coordinates; the shape score further combines the normalized silhouette result to emphasize the shape of the main body; and the basic comprehensive score combines color similarity as a basic score before adding cross-view stereoscopic constraints.
[0077] Canvas matching score is calculated using the following formula: ; Among them, canvas matching score This indicates the overall matching degree of the candidate view in terms of its outline, edges, overall occupied area, and center position in the original canvas coordinates; canvas silhouette intersection-over-combination ratio. This represents the intersection-union ratio (IoU) of the candidate silhouette and the reference silhouette without translation and scale normalization; edge matching metric. Indicates the degree of consistency between the candidate contour edges and the reference contour edges; bounding box intersection-union ratio. Indicates the degree of overlap between the bounding boxes aligned with the two subject axes; center similarity. This indicates the degree of consistency between the center positions of the two main entities. In the formula, 0.45, 0.25, 0.20, and 0.10 represent the weights of the corresponding indicators, and the sum of these weights is 1.
[0078] Based on the canvas matching score, to simultaneously consider the contour shape after eliminating translation and scale differences, the shape score is calculated according to the following formula: ; Among them, shape score This indicates the degree of shape consistency after comprehensively considering the matching between the normalized subject outline and the original canvas; normalized silhouette intersection-over-union ratio. This represents the intersection-union ratio of the silhouettes obtained by centering and proportionally scaling the candidate and reference subjects respectively; canvas matching score. This represents the comprehensive matching result under the original canvas coordinates obtained from the previous formula. In the formula, 0.55 and 0.45 are the weights of the normalized silhouette intersection-over-union ratio and the canvas matching score, respectively.
[0079] Based on the shape score, to ensure that the basic score reflects both shape and overall color, the basic comprehensive score is calculated using the following formula: ; Among them, the basic comprehensive score This indicates the overall matching degree of shape and color of the candidate view before applying cross-viewpoint stereoscopic penalty; shape score. This indicates the degree of shape consistency obtained from the previous formula; color similarity. This indicates the degree of consistency in the overall color distribution between the candidate subject and the reference subject. 0.8 and 0.2 in the formula represent the weights of the shape score and color similarity, respectively.
[0080] The purpose of the above scoring is to convert multiple individual indicators into directly comparable candidate evaluation metrics: the canvas matching score is mainly used for matching judgment in the shape stage, and the basic comprehensive score will also be combined with the cross-view stereoscopic ratio (described later) to form a candidate comprehensive score, which will be used in the stage gating of step S104 as the basis for judging whether the candidate has achieved effective improvement relative to the current best model. The weights remain unchanged within the same stage; when there are existing records of manual acceptance and rejection of similar objects, the weight combination can be labeled under the constraint that the weights are non-negative and their sum is 1; when there are no historical records, the above default weights are used to avoid arbitrarily changing the scoring direction in the same task.
[0081] Achieving a high profile score from a single reference viewpoint does not guarantee that the candidate model possesses true 3D thickness. For example, a model that appears to be a thin sheet may highly overlap with the reference profile from the front, but its visible area will significantly decrease when viewed from the side or top. To identify this situation, the system compares the foreground occupancy of the same candidate model from the reference viewpoint and from an approximately orthogonal auxiliary viewpoint.
[0082] For the perspective number The foreground footprint is calculated according to the following formula based on the corresponding perspective for judging stereoscopic perception: ; Among them, the foreground footprint Indicates the viewpoint number The degree to which the subject effectively occupies space on the canvas from the corresponding viewpoint; viewpoint number Indicates the viewpoint number used to determine the sense of depth; the proportion of the subject's bounding box to the canvas. Indicates the viewpoint number The ratio of the subject's bounding box area to the canvas area from the corresponding perspective; the proportion of the subject's foreground filling. Indicates the viewpoint number The ratio of the foreground pixel area to the bounding box area of the subject from the corresponding viewpoint. Using the geometric mean of the two ratios, it can simultaneously reflect the overall size of the subject on the canvas and the actual degree to which the subject fills its own bounding box.
[0083] After obtaining the foreground footprints from each participating perspective, the cross-viewpoint stereoscopic ratio is calculated using the following formula: ; Among them, the cross-view stereoscopic ratio Indicates the degree of consistency of the foreground footprint under different viewing directions; foreground footprint Indicates the degree of effective foreground occupancy corresponding to each viewpoint; viewpoint number This indicates a comparison across all viewpoints involved in the stereoscopic assessment; `min` and `max` represent the minimum and maximum values of the foreground footprint for each viewpoint, respectively. When the maximum foreground footprint is 0, the cross-viewpoint stereoscopic ratio is... Set to 0; otherwise, the cross-viewpoint stereoscopic ratio Located between 0 and 1. The viewpoints involved in the calculation include at least a reference viewpoint and an auxiliary viewpoint approximately orthogonal to the reference direction. Therefore, when the candidate model only appears normal in the reference direction but approaches the thin slice in side or top views, at least one viewpoint's foreground footprint is considered. Significantly reduced, cross-view stereoscopic ratio It then decreases.
[0084] After obtaining the basic comprehensive score and the cross-view stereoscopic ratio, the system needs to merge "similar from the reference viewpoint" and "still possessing a reasonable three-dimensional volume from other directions" into a single candidate comprehensive score. This score is then written into the candidate review results and participates in the appearance stage pass judgment and candidate comprehensive improvement comparison in step S104. The candidate comprehensive score is calculated according to the following formula: ; Among them, the candidate comprehensive score This represents the final view's comprehensive evaluation result, taking into account both reference matching quality and cross-view stereoscopic effect; basic comprehensive score. This represents the basic matching result of the aforementioned shape and color; cross-viewing angle stereoscopic ratio. Indicates the consistency of the foreground footprint under different viewing directions; stereoscopic penalty coefficient. This represents the penalty intensity for insufficient stereoscopic perception on the basic comprehensive score; max(·) is used to ensure that the penalty factor is not less than 0. The stereoscopic perception penalty coefficient... The default value is 0.5, but it can be selected within the range of 0.3 to 0.8. When there are similar erroneous thin-slice samples, select the minimum value that allows the thin-slice samples to fall below the threshold of the corresponding stage without reducing the pass rate of confirmed 3D samples. When the cross-view stereoscopic ratio... The penalty is smaller when the value is close to 1, and the cross-view stereoscopic ratio is lower. The penalty increases when the threshold is lowered, thereby suppressing candidates that only form similar contours from the reference viewpoint.
[0085] After completing the above view index calculations, step S103 also checks the assembly relationships of the candidate models from the perspective of the 3D geometry itself. The step of detecting assembly relationships in the candidate 3D models includes performing an assembly-level mesh review based on the component structure contract. For example... Figure 4 As shown, the assembly-level mesh review checks both the local mesh quality of each candidate named component and the contact and spatial relationships between multiple candidate named components. Local mesh quality checks include degenerate faces, flipped faces, open boundaries, and watertightness. Triangular faces with an area smaller than a preset area threshold are marked as degenerate faces; faces with inconsistent normal directions or abnormal directional volume directions in closed meshes are marked as flipped face risks; edges connecting only one triangular face are marked as open boundaries.
[0086] Assembly reviews may also encounter isolated small meshes that do not correspond to necessary contract components, such as scattered fragments generated during modeling. This paper refers to these small geometric blocks that are topologically separated from the main body and do not correspond to necessary components as "non-essential connected components"; they are allowed to be ignored as noise only when their size is small enough.
[0087] To avoid inconsistent judgments arising from fixed numerical thresholds across models of different sizes or mesh densities, assembly reviews simultaneously establish normalized thresholds using both the overall scale of the target object and the mesh resolution. The degenerate surface area threshold is first determined using the following formula: ; Among them, the degradation surface area threshold Triangular faces smaller than this area are considered degenerate faces; the diagonal length of the target object's bounding box. Indicates the overall scale of the candidate model; the median edge length of the grid. The median of the side lengths of all non-degenerate triangles is used to characterize the current mesh resolution; max(·) represents the larger of the two area lower limits obtained by global scale and mesh resolution. This avoids using too small an absolute area threshold for large models and also avoids bias caused by using the same absolute threshold for different mesh densities.
[0088] For component contact detection, the contact distance threshold is determined according to the following formula: ; Among them, the contact distance threshold Indicates the maximum surface distance between two candidate named parts that can be considered to be in contact; the diagonal length of the target object's bounding box. Indicates the overall scale of the candidate model; the median edge length of the grid. This represents the typical side length of the current grid; max(·) represents the larger of two distance lower limits determined by the overall scale and the grid sampling accuracy. 0.005 can be calibrated according to the attachment size within the range of 0.002–0.01 to accommodate contact judgments for both small attachments and large components.
[0089] For non-essential connected components that do not correspond to essential contractual parts, if their bounding box diagonal is less than 1% of the diagonal of the overall bounding box of the target object, they can be ignored as scattered geometric noise; this exemption does not apply to essential components. Through the above-mentioned scale and resolution normalization, the technical meaning of degenerate surfaces, contact, and noise judgments can be kept similar under different model sizes and mesh fineness levels.
[0090] Beyond local mesh quality checks on individual named components, the system also uses contact diagrams to determine whether compliant connections exist between components. The system constructs a contact diagram based on the bounding box distances, surface sampling point distances, and attachment contracts of candidate named components. Each node represents a candidate named component, and connection edges are established between two components that meet the contact distance or attachment connection conditions. The component structure contract can specify a primary load-bearing component as the overall assembly connection reference, hereinafter referred to as the "main root component." The system traverses the contact diagram starting from components in contact with the ground or the main root component; components that cannot be connected to the ground or the main root component through contact relationships and whose dimensions exceed the noise threshold are identified as suspended components. For connection methods that allow for local gaps, such as hinges and axial connections, the system determines whether to establish a connection edge based on the allowable gaps registered in the attachment contract. The technical advantage of contact diagrams is that they transform the previously scattered pairwise distance judgments into a connection accessibility judgment for the entire model, thereby identifying suspended components that "geometrically exist but are not actually connected to the main structure" and avoiding misjudging normal gaps allowed by the attachment contract as breaks.
[0091] In addition to suspended components, assembly review also detects overlapping surfaces across components. These assembly-level overlapping surfaces are used to identify triangular facet combinations belonging to different candidate named components, with a planar distance below the overlapping surface distance threshold, a normal angle below the overlapping surface angle threshold, and a high overlap ratio on the common projection plane. Detected overlapping surface areas may cause depth contention and flickering during rendering. The system records the names of the two involved components, the overlapping area, and their spatial positions, allowing the next round of scripting to adjust component positions or delete duplicate surfaces.
[0092] Assembly reviews also need to distinguish between two easily confused situations: one is overlapping surfaces across components where different component surfaces are almost in the same location, causing depth competition; the other is naturally thin sheets or structures that inherently require openings. The former should be identified as assembly defects and reported for modification, while the latter cannot be judged as model errors simply because open boundaries exist.
[0093] For overlapping surfaces of components, the planar distance threshold is determined according to the following formula: ; Among them, the overlap distance threshold This represents the maximum planar distance between two approximately coplanar triangular faces belonging to different candidate named components that can still be identified as overlapping faces; the diagonal length of the target object's bounding box. Indicates the overall scale of the candidate model; the median edge length of the grid. This represents the typical side length of the current mesh; `max(·)` indicates taking the larger of the two distance lower limits obtained by the overall scale and mesh resolution. Except for planar distances, the normal angle threshold is set to 5° by default and can be adjusted within the range of 3°–8°. A surface is considered overlapping when the ratio of the overlapping area of the common projection to the area of the smaller triangular face is not less than 0.6. This combination of conditions can reduce false alarms caused solely by two surfaces being spatially close but not aligning in orientation or projection.
[0094] For natural thin sheets or open structures, the system first calculates the geometric flatness of the component using the following formula: ; Among them, geometric flatness Indicates the dimensional ratio of a component between its thinnest and longest directions; minimum size of the component enclosure. This represents the minimum dimension of the component's bounding box in three directions; the maximum dimension of the component's bounding box. This indicates the maximum value among the three dimensions of the component's bounding box. Geometric flatness. The smaller the value, the closer the component is to a sheet-like shape.
[0095] Only when geometric flatness An exemption for open boundaries is only allowed when the threshold is no greater than 0.03, and the semantic name or material category of the component simultaneously points to a sheet, fabric, blade, glass sheet, or opening port. The flatness judgment threshold can be set according to the object category within the range of 0.01-0.05. The use of "geometric shape + semantic or material" joint judgment is to avoid misjudging components that should be closed but are incompletely modeled as normal openings simply because of their thinness. For containers, shells, or glass containers that should be closed, the system continues to check the boundary loop, shell connectivity, and watertightness. For natural sheets or opening structures such as blades, fabric, pipe ports, and signs, open boundaries may not be considered as serious defects if the above joint conditions are met. If the component structure contract explicitly defines a glass component as a closed container, then even if its material category is glass, the opening exemption does not apply.
[0096] After completing local mesh, contact relationships, overlapping surfaces, and open boundary checks, the assembly review also checks the number of required components and accessory contracts. If the actual gap between a sub-component and its parent component exceeds the allowable gap, a connection deviation is recorded; if the number of required components is insufficient or the matching confidence is below a threshold, a missing component is recorded. Any serious defect (specific criteria are described below) can limit the candidate comprehensive score below the final pass threshold. In one embodiment, the final pass threshold is 0.7.
[0097] The geometric scoring below also uses the term "necessary enclosed component," which refers to a contract component that simultaneously meets two conditions: first, it is marked as a necessary component in the component structure contract; and second, it must form a closed, watertight structure according to its component category or attachment requirements. For example, the necessary shell of a container that is explicitly required to be a closed structure is a necessary enclosed component.
[0098] To convert different types of assembly defects, such as degraded surfaces, flipped surfaces, open boundaries, watertightness, suspension, overlapping surfaces, and attachment connection deviations, into unified quantitative results that can be directly used in the structural stage of step S104, the system calculates geometric scores according to the normalized proportions of each type of defect:
[0099] Among them, geometric scoring This represents the overall mesh quality and assembly quality of the candidate 3D model; a higher value indicates fewer overall defects. Degenerate surface ratio. This indicates the proportion of the degraded surface area to the total surface area; the flipping ratio. This indicates the proportion of the flipped area to the total surface area; open boundary ratio. This indicates the proportion of the open boundary length of the non-exempt component to the total side length; watertightness failure rate. This indicates the percentage of essential sealing components that failed the watertightness test out of the total number of essential sealing components; the percentage of essential suspension components. This indicates the proportion of the number of components necessary for levitation to the total number of components required; weight ratio. This indicates the proportion of the assembly-level surface area to the total surface area of the relevant components, limited to 0-1; Appendix: Contract Violation Proportion This represents the proportion of connections that violate the supplementary contract to the total number of supplementary contracts; clip(·) indicates that the final score will be limited to the range of 0-1. In the formula, 0.15, 0.10, 0.10, 0.10, 0.20, 0.15, and 0.20 represent the penalty weights for the corresponding defect proportions.
[0100] The above geometric score The candidate review results are included and used together with the attachment gap check in the structural stage of step S104 as the gating criteria; therefore, this score is not an isolated statistical result. Furthermore, sandbox execution failure, missing essential components, suspended essential components, non-watertight essential enclosure components, or a single overlapping area exceeding 5% of the relevant component's surface area are all directly recorded as serious defects. The final stage is not permitted until serious defects are eliminated, thus preventing weighted averages from masking a few structural problems that could render the model unusable.
[0101] After step S103 generates candidate review results, the process proceeds to step S104. Step S104 first identifies rejected items based on the candidate review results and then locates these rejected items to their corresponding named components to generate script modification feedback. In this phased implementation, before locating and providing feedback, the current stage contract execution stage gating is used to determine whether the candidate model is acceptable and whether the current optimal model should be updated. Figure 5 As shown, the generation process, from coarse to fine, includes the bulk stage, structure stage, shape stage, material stage, and appearance stage. The bulk stage is used to determine the main bulk, overall outline, and proportions; the structure stage is used to determine the contact relationships, geometric quality, and assembly clearances of components; the shape stage is used to determine the number of key features and shape details; the material stage is used to determine the material type and color swatches; and the appearance stage is used to complete the lighting, appearance mode, and final comprehensive review.
[0102] The stage gating system not only saves a 3D model, but also the corresponding scripts, named component parameter tables, review reports, and stage status. To avoid repeated listing later, this paper refers to this set of data, which is saved together with the current best model, as the "current best record".
[0103] The above stages proceed in a coarse-to-fine order. In regular iterations, the current best record is generally maintained at the current stage or moves to the next stage, and is not automatically downgraded due to the failure of a new candidate. If it is necessary to modify previously locked fields later, the corresponding locks are revoked according to the rules below, and the baseline is re-established at the corresponding stage. Different evaluation metrics are used for different generation stages because the technical objectives to be confirmed at each stage are different: the bulk stage first ensures that the main outline and proportions are reasonable; the structure stage focuses on eliminating mesh and assembly defects; the shape stage checks key shape features; the material stage evaluates color and material; and the appearance stage finally evaluates the overall visual effect.
[0104] In one embodiment, the bulk stage requires a normalized silhouette intersection-over-union ratio of 0.35; the structural stage requires a geometric score. Achieve a score of 0.55 and ensure that the gaps between attachments do not exceed the requirements of the attachment contract; the shape stage requires canvas matching scoring. The confidence level must reach 0.30, and the shape feature items registered as required in the phase contract must match with a confidence level of 0.70; the material phase requires color similarity. Achieve a score of 0.55; the overall score for candidates is required in the appearance stage. The target score reaches 0.70, and all three preset appearance modes—neutral lighting, grazing lighting, and reference lighting—are complete and free of serious defects. The thresholds for volume, structure, shape, material, and appearance can be calibrated within the ranges of 0.30–0.50, 0.50–0.75, 0.30–0.60, 0.45–0.70, and 0.65–0.80, respectively. During calibration, manually confirmed acceptable and rejected candidates from the same object category are used, selecting the lowest threshold that excludes candidates with serious defects while retaining those already confirmed as acceptable. Once the threshold is written into the phase contract, it remains unchanged in the current task. This phased gating avoids premature optimization of color or appearance before the main structure is reliable, and also prevents later detail modifications from damaging already approved structural indicators.
[0105] The term "locked-in metric" refers to an evaluation metric that has met the requirements at a certain stage and should not be significantly reduced in subsequent iterations. "Backoff tolerance" represents the maximum allowable decrease in the locked-in metric. Based on these definitions, the stage contract records the locked-in metric and its backoff tolerance. In one embodiment, the backoff tolerances for normalized silhouette intersection-union ratio (CIU), canvas silhouette intersection-union ratio (CIU), edge matching metric, and bounding box intersection-union ratio (CIU) are set to 0.02, 0.02, 0.03, and 0.03, respectively. The candidate gating first determines whether the highest stage passed by the candidate is lower than the current optimal model, then determines whether the reduction in any locked-in metric exceeds the backoff tolerance, and finally determines whether the candidate's overall improvement reaches the improvement threshold. In one embodiment, the improvement threshold is 0.003. If any condition is not met, the candidate is rejected, and the current optimal model and its script remain.
[0106] The candidate comprehensive improvement is used to determine whether a new candidate model has achieved a substantial improvement relative to the current best model that is sufficient to outweigh the score fluctuations. The indicators used for comparison can be either similarity indicators (higher values are better) or error indicators (lower values are better); for the latter, they are first converted to "1 minus normalized error," and then standardized to "higher values indicate better results." The candidate comprehensive improvement is only calculated if the candidate does not violate the requirements of the current stage and the reduction in the locked indicators does not exceed the backoff tolerance. ; Among them, candidate comprehensive improvement amount This indicates the weighted net improvement of the new candidate relative to the current best model on the currently locked indicators; indicator number. Indicates the indicator number participating in the improvement comparison at the current stage; candidate indicator value. Indicates the new candidate model in the index number The normalized evaluation value of the corresponding indicator; the current optimal indicator value. This indicates the current optimal model at index number. Normalized evaluation values for corresponding indicators; indicator weights The phase contract is indicated by the indicator number. The corresponding indicators are registered with non-negative weights, and the sum of the weights of all indicators is 1.
[0107] Locked indicators will not be included in the candidate comprehensive improvement quantity. Instead of summing the results, a separate rollback tolerance check is performed to prevent an increase in an unlocked indicator from masking a significant decrease in a qualified indicator. The improvement threshold is set to 0.003 by default, but can be determined within the range of 0.001 to 0.01 based on the upper limit of fluctuation in repeated scoring calculations: first, the same script is repeatedly rendered and reviewed to obtain the maximum natural fluctuation value of each indicator, and then the improvement threshold is set to more than 1.5 times this fluctuation value, so that only improvements exceeding the calculation noise are accepted by the stage gating.
[0108] When the aforementioned candidate gating is deemed successful, its script, named component parameter table, review report, and stage status are saved as a new current optimal record, and the qualification indicators for that stage are added to the locked indicator set. During the next script generation, the stage contract provides the visual language model with the permissible modification range. For example, after entering the material stage, material and color parameters can be modified, but the dimensions and connection relationships of locked main components cannot be reset; if structural modifications are truly necessary, the baseline should be re-established in the structure stage, rather than implicitly exceeding the locked range within the same stage.
[0109] To ensure that the "allowed modification scope" in the phase contract is implemented in specific fields of the script, the system directly uses the aforementioned `mutable_paths` field to store a list of parameter paths that can be modified in this phase. The bulk phase allows modification of the primitive type, center, overall size, and orientation of the main components; the structure phase allows modification of parent-child relationships, connection methods, connection positions, and attachment gaps; the shape phase allows modification of chamfers, curvature, cross-sections, local thickness, quantity, and subdivision level; the material phase only allows modification of material type, color, roughness, and texture scale; and the appearance phase only allows modification of camera, lighting, and rendering parameters. If a subsequent phase needs to change a field from a previous phase, the phase control module first cancels the corresponding locked record and returns to the phase that generated the field to re-establish the baseline. It does not allow bypassing the allowed modification scope of the current phase to directly modify locked fields.
[0110] Conversely, when a candidate gating test fails, the system converts the candidate review report into structured feedback instructions. Each feedback instruction includes the component semantic name, problem type, measured value, target range, target parameters, modification direction, allowed modification range, and priority. The feedback priorities are, in order: critical defect, missing essential component, positional deviation, proportional deviation, quantity deviation, connectivity deviation, and detail deviation. The visual language model modifies the current optimal script based on these feedback instructions, without needing to regenerate the entire model unrelated to the problem.
[0111] To ensure feedback directly addresses specific parameters in the script, rather than merely concluding overall similarity is insufficient, the modification direction of feedback instructions is directly determined by the measured value and target range: values below the lower limit are marked as "increase," and values above the upper limit are marked as "decrease." When a component is missing, a new component instruction is generated, along with the parent component, minimum quantity, and allowed primitives. When the gap between attachments is too large, the child component is moved towards the parent component along the normal of the parent component's connection surface, with the target displacement being the measured gap minus the target gap. When overlapping surfaces occur, the modifiable component is moved along the normalized direction of the difference between the normals of the two overlapping surfaces, with the movement amount being at least the difference between the overlapping surface distance threshold and the measured plane distance. Each feedback only includes parameter paths allowed by the phase contract. When multiple issues point to the same parameter, the one with the highest priority is retained, and the remaining issues are re-reviewed in the next round.
[0112] The feedback described above can be specifically applied at the component level. For example, when a caster is missing, the feedback instruction specifies the addition of a named caster component, its parent component, and the minimum quantity; when the armrest height is off, the feedback instruction specifies the height parameters and adjustment direction of the armrest component; when the seat cushion is too thick, the feedback instruction specifies the thickness parameters and target range of the seat component; when there is overlapping surface between components, the feedback instruction simultaneously provides the names of two related components, the overlapping surface location, and the suggested displacement direction. This feedback, along with the current optimal script, locked indicators, and the current stage, is then input into the visual language model to form the script for the next round.
[0113] To prevent candidate models from being generated repeatedly without terminating the process, a maximum number of iterations is set for each generation task. Maximum number of iterations The default value is 20, which can be set between 10 and 50 depending on the number of object components. Generation stops if no candidates pass the gating for three consecutive rounds. If the final stage has not been passed by the time the process stops, the system outputs the current optimal script, the current optimal model, and a report of failed items, but does not mark failed models as final qualified results. This stopping rule is only used to limit iterative resource consumption and does not lower the original passing threshold for each stage.
[0114] After generating structured feedback when a candidate fails in step S104, the process proceeds to step S105. Step S105 sends this feedback back to the script generation stage, forming a closed loop of "generation—execution—review—feedback—regeneration." Step S105 is further refined as follows: the step of iterating the procedural modeling script based on the script feedback until the candidate 3D model meets the preset generation requirements, and outputting the final procedural modeling script and the final 3D model, includes: inputting the structured feedback instruction, the procedural modeling script corresponding to the current optimal model, the locked indicators, and the current generation stage into the visual language model to generate a modified procedural modeling script; executing the modified procedural modeling script again in a constrained execution environment and regenerating the candidate review results; repeating stage gating and script modification until the candidate 3D model passes the appearance stage or reaches the preset stopping condition. Upon passing the final stage, the final procedural modeling script, the named component parameter table, the final 3D model, and the review records for each stage are saved. Through this closed loop, failed items can be continuously located to specific named components and script parameters, while locked indicators are subject to rollback constraints in subsequent modifications, thereby achieving local error correction, avoiding repeated reconstruction of irrelevant components, and enabling the generation process to stably converge to an output result after meeting the stage requirements.
[0115] As a specific implementation, let's take the generation of a procedural 3D model based on a reference image of a modern swivel chair as an example. The system extracts the main body mask and performs cropping, centering, and scale normalization. The reference image is estimated to be a frontal view, resulting in a main body aspect ratio of approximately 0.85. The visual language model generates component structure contracts based on the normalized reference image and textual requirements. These contracts include named components such as seat, backrest, armrest, support, star_base, and caster, and record the parent-child relationships and connection methods of each component. Specifically, seat, backrest, armrest, support, star_base, and caster all belong to the aforementioned contract components after being written into the component structure contract; if a contract component is marked as required, then that contract component is also considered a required component.
[0116] In the bulk stage, the visual language model generates the first version of the restricted DSL script, constructing the supporting columns and five-star base using cylinders and sweep primitives, the seat cushion using rounded cuboids, and the armrests using sweep primitives, while setting chamfering, mirroring, and transformation parameters. The script executes within the operation budget and clock timeout, resulting in candidate models with named components. These components, actually generated by the script and already bound to semantic names, are the candidate named components, which the system then matches and evaluates against the aforementioned contract components. The system renders from reference view, side view, top view, and oblique view. In one evaluation example, the normalized silhouette intersection-over-union ratio is approximately 0.62, and the canvas matching score is... Approximately 0.71, cross-viewing angle stereoscopic ratio Approximately 0.88, basic comprehensive score Approximately 0.68; when the stereoscopic penalty coefficient When the value is 0.5, the candidate comprehensive score The value is approximately 0.64. This candidate model has reached the block stage threshold and has not caused the locked metric to regress, therefore it is saved as the current optimal model.
[0117] Upon entering the structural phase, assembly review revealed an insufficient number of casters and detected a gap between an armrest and seat exceeding the specifications outlined in the attachment. The system generated feedback instructions to supplement caster components and adjust armrest connection positions. The visual language model only modified the parameters and local scripts of the corresponding components; the support leg distribution direction remained unchanged for the same user seed, allowing direct comparison of the two wheel results. After the modified candidates were checked against the attachment specifications and contact diagrams, the proportions, main body outline, and component connection relationships were finalized.
[0118] Upon entering the shape stage, the system detected that the seat thickness was too large based on the reference viewpoint and used the seat thickness parameter as the target parameter. Since the connection between the five-star base and the support column was already locked in the stage contract, the visual language model could not reconstruct this connection. In the material and appearance stage, only the color swatch, roughness, lighting, and rendering mode were adjusted. The final output retains the restricted DSL script, named component parameter table, final model, and review records from each stage, allowing for further modifications to armrest height, seat thickness, or caster structure based on component names.
[0119] The above specific embodiments use a single reference image for illustration, but the input reference information of the present invention is not limited to a single image. For multiple images, the viewpoint of each image can be estimated separately, and the image with clear viewpoint information can be used as the matching reference for the corresponding viewpoint. For cases with only text descriptions, a component structure contract can be formed based on the object category, components, quantity, and spatial relationships in the text, and the standard viewpoint corresponding to the object category can be used as the initial reference viewpoint. The number and orientation of auxiliary viewpoints can be set according to the object category, and the number of generation stages can also be adjusted, but the basic control rules of "locking qualified indicators after a stage is passed" and "rejecting new candidates when the locked indicators decrease beyond the backoff tolerance" should still be retained.
[0120] Similarly, the modeling primitives that can be called by the restricted DSL can also be configured according to specific business objects. The furniture library can add primitives for upholstery, tubular supports, and casters; the building library can add primitives for walls, doors and windows, roofs, and floor arrays; and the vegetation library can add primitives for branching and leaf distribution. Adding a new primitive requires registering its name, parameter fields and value rules, operation counting method, output mesh type, and allowed stages. Unregistered primitives cannot be directly called by scripts. This method of expanding by business type but always managing through a registry improves the efficiency of modeling specific objects while preserving closed-vocabulary boundaries. This ensures that newly added primitives continue to have verifiable parameters, statistically analyze resource consumption, and restrict the stages of use, avoiding the reintroduction of arbitrary code execution risks through business expansion.
[0121] The processing steps in the aforementioned method can also be handled by... Figure 6 The corresponding modules in the system are implemented to establish a correspondence between the method steps and the system modules. In one specific implementation, the execution module is a sandbox execution module. Figure 6 The system shown includes a reference processing module, a structural contract generation module, a script generation module, a sandbox execution module, a rendering module, a closed-loop review module, a stage control module, and a feedback and output module. The reference processing module receives the raw reference information and completes the main body mask extraction, cropping, scale normalization, viewpoint estimation, and additional channel alignment. The structural contract generation module generates a contract component list, assembly drawing, required markings, and parent-child component attachment contracts based on the processed reference information. The script generation module then uses these structural constraints and the current stage constraints as input to call the visual language model to generate or modify the restricted DSL script.
[0122] Based on the above method steps and the correspondence between system modules, each module further undertakes the following functions: The sandbox execution module includes a primitive registry, a script parsing unit, an execution environment interface restriction unit, an operation counting unit, a timeout control unit, and a deterministic random number unit, used to generate candidate 3D models in a restricted manner according to the aforementioned script execution plan. The rendering module outputs color maps, main body masks, depth maps, or normal maps based on reference and auxiliary viewpoints. The closed-loop review module includes a multi-view scoring unit, a stereoscopic judgment unit, and an assembly review unit; the stage control module includes a stage status unit, an indicator locking unit, and a candidate gating unit; the feedback and output module converts the review results into structured feedback instructions and saves the script, named component parameter table, 3D model, and review record upon final approval.
[0123] To further illustrate the interoperability between modules, each module transmits structured data sequentially according to the aforementioned method steps. The reference processing module first outputs reference data containing a normalized reference image, a subject mask, a reference viewpoint, and available additional channels; the structural contract generation module reads this reference data and outputs the component structural contract; the script generation module then reads the component structural contract, the current stage contract, and the feedback instructions from the previous round, generating the current round's script. The sandbox execution module executes this script and outputs candidate 3D models, a named component parameter table, and an execution log; the rendering module generates candidate views for each viewpoint based on the candidate 3D models; the closed-loop review module combines the candidate views, candidate 3D models, and component structural contracts to form a candidate review report. The stage control module makes a pass or rejection judgment based on the candidate review report and the current stage contract: if a candidate fails, the feedback and output module generates new feedback instructions and returns them to the script generation module; if a candidate finally passes, the final script, named component parameter table, final 3D model, and review records for each stage are saved. The data transmitted by each module carries a task identifier, stage number, and component identifier. If an inconsistency in identifiers is found, the current data processing is stopped, thereby preventing the mixing of data from different tasks, different stages, or different components. Therefore, the data passed between modules is structured data corresponding to the same task, the same stage, and the same named component system. This maintains a one-to-one correspondence between reference constraints, script generation, model execution, review results, and modification feedback, reducing the mixing of information across stages or components.
[0124] In terms of specific deployment methods, the above modules can be deployed in the same electronic device, or they can be deployed in multiple communicating devices according to the computational resource requirements of visual language model inference, geometric execution, and rendering review. The system uses a processor to execute computer programs in memory to implement the aforementioned method steps; 3D models, restricted DSL scripts, component structure contracts, phase contracts, and review records can be stored in local memory or a controlled task storage service.
[0125] The terms "first," "second," etc., used in this specification are only for distinguishing technical features of the same type and do not indicate a necessary sequential or quantitative relationship. Unless otherwise expressly defined, the inclusion does not exclude the existence of other steps or modules. Within the scope of the inventive concept, equivalent substitutions for reference channels, modeling primitives, scoring weights, number of stages, thresholds, and module deployment methods can all be used to implement this invention.
Claims
1. A procedural 3D model generation method based on closed-loop comparison of visual language models, characterized in that, include: Obtain reference information for the target object and establish a component structure contract containing named components; A procedural modeling script is generated based on the component structure contract using a visual language model; The procedural modeling script is executed to obtain candidate 3D models, and the candidate 3D models are reviewed based on the reference information to form candidate review results; The failed items in the candidate review results are located to the corresponding named components and script modification feedback is generated; Based on the script modification feedback, iterate the procedural modeling script until the candidate 3D model meets the preset generation requirements, and output the final procedural modeling script and the final 3D model.
2. The procedural 3D model generation method according to claim 1, characterized in that, The steps of obtaining reference information of the target object and establishing a component structure contract include: The reference information includes reference images, text descriptions, or a combination of reference images and text descriptions; When the reference information includes a reference image, the reference image is cropped, centered, and scaled, and a reference viewpoint is determined. Based on the reference information and the reference image processing results obtained when the reference information includes a reference image, the visual language model is used to obtain structured component information for establishing the component structure contract.
3. The procedural 3D model generation method according to claim 1, characterized in that, The steps for establishing a component structure contract include: Register semantic names, geometric attributes, parent component identifiers, connection methods, required tags, and quantity requirements for each named component, and construct an assembly drawing based on the parent component identifiers and connection methods; Set up an attachment contract for named components with parent-child relationships, the attachment contract including allowed connection types and allowed gaps.
4. The procedural 3D model generation method according to claim 1, characterized in that, The step of generating the procedural modeling script includes: Set constraints for the generation phase and a preset set of closed-vocabulary primitives; The component structure contract and the generation stage constraints are input into the visual language model, and the visual language model selects modeling primitives from the preset closed vocabulary primitive set to generate a restricted domain-specific language script. The restricted domain-specific language script associates named components with corresponding meshes through component declarations.
5. The procedural 3D model generation method according to claim 4, characterized in that, The step of executing the procedural modeling script includes: The restricted domain-specific language script is executed in a restricted sandbox, which only opens the preset closed vocabulary primitive set, deterministic random number interface and operation counting guard, and restricts the call to file system, network and dynamic code construction interface; Set operation budgets and execution timeouts for the domain-specific language scripts; Deterministic pseudo-random numbers are generated based on user seeds for use by the restricted domain-specific language scripts.
6. The procedural 3D model generation method according to claim 1, characterized in that, The reference information includes a reference image, and the step of forming candidate review results includes: A reference viewpoint is determined based on the reference image, and the candidate 3D model is rendered from the reference viewpoint and at least one auxiliary viewpoint to obtain a candidate view set. The view matching index is calculated based on the candidate view set and the reference image, and the cross-view stereoscopic index is determined based on the foreground footprint under different viewpoints.
7. The procedural 3D model generation method according to claim 1, characterized in that, The step of forming candidate review results further includes: Based on the component structure contract, the assembly relationship of the candidate 3D model is detected; Identify suspended components based on the contact relationships between named components; Identify assembly-level overlapping surfaces based on surfaces that are approximately coplanar and have projected overlap, belonging to different named components; The assembly relationship detection results are written into the candidate review results.
8. The procedural 3D model generation method according to claim 1, characterized in that, The steps of generating script modification feedback and iterating the procedural modeling script include: Multiple preset generation stages are set up in a coarse-to-fine order, and the pass threshold, locking index, rollback tolerance and allowable modification range of each preset generation stage are recorded by stage contract; stage gating is performed on candidate 3D models according to the stage contract, and candidate 3D models that pass the stage gating are saved as the current optimal model, and the locking index that the current optimal model has met is determined as the locked index. For any subsequent candidate 3D model in any preset generation stage, the stage gate is passed only when the pass threshold of the preset generation stage is reached and the reduction of the locked indicators does not exceed the backoff tolerance corresponding to the preset generation stage; when the subsequent candidate 3D model fails the stage gate, the failed items in its candidate review results are located to the script parameters of the corresponding named component to form a feedback instruction as the script modification feedback, and the feedback instruction is used to modify the procedural modeling script corresponding to the current optimal model.
9. A procedural 3D model generation system based on closed-loop comparison of visual language models, characterized in that, include: The reference processing module is used to obtain reference information of the target object; A structural contract generation module is used to establish a component structural contract containing named components based on the reference information; The script generation module is used to generate a procedural modeling script based on the component structure contract using a visual language model; The execution module is used to execute the procedural modeling script to obtain candidate 3D models; The closed-loop review module is used to review the candidate 3D model based on the reference information and form a candidate review result. The feedback and output module is used to locate the failed items in the candidate review results to the corresponding named components, form script modification feedback and provide it to the script generation module to iterate the procedural modeling script, and output the final procedural modeling script and the final 3D model when the candidate 3D model meets the preset generation requirements.
10. The programmed 3D model generation system according to claim 9, characterized in that, The execution module executes the procedural modeling script in a constrained execution environment; The system also includes a rendering module and a stage control module. The rendering module performs multi-view rendering on the candidate 3D model and obtains multi-view rendering results. The closed-loop review module performs view comparison based on the reference information and the multi-view rendering results, and performs assembly relationship detection based on the component structure contract. The stage control module performs stage gating based on the candidate review results. The feedback and output module converts the failed items in the candidate review results into structured feedback instructions containing component semantic names and target parameters, and provides the structured feedback instructions as script modification feedback to the script generation module.
