A method and apparatus for generating procedural content for building complexes based on a large language model
By generating parametric component code from a large language model and integrating it into a procedural content generation pipeline, the problems of uncontrollable 3D model generation and non-standard topology in existing technologies are solved. This enables parametric controllability, flexible expansion, and batch production of building complexes, improving production efficiency and adaptability.
Patent Information
- Application Number
- CN202611346623.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-17
AI Technical Summary
Existing AI-assisted 3D model generation solutions suffer from problems such as uncontrollable generated models, lack of parametric editing capabilities, and non-standard topologies that prevent direct integration into production pipelines, resulting in low efficiency and limited scalability in the production of 3D building complex assets.
By combining a large language model with a code generation constraint mechanism, multiple types of procedural component code with parameter-exposed syntax are generated. This code is then integrated into the procedural content generation pipeline of a digital content creation tool to perform tasks such as generating the main structural block mesh of the building complex, hierarchical mesh segmentation, component type distribution, and adaptive mapping of point cloud size. A three-level identification system is constructed to achieve batch installation of components.
It enables the programmed and automated generation of building complexes that are parameterized, controllable, flexibly expandable, and capable of batch production, thereby improving the production efficiency and pipeline adaptability of 3D building complex assets.
Smart Images

Figure CN123114449A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D modeling and procedural content generation technology, and in particular to a method and apparatus for generating procedural content about building complexes based on a large language model. Background Technology
[0002] Currently, the mainstream solutions for AI-assisted 3D model generation fall into two main categories: The first is image-driven online modeling, which optimizes prompts using a large language model, generates reference images using text-to-image tools, and then directly generates the model through a 3D generation platform. This type of solution has fundamental flaws: the generated model is a single-form mesh model, lacking adjustable component-level parameters such as door width, window opening degree, and number of floors, making secondary editing and variant expansion impossible; furthermore, the model topology is usually non-manifold, making it unsuitable for direct integration into procedural content generation pipelines, requiring significant rework before entering game and film production lines.
[0003] The second category is programmatic content generation and modeling solutions: in digital content creation tools, code is manually written to control the generation of models through node parameters. This type of solution has a fundamental flaw: the code writing relies entirely on professional technical personnel, the development threshold is extremely high, the expansion of asset variations is limited by human productivity, and it is disconnected from artificial intelligence generation capabilities, making it impossible to embed artificial intelligence capabilities into the core process of batch generation of building complexes, and it is difficult to achieve full-process automation and efficiency improvement. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method and apparatus for generating procedural content of building complexes based on a large language model. By utilizing a large language model combined with a code generation constraint mechanism, multiple types of procedural component codes with parameterized syntax are generated. The procedural component codes are then integrated into the procedural content generation pipeline of a digital content creation tool. The generation of the main structural block mesh of the building complex is performed sequentially, the mesh is segmented hierarchically and a three-level identification system is constructed, component type distribution is completed based on binary tree branching logic, and component batch installation is completed by adaptive mapping of point cloud size. This solves the problems of uncontrollable generated models, lack of parametric editing capabilities, and non-standard topology that cannot be directly connected to the production pipeline in existing online modeling solutions. It realizes the procedural and automated generation of building complexes that is parametrically controllable, flexibly expandable, and capable of batch production, thereby improving the production efficiency and pipeline adaptability of 3D building complex assets.
[0005] This application provides a method for generating procedural content about building clusters based on a large language model. The method includes: In response to the user input of functional requirement information received by the preset digital content creation tool, and based on the functional requirement information, the tool uses a preset large language model combined with a preset code generation constraint mechanism to generate multiple types of procedural component code with parameter extroversion syntax; wherein, the procedural component code includes at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code. The programmatic component code is integrated into the programmatic content generation pipeline in the digital content creation tool, and the building structure generation code is called based on the preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the programmatic content generation pipeline. The floor segmentation code and the facade unit segmentation code are invoked to perform hierarchical mesh segmentation processing on the main structural block mesh of the building complex, so as to obtain the floor unit corresponding to each main structural block of the building complex, and to perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade mesh including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system; Based on the three-level identification system, the door component code, the window component code, and the wall component code are called, and the component type distribution processing of the cell facade grid is performed using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell; wherein, the component type of the component layout point cloud includes one of the door component type, window component type, and wall component type; Determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a three-dimensional building complex model.
[0006] Furthermore, based on the functional requirement information, the generation of multiple types of procedural component code with parameter extroversion syntax is achieved using a preset large language model combined with a preset code generation constraint mechanism, including: The pre-set syntax constraint rules in the preset code generation constraint mechanism are concatenated before the functional requirement information to obtain the target prompt word, and the target prompt word is input into the preset large language model; wherein, the pre-set syntax constraint rules are used to constrain the large language model to follow the built-in programming language specification and parameter external syntax of the digital content creation tool to generate code; In response to receiving the structured results returned by the large language model, the structured results are parsed and the code validity is verified to obtain multiple initial code snippets; The initial code snippet is sent back to the large language model, and the secondary parameter review rules in the code generation constraint mechanism are used to instruct the large language model to generate multiple types of programmatic component code with parameter externalization syntax.
[0007] Furthermore, the step of integrating the procedural component code into the procedural content generation pipeline of the digital content creation tool, and calling the building structure generation code based on preset building constraint configuration parameters, to generate a building complex main structure block mesh including multiple building complex main structure blocks in the procedural content generation pipeline, includes: The programmatic component code is integrated into the programmatic content generation pipeline in the digital content creation tool, and a visual parameter control panel is generated in the digital content creation tool; wherein, the visual parameter control panel includes plot grid parameters, building size range parameters, and random floor parameters; Based on the plot grid parameters, a plot layout grid is generated, and based on the building size range parameters and the floor random parameters, a building group main structure block corresponding to each plot in the plot layout grid is generated; Randomly remove some of the main structural blocks of the building complex as blank spaces to obtain a grid of main structural blocks of the building complex that includes multiple main structural blocks of the building complex, and assign a unique structural block identifier to each main structural block of the building complex.
[0008] Furthermore, the hierarchical meshing process performed on the main structural block mesh of the building complex to obtain the floor unit corresponding to each main structural block of the building complex includes: For each main structural block of the building complex in the grid, determine the extreme value of the vertical bounding box of the main structural block of the building complex, and obtain the vertical low point height value and the vertical high point height value; Based on a preset number of floor segments, linear interpolation is performed between the vertical low point height value and the vertical high point height value to generate an ordered sequence of equidistantly distributed points corresponding to the main structural blocks of the building complex. Based on the ordered point sequence, Thiessen polygon cutting is performed to horizontally divide the main structural block of the building complex into multiple independent floor units, and a corresponding floor identifier is assigned to each floor unit; wherein, the floor identifier is associated with the structural block identifier of the corresponding main structural block of the building complex to form a secondary identifier.
[0009] Furthermore, the nested subdivision and segmentation process of the facade of each floor unit to obtain multiple cells corresponding to each floor unit includes: By traversing all facades of each floor unit through nested loop nodes, the normal direction and centroid position of the facade are determined. The facade is rotated with the centroid position as the pivot so that the normal direction is aligned with the depth axis, thus obtaining the standard planar rectangle corresponding to the facade. Based on the reference unit size corresponding to the standard planar rectangle, the number of cells is determined using the remainder comparison method, and the actual size of the cells is determined based on the number of cells. The standard planar rectangle is cut at equal intervals along its long side to generate multiple cell faces, and the original facade of the floor unit is deleted. The cell faces are rotated back to their original orientation using a preset rotation inverse matrix to obtain multiple cells corresponding to each floor unit, and a corresponding cell sequence identifier is assigned to each cell; wherein, the cell sequence identifier and the secondary identifier are combined to form the tertiary identifier system.
[0010] Furthermore, the step of distributing component types to the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell includes: In the programmatic content generation pipeline, multi-level distribution nodes are built to form the first distribution link and the second distribution link under the preset binary tree branching logic; The cells corresponding to non-functional facades are mapped to the wall component types, and the cells corresponding to functional facades are sent to the first distribution link; In the first distribution link, the cells of the first floor are filtered based on the floor identifier corresponding to each floor unit, and the cells of the first floor are distributed to the first floor dedicated branch, while the cells of the other floors are distributed to the standard floor general branch. In the second distribution link, for each cell in the first-level dedicated branch, a secondary filtering is performed based on the unit sequence identifier corresponding to each cell. The cells with the unit sequence identifier as the starting value are mapped to the door component type, and the remaining cells are mapped to the window component type. For each cell in the standard layer general branch, map that cell to the window component type; Based on the wall component type, door component type, or window component type corresponding to each cell, a categorized component layout point cloud is generated.
[0011] Furthermore, determining the scaling ratio between the actual size of each cell and the corresponding calibration size of the component type, and based on the scaling ratio, adapting and installing the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a 3D building complex model, includes: For each anchor point in the cell, a local orthogonal basis matrix is constructed based on the spatial position of the anchor point and the normal direction of the cell, and the actual width and actual height values of each cell are determined. The ratio between the actual width value and the corresponding nominal width value of the component type is determined as the width scaling ratio, and the ratio between the actual height value and the corresponding nominal height value of the component type is determined as the height scaling ratio. The width scaling ratio, the height scaling ratio, and the preset thickness scaling ratio are written into the local orthogonal basis matrix. The component layout point cloud is mapped to the corresponding position of each cell through matrix transformation. The component layout point cloud is then installed in batches through point copy mapping to assemble a three-dimensional building complex model.
[0012] Furthermore, the method also includes: Perform capping and mesh cleanup on the three-dimensional building complex model to obtain the target three-dimensional building complex model; The nodes corresponding to the generated target 3D building complex model are encapsulated into a reusable procedural generation pipeline, and the global parameters of the procedural generation pipeline are centralized in the main control panel of the digital content creation tool.
[0013] This application embodiment also provides a procedural content generation device for building clusters based on a large language model, the procedural content generation device for building clusters includes: The component code generation module is used to respond to the user input functional requirement information received by the preset digital content creation tool, and based on the functional requirement information, to generate multiple types of programmatic component code with parameter extroversion syntax using a preset large language model combined with a preset code generation constraint mechanism; wherein, the programmatic component code includes at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code. The main structure generation module is used to integrate the programmatic component code into the programmatic content generation pipeline in the digital content creation tool, and call the building structure generation code based on preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the programmatic content generation pipeline. The floor unit segmentation module is used to call the floor segmentation code and the facade unit segmentation code to perform hierarchical mesh segmentation processing on the main structural block mesh of the building complex, to obtain the floor unit corresponding to each main structural block of the building complex, and to perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade mesh including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system; The component type distribution module is used to call the door component code, the window component code, and the wall component code based on the three-level identification system, and to perform component type distribution processing on the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell; wherein, the component type of the component layout point cloud includes one of the door component type, window component type, and wall component type; The building model assembly module is used to determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping, so as to assemble a three-dimensional building complex model.
[0014] Furthermore, the procedural content generation device for building complexes also includes: The model finishing processing module is used to perform capping processing and mesh cleaning on the three-dimensional building complex model to obtain the target three-dimensional building complex model. The global parameter centralization module is used to encapsulate the nodes corresponding to the generation of the target 3D building complex model into a reusable procedural generation pipeline, and centralize the global parameters of the procedural generation pipeline into the main control panel of the digital content creation tool.
[0015] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the above-described method for generating procedural content of building groups based on a large language model are performed.
[0016] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method for generating procedural content of building clusters based on a large language model.
[0017] This application provides a method and apparatus for generating procedural content for building complexes based on a large language model. The method includes: responding to a preset digital content creation tool receiving user-inputted functional requirement information, and based on the functional requirement information, generating multiple types of procedural component codes with parameter-exposed syntax using a preset large language model combined with a preset code generation constraint mechanism; wherein, the procedural component codes include at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code; integrating the procedural component codes into the procedural content generation pipeline in the digital content creation tool, and based on preset building constraint configuration parameters, calling the building structure generation code to generate a building complex main structure block mesh including multiple building complex main structure blocks in the procedural content generation pipeline; calling the floor segmentation code and the facade unit segmentation code to perform hierarchical mesh segmentation processing on the building complex main structure block mesh to obtain each... The system describes the floor units corresponding to the main structural blocks of the building complex, and performs nested subdivision and segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, forming a cell facade grid that includes the main structural blocks of the building complex, the floor units, and the cells corresponding to each other in a three-level identification system. Based on the three-level identification system, the system calls the door component code, the window component code, and the wall component code, and uses a preset binary tree branching logic to perform component type distribution processing on the cell facade grid to obtain the component layout point cloud corresponding to each cell. The component type of the component layout point cloud includes one of the door component type, window component type, and wall component type. The system determines the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapts and installs the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a three-dimensional building complex model.
[0018] Compared with existing AI-assisted 3D model generation methods such as image-driven online modeling and procedural content generation modeling, this method utilizes a large language model combined with a code generation constraint mechanism to generate multiple types of procedural component codes with parametric syntax. These procedural component codes are then integrated into the procedural content generation pipeline of a digital content creation tool. This process sequentially generates the main structural block mesh of the building complex, hierarchically segments the mesh and constructs a three-level identification system, distributes component types based on binary tree branching logic, and performs batch installation of components through adaptive point cloud mapping. This solves the problems of uncontrollable model generation, lack of parametric editing capabilities, and non-standard topology that prevents direct integration with production pipelines in existing online modeling solutions. It achieves parametrically controllable, flexibly expandable, and batch-producible procedural automated generation of building complexes, improving the production efficiency and pipeline adaptability of 3D building complex assets.
[0019] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 One of the flowcharts for a method of generating procedural content for building groups based on a large language model, provided in an embodiment of this application; Figure 2 A second flowchart illustrating a method for generating procedural content about building clusters based on a large language model, provided in an embodiment of this application. Figure 3 One of the structural schematic diagrams of a procedural content generation device for building groups based on a large language model provided in an embodiment of this application; Figure 4 A second schematic diagram of a procedural content generation device for building complexes based on a large language model, provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0023] Research has revealed that current mainstream AI-assisted 3D model generation solutions fall into two main categories: The first is image-driven online modeling, which optimizes prompts using a large language model, generates reference images using text-to-image tools, and then directly generates the model through a 3D generation platform. This type of solution has fundamental flaws: the generated model is a single-form mesh model, lacking adjustable component-level parameters such as door width, window opening degree, and number of floors, making secondary editing and variant expansion impossible; furthermore, the model topology is typically non-manifold, preventing direct integration into procedural content generation pipelines, requiring significant rework before entering game and film production lines.
[0024] Furthermore, the second category is programmatic content generation and modeling solutions: in digital content creation tools, code is manually written to control the generation model through node parameters. This type of solution has fundamental flaws: code writing relies entirely on professional technical personnel, resulting in extremely high development barriers; asset variant expansion is limited by human capacity; and it is disconnected from artificial intelligence generation capabilities, making it impossible to embed artificial intelligence capabilities into the core process of batch generation of building complexes, thus hindering the automation and efficiency improvement of the entire process.
[0025] Based on this, this application provides a method for generating procedural content for building complexes based on a large language model. By utilizing a large language model combined with a code generation constraint mechanism, multiple types of procedural component codes with parameterized syntax are generated. The procedural component codes are then integrated into the procedural content generation pipeline of a digital content creation tool. The method sequentially executes the generation of the main structural block mesh of the building complex, hierarchical mesh segmentation and construction of a three-level identification system, component type distribution based on binary tree branching logic, and batch installation of components through adaptive mapping of point cloud sizes. This method solves the problems of uncontrollable generated models, lack of parameterized editing capabilities, and non-standard topology that prevents direct integration with production pipelines in existing online modeling solutions. It achieves parameterized, controllable, flexibly expandable, and batch-producible procedural automated generation of building complexes, improving the production efficiency and pipeline adaptability of 3D building complex assets.
[0026] Please see Figure 1 , Figure 1 This is one of the flowcharts for a method of generating procedural content for building complexes based on a large language model, provided in an embodiment of this application. The method for generating procedural content for building complexes based on a large language model provided in this application embodiment can be applied to scenarios such as game asset creation, film and television scene construction, and digital city generation. The method does not directly generate the final 3D model through the large language model, but rather uses the large language model as a code generation component in a procedural content generation pipeline. The large language model outputs parametric code that conforms to engineering specifications, which is then connected to the node pipeline of a digital content creation tool to complete the entire process of structure generation, hierarchical segmentation, component distribution, and model assembly. All generated code supports visual parameter adjustment, enabling batch, controllable, and editable generation of building complexes.
[0027] like Figure 1 As shown, the method includes: S101. In response to the preset digital content creation tool receiving the user's input functional requirement information, and based on the functional requirement information, using a preset large language model combined with a preset code generation constraint mechanism to generate multiple types of programmatic component code with parameter extroversion syntax.
[0028] The programmatic component code includes at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code.
[0029] Here, a large language model is a natural language processing model trained on a large-scale corpus, which has the ability to generate code, understand text and reason logically, and can generate program code that conforms to specified specifications according to natural language instructions; digital content creation tools refer to 3D creation software with node-based programming and geometric processing capabilities, which are carrier tools for programmatic content generation.
[0030] In this application embodiment, programmatic content generation refers to the technology of automatically generating digital content assets by writing program code and algorithm logic, without the need for manual creation.
[0031] Here, the parameter exposing syntax is a unique syntax of the programming language built into the digital content creation tool. Parameters declared through this syntax can automatically generate visual adjustment controls on the software node interface, realizing visual control of code parameters.
[0032] In this step, the core upstream production capacity link of the entire building complex's procedural generation pipeline is to transform users' natural language functional requirements into standardized code assets that can be directly accessed by the procedural content generation pipeline.
[0033] The programmatic component code is written in the built-in programming language of the digital content creation tool and can be directly imported into the attribute operation node of the corresponding tool to run and take effect without additional format conversion and code adaptation. Unlike the scattered and unstandardized code generated by the general large language model, the code generated in this step has undergone dual verification of pre-syntactic constraints and secondary parameter review. All control parameters support visual panel adjustment and can be directly called by subsequent stages as functional nodes of the pipeline, truly realizing the deep integration of artificial intelligence code generation capabilities and programmatic content generation process.
[0034] Here, the built-in programming language is the native programming language of the digital content creation tool, which supports data types such as lists, arrays, floating-point numbers, integers, strings, matrices, and quaternions. It has good compatibility, fast running speed, and is easy to maintain within the tool.
[0035] In this embodiment, the problems of code generated by the general large language model not conforming to the engineering specifications of the digital content creation tool, hard-coded parameters that cannot be visually adjusted, and low efficiency of manually writing programmatic code are solved, providing standardized and parameterizable code components for subsequent programmatic content generation pipelines.
[0036] In this way, through the dual mechanism of pre-existing syntax constraints and secondary parameter review, the generated code can be directly integrated into the programmatic content generation pipeline. All control parameters support visual UI adjustment, which greatly improves the development efficiency of programmatic components and reduces the threshold and workload of manual coding.
[0037] In one possible implementation of this application, in specific implementation, step S101, which generates multiple types of procedural component code with parameter extroversion syntax based on the functional requirement information using a preset large language model combined with a preset code generation constraint mechanism, may include: S1011. Before the functional requirement information, the pre-syntactic constraint rules in the preset code generation constraint mechanism are concatenated to obtain the target prompt word, and the target prompt word is input into the preset large language model.
[0038] The pre-syntax constraint rules are used to constrain the large language model to follow the built-in programming language specifications and parameter-externalized syntax generation code of the digital content creation tool.
[0039] Here, the pre-defined grammatical constraint rules are pre-set fixed instruction texts, such as "code must be generated strictly in accordance with the version specifications of the corresponding digital content creation tool, and all control parameters must be declared using parameter externalization syntax". This rule is automatically appended before the user-inputted functional requirement text to ensure that the code output by the large language model conforms to the engineering specifications of the digital content creation tool from the source.
[0040] In this step: the code generation specifications of the large language model are constrained from the source to avoid generating code that does not conform to the syntax requirements of the digital content creation tool, thereby reducing the workload of subsequent code adaptation.
[0041] In this way, by pre-combining constraint rules with prompt words, the code output format can be controlled in a targeted manner without modifying the model itself, which greatly improves the accuracy of generating compliant code and reduces the cost of subsequent code verification and modification.
[0042] S1012. In response to receiving the structured result returned by the large language model, perform field parsing and code validity verification on the structured result to obtain multiple initial code snippets.
[0043] Here, the structured result is the response data with a fixed field structure returned by the large language model interface, which includes code content, explanatory text, and other information.
[0044] In this step, since the structure of the fields returned by the interfaces of different large language model service providers varies, this step will extract the code text content from the returned results according to the interface specifications of the corresponding model, verify the syntax validity of the code line by line, and mark explanatory text and invalid code lines as comments; at the same time, it will identify the case segmentation markers in the code, split multiple independent sample code segments into multiple independent initial code fragments, and map and store them separately.
[0045] S1013. The initial code snippet is sent back to the large language model, and the secondary parameter review rules in the code generation constraint mechanism are used to instruct the large language model to generate multiple types of programmatic component code with parameter externalization syntax.
[0046] Here, the secondary parameter review rules are preset instruction rules, which require the large language model to supplement all external parameters in the initial version of the code with functional descriptions, comments and recommended value ranges, to help developers quickly debug parameters and generate multiple asset variants.
[0047] In this step, the initial code is annotated and optimized to improve its debuggability and usability, and to help developers quickly adjust parameters to generate asset variants.
[0048] In this way, the generated code comes with parameter function descriptions and recommended value ranges, as well as built-in parameter validity constraint logic. Developers can quickly debug parameters without consulting documentation, significantly improving the iteration efficiency of asset variants.
[0049] S102. Integrate the procedural component code into the procedural content generation pipeline in the digital content creation tool, and call the building structure generation code based on the preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the procedural content generation pipeline.
[0050] Here, the main structural block of the building complex represents the basic geometric model of the overall volume of a single building. It is the basic geometric carrier for generating the building complex and is used to support subsequent processes such as floor division and component installation.
[0051] In this step, the overall volume and spatial layout of the building complex are generated. Driven by preset building constraint configuration parameters, the main structural blocks of the building complex with different sizes, floors and orientations are generated in batches to form the basic geometric framework of the entire building complex. The output is a structural block mesh with a unique structural block identifier, which is the basic geometric carrier for all subsequent hierarchical division, component distribution and model assembly. All subsequent fine processing is carried out layer by layer based on the output results of this step.
[0052] The procedural content generation pipeline refers to an automated processing link in digital content creation tools, which consists of multiple functional nodes connected sequentially according to the data flow. After inputting basic data, it can complete multiple geometric processing steps in sequence and finally output the target model asset.
[0053] In this embodiment, based on parameterized building structure generation code, building main structures with differentiated volumes are generated in batches, constructing the overall layout and basic geometric carrier of the building complex, providing basic support for subsequent hierarchical division and component installation.
[0054] In this way, the overall attributes of a building complex, such as density, size range, and floor height, can be quickly adjusted through parametric control, and multiple layout schemes can be generated with one click, which greatly improves the output efficiency of the overall building complex scheme compared to manual modeling.
[0055] In one possible implementation of this application, step S102 may include: S1021. Integrate the programmatic component code into the programmatic content generation pipeline in the digital content creation tool, and generate a visual parameter control panel in the digital content creation tool.
[0056] The visualization parameter control panel includes plot grid parameters, building size range parameters, and random floor parameters.
[0057] In this step, the building structure generation code is imported into the attribute calculation node of the digital content creation tool. Since the code is written using parameter extroversion syntax, the node will automatically recognize the parameter declarations in the code and generate corresponding visual controls such as sliders and numerical input boxes to form a visual parameter control panel.
[0058] The plot grid parameters include the number of grid columns, the number of grid rows, the plot spacing, the safety margin, the center jitter amplitude, the probability of empty space, and the random seed; the building size range parameters include the minimum building width, the maximum building width, the minimum building depth, the maximum building depth, the single-story height, the minimum number of floors, the maximum number of floors, the maximum number of terraces, the terrace scaling factor, and the maximum yaw angle.
[0059] S1022. Based on the plot grid parameters, generate a plot layout grid, and based on the building size range parameters and the floor random parameters, generate the main building structure block corresponding to each plot in the plot layout grid.
[0060] In this step, a two-dimensional plot grid is first generated according to the number of rows and columns and the spacing between plots, with each plot corresponding to a building generation position; then, driven by a random seed, the width, depth, number of floors, yaw angle and other attributes of the building are randomly generated for each plot within the building size range, generating the main structural block of the building complex of the corresponding volume.
[0061] S1023. Randomly remove some of the main structural blocks of the building complex as blank spaces to obtain a grid of main structural blocks of the building complex that includes multiple main structural blocks of the building complex, and assign a unique structural block identifier to each main structural block of the building complex.
[0062] In this step, based on the probability parameter of vacant land, structural blocks on some plots are randomly removed as vacant spaces in the building complex to improve the naturalness of the layout; at the same time, each retained main structural block of the building complex is assigned a unique integer structural block identifier as a unique identity identifier for the building throughout the entire process, and all subsequent attributes will be associated with this identifier.
[0063] S103. Call the floor segmentation code and the facade unit segmentation code to perform hierarchical grid segmentation processing on the main structural block grid of the building complex to obtain the floor unit corresponding to each main structural block of the building complex, and perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade grid including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system.
[0064] Here, the three-level identification system is an attribute system composed of three unique identifiers: structural block identifier, floor identifier, and unit sequence identifier. It can accurately locate the building, floor, and facade of each cell and has complete hierarchical semantics.
[0065] This step involves the hierarchical decomposition of the building complex structure. The output grid of the main structural blocks of the building complex is used to decompose the complete building volume into standardized cell facades through a two-level automated process of "horizontal floor division and facade unit subdivision". The three-level identification system built simultaneously assigns a unique hierarchical semantic attribute to each cell, realizing full-link traceability and control from the overall building to the floor and then to the facade unit. This provides a unified location and size benchmark for the subsequent accurate distribution and location-based installation of component types.
[0066] In this embodiment, the main structural block of the entire building complex is disassembled layer by layer into standardized cell facades, establishing a hierarchical geometric structure system, which provides a location carrier and size benchmark for the precise distribution and installation of subsequent components.
[0067] In this way, by replacing manual modeling and splitting with two-level automated segmentation, the segmentation accuracy is uniform and the topology is regular. At the same time, a complete two-level and three-level labeling system is established to achieve precise positioning and semantic management of each cell.
[0068] In one possible implementation of this application, in specific implementation, the step S103 of performing hierarchical mesh segmentation processing on the main structural block mesh of the building complex to obtain the floor unit corresponding to each main structural block of the building complex may include: S1031. For each main structural block of the building complex in the grid of the main structural block of the building complex, determine the extreme value of the vertical bounding box of the main structural block of the building complex, and obtain the vertical low point height value and the vertical high point height value.
[0069] In this step, the floor segmentation code is invoked, and each main structural block of the building complex is processed one by one based on the structural block identifier within the loop node. First, the geometric data of the current structural block is read, and the minimum value (vertical low point height value) and maximum value (vertical high point height value) of its vertical bounding box are calculated. At the same time, the validity of the extreme values is checked. If the maximum value is less than the minimum value, the two values are automatically swapped. If the two values are equal, a single point is generated according to preset parameters.
[0070] S1032. Based on the preset number of floor segments, perform linear interpolation between the vertical low point height value and the vertical high point height value to generate an ordered sequence of equidistantly distributed points corresponding to the main structural blocks of the building complex.
[0071] In this step, based on the set number of floor segments (i.e., the number of floors minus one), uniform linear interpolation is performed between the vertical low point and the high point to calculate the vertical coordinates of each dividing point; the horizontal coordinates of all dividing points are taken by default from the center of the bounding box of the structural block, but the offset value can also be customized through parameters; finally, a set of three-dimensional point sequences arranged equidistantly along the vertical direction is obtained, and an interpolation parameter attribute in the range of 0 to 1 is attached to each point to mark the relative height position of the corresponding floor in the whole building.
[0072] S1033. Based on the ordered point sequence, perform Thiessen polygon cutting to horizontally divide the main structural block of the building complex into multiple independent floor units, and assign a corresponding floor identifier to each floor unit.
[0073] The floor identifier is associated with the structural block identifier of the corresponding main structural block of the building complex to form a secondary identifier.
[0074] Here, the Thiessen polygon cut, also known as the Vino cut, is a geometric processing method based on point sets to divide space into regions, achieving regular horizontal layering through an ordered sequence of points.
[0075] In this step, the ordered point sequence is used as the cutting seed point. The Thiessen polygon cutting node is input to divide the main structural block of the building complex into spaces. Since all seed points are arranged regularly in the vertical direction, each area obtained after cutting is a horizontal thin layer structure, which corresponds to a floor unit.
[0076] Furthermore, after the cutting is completed, a corresponding floor identifier is assigned to each floor unit, for example, 0, 1, 2, etc. from bottom to top; the floor identifier is bound to the structural block identifier of the building to form a secondary identifier, ensuring that each floor unit can be uniquely identified by "structural block identifier and floor identifier".
[0077] In this way, the horizontal layering of the main structural blocks of the building complex is completed, generating independent floor units and establishing a two-level identification system. The Thiessen polygon cutting based on ordered points avoids the fragmentation problem of random cutting, and the generated floor units have a regular topology and clear hierarchy; the two-level identification system realizes the precise binding of floors with their respective buildings, providing a hierarchical index for subsequent facade subdivision.
[0078] In one possible implementation of this application, in specific implementation, the step S103 of performing nested subdivision and segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit may include: S1034. By traversing all facades of each floor unit through nested loop nodes, the normal direction and centroid position of the facade are determined. The facade is rotated with the centroid position as the pivot so that the normal direction is aligned with the depth axis, thereby obtaining the standard planar rectangle corresponding to the facade.
[0079] In this step, the facade unit segmentation code is called and executed in the nested loop node: the outer loop traverses each floor unit, and the inner loop traverses each facade of the floor, processing each facade one by one.
[0080] Furthermore, firstly, the normal direction and centroid coordinates of the current facade are calculated. Using the centroid as the pivot, the facade is rotated and transformed so that the normal direction of the facade is aligned with the depth axis. At this point, the facade is converted into a rectangle on a standard plane, which facilitates subsequent dimension calculations and uniform cutting.
[0081] S1035. Based on the reference unit size corresponding to the standard planar rectangle, determine the number of cells using the remainder comparison method, and determine the actual size of the cells based on the number of cells.
[0082] In this step, the width and height of the standard rectangle are read, and the reference unit size is set as the unit division reference. The facade width is divided by the reference unit size to obtain the quotient and remainder. If the remainder is less than the preset threshold, the number of cells is the integer part of the quotient. If the remainder is greater than or equal to the threshold, the number of cells is the rounded integer value of the quotient. Then, the actual facade width is divided by the number of cells to obtain the actual width of the adapted cells, ensuring that all cells evenly fill the entire facade.
[0083] S1036. Cut the standard planar rectangle at equal intervals along its long side to generate multiple cell faces, and delete the original facade of the floor unit.
[0084] In this step, the long side direction of the standard rectangle is identified, and the rectangle is cut at equal intervals along the long side according to the calculated number of cells, splitting the original single quadrilateral face into multiple small quadrilateral cell faces; after the cutting is completed, the original face is deleted, and the newly generated cell faces are retained.
[0085] S1037. Using a preset rotation inverse matrix, the cell face is rotated back to its original orientation to obtain multiple cells corresponding to each floor unit, and a corresponding cell sequence identifier is assigned to each cell.
[0086] The unit sequence identifier and the secondary identifier are combined to form the three-level identifier system.
[0087] In this step, the inverse matrix of the rotation operation is used to rotate all cell faces back to their original spatial orientation, making them consistent with the original facade orientation; cell sequence identifiers are assigned to cells within the same facade in sequence, for example, 0, 1, 2, etc. from left to right; the cell sequence identifiers are bound to the secondary identifiers to form a three-level identifier system of "structural block identifier, floor identifier, and cell sequence identifier", and each cell has a unique three-level identity identifier and complete hierarchical semantics.
[0088] In this way, the rotation inverse matrix ensures that the spatial position and orientation of the cell perfectly match the original facade without any positional deviation; the three-level identification system achieves accurate positioning of the entire hierarchy of "building, floor, and unit", providing a complete semantic index for the subsequent distribution of binary tree components.
[0089] S104. Based on the three-level identification system, call the door component code, the window component code, and the wall component code, and use the preset binary tree branching logic to perform component type distribution processing on the cell facade grid to obtain the component layout point cloud corresponding to each cell.
[0090] The component types of the point cloud arrangement include one of the following: door component type, window component type, and wall component type.
[0091] Here, the binary tree branching logic is a branch filtering logic constructed through multi-level binary flow nodes. Each level of node divides the input data into two branches to perform differentiated processing, thereby achieving hierarchical rule control.
[0092] In this step, the rule-based intelligent distribution of building facade components is carried out. The door component code, the window component code, and the wall component code are called. Based on the preset binary tree branching logic, the corresponding door, window, and wall component types are accurately matched for each cell according to the three-level filtering rules of "facade functional attributes, floor level, and unit order".
[0093] Here, this step replaces the traditional method of manually arranging components one by one or distributing them based on random probability. It realizes semantic and rule-based automatic control of the facade component layout, which is the core link to ensure the unity of the building group's style and support flexible adjustment of layout rules.
[0094] In this embodiment of the application, based on the three-level identification system, hierarchical branching filtering rules are used to match the corresponding component type for each cell, thereby achieving semantic and rule-based precise distribution of building facade components.
[0095] In this way, compared with traditional random distribution or hard-coded rules, binary tree branching logic has a clear hierarchical structure, flexible and convenient rule adjustment, and can accurately control the component types of different floors and locations, meeting the requirements of complex facade design rules.
[0096] In one possible implementation of this application, in specific implementation, step S104, which uses preset binary tree branching logic to perform component type distribution processing on the cell facade grid to obtain the component layout point cloud corresponding to each cell, may include: S1041. In the programmatic content generation pipeline, a multi-level distribution node is built to form a first distribution link and a second distribution link under the preset binary tree branching logic.
[0097] In this step, a multi-layered distribution node is built in the node network of the digital content creation tool. The first layer is the facade attribute distribution node, the second layer is the floor dimension distribution node (i.e., the first distribution link), and the third layer is the unit dimension distribution node (i.e., the second distribution link), which together form a binary tree-like distribution structure. Each level of node performs binary branch filtering according to the corresponding attribute.
[0098] S1042. Assign the cell corresponding to the non-functional facade to the wall component type, and send the cell corresponding to the functional facade to the first distribution link.
[0099] In this step, the first layer of filtering is carried out based on the functional attributes of the facade. All cells of non-functional facades (such as building gables and adjacent building surfaces) do not need to be set with doors and windows and are directly assigned as wall component types. Cells of functional facades enter the next level of the flow path for further type assignment.
[0100] S1043. In the first distribution link, based on the floor identifier corresponding to each floor unit, the cells of the first floor are distributed to the first floor dedicated branch, and the cells of the remaining floors are distributed to the standard floor general branch.
[0101] In this step, the second layer of filtering is performed according to the floor identifier. The cells of the first floor (floor identifier is 0) enter the first floor exclusive branch, which supports the setting of special components such as doors; the cells of the second floor and above enter the standard floor general branch; if some standard floors are preset to be solid wall floors, the cells of that floor are directly assigned to the wall component type.
[0102] S1044. In the second distribution link, for each cell in the first-level dedicated branch, a secondary filtering is performed based on the unit sequence identifier corresponding to each cell, and the cells with the unit sequence identifier as the starting value are mapped to the door component type, and the remaining cells are mapped to the window component type.
[0103] S1045. For each cell in the standard layer general branch, map the cell to the window component type.
[0104] In this step, in the dedicated branch on the first floor, the third layer of filtering is performed according to the unit sequence identifier. Typically, the cells in the center or entrance position (with the unit sequence identifier set to the preset starting value) are assigned as door component type, and the remaining cells on the first floor are assigned as window component type. All cells in the general branch of the standard layer are assigned as window component type by default, but some units can also be assigned as wall component type according to preset rules.
[0105] S1046. Based on the wall component type, door component type or window component type corresponding to each cell, generate a classified component layout point cloud.
[0106] In this step, the center position of each cell is extracted as the component installation anchor point. Each anchor point carries the corresponding component type attribute, normal direction attribute, and third-level identifier attribute. Finally, three independent layout point clouds are output: door component point cloud, window component point cloud, and wall component point cloud, which are used for subsequent component mapping and installation.
[0107] S105. Determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping, so as to assemble a three-dimensional building complex model.
[0108] Here, bit copy mapping is a geometric instantiation technique in digital content creation tools that can batch copy a single asset model to multiple target locations and automatically match the position, rotation, and scaling attributes of the corresponding locations.
[0109] This step involves the adaptive and automated assembly of building components. By converting the actual cell size to the component's labeled size and combining this with spatial orthogonal basis matrix transformation, the standardized component model is automatically adapted and installed into cell positions of different sizes and orientations. This step overcomes the limitations of traditional point-to-point replication technology, which can only reuse assets at fixed sizes. It achieves the effect of adapting a set of standard components to multiple building specifications, significantly reducing the workload of repeatedly creating component assets, and ultimately completing the assembly of the entire building complex's complete 3D model.
[0110] Among them, the calibration dimension refers to the reference dimension of the standardized component model, that is, the standard length, width and height dimensions of the component in the original coordinate system, which serves as the reference for size adaptation.
[0111] In this embodiment, standardized component models are automatically adapted to cells of different sizes to complete the batch installation of building facade components, enabling one set of components to adapt to multiple building sizes.
[0112] This solves the problem that traditional point copying can only be done with a fixed size and that different sized cells need to be made into separate components, greatly reducing the workload of component asset production. The components are accurately adapted, without deformation, and the installation position is accurate.
[0113] In one possible implementation of this application, step S105 may include: S1051. For each anchor point in the cell, construct a local orthogonal basis matrix based on the spatial position of the anchor point and the normal direction of the cell, and determine the actual width and actual height values of each cell.
[0114] Here, the orthogonal basis matrix is a transformation matrix composed of three mutually orthogonal unit vectors, used to describe the orientation and coordinate system of an object in three-dimensional space, and to realize spatial transformation between different coordinate systems.
[0115] In this step, the standardized component model is first normalized: the bounding box size of the standard component is calculated, the orthogonal basis matrix of the component is constructed, and the vertex coordinates of the component are transformed into the standard form of unit size to obtain the component model with the specified size; then, for the installation anchor point of each cell, the spatial position of the anchor point is used as the translation vector, the cell normal direction is used as the depth axis direction, and the vertical upward direction of the world coordinates is used as the Y-axis direction. The X-axis direction is obtained by cross product calculation. The three orthogonal unit vectors together constitute the rotation part of the local orthogonal basis matrix; at the same time, the actual width and actual height values of the cell are read.
[0116] S1052. The ratio between the actual width value and the corresponding nominal width value of the component type is determined as the width scaling ratio, and the ratio between the actual height value and the corresponding nominal height value of the component type is determined as the height scaling ratio.
[0117] In this step, a scaling method is used to calculate the adaptation scaling value. The scaling ratio in the width direction is the actual width of the cell divided by the component's nominal width, and the scaling ratio in the height direction is the actual height of the cell divided by the component's nominal height. The scaling ratio in the thickness direction is manually set through external parameters and adjusted by the user according to the building's wall thickness requirements. Through this scaling method, standardized components can automatically adapt to cells of different sizes without the need to create component assets separately for each size.
[0118] S1053. Write the width scaling ratio, the height scaling ratio, and the preset thickness scaling ratio into the local orthogonal basis matrix. Map the component layout point cloud to the corresponding position of each cell through matrix transformation. Complete the batch installation of the component layout point cloud through point copy mapping to assemble a three-dimensional building complex model.
[0119] In this step, the scaling ratios in three directions are written into the local orthogonal basis matrix to obtain the complete spatial transformation matrix; the vertex coordinates of the standardized components are multiplied by the transformation matrix to adapt the components to the position, orientation and size of the corresponding cells; by copying the mapping nodes by point, the corresponding type of components are mapped to all anchor points of the same type in batches, and the batch installation of all door, window and wall components is completed at one time, finally obtaining the assembled three-dimensional building complex model.
[0120] Optional, please refer to Figure 2 , Figure 2 This is a second flowchart illustrating a method for generating procedural content for building complexes based on a large language model, provided as an embodiment of this application. Figure 2 As shown in the embodiment of this application, the method for generating procedural content of building complexes based on a large language model also includes steps S106 and S107. Specifically, steps S106 and S107 are the finished product optimization and asset solidification links of the entire process. On the one hand, the assembled 3D building complex model is capped, cleaned up, and optimized in terms of topology to ensure that the output model meets the production standards of downstream production pipelines such as games and movies. On the other hand, the node network of all previous steps is encapsulated into a standardized and reusable procedural generation pipeline, and the core adjustment parameters are centralized in a unified control panel to realize a batch production mode of "parameter adjustment and one-click generation". This allows the entire generation method to be quickly reused in different projects and building complex production scenarios of different styles.
[0121] S106. Perform capping and mesh cleanup on the three-dimensional building complex model to obtain the target three-dimensional building complex model.
[0122] In this step, a capping surface is added to the top of each building to close the building's top structure and form a complete closed geometry; at the same time, redundant attributes, useless geometry, and erroneous topology of the entire building complex model are cleaned up, the model data structure is optimized, and the performance of subsequent use is improved.
[0123] This process improves the enclosure of the building model, removes redundant data, and enhances the quality and usability of the final model. The capping process ensures the building geometry is closed and complete, meeting the requirements of subsequent rendering, baking, and other production stages; mesh cleaning removes useless data, reduces model size, and improves the performance of subsequent operations.
[0124] S107. Encapsulate the nodes corresponding to the generated target 3D building complex model into a reusable procedural generation pipeline, and centralize the global parameters of the procedural generation pipeline into the main control panel of the digital content creation tool.
[0125] In this step, all node networks from steps S101 to S105 are encapsulated into an independent digital asset node, forming a reusable procedural generation pipeline. Global parameters that affect the overall effect (e.g., building density, size range, component style, random seed, etc.) are extracted to the main control panel. Users only need to adjust the main control parameters to regenerate the entire building complex with one click. It supports the rapid generation of multiple variations of building complexes with different styles and layouts. The output model can be directly connected to content production pipelines such as games and movies.
[0126] This approach encapsulates fragmented node processes into standardized, reusable assets, centralizes global parameters, lowers the barrier to entry, and improves batch generation efficiency. The encapsulated procedural pipeline can be directly reused in building cluster generation scenarios for different projects without the need for repeated process setup; the central control panel centralizes all core parameters, allowing users to adjust the overall effect without delving into the internal node network, making it convenient and efficient, and supporting the rapid generation of multiple scheme variations.
[0127] In summary, the method described in this application has the following advantages compared with the prior art: Deep integration of artificial intelligence and programmatic generation: Large language models are embedded as code generators in the core links of the programmatic content generation pipeline, replacing manual writing of modeling code, greatly reducing the development threshold of programmatic modeling, and significantly improving asset generation efficiency.
[0128] Full-process parameterization and controllability: All generated component code adopts parameter externalization syntax, and parameters can be directly adjusted through a visual interface. The generated building complex assets have complete parameterized editing capabilities and support the rapid generation of asset variants of multiple styles and sizes.
[0129] Hierarchical and precise semantic control: Through a three-level identification system and binary tree branching logic, semantic and precise distribution of building components is achieved. Compared with the traditional random distribution based on location probability, it has stronger controllability and interpretability and can flexibly adapt to complex facade design rules.
[0130] Adaptive component reuse: Through size ratio conversion and spatial matrix transformation, standardized components can be automatically adapted to cells of different sizes. A set of components can be reused on building facades of various specifications, greatly reducing the workload of creating repetitive assets.
[0131] End-to-end closed-loop reusable: It forms a complete automated pipeline from code generation to final model output, which can be packaged into reusable assets. It supports batch generation of building complex assets with different layouts and styles. The output model has a regular topology and can be directly connected to content production pipelines such as games and movies.
[0132] The method for generating procedural content for building complexes based on a large language model provided in this application generates multiple types of procedural component codes with parameter-exposed syntax by utilizing a large language model combined with a code generation constraint mechanism. These procedural component codes are then integrated into the procedural content generation pipeline of a digital content creation tool. This process sequentially generates the main structural block mesh of the building complex, performs hierarchical mesh segmentation and constructs a three-level identifier system, distributes component types based on binary tree branching logic, and performs batch installation of components through adaptive mapping of point cloud sizes. This method solves the problems of uncontrollable generated models, lack of parameterized editing capabilities, and non-standard topologies that prevent direct integration with production pipelines in existing online modeling solutions. It achieves parameterized, controllable, flexibly expandable, and batch-producible procedural automated generation of building complexes, improving the production efficiency and pipeline adaptability of 3D building complex assets.
[0133] Please see Figure 3 , Figure 4 , Figure 3 This is one of the structural schematic diagrams of a device for generating procedural content about building clusters based on a large language model, provided in an embodiment of this application. Figure 4 This is a second schematic diagram of a device for generating procedural content about building complexes based on a large language model, provided as an embodiment of this application. Figure 3 As shown, the procedural content generation device 300 for building complexes includes: The component code generation module 310 is used to respond to the user input functional requirement information received by the preset digital content creation tool, and based on the functional requirement information, to generate multiple types of programmatic component codes with parameter extroversion syntax using a preset large language model combined with a preset code generation constraint mechanism; wherein, the programmatic component codes include at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code. The main structure generation module 320 is used to connect the procedural component code into the procedural content generation pipeline in the digital content creation tool, and call the building structure generation code based on preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the procedural content generation pipeline. The floor unit segmentation module 330 is used to call the floor segmentation code and the facade unit segmentation code to perform hierarchical grid segmentation processing on the main structural block grid of the building complex, to obtain the floor unit corresponding to each main structural block of the building complex, and to perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade grid including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system; The component type distribution module 340 is used to call the door component code, the window component code, and the wall component code based on the three-level identification system, and to perform component type distribution processing on the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell; wherein, the component type of the component layout point cloud includes one of the door component type, window component type, and wall component type; The building model assembly module 350 is used to determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping, so as to assemble a three-dimensional building complex model.
[0134] Furthermore, when the component code generation module 310 generates multiple types of procedural component code with parameter extroversion syntax based on the functional requirement information and using a preset large language model combined with a preset code generation constraint mechanism, the component code generation module 310 is used to: The pre-set syntax constraint rules in the preset code generation constraint mechanism are concatenated before the functional requirement information to obtain the target prompt word, and the target prompt word is input into the preset large language model; wherein, the pre-set syntax constraint rules are used to constrain the large language model to follow the built-in programming language specification and parameter external syntax of the digital content creation tool to generate code; In response to receiving the structured results returned by the large language model, the structured results are parsed and the code validity is verified to obtain multiple initial code snippets; The initial code snippet is sent back to the large language model, and the secondary parameter review rules in the code generation constraint mechanism are used to instruct the large language model to generate multiple types of programmatic component code with parameter externalization syntax.
[0135] Furthermore, when the main structure generation module 320 is used to integrate the procedural component code into the procedural content generation pipeline of the digital content creation tool, and, based on preset building constraint configuration parameters, calls the building structure generation code to generate a building group main structure block mesh including multiple building group main structure blocks in the procedural content generation pipeline, the main structure generation module 320 is used for: The programmatic component code is integrated into the programmatic content generation pipeline in the digital content creation tool, and a visual parameter control panel is generated in the digital content creation tool; wherein, the visual parameter control panel includes plot grid parameters, building size range parameters, and random floor parameters; Based on the plot grid parameters, a plot layout grid is generated, and based on the building size range parameters and the floor random parameters, a building group main structure block corresponding to each plot in the plot layout grid is generated; Randomly remove some of the main structural blocks of the building complex as blank spaces to obtain a grid of main structural blocks of the building complex that includes multiple main structural blocks of the building complex, and assign a unique structural block identifier to each main structural block of the building complex.
[0136] Furthermore, when the floor unit segmentation module 330 performs hierarchical mesh segmentation processing on the main structural block mesh of the building complex to obtain floor units corresponding to each main structural block of the building complex, the floor unit segmentation module 330 is used to: For each main structural block of the building complex in the grid, determine the extreme value of the vertical bounding box of the main structural block of the building complex, and obtain the vertical low point height value and the vertical high point height value; Based on a preset number of floor segments, linear interpolation is performed between the vertical low point height value and the vertical high point height value to generate an ordered sequence of equidistantly distributed points corresponding to the main structural blocks of the building complex. Based on the ordered point sequence, Thiessen polygon cutting is performed to horizontally divide the main structural block of the building complex into multiple independent floor units, and a corresponding floor identifier is assigned to each floor unit; wherein, the floor identifier is associated with the structural block identifier of the corresponding main structural block of the building complex to form a secondary identifier.
[0137] Furthermore, when the floor unit segmentation module 330 performs nested subdivision segmentation on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, the floor unit segmentation module 330 is used to: By traversing all facades of each floor unit through nested loop nodes, the normal direction and centroid position of the facade are determined. The facade is rotated with the centroid position as the pivot so that the normal direction is aligned with the depth axis, thus obtaining the standard planar rectangle corresponding to the facade. Based on the reference unit size corresponding to the standard planar rectangle, the number of cells is determined using the remainder comparison method, and the actual size of the cells is determined based on the number of cells. The standard planar rectangle is cut at equal intervals along its long side to generate multiple cell faces, and the original facade of the floor unit is deleted. The cell faces are rotated back to their original orientation using a preset rotation inverse matrix to obtain multiple cells corresponding to each floor unit, and a corresponding cell sequence identifier is assigned to each cell; wherein, the cell sequence identifier and the secondary identifier are combined to form the tertiary identifier system.
[0138] Furthermore, when the component type distribution module 340 performs component type distribution processing on the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell, the component type distribution module 340 is used to: In the programmatic content generation pipeline, multi-level distribution nodes are built to form the first distribution link and the second distribution link under the preset binary tree branching logic; The cells corresponding to non-functional facades are mapped to the wall component types, and the cells corresponding to functional facades are sent to the first distribution link; In the first distribution link, the cells of the first floor are filtered based on the floor identifier corresponding to each floor unit, and the cells of the first floor are distributed to the first floor dedicated branch, while the cells of the other floors are distributed to the standard floor general branch. In the second distribution link, for each cell in the first-level dedicated branch, a secondary filtering is performed based on the unit sequence identifier corresponding to each cell. The cells with the unit sequence identifier as the starting value are mapped to the door component type, and the remaining cells are mapped to the window component type. For each cell in the standard layer general branch, map that cell to the window component type; Based on the wall component type, door component type, or window component type corresponding to each cell, a categorized component layout point cloud is generated.
[0139] Furthermore, when the building model assembly module 350 determines the scaling ratio between the actual size of each cell and the corresponding calibration size of the component type, and based on the scaling ratio, adapts and installs the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a three-dimensional building complex model, the building model assembly module 350 is used to: For each anchor point in the cell, a local orthogonal basis matrix is constructed based on the spatial position of the anchor point and the normal direction of the cell, and the actual width and actual height values of each cell are determined. The ratio between the actual width value and the corresponding nominal width value of the component type is determined as the width scaling ratio, and the ratio between the actual height value and the corresponding nominal height value of the component type is determined as the height scaling ratio. The width scaling ratio, the height scaling ratio, and the preset thickness scaling ratio are written into the local orthogonal basis matrix. The component layout point cloud is mapped to the corresponding position of each cell through matrix transformation. The component layout point cloud is then installed in batches through point copy mapping to assemble a three-dimensional building complex model.
[0140] Furthermore, such as Figure 4 As shown, the procedural content generation device 300 for building complexes further includes: The model finishing processing module 360 is used to perform capping processing and mesh cleaning on the three-dimensional building complex model to obtain the target three-dimensional building complex model. The global parameter aggregation module 370 is used to encapsulate the nodes corresponding to the generation of the target 3D building complex model into a reusable procedural generation pipeline, and to centralize the global parameters of the procedural generation pipeline into the main control panel of the digital content creation tool.
[0141] The architectural complex procedural content generation device based on a large language model provided in this application generates multiple types of procedural component codes with parameter-exposed syntax by utilizing a large language model combined with a code generation constraint mechanism. The procedural component codes are then integrated into the procedural content generation pipeline of a digital content creation tool. The device sequentially executes the generation of the main structural block mesh of the architectural complex, hierarchical mesh segmentation and construction of a three-level identification system, component type distribution based on binary tree branching logic, and batch installation of components through adaptive mapping of point cloud sizes. This solves the problems of uncontrollable generated models, lack of parameterized editing capabilities, and non-standard topology that prevents direct connection to the production pipeline in existing online modeling solutions. It achieves parameterized, controllable, flexibly expandable, and batch-producible procedural automated generation of architectural complexes, improving the production efficiency and pipeline adaptability of 3D architectural complex assets.
[0142] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
[0143] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 and the memory 520 communicate via the bus 530. When the machine-readable instructions are executed by the processor 510, they can perform the operations described above. Figure 1 as well as Figure 2 The steps of the method for generating procedural content for building clusters based on a large language model in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0144] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 as well as Figure 2 The steps of the method for generating procedural content for building clusters based on a large language model in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0145] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0149] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating procedural content about architectural complexes based on a large language model, characterized in that, The method includes: In response to the user input of functional requirement information received by the preset digital content creation tool, and based on the functional requirement information, the tool uses a preset large language model combined with a preset code generation constraint mechanism to generate multiple types of procedural component code with parameter extroversion syntax; wherein, the procedural component code includes at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code. The programmatic component code is integrated into the programmatic content generation pipeline in the digital content creation tool, and the building structure generation code is called based on the preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the programmatic content generation pipeline. The floor segmentation code and the facade unit segmentation code are invoked to perform hierarchical mesh segmentation processing on the main structural block mesh of the building complex, so as to obtain the floor unit corresponding to each main structural block of the building complex, and to perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade mesh including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system; Based on the three-level identification system, the door component code, the window component code, and the wall component code are called, and the component type distribution processing of the cell facade grid is performed using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell; wherein, the component type of the component layout point cloud includes one of the door component type, window component type, and wall component type; Determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a three-dimensional building complex model.
2. The method according to claim 1, characterized in that, Based on the functional requirements information, the system generates multiple types of programmatic component code with parameter extroversion syntax using a preset large language model combined with a preset code generation constraint mechanism, including: The pre-set syntax constraint rules in the preset code generation constraint mechanism are concatenated before the functional requirement information to obtain the target prompt word, and the target prompt word is input into the preset large language model; wherein, the pre-set syntax constraint rules are used to constrain the large language model to follow the built-in programming language specification and parameter external syntax of the digital content creation tool to generate code; In response to receiving the structured results returned by the large language model, the structured results are parsed and the code validity is verified to obtain multiple initial code snippets; The initial code snippet is sent back to the large language model, and the secondary parameter review rules in the code generation constraint mechanism are used to instruct the large language model to generate multiple types of programmatic component code with parameter externalization syntax.
3. The method according to claim 1, characterized in that, The step of integrating the procedural component code into the procedural content generation pipeline of the digital content creation tool, and calling the building structure generation code based on preset building constraint configuration parameters to generate a building complex main structure block mesh including multiple building complex main structure blocks in the procedural content generation pipeline, includes: The programmatic component code is integrated into the programmatic content generation pipeline in the digital content creation tool, and a visual parameter control panel is generated in the digital content creation tool; wherein, the visual parameter control panel includes plot grid parameters, building size range parameters, and random floor parameters; Based on the plot grid parameters, a plot layout grid is generated, and based on the building size range parameters and the floor random parameters, a building group main structure block corresponding to each plot in the plot layout grid is generated; Randomly remove some of the main structural blocks of the building complex as blank spaces to obtain a grid of main structural blocks of the building complex that includes multiple main structural blocks of the building complex, and assign a unique structural block identifier to each main structural block of the building complex.
4. The method according to claim 3, characterized in that, The step of performing hierarchical mesh segmentation on the main structural block mesh of the building complex to obtain the floor unit corresponding to each main structural block of the building complex includes: For each main structural block of the building complex in the grid, determine the extreme value of the vertical bounding box of the main structural block of the building complex, and obtain the vertical low point height value and the vertical high point height value; Based on a preset number of floor segments, linear interpolation is performed between the vertical low point height value and the vertical high point height value to generate an ordered sequence of equidistantly distributed points corresponding to the main structural blocks of the building complex. Based on the ordered point sequence, Thiessen polygon cutting is performed to horizontally divide the main structural block of the building complex into multiple independent floor units, and a corresponding floor identifier is assigned to each floor unit; wherein, the floor identifier is associated with the structural block identifier of the corresponding main structural block of the building complex to form a secondary identifier.
5. The method according to claim 4, characterized in that, The process of nesting and subdividing the facade of each floor unit to obtain multiple cells corresponding to each floor unit includes: By traversing all facades of each floor unit through nested loop nodes, the normal direction and centroid position of the facade are determined. The facade is rotated with the centroid position as the pivot so that the normal direction is aligned with the depth axis, thus obtaining the standard planar rectangle corresponding to the facade. Based on the reference unit size corresponding to the standard planar rectangle, the number of cells is determined using the remainder comparison method, and the actual size of the cells is determined based on the number of cells. The standard planar rectangle is cut at equal intervals along its long side to generate multiple cell faces, and the original facade of the floor unit is deleted. The cell faces are rotated back to their original orientation using a preset rotation inverse matrix to obtain multiple cells corresponding to each floor unit, and a corresponding cell sequence identifier is assigned to each cell; wherein, the cell sequence identifier and the secondary identifier are combined to form the tertiary identifier system.
6. The method according to claim 1, characterized in that, The step of distributing component types to the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell includes: In the programmatic content generation pipeline, multi-level distribution nodes are built to form the first distribution link and the second distribution link under the preset binary tree branching logic; The cells corresponding to non-functional facades are mapped to the wall component type, and the cells corresponding to functional facades are sent to the first distribution link; In the first distribution link, the cells of the first floor are filtered based on the floor identifier corresponding to each floor unit, and the cells of the first floor are distributed to the first floor dedicated branch, while the cells of the other floors are distributed to the standard floor general branch. In the second distribution link, for each cell in the first-level dedicated branch, a secondary filtering is performed based on the unit sequence identifier corresponding to each cell. The cells with the unit sequence identifier as the starting value are mapped to the door component type, and the remaining cells are mapped to the window component type. For each cell in the standard layer general branch, map that cell to the window component type; Based on the wall component type, door component type, or window component type corresponding to each cell, a categorized component layout point cloud is generated.
7. The method according to claim 1, characterized in that, The process of determining the scaling ratio between the actual size of each cell and the calibrated size of the corresponding component type, and based on the scaling ratio, adapting and installing the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping to assemble a 3D building complex model, includes: For each anchor point in the cell, a local orthogonal basis matrix is constructed based on the spatial position of the anchor point and the normal direction of the cell, and the actual width and actual height values of each cell are determined. The ratio between the actual width value and the corresponding nominal width value of the component type is determined as the width scaling ratio, and the ratio between the actual height value and the corresponding nominal height value of the component type is determined as the height scaling ratio. The width scaling ratio, the height scaling ratio, and the preset thickness scaling ratio are written into the local orthogonal basis matrix. The component layout point cloud is mapped to the corresponding position of each cell through matrix transformation. The component layout point cloud is then installed in batches through point copy mapping to assemble a three-dimensional building complex model.
8. The method according to claim 1, characterized in that, The method further includes: Perform capping and mesh cleanup on the three-dimensional building complex model to obtain the target three-dimensional building complex model; The nodes corresponding to the generated target 3D building complex model are encapsulated into a reusable procedural generation pipeline, and the global parameters of the procedural generation pipeline are centralized in the main control panel of the digital content creation tool.
9. A device for generating procedural content about architectural complexes based on a large language model, characterized in that, The procedural content generation device for the building complex includes: The component code generation module is used to respond to the user input functional requirement information received by the preset digital content creation tool, and based on the functional requirement information, to generate multiple types of programmatic component code with parameter extroversion syntax using a preset large language model combined with a preset code generation constraint mechanism; wherein, the programmatic component code includes at least building structure generation code, floor segmentation code, facade unit segmentation code, door component code, window component code, and wall component code. The main structure generation module is used to integrate the programmatic component code into the programmatic content generation pipeline in the digital content creation tool, and call the building structure generation code based on preset building constraint configuration parameters to generate a building group main structure block mesh including multiple building group main structure blocks in the programmatic content generation pipeline. The floor unit segmentation module is used to call the floor segmentation code and the facade unit segmentation code to perform hierarchical mesh segmentation processing on the main structural block mesh of the building complex, to obtain the floor unit corresponding to each main structural block of the building complex, and to perform nested subdivision segmentation processing on the facade of each floor unit to obtain multiple cells corresponding to each floor unit, so as to form a cell facade mesh including the main structural block of the building complex, the floor unit and the cells corresponding to the three-level identification system; The component type distribution module is used to call the door component code, the window component code, and the wall component code based on the three-level identification system, and to perform component type distribution processing on the cell facade grid using a preset binary tree branching logic to obtain the component layout point cloud corresponding to each cell; wherein, the component type of the component layout point cloud includes one of the door component type, window component type, and wall component type; The building model assembly module is used to determine the scaling ratio between the actual size of each cell and the calibration size of the corresponding component type, and based on the scaling ratio, adapt and install the procedural components corresponding to the component layout point cloud to the corresponding positions of each cell through point-to-point copy mapping, so as to assemble a three-dimensional building complex model.
10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the method for generating procedural content of building complexes based on any one of claims 1 to 8.
