Chinese style garden programmed generation method and system

Through a Chinese garden programmatic generation method and system combining WFC algorithm and 3D texture mapping technology, the problem of difficulty in generating Chinese ancient building complexes in the existing technology is solved, and efficient and flexible 3D digital asset generation is achieved, which lowers the threshold for use and improves creative efficiency.

CN120180552APending Publication Date: 2025-06-20TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510244662.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively generate a three-dimensional model that conforms to the structural rules of Chinese ancient building complexes, and the existing programmatic building generation tools are cumbersome and have high thresholds, so they cannot take into account the expression and creative practice of ancient building structures.

Method used

A Chinese garden programmatic generation method and system is adopted to optimize the building layout and decoration details through the collaborative work of water and land terrain division, garden layout generation and single building generation, combined with WFC algorithm and 3D texture mapping technology, and to generate building complexes that conform to Chinese garden rules.

Benefits of technology

It significantly lowers the threshold for users to learn ancient architecture knowledge, improves the creative efficiency of art workers, promotes the output speed of 3D digital assets, ensures that the generated garden complex complies with the layout rules of Chinese gardens, and takes into account the needs of diversified expression and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180552A_ABST
    Figure CN120180552A_ABST
Patent Text Reader

Abstract

The invention discloses a Chinese style garden programmed generation method and system, and the method comprises the steps: firstly, carrying out the land and water terrain division according to the land and water distribution data drawn by a user, generating a terrain mask graph, and providing a basis for the subsequent layout; secondly, in a garden layout generation stage, the system screens an area suitable for building placement from the terrain mask graph, optimizes the building layout by using a WFC algorithm in combination with a 3D texture mapping technology, generates a preliminary layout white-box model conforming to garden rules, and optimizes building orientation and path connectivity; and finally, in a single building generation stage, the system generates a building model comprising a framework and a small component structure according to building parameters input by a user, and decoration details are added to perfect the appearance of the building. According to the method, the basic rules and diversified expression requirements of the Chinese style building are met, the learning cost of the user can be reduced through parameterized adjustment and interaction functions, the creation efficiency is improved, and the digital generation effect and the propagation effect of the Chinese style garden are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technology of procedural generation of buildings, and particularly to a method and system for procedural generation of Chinese gardens. Background Art

[0002] Nowadays, large-scale interactive media applications have emerged in related industrial fields such as entertainment, tourism, and cultural heritage protection. Virtual reality development requires a large number of three-dimensional scenes, among which ancient building models account for a large proportion. Many manufacturers have also begun to attempt to reproduce and recreate the three-dimensional scenes of Chinese ancient buildings. Chinese ancient buildings have general rules in the single structure. Among them, "jian" refers to the rectangular space formed by adjacent walls or columns, which is the standard unit for organizing space in traditional Chinese architecture and can be expanded or repeated for single buildings or building complexes. Therefore, using these repetitive rules to procedurally generate ancient buildings can help designers quickly produce Chinese ancient building models and scenes that meet the standards in the construction of large-world scenes.

[0003] However, the learning cost of the construction rules of Chinese ancient building complexes is high, and there is a lack of methods for generating Chinese building complexes.

[0004] Existing procedural building generation methods in the industry usually rely on string rewriting, such as L-System, SplitGrammar, or Shape Grammar, etc.; Salpisti et al. combined image-based modeling and shape grammar modeling and applied them to vehicle driving scene simulation to generate urban buildings of different styles. However, most of these buildings are modern urban buildings, and the building silhouettes are relatively close to "square boxes", making it difficult to describe the variable body structures of ancient buildings and even more difficult to describe the complex cornice structures. Grammar-based methods will produce block-like models, but it is difficult to model curved ridges and surfaces with various shapes and different roof types. Huang et al. proposed a spline-based interactive procedural pavilion building modeling method. This tool only uses two main parameters, namely platform width and platform depth, to create a platform and edits it using control points and guiding paradigms. After editing, the modeling system selects prefabricated components from the component library and instantiates them onto the framework to obtain the final model. However, this method is for the editing of single ancient building models and does not consider the influence of the ancient building group environment.

[0005] The existing ancient building procedural generation tools still have deficiencies in design. They usually focus on the generation of single ancient buildings and modern building complexes, and cannot be adapted to ancient building groups. Moreover, they are relatively cumbersome in operation, have a certain threshold for the user's architectural knowledge reserve, lack clear usage guidelines and rich interactive elements, and thus it is difficult to balance the expression of ancient building structures and the promotion of active creative practices. Based on the research status of architectural procedural generation, we can find that at present, there is a lack of procedural building generation tools with both high performance and high flexibility, and there is also a lack of procedural generation methods for complex Chinese ancient building groups represented by gardens.

[0006] It should be noted that the information disclosed in the above background art is only used for understanding the background of the present application, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0007] The main purpose of the present invention is to overcome the defects existing in the above background art, and provide a method and system for procedural generation of Chinese gardens.

[0008] To achieve the above purpose, the present invention adopts the following technical solutions:

[0009] A method for procedural generation of Chinese gardens, comprising the following steps:

[0010] S1. Water-land terrain division: Divide the water-land area according to the water-land distribution data drawn by the user, and convert the water-land division result into a terrain mask map;

[0011] S2. Garden layout generation: Screen out the areas suitable for building placement from the terrain mask map; Optimize the building layout through the WFC algorithm combined with 3D texture mapping technology to make it conform to the garden rules; Generate a white-box model of the preliminary layout of the garden buildings, and optimize the orientation and path connectivity of the garden buildings to provide layout information for the generation of single buildings;

[0012] S3. Single building generation: Generate a building model including a skeleton and a sub-component structure according to the building parameters input by the user, and add decorative details to the building to improve the building appearance.

[0013] Further, in step S1, the water-land terrain division generates a terrain mask map through the input data drawn by the user, specifically including:

[0014] Discretize the water-land distribution data drawn by the user into a uniform grid, and assign a scalar value representing the water level or land attribute to each grid node;

[0015] Perform binary classification on the grid cells by setting a threshold to generate a water-land boundary polygon;

[0016] Topologically connect and smooth the generated land-water boundary polygons to form a continuous terrain mask map.

[0017] Furthermore, in step S2, the WFC algorithm combines 3D texture mapping technology to optimize the building layout, specifically including:

[0018] Divide the candidate building area into grids and initialize the entropy value of each grid;

[0019] Iteratively select the lowest entropy cell and randomly select the final module at this position according to the weight probability;

[0020] Combine 3D texture mapping technology and constrain the module selection of adjacent grids according to the water direction and height information of the terrain mask map;

[0021] Generate a connected graph of the building layout that conforms to the garden rules through constraint propagation and loop processing.

[0022] Furthermore, during the iteration of the WFC algorithm, grids in the water direction are preferentially selected for module placement, and unreasonable generation results inside the water area are removed according to the 3D texture mapping rules.

[0023] Furthermore, in step S2, after generating the white-box model of the preliminary layout of the garden buildings, further optimize the building orientation and path connectivity, specifically including:

[0024] Dynamically adjust the building orientation according to the landscape view matching rules;

[0025] Ensure the path accessibility between buildings through the path connectivity optimization algorithm;

[0026] Supplement connecting bridges to broken paths to optimize the overall connectivity of the garden layout.

[0027] Furthermore, in step S3, the generation of individual buildings includes:

[0028] Generate the foundation and walls according to the building parameters input by the user, and determine the column spacing by generating cylinders in a loop;

[0029] Generate different types of roofs according to the building type, including hip roofs, gable and hip roofs, overhanging roofs, and pyramidal roofs;

[0030] Optimize the topological structure of the roof grid through the annular dissection method to ensure the natural presentation of texture mapping.

[0031] Furthermore, during the roof generation process, ensure that the normal directions of the roof grids are consistent through vertex coordinate calculation and triangular patch generation, and avoid abnormal lighting during rendering.

[0032] Further, in step S3, adding decorative details to the building specifically includes:

[0033] By parametrically adjusting the tile arrangement, arranging the tiles row by row along the roof slope to ensure tight connection between the tiles;

[0034] Using texture masks to randomly overlay carved patterns in the wall and door / window areas, and implementing dynamic color adjustment for the carvings and painted patterns through Shaders.

[0035] Further, in step S3, after the individual building is generated, it supports the user to adjust the building form details through the interaction interface, including the selection of roof type, size control, roof slope adjustment, eave curvature, column spacing, door / window style, and building component material library.

[0036] A Chinese-style garden procedural generation system includes:

[0037] A land-water terrain division module, used to divide the land-water area according to the land-water distribution data drawn by the user, and convert the land-water division result into a terrain mask map;

[0038] A garden layout generation module, used to screen out the areas suitable for building placement from the terrain mask map, optimize the building layout through the WFC algorithm combined with 3D texture mapping technology to make it conform to the garden rules; generate a white-box model of the preliminary layout of the garden buildings, and optimize the garden building orientation and path connectivity to provide layout information for the generation of individual buildings;

[0039] An individual building generation module, used to generate a building model including a skeleton and a small component structure according to the building parameters input by the user, and add decorative details to the building to improve the building appearance.

[0040] The present invention has the following beneficial effects:

[0041] The method and system for procedurally generating Chinese-style gardens according to the embodiments of the present invention integrate the layout rules of Chinese-style gardens into the procedural generation of building complexes, providing a top-down generation method from the overall layout of the garden to individual buildings, significantly reducing the learning threshold of users for ancient architecture knowledge, improving the creative efficiency of art workers, and promoting the output speed of 3D digital assets. Combining the improved WFC algorithm and 3D texture mapping technology, the present invention optimizes the generation process of building layouts, ensures that the generated garden building complexes conform to the layout rules of Chinese-style gardens, and at the same time takes into account the needs of diverse expressions and flexibility. Through the coordinated work of three parts: land and water terrain division, garden layout generation, and individual building generation, the present invention can not only efficiently generate building complexes that conform to the rules of Chinese-style gardens, but also provide users with rich interactive functions and real-time feedback, enhancing the control and flexibility of building details. The embodiments of the present invention provide a tool for procedurally generating ancient buildings developed based on a hierarchical tree and spline modeling framework. In addition, the embodiments of the present invention propose solutions from the perspectives of the overall garden building layout and connected paths. The present invention overcomes the limitations of only generating individual buildings in the prior art, realizes the procedural generation of the structure of complex Chinese ancient building complexes, and thus significantly improves the digital dissemination effect and user experience of Chinese-style gardens.

[0042] Other beneficial effects in the embodiments of the present invention will be further described below. Brief Description of the Drawings

[0043] Figure 1 is the system architecture diagram in the embodiments of the present invention;

[0044] Figure 2 is the system working flow chart in the embodiments of the present invention;

[0045] Figure 3 is the garden hierarchical structure diagram used in the system in the embodiments of the present invention;

[0046] Figure 4 is the technical architecture diagram of the land and water division module in the garden procedural generation system in the embodiments of the present invention;

[0047] Figure 5 is the technical architecture diagram of the garden layout generation module in the garden procedural generation system in the embodiments of the present invention;

[0048] Figure 6 is the solution schematic diagram of the individual building generation and interaction module in the garden procedural generation system in the embodiments of the present invention;

[0049] Figure 7 is the schematic diagram of the building layout generation process of the garden layout generation module in the garden procedural generation system in the embodiments of the present invention;

[0050] Figure 8 It is a schematic diagram of the white-box generation result of the garden layout generation module in the garden procedural generation system in the embodiment of the present invention;

[0051] Figure 9 It is a schematic diagram of the building generation result of the single building generation and interaction module in the garden procedural generation system in the embodiment of the present invention.

[0052] Figure 10 It is the overall flowchart of the Chinese-style garden procedural generation method in the embodiment of the present invention. Specific implementation manners

[0053] The following makes a detailed description of the implementation manners of the present invention. It should be emphasized that the following description is merely exemplary and not intended to limit the scope of the present invention and its applications.

[0054] The conventional generation methods of Chinese ancient architectures usually only focus on the generation of a single building. The present invention aims to develop an ancient architecture procedural generation tool based on a hierarchical tree and spline modeling framework to achieve top-down generation from the overall garden layout to the garden single buildings. The main processes include three stages: land and water terrain division, garden layout generation, and single building generation. Among them, in the land and water terrain division stage, according to the user's input, data output related to the garden layout generation module is obtained. The garden layout generation stage is the basis for generating the garden building complex. It mainly embeds the main layout rules of Chinese-style gardens into the building complex generation framework and realizes the generation of scene models from 2D to 3D dimensions by improving the WFC algorithm. The single building generation stage can realize the generation of different forms of single ancient buildings and provide users with parameters and interactive experiences for adjusting building details, enhancing the user's control over the details and flexibility of the building complex generation. The present invention can enhance the efficiency and flexibility of the digital generation of garden 3D assets, utilize procedural generation technology, enhance the user's learning and experience of Chinese-style garden landscape content, and thus improve the digital dissemination effect of Chinese-style gardens.

[0055] Refer to Figures 1 to 10 , the embodiment of the present invention provides a Chinese-style garden procedural generation method, including the following steps (see Figure 10 ):

[0056] Step S1, land and water terrain division: Divide the land and water areas according to the land and water distribution data drawn by the user, and convert the land and water division result into a terrain mask map.

[0057] In a preferred embodiment, in step S1, the land and water terrain division generates a terrain mask map from the input data drawn by the user, which specifically includes: discretizing the land and water distribution data drawn by the user into a uniform grid, and assigning a scalar value representing the water level or land attribute to each grid node; classifying the grid cells into binary values by setting a threshold to generate a land and water boundary polygon; performing topological connection and smoothing processing on the generated land and water boundary polygon to form a continuous terrain mask map.

[0058] Step S2, garden layout generation: Screen out the areas suitable for building placement from the terrain mask map; optimize the building layout through the WFC (WaveFunctionCollapse) algorithm combined with 3D texture mapping technology to make it conform to the garden rules; generate a white box model of the preliminary layout of the garden building, and optimize the orientation and path connectivity of the garden building to provide layout information for the generation of individual buildings.

[0059] In a preferred embodiment, in step S2, the WFC algorithm combined with 3D texture mapping technology to optimize the building layout specifically includes: dividing the candidate building area into grids and initializing the entropy value of each grid; iteratively selecting the lowest entropy cell and randomly selecting the final module at this position according to the weight probability; combining 3D texture mapping technology, and constraining the module selection of adjacent grids according to the water direction and height information of the terrain mask map; generating a connected graph of the building layout that conforms to the garden rules through constraint propagation and loop processing. Further preferably, during the iteration of the WFC algorithm, grids in the water direction are preferentially selected for module placement, and unreasonable generation results inside the water area are eliminated according to the 3D texture mapping rules. Preferably, after generating the white box model of the preliminary layout of the garden building, further optimize the building orientation and path connectivity, specifically including: dynamically adjusting the building orientation according to the landscape opposite view rules; ensuring the path accessibility between buildings through the path connectivity optimization algorithm; supplementing connecting bridges for broken paths to optimize the overall connectivity of the garden layout.

[0060] Step S3, individual building generation: Generate a building model including a skeleton and a sub-component structure according to the building parameters input by the user, and add decorative details to the building to improve the building appearance.

[0061] In a preferred embodiment, in step S3, the individual building generation includes: generating a foundation and a wall according to the building parameters input by the user, and determining the column spacing by circularly generating cylinders; generating different types of roofs according to the building type, including hip roofs, gable and hip roofs, overhanging gable roofs, and pyramidal roofs; optimizing the topological structure of the roof grid through the annular dissection method to ensure the natural presentation of texture mapping. Further, during the roof generation process, the normal direction of the roof grid is ensured to be consistent through vertex coordinate calculation and triangular patch generation, avoiding abnormal lighting during rendering.

[0062] In a preferred embodiment, adding decorative details to the building specifically includes: parametrically adjusting the tile arrangement, arranging the tiles row by row along the roof slope to ensure tight connection between the tiles; using texture masks to randomly overlay carved patterns in the wall and door / window areas, and implementing dynamic color adjustment for the carvings and painted patterns through a Shader. After the individual building is generated, it supports the user to adjust the building form details through an interactive interface, including the selection of roof type, size control, roof slope adjustment, eave curvature, column spacing, door / window style, and building component material library.

[0063] An embodiment of the present invention also provides a Chinese garden procedural generation system (see Figure 1 ), including: a water-land terrain division module for dividing water-land areas according to the water-land distribution data drawn by the user and converting the water-land division result into a terrain mask map; a garden layout generation module for screening out areas suitable for building placement from the terrain mask map, optimizing the building layout through the WFC algorithm combined with 3D texture mapping technology to make it conform to garden rules, generating a white-box model of the preliminary layout of the garden buildings, and optimizing the orientation and path connectivity of the garden buildings to provide layout information for the generation of individual buildings; an individual building generation module for generating a building model including a skeleton and a small component structure according to the building parameters input by the user, and adding decorative details to the building to improve the building appearance.

[0064] The Chinese garden procedural generation method and system of the present invention integrate the layout rules of Chinese gardens into the procedural generation of building groups. On the basis of meeting the basic rules and requirements of Chinese architecture in terms of flexibility, they also take into account the diverse expressions of ancient garden building groups, and can provide rich interactive functions and real-time feedback on the interaction results in terms of game play. It overcomes the difficulties in the editing and interaction of individual building models and the visual representation of landscaping rules in Chinese garden scenes, reduces the threshold for users to learn and understand ancient architecture knowledge, improves the creation efficiency of art workers, and promotes the output speed of 3D digital assets. The present invention realizes the top-down generation from the overall layout of the garden to the individual garden buildings. The preferred embodiment also realizes the development of an ancient building procedural generation tool based on a hierarchical tree and spline modeling framework. The present invention can also provide parameters and interactive experiences for users to adjust building details, enhancing the user's control over the details and flexibility of the building group generation. Different from the generation of a single building, the present invention proposes a solution for Chinese ancient building groups from the perspectives of the overall garden building layout and the garden connection path. Generally speaking, the present invention can enhance the efficiency and flexibility of the digital generation of garden 3D assets, utilize procedural generation technology to enhance the user's learning and experience of Chinese garden landscape content, and thus improve the digital communication effect of Chinese gardens.

[0065] The following further describes specific embodiments and examples of the present invention.

[0066] A Chinese-style garden procedural generation system includes a land and water terrain division interaction module, a garden layout generation module, and a single building generation and interaction module. Among them, the land and water terrain division module obtains relevant data output for the garden layout generation module by accepting user input. The garden layout generation module is the basis for generating a garden building complex. This module mainly embeds the main layout rules of Chinese-style gardens into the building complex generation framework and realizes the generation of scene models from 2D to 3D dimensions by improving the WFC algorithm. The single building generation and interaction module is used for generating different forms of single ancient buildings and provides users with parameters and interaction experiences that can adjust building details, enhancing the user's control over the details and flexibility of the building complex generation. The present invention can enhance the efficiency and flexibility of the digital generation of garden 3D assets, utilize procedural generation technology, enhance the user's learning and experience of Chinese-style garden landscape content, and thus improve the digital dissemination effect of Chinese-style gardens.

[0067] In some embodiments, the interaction module for controlling the land and water area division includes an input processing module, a drawing input module processing, and an interaction interface module. The input processing module is used to process inputs from hardware and software. The drawing input module is used to process inputs related to drawing. The interaction interface module is used to construct the visual UI elements of the game and create a user interface. The land and water area division module includes the design and technical access of the work process for processing user-drawn input data and storing the land and water distribution data structure. The content generation of the garden layout generation module is based on the land and water division mask map drawn by the user and the layout rules of Chinese-style gardens. The content control related to the garden layout generation module includes adjusting macro-adjustment parameters such as the garden orientation, the average height of the garden, and the building occupancy ratio within the garden area. The garden generation interaction system includes garden layout interaction and garden single building interaction. The generation of garden single buildings includes four types of roofs and supports dynamic adjustment of the floor area length and width, building height, and eave curvature rate of the building.

[0068] Different from the generation of a single building, the embodiments of the present invention propose a solution for the generation of Chinese-style ancient building complexes from the perspectives of the overall garden building layout and the garden connection path. And a tool for procedural generation of ancient buildings is developed based on a hierarchical tree and spline modeling framework.

[0069] The procedural generation method and system of the building complex based on garden rules proposed by the embodiments of the present invention mainly include the following parts: land and water terrain division interaction, garden layout generation, single building generation and interaction. When the present invention is a computational program product, it finally forms an application product that can be directly installed and used in the Unity3D project. Combined Figure 1 with the following, each module in the embodiments of the present invention will be specifically introduced.

[0070] Process Overview

[0071] For the above-mentioned interactive media, it is unrealistic for 3D artists and scene artists to generate garden buildings manually, which requires the assistance of programs. However, if artists often need to change the style of the scene and iterate the visual performance of the garden, and designers also need to frequently adjust which areas in the map need to generate buildings, or adjust the form of the generated buildings. The operation process of the system is as follows Figure 2 shown.

[0072] Therefore, the process in the present invention disassembles the production of art resources in the garden scene from top to bottom. The artist determines the distribution of land and water in the generation area, and then the program delineates the area where buildings need to be generated on the map according to the garden rules. Finally, the single building is instantiated in the building area and the details are adjusted.

[0073] First of all, designing parameters related to building rules is the basic part of this tool. By defining key parameters such as the spatial position, proportion, and scale of the building, the generated building is ensured to comply with the garden layout rules. For example, the height limit, spacing, and orientation of the building can be set through parameters to ensure the reasonable distribution of the building in the garden. This process not only lays the foundation for the building layout, but also provides a basis for subsequent iterations and adjustments.

[0074] On this basis, calculation iteration rules are written to control the spatial relationship and changes of the generated building complex. Iteration rules allow the tool to repeatedly optimize the building position according to different layout requirements to ensure that the generated garden has a reasonable spatial distribution. For example, through iterative algorithms, the system can achieve dynamic adjustment of buildings, simulate gradual changes in nature, and optimize the overall layout effect. The introduction of iterative rules enables the garden layout to be adaptively adjusted, meeting aesthetic requirements while also having spatial functionality.

[0075] The instantiation generation of individual buildings is the key to transforming architectural rules and iterative results into actual buildings. In this step, the tool will concretize each building unit into a 3D model with actual form according to the previous parameter settings. Through instantiation generation, each building unit not only conforms to the parameter rules, but also has the characteristics of adapting to specific locations and sizes, forming an organic part of the overall building complex.

[0076] Parametric adjustment and control is an important function of the garden generation tool, allowing users to personalize the generated garden. Through parametric adjustment, users can easily adjust the height, color, orientation, etc. of the building, so that the generated garden can meet the needs of specific projects while being flexible and controllable. This design greatly improves the applicability of the tool, making it suitable not only for standard garden design, but also for creative design scenarios.

[0077] The development of editing brushes is to enhance the user experience and allow users to manually edit local areas. The functions of the editing brushes include selecting, adding, deleting, and modifying building or landscape elements. Designers can use the brushes to make fine adjustments in the generated garden, such as modifying the vegetation type at the edge of a building or adjusting the boundary of a water body. The addition of this function greatly enhances the user's operational freedom and enables the procedurally generated results to be perfectly integrated with the designer's personal style.

[0078] Multi-level model of the garden

[0079] Chinese gardens are famous for their unique cultural connotations and spatial expressions, and the layout of their buildings and landscapes presents a significant hierarchical structure. This hierarchical model, from the macroscopic overall planning to the microscopic detailed design, reflects the profound understanding of traditional Chinese culture regarding spatial organization and functional requirements. This article explores the hierarchical model and spatial logic of Chinese garden architecture from five levels: the overall layout of the garden, landscape areas, individual buildings, architectural components, and the interaction between people and the scenery.

[0080] Firstly, the overall layout of the garden is the top-level structure of garden design and the basis for determining the spatial pattern of the garden. At this level, designers need to comprehensively consider the terrain, climate, historical culture, and functional requirements to construct the spatial framework of the garden. The core concept of the overall layout of Chinese gardens is "adapting to local conditions," emphasizing the harmonious relationship between humans and nature. Imperial gardens usually adopt an axisymmetric layout form to showcase order and majesty, while private gardens tend to be more freely combined, pursuing the flexibility and diversity of space. The overall layout not only needs to reasonably arrange the positions of the main entrance, main scenic areas, and auxiliary functional areas but also create an overall landscape with cultural depth and artistic aesthetics through the ingenious combination of nature and the artificial.

[0081] Secondly, at the level of landscape areas, Chinese gardens divide the overall layout into several independent yet interrelated landscape units through separation and connection. The division of these areas aims to achieve the visual effect of changing scenery with each step while endowing each area with a unique thematic mood. Through design techniques such as door openings and lattice windows, metaphorical spatial transitions are achieved between landscape areas, and the use of obstructive scenery increases the privacy and interest of the areas. Each area is usually divided into a reception area, a recreation area, a praying area, etc. according to its function and is connected by paths and corridors to form a spatially rich sequence. The spatial organization of the areas not only pays attention to the rationality of functional zoning but also reflects the dynamic aesthetics of the traditional garden that "the scenery changes with each step."

[0082] Based on the landscape area, individual buildings become the core elements that carry specific functions and landscape artistic conceptions. The buildings in Chinese gardens are shaped by their functions, and their forms and positions reflect the overall layout idea of the gardens. The main buildings such as halls are often located at the core of the gardens, being both the functional centers of the gardens and the concentrated expressions of culture and art; pavilions provide the function of overlooking from a height for visitors through the extension of vertical space and enhance the three-dimensional sense of the gardens. Auxiliary buildings such as corridors, pavilions, and waterside pavilions play the roles of connecting spaces and embellishing scenic spots. Chinese garden buildings emphasize the integration with natural landscapes, with the buildings and the environment permeating each other and jointly constituting a vibrant overall space.

[0083] The methods in the embodiments of the present invention all focus on the four hierarchical structures included in the gardens: the overall layout of the gardens, landscape areas, individual buildings, and building components. The generation process of the garden generation tool is based on these four levels. Through the analysis of Chinese gardens, a set of six recurring space types are determined: (1) large rooms, (2) small rooms, (3) pavilions, (4) courtyards and squares, (5) covered corridors, and (6) paths, and these six space types are used as the main content of generation. According to different generation technical methods, these six main space types can be further divided into three categories: housing buildings, connecting buildings, and customizable areas. Large and small houses are usually defined physically and visually by walls and the surrounding landscapes. The main component houses of Chinese garden buildings can be clearly divided into two types, which can be described here with the descriptors "large" and "small". However, the definition of a large room or a small room does not entirely depend on its area. The house area and its surrounding components are all considered part of the house. The area of a large room is indeed usually larger than that of a small room, but importantly, it usually also has a courtyard containing other landscape elements. Therefore, a large room is one that provides a relatively complete and independent living space, while a small room, even if close in area to its larger counterpart, does not have these functions. The space type of "pavilion" includes covered or roofed structures. "Courtyards and squares" are open and have unclear boundaries. The last two types are variants of narrow spaces. The first is a roofed or "covered corridor", and the second is usually an uncovered winding "path". The scope of these corridor types is determined by the surface treatment of the ground plane (such as paving stones) and low landscape walls and plantings.

[0084] Among the six space types, the definition of the path is the most complex because many paths in Chinese gardens are very short and only provide an intermediate connection structure between the other two main elements. Instead of adding numerous independent paths in each garden structure, it is better to only calculate the paths necessary to connect two spaces. In addition, the connecting paths between different space types also have certain characteristics. For example, a pavilion usually has only one connection; a part of the courtyard is usually connected to a large garden room, etc.

[0085] Based on the mathematical characteristics of the above-mentioned garden rules, the composition structure of the garden can be abstracted into a series of spatial type diagrams and connected graphs. The average size and quantity of each spatial type are used to generate nodes, and then the connection points are optimized to achieve the graphic value. Finally, the nodes are transformed into abstract but correctly scaled garden elements.

[0086] Land-water division interaction

[0087] The drawing tool assists the user in controlling the land-water distribution of the garden area and realizes the visualization of the concept. The drawing tool is one of the functions within the tool system and provides an intuitive and easy-to-use interface for the user. From the user's perspective, on the left side of the screen are the drawing board and various painting tools, and the real-time generated drawing results are displayed on the scene terrain.

[0088] The interaction function includes an input processing module, a drawing input module, and an interaction interface module. The input processing module is used to process the input from hardware and software. The drawing input module is used to process the input related to drawing. The interaction interface module is used to construct the visual UI elements of the game and create the user interface.

[0089] The input processing module processes the input from hardware and software. Hardware inputs, such as mouse and keyboard operations, are managed through the built-in c# interface in Unity. Software inputs, mainly involving UI interactions, are implemented by creating the UnityEditor class and its subclasses.

[0090] The drawing input module processes the input related to drawing. The system is based on the surface texture drawing function in the UnityTerrain module. When the player enters the drawing mode, they can click to select a brush and hold down and move the mouse within the canvas range to draw. The implementation methods of the drawing system are one or more of the following:

[0091] (1) Create a texture brush material for the brush, and define the brush shape (such as circular, soft edge, square, etc.) through a predefined grayscale map (BrushMask). The white area represents the maximum intensity, and the black represents no influence. (2) Convert the screen coordinates (mouse / touch point) of the brush to the local coordinates of the terrain, and then map them to the UV coordinates of the Splatmap. (3) Update the channel weight values of the target area according to the brush intensity (Opacity) and blending mode (Additive, Lerp, etc.). (4) After modifying the Splatmap, trigger the texture update of the terrain material to display the blending effect in real time.

[0092] Garden layout generation

[0093] Garden layout generation is the main part of the entire garden procedural generation system, which is used to introduce local and overall rules of the garden and generate a connected graph of garden buildings based on the division of land and water areas in the garden. Preferably, the virtual digital human technology includes at least one of character image modeling, animation data driving, and voice dialogue synthesis. Combining Figure 5 , the main contents in the embodiments of the present invention are specifically introduced as follows:

[0094] (1) Division of garden scene modules. In the embodiments of the present invention, the topographic map drawn in the previous module is divided into water and land by the Marching Square algorithm, and a two-dimensional water area contour is extracted based on the topographic map. The Marching Square algorithm is widely used in fields such as terrain, landform, and image edge detection. The generation result of the algorithm can be adjusted by setting garden size and style parameters. The garden size can set the terrain grid resolution (such as 256×256) and physical size (such as 100m×100m). The style parameters can set the water body proportion and flat ground undulation threshold of the garden.

[0095] The application of the Marching Squares algorithm in garden land and water division can be achieved through the following steps: First, discretize the two-dimensional topographic map data of the garden scene into a uniform grid, divide the terrain into N×N grid cells, and assign a scalar value representing water level or land attribute (such as a value in the range of 0-1 representing the gradual change from water area to land) to each grid node; Second, set a threshold (such as 0.5 for the land and water boundary) and traverse all grid cells, perform binary classification (water area or land) on the four vertices of each cell to generate a 4-bit status code (such as 0101). Subsequently, according to the predefined 16 types of Marching Squares topological configuration tables, determine the endpoint positions of the equal-value line segments connecting the water area and the land within the cell, and calculate the exact coordinates of the endpoints through linear interpolation (; Finally, perform topological connection and smoothing processing on the line segments generated by all cells to form a closed and continuous land and water boundary polygon, generate a terrain mask map (TerrainMask), such as 0 = water body, 1 = flat ground, 2 = mountain, and optimize the contour in combination with terrain features (such as slope, curvature). This process converts discrete geographical data into a continuous ecological interface through numerical calculations, providing a planning basis for garden design that combines mathematical rigor and visual naturalness. In terms of detail optimization, it is necessary to select building sites on the basis of the flat ground content. In this system, areas with a continuous area greater than 50m 2 in the flat ground area are selected as building sites, and the area masks that are not selected are replaced with mountains.

[0096] (2) Generation of garden scene layout. In the embodiments of the present invention, the buildable area is calculated based on the terrain mask map obtained in the previous step, and the area with a terrain mask of 1 (flat ground) is selected as the candidate area for the building site. Then, the details of the building selection area are constrained by defining the adjacent local rules and global rules of the garden layout. Based on the connected graph principle of spatial statements, in order to apply the garden distribution rules at the macroscopic level of garden generation, 3D texture is introduced to adjust and optimize the generation process of the WFC algorithm. 3DTexture (3D texture) is a texture mapping technology used in computer graphics for material and texture representation in three-dimensional space. Different from traditional 2D textures, 3D textures not only contain two dimensions of X and Y, but also contain Z-axis data, enabling it to be mapped inside the volume of the garden scene.

[0097] In the process of generating the garden layout, the present invention mainly applies the water management rule in the garden rules for optimizing the iterative rule of water-land area division. For example, the waters in large gardens are mostly dispersed, with the characteristics of multiple centers, while small and medium-sized gardens are usually concentrated, centered around a pool and surrounded by buildings.

[0098] The core idea of the WFC algorithm is to gradually determine the state of each unit (such as color blocks, pattern blocks) in a limited space, so that the generated result conforms to the adjacency rules, thus generating an overall harmonious pattern. The input of the algorithm usually includes a small sample pattern and adjacency rules. The WFC algorithm constructs a "pattern set" by analyzing the local structure and adjacent relationships of the sample pattern, which describes the ways in which each pattern can be adjacent to other patterns.

[0099] At the beginning of the algorithm, the state of each unit is undetermined, that is, each unit may become any pattern. During the running process, the WFC algorithm randomly selects an undetermined unit and collapses its state into a specific pattern according to the adjacency rules, that is, determines the specific state of the unit. Then, the algorithm propagates this selection to the adjacent units, constraining their possible patterns and thus narrowing down their range of possibilities. This process of "collapse - propagation" will continue until the states of all units are determined.

[0100] The specific process of the WaveFunctionCollapse algorithm designed in the preferred embodiment is as follows:

[0101] 1. Initialize the wave function space

[0102] Grid division: Divide the candidate building area into an N×M grid.

[0103] Entropy value initialization: Each grid initially contains the superposition state of all possible modules, and the entropy value is 0

[0104] 2. Iterative Collapse and Propagation

[0105] Select the lowest entropy cell: Find the grid position with the lowest entropy value as the starting point of collapse. When generating the garden layout, the initial lowest entropy cell is the position of the garden gate.

[0106] Collapse module: Randomly select the final module at this position according to the weight probability. After determining the orientation, size, and gate position of the garden, a 3D texture integrating the building distribution rules in the garden can be generated in the three-dimensional space of the garden based on the terrain mask map generated according to the water and land contours in the previous section. According to the general shape of the terrain mask map, the center point O and the general range of each water area can be calculated. By calculating the distance D between two points on the 2D map and using a threshold to judge, the water area position closest to the current generation point can be found, obtaining the vector V between the coordinate point and the water area direction. When iterating the adjacent position information, the grid in the water area direction is preferentially selected for iteration. At the same time, the following rules are followed during the mapping process of the 3D texture:

[0107] Table 1 3D Texture Mapping Rules

[0108] Height value Corresponding generation module Low height area (0 - 1) Foundation, road Medium height area (1 - 2) Small houses, corridors, gazebos High height area (2+) Large houses

[0109] Constraint propagation: Traverse the eight-neighborhood adjacent grids of the newly placed module, and at the same time superimpose the building height information in the 3D texture in the constraint rules, then the generation results inside the water area can be excluded when generating the garden layout, as Figure 7 shown. Update the entropy value of the affected grids and add them to the processing queue.

[0110] Loop processing: Repeat selection-collapse-propagation until all grids are collapsed or a contradiction occurs, and finally generate a 2D connected graph of the garden layout.

[0111] 3. Contradiction Resolution Mechanism

[0112] Backtracking and Retrying: When a situation where the constraints cannot be satisfied occurs, backtrack to the nearest optional branch and regenerate.

[0113] Local Reset: Only reset the grid state of the conflict area to avoid global recalculation.

[0114] (3) White-box Generation. After the WFC process ends, the placement positions of various types of buildings and the connection structure between buildings can be obtained. On this basis, the garden rules are further applied to optimize it. First is the optimization of the building orientation. According to the landscape view rule, the rotation angle needs to be dynamically adjusted according to the building type and position. Then is to ensure the path connectivity. First is the optimization of the corridor connection. If the distance between two pavilions exceeds the threshold, a corridor module is automatically inserted. Then use the A* algorithm to verify the generated path, which can check the accessibility of all buildings and supplement connection bridges for broken paths. The white-box generation results are as Figure 8As shown

[0115] After optimizing the generation results, a building location table and a building connectivity graph are obtained. The building location table is used to record the grid coordinates, rotation angles, and types of each building, and the building connectivity graph is used to store the adjacency matrix of path connection relationships. For each individual ancient building, it can be first represented by a white box, which can be used to record the length, width, and height of the building, facilitate previewing the general distribution of the generated building, and save it as a data file for storage and reading.

[0116] Generation and Interaction of Individual Buildings

[0117] The individual building generation part includes an input data processing module, a building module instantiation module, and an interaction interface module. The input data processing module is used to process the inputs from hardware and software. The building instantiation module is used to generate the skeleton and sub-component structure of the building according to the input data. The interaction interface module is used to create a user adjustment interface to make detailed adjustments to the generated building. The results of individual building generation are as Figure 9 shown

[0118] Individual building generation is based on the unity engine. A custom window is created using the UnityEditor namespace and developed by writing c# scripts within the engine. The generation and combination of ancient buildings are carried out at three levels: the roof, the building body, and the podium. The building type selection supports four types of roofs: hip roof, gable and hip roof, pavilion roof, and hard mountain roof. At the same time, basic parameter input and adjustment functions are provided, such as the length / width / height, number of floors, roof slope, and eaves extension length of the building. And this system supports the selection of building component materials.

[0119] The steps of individual building generation specifically include:

[0120] (1) Build a building database. Determine the building type and size data, configure a json file to record the parameter tables of each type of house, and implement the initial settings during building generation. In Unity, the built-in Resources class module can be used or external files can be read according to the path. When instantiating a building, the file path is determined through the building type parameter, and then the read building data is processed further.

[0121] Table 2 Individual Building Design Table

[0122]

[0123]

[0124] (2) Building data processing. After the application reads the data input from the json file, it is necessary to store and record the building data. In the Unity engine, the present invention utilizes the built-in json file reading module to extract the initial building data and save it into a data structure.

[0125] (3) Foundation and wall generation. A rectangular base is generated according to the input length and width. The input parameters are read, including the building base length (L), width (W), and foundation height (H base ). The foundation mesh is dynamically constructed through the MeshFilter class in Unity to generate the bottom and side surfaces. During the process of generating the foundation, it is necessary to first determine the type of the building. The building with a pyramidal roof is a pavilion building, so the number of polygon sides of the base is greater than 4, while the bases of the other several types of buildings are quadrilaterals. For the generation of columns and walls, cylinders can be generated through a loop. The spacing between them is determined by the building size, and parameters are set to adjust their density. The size of the wall is determined by the size and position of the cylinders. The column spacing d is adaptively calculated according to the building scale

[0126] (4) Generation of different types of roofs. The system implements four typical Chinese roof types: hip roof, gable and hip roof, overhanging gable roof, and hard gable roof. The key differences of each roof type are as follows:

[0127] Hip roof: As a typical representative of the four-slope roof, the core of the hip roof lies in calculating the intersection point of the four inclined ridges (i.e., the top center). The trapezoidal slope surface is generated through vertex coordinate calculation, and the smooth connection of the four inclined ridges is ensured. The ridge line is defined by a Bezier curve to simulate the elegant arc of traditional buildings.

[0128] Gable and hip roof: The gable and hip roof combines the characteristics of the hip roof and the overhanging gable roof, and its structure is more complex, including nine ridge lines (one main ridge, four vertical ridges, and four hip ridges). During the generation process, the starting and ending points of each ridge line need to be accurately calculated, and the smooth transition of the ridge lines is ensured through an interpolation algorithm.

[0129] Overhanging gable roof: The characteristic of the overhanging gable roof is that the roof extends beyond the gable wall to form a cantilever structure. During generation, the overhanging length of the eaves needs to be calculated, and a support structure (such as purlins) is generated below the overhanging part. The ridge line of the overhanging gable roof is usually relatively straight and is suitable for being generated through a linear interpolation algorithm.

[0130] Pyramidal roof: The top of the pyramidal roof converges at a point to form a conical or cone-shaped structure. The number of slope surfaces of the pyramidal roof is diverse, and common ones include four-cornered pyramidal, six-cornered pyramidal, eight-cornered pyramidal, etc. The number of slope surfaces is directly related to the shape of the building plane. The ridge extends from the top center to the surrounding, forming obvious ridge lines. Internally, complex wooden frameworks such as brackets and purlins are usually used to support to ensure the stability of the structure.

[0131] To support various types of roofs, it is first necessary to design the base class BuildingBaseRoof to define the general interfaces and properties, including the basic grid structure and the ridge structure. The ridge also includes the extended flying ridge. Grid generation consists of two steps: vertex coordinate calculation and triangle mesh generation.

[0132] First, the roof vertices are arranged in clockwise order. The purpose of this step is to ensure that the normal directions of the triangle meshes are consistent, thus avoiding abnormal lighting or model display errors during rendering. In Unity, the triangle meshes of the grid are defined by the Mesh.triangles array, which stores the order of vertex indices. If the vertices are arranged in clockwise order, Unity will automatically calculate the correct normal direction (the default normal direction faces the observer). For example, for a hip roof, the vertex order can be arranged in sequence according to the intersection points of the ridge line and the eaves, ensuring that the vertex index order of each triangle mesh is consistent. In this way, each patch of the roof can correctly respond to lighting calculations and avoid rendering problems caused by inconsistent normal directions.

[0133] Secondly, to optimize the topology of the roof grid and avoid texture distortion, this system adopts the annular dissection method. The annular dissection method is a technique that decomposes complex surfaces into multiple concentric rings and is applicable to the multi-layer structures of Chinese ancient architecture roofs (such as ridges, eaves, tile arrangements, etc.). In the specific implementation, each level of the roof (such as the main ridge, secondary ridge, eaves) is divided into multiple annular regions, and the vertices within each region are arranged along an annular path. By connecting the vertices of each ring to the vertices of adjacent rings, triangle meshes are generated. The advantage of this method is that it can effectively avoid the appearance of narrow and long triangle meshes, thereby reducing texture stretching and distortion phenomena. For example, in the generation of a hip-and-gable roof, the area between the main ridge and the eaves is divided into multiple concentric rings, and the vertices of each ring are distributed at a fixed interval, ensuring that the aspect ratio of the triangle meshes is close to 1:1, thus optimizing the texture mapping effect.

[0134] (5) Decoration and detail generation. The decoration of a single ancient building mainly includes tiles and carvings. The tile system is a core component of roof generation, and its goal is to achieve precise tile arrangement and efficient rendering on the roof slope. By parametrically adjusting the tile arrangement, the number of tiles in each row is dynamically calculated based on the roof width and tile size. For example, if the roof width is W and the tile width is w, then the number of tiles in each row is: The tiles are arranged row by row along the roof slope. The row spacing is determined by the tile height and the roof slope to ensure tight connection between the tiles. When instantiating the tiles, the ObjectPool technology is used to manage the tile instantiation, avoiding the performance overhead caused by frequent calls to Instantiate. By pre-generating the tile object pool and reusing it when needed, the generation efficiency is significantly improved. For large-scale roofs, the GPUInstancing technology is adopted to batch render the tiles with the same material, reducing the DrawCall. After generating the mesh, the UV coordinates of the tile material are dynamically adjusted according to the roof slope to prevent texture stretching. For example, on a steep slope, the vertical ratio of the UV is compressed to ensure the natural presentation of the tile texture.

[0135] Carving and painting are the finishing touches of Chinese architectural decoration. Their generation needs to combine texture mapping technology and Shader programming. The generation of carving textures uses texture masks (Alpha channels) to randomly overlay carving textures in the wall and door / window areas. The distribution density and shape of the carvings are controlled by the mask to ensure a natural transition of the decorative effect. Support for dynamic switching of multiple carving patterns to meet the needs of different architectural styles. The dynamic color adjustment of carving and painting is achieved through Shaders, supporting real-time adjustment of color parameters to facilitate rapid iteration and optimization by designers.

[0136] (6) User interaction and extension.

[0137] The single building interaction module in the embodiments of the present invention is used to adjust the generation form details and dimensions of the single building, providing an intuitive visual operation interface, while supporting parametric control and real-time preview, reducing the user's learning cost, improving the generation efficiency, and enhancing the user's cultural experience perception of the Chinese garden.

[0138] By defining the editor interface, the core operation panel is implemented by customizing the EditorWindow, and the main adjustment functions are partitioned. It mainly includes basic parameters such as roof type, size control, roof slope adjustment, eave curvature, column spacing. And decorative control parameters such as door / window styles, building component material libraries. Finally, preview is performed through the UnityScenes view, supporting rotation, zooming, and panning operations.

[0139] After the initial generation of the garden scene, further adjustments to buildings, vegetation, rockeries, and roads are still needed. To consider the usability of the tools, the interaction and generation methods of the scene buildings complement each other. In addition to having a friendly UI for users to set and adjust parameters specifically, more intuitive and easy-to-use interaction methods need to be added.

[0140] For the decorative buildings and connecting buildings in the garden scene, such as pool water, vegetation, courtyard walls, paths, the present invention uses the Unity engine combined with the Dreamteck Splines plug-in to increase the spline function to achieve the control and modification of details, and adjust the placement details of the courtyard walls in the garden.

[0141] An embodiment of the present invention also provides a storage medium for storing a computer program, which when executed performs at least the method described above.

[0142] An embodiment of the present invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein, the processor is used to execute the computer program to perform at least the method described above.

[0143] An embodiment of the present invention also provides a processor, which executes a computer program and performs at least the method described above.

[0144] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), a ferromagnetic random access memory (FRAM, Ferromagnetic Random Access Memory), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a disk memory or a tape memory. The storage medium described in the embodiments of the present invention is intended to include, but not limited to, these and any other suitable types of memories.

[0145] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the couplings between the components shown or discussed, either directly or through some interfaces, indirect couplings or communication connections of devices or units, can be electrical, mechanical or other forms.

[0146] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, each functional unit in the embodiments of the present invention can be all integrated in a processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0148] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0149] Alternatively, if the above integrated units of the present invention are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.

[0150] In the method disclosed in several method embodiments provided by the present invention, they can be arbitrarily combined without conflict to obtain new method embodiments.

[0151] In the features disclosed in several product embodiments provided by the present invention, they can be arbitrarily combined without conflict to obtain new product embodiments.

[0152] In the features disclosed in several method or device embodiments provided by the present invention, they can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0153] The above content is a further detailed description of the present invention in combination with specific preferred embodiments. It cannot be determined that the specific implementation of the present invention is only limited to these descriptions. For those skilled in the technical field to which the present invention pertains, without departing from the concept of the present invention, several equivalent substitutions or obvious modifications can be made, and as long as the performance or use is the same, they should all be regarded as belonging to the protection scope of the present invention.

Claims

1. A method for programmatically generating a Chinese garden, characterized in that: The following steps are involved: S1. Water and land terrain division: divide the water and land areas according to the water and land distribution data drawn by the user, and convert the water and land division results into a terrain mask map; S2, Garden layout generation: select areas suitable for building placement from the terrain mask map; optimize the building layout through the WFC algorithm combined with 3D texture mapping technology to make it conform to the garden rules; generate a white box model of the preliminary layout of garden buildings, and optimize the orientation and path connectivity of garden buildings to provide layout information for the generation of single buildings; S3. Single building generation: Generate a building model including a skeleton and small component structure based on the building parameters input by the user, and add decorative details to the building to improve the building's appearance.

2. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S1, the water and land terrain division generates a terrain mask map through the input data drawn by the user, which specifically includes: Discretize the water and land distribution data drawn by the user into a uniform grid, and assign a scalar value representing the water level or land attribute to each grid node; The grid cells are binarized and classified by setting a threshold to generate water-land boundary polygons; The generated land and water boundary polygons are topologically connected and smoothed to form a continuous terrain mask map.

3. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S2, the WFC algorithm is combined with 3D texture mapping technology to optimize the building layout, specifically including: Divide the candidate building area into grids and initialize the entropy value of each grid; By iteratively selecting the lowest entropy unit, the final module at that position is randomly selected according to the weighted probability; Combined with 3D texture mapping technology, the module selection of adjacent grids is constrained according to the water direction and height information of the terrain mask map; Through constraint propagation and loop processing, a connected graph of building layouts that conform to garden rules is generated.

4. The method for programmatically generating a Chinese garden according to claim 3, characterized in that: During the iteration process, the WFC algorithm preferentially selects the grids in the water area direction for module placement, and removes unreasonable generation results inside the water area according to the 3D texture mapping rules.

5. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S2, after generating the white box model of the preliminary layout of the garden buildings, further optimizing the building orientation and path connectivity includes: Dynamically adjust the building orientation according to the landscape rules; Ensure path accessibility between buildings through path connectivity optimization algorithm; Add connecting bridges to broken paths to optimize the overall connectivity of the garden layout.

6. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S3, the generation of the single building includes: Generate foundations and walls based on architectural parameters entered by the user, and determine column spacing by cyclically generating columns; Generate different types of roofs according to the building type, including hip roof, gable roof, hip roof and pointed roof; The topology of the roof mesh is optimized through the ring subdivision method to ensure the natural presentation of texture mapping.

7. The method for programmatically generating a Chinese garden according to claim 6, characterized in that: During the roof generation process, vertex coordinates are calculated and triangle patches are generated to ensure that the normal direction of the roof mesh is consistent, thereby avoiding abnormal lighting during rendering.

8. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S3, adding decorative details to the building specifically includes: By adjusting the tile layout parametrically, the tiles are arranged row by row along the roof slope to ensure close connection between the tiles; Use map masks to randomly overlay carved textures on walls, doors and windows, and use Shader to achieve dynamic color adjustment of carvings and paintings.

9. The method for programmatically generating a Chinese garden according to claim 1, characterized in that: In step S3, after the single building is generated, the user is supported to adjust the building form details through the interactive interface, including the roof type, size control, roof slope adjustment, eaves curvature, column spacing, door and window styles and the selection of building component material library.

10. A Chinese garden programmatic generation system, characterized in that: include: The water-land terrain division module is used to divide the water-land area according to the water-land distribution data drawn by the user, and convert the water-land division result into a terrain mask map; A garden layout generation module is used to select areas suitable for building placement from the terrain mask map, and optimize the building layout through the WFC algorithm combined with 3D texture mapping technology to make it conform to garden rules; Generate a white box model of the preliminary layout of garden buildings, optimize the orientation and path connectivity of garden buildings, and provide layout information for the generation of individual buildings; The single building generation module is used to generate a building model including a skeleton and small component structure according to the building parameters input by the user, and add decorative details to the building to improve the building's appearance.

Citation Information

Cited By

  • Connected terrain generation method and device, electronic equipment and storage medium

    CN121810866A

  • Connected terrain generation method and apparatus, electronic device, and storage medium

    CN121810866B

  • Map generation control method and system and server

    CN121918740A