A procedurally generated environment construction method that mixes procedural generation with hand editing

CN122816618APending Publication Date: 2026-09-25BEIJING MINGHAI BONA TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610725551.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

程序化生成方式能够根据预设规则快速生成较大范围的环境场景,但其生成结果往往依赖统一规则或随机参数,难以满足特定训练任务中对局部空间布局、通行关系、安全边界和障碍物布置的精细要求;手工编辑方式虽然能够由用户直接调整局部场景内容,但在对程序化生成的初始环境进行添加、删除、移动、路径调整或区域限制等操作后,容易造成编辑区域与未编辑区域之间过渡不自然,出现地形或网格突变、道路或通行网络断裂、出入口不可达、环境元素重叠、安全区域被侵入、非预期孔洞或孤立区域等问题

Benefits of technology

[0047]1、本方案通过在获取基础空间数据和环境元素数据后构建环境权重场,使初始环境场景的生成过程能够同时考虑道路延伸方向、建筑物边界、安全区域边界、障碍物分布以及通行区域等因素,相较于单纯依赖随机规则或固定模板的生成方式,能够使建筑物、道路、障碍物、掩体、出入口和安全区域等环境元素在生成阶段即具备较合理的空间分布关系,减少初始场景中元素重叠、通行阻断和安全区域布置不合理的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122816618A_ABST
    Figure CN122816618A_ABST
Patent Text Reader

Abstract

The application discloses a kind of environment construction methods of procedural generation and manual editing hybrid, it is related to computer graphics and virtual environment construction field.The method obtains the basic space data and environment element data of the environment to be constructed, constructs environment weight field and generates initial environment scene;Receive user manual editing operation, convert it into editing control data;According to editing control data and environment weight field, determine local editing influence domain and boundary transition zone;Build the fusion optimization target including geometric continuity constraint, environment element stability constraint and scene relationship constraint, optimize environment element distribution, and reconstruct output target environment scene.The application can reduce road fracture, entrance and exit inaccessible, element overlap, safety area invasion and non-expected hole and other problems, improve the continuity and editing efficiency of environment construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer graphics and virtual environment construction, and in particular to a method for constructing environments that combines procedural generation with manual editing. Background Technology

[0002] Virtual environment construction technology is widely used in scenarios such as security training, emergency drills, urban simulation, and 3D visualization. It typically requires generating a 3D environment containing various environmental elements such as buildings, roads, obstacles, entrances / exits, and safe zones within a short period. Existing environment construction methods mainly include procedural generation and manual editing. Procedural generation can quickly generate large-scale environmental scenes according to preset rules, but its results often rely on uniform rules or random parameters, making it difficult to meet the precise requirements of local spatial layout, traffic relationships, safety boundaries, and obstacle placement in specific training tasks. While manual editing allows users to directly adjust local scene content, operations such as adding, deleting, moving, adjusting paths, or restricting areas in the procedurally generated initial environment can easily lead to unnatural transitions between edited and unedited areas, resulting in problems such as abrupt terrain or mesh changes, broken roads or traffic networks, inaccessible entrances / exits, overlapping environmental elements, intrusion into safe zones, unexpected holes, or isolated areas. Existing hybrid construction methods typically focus on overlaying, replacing, or locally smoothing the results generated by the program with those edited by the user. They lack a fusion optimization mechanism that can simultaneously consider the generation density of environmental elements, directional constraints, access costs, editing sensitivity, and scene relationship constraints. As a result, manually edited environmental scenes still have shortcomings in terms of geometric continuity, element stability, and accessibility.

[0003] To address this, a hybrid approach to environment construction, combining procedural generation with manual editing, is proposed. Summary of the Invention

[0004] The main objective of this invention is to provide a method for building an environment that combines procedural generation with manual editing, which can effectively solve the problems in the background art.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A method for building environments that combines procedural generation with manual editing includes the following steps:

[0007] S1, acquire the basic spatial data and environmental element data of the environment to be constructed, construct an environmental weight field based on the basic spatial data and environmental element data, and generate an initial environmental element distribution and corresponding initial environmental scene based on the environmental weight field;

[0008] S2, receiving manual editing operations from the user for the initial environment scenario, and converting the manual editing operations into editing control data, the editing control data including editing location, editing type, editing object category, and editing influence range;

[0009] S3, determine the local editing influence domain based on the editing control data and the environmental weight field, and determine the boundary transition zone between the local editing influence domain and the unedited area;

[0010] S4. Based on the local editing influence domain and the boundary transition region, a fusion optimization objective including geometric continuity constraints, environmental element stability constraints and scene relationship constraints is constructed to perform fusion optimization on the initial environmental element distribution to obtain the optimized environmental element distribution.

[0011] S5, Reconstruct and output the target environment scene based on the optimized distribution of environmental elements;

[0012] The scenario relationship constraints include at least one of the following: road or traffic network connectivity status, entrance / exit reachability status, environmental element overlap status, safe zone intrusion status, and unexpected hole status.

[0013] Furthermore, the basic spatial data includes at least one of environmental boundary range data, terrain elevation data, existing building outline data, road centerline data, traffic area data, and safety boundary data;

[0014] The environmental element data includes at least one of buildings, roads, obstacles, shelters, entrances and exits, safe zones, and patrol routes;

[0015] When generating the initial environment scene, the generation area, prohibited area, adjacency relationship and passage constraint relationship of different environment elements are determined according to the basic spatial data and environment element data, so that the environment elements in the initial environment scene meet the preset spatial distribution conditions.

[0016] Furthermore, the environmental weight field is used to characterize the generation density, orientation constraints, passage cost, and edit sensitivity of environmental elements at different locations in the environment to be constructed;

[0017] When constructing the environmental weight field, an environmental feature center is selected, and the environmental weight field is determined based on the environmental feature weight, influence range parameter, and main direction vector corresponding to the environmental feature center.

[0018] The environmental feature center includes at least one of the following: road centerline sampling point, building boundary point, obstacle center point, entrance / exit location point, and safe zone boundary point. The main direction vector includes at least one of the following: road extension direction, building boundary normal, safe zone boundary normal, or obstacle arrangement direction.

[0019] Furthermore, in step S1, generating the initial environmental scene based on the environmental weight field includes:

[0020] Increase the generation weight of roads and traffic areas based on road centerline sampling points and entrance / exit locations; reduce the generation weight of obstacles, shelters, or enclosed elements within safe zones based on safe zone boundary points; control the spacing between buildings, obstacles, and shelters based on building boundary points and obstacle center points; adjust the generation differences of environmental elements along and perpendicular to the road direction based on road extension direction and traffic area data to reduce environmental element overlap and traffic obstruction in the initial environmental scene.

[0021] Furthermore, in step S2, the manual editing operation includes at least one of adding, deleting, moving, scaling, path adjustment, and area restriction; when converting the manual editing operation into editing control data, the editing control point, editing type, displacement vector, editing object category, and editing influence range corresponding to the manual editing operation are extracted;

[0022] In step S3, the local editing influence domain is determined based on the editing control point, the editing influence range, and the passage cost, direction constraint, and editing sensitivity in the environmental weight field, and the local editing influence domain is extended outward by a preset distance to form the boundary transition zone.

[0023] Furthermore, in step S3, the editing influence weights at each location within the local editing influence domain are calculated based on the editing control data and the environmental weight field. These editing influence weights are determined according to the following model:

[0024]

[0025] in, For position Editing at a certain point affects the weight. For the first One editing control point, To edit the number of control points, The location determined based on the environmental weight field With the The weighted distance between each edit control point For the first The influence range parameter corresponding to each editing control point For the first Each edit control point corresponds to a weight for the edit type. For position Belongs to the category of environmental elements The corresponding element weights;

[0026] The weighted distance is determined based on the passage cost, directional constraints, and obstacle distribution in the environment to be constructed; the editing influence weight is used to determine the adjustment range of the distribution of environmental elements within the local editing influence domain, and to make the adjustment range gradually decrease from the editing position to the boundary transition area.

[0027] Furthermore, in step S4, a fusion optimization objective function is established to optimize the distribution of environmental elements within the local editing influence domain and boundary transition zone. The fusion optimization objective function is:

[0028]

[0029] in, To integrate and optimize the objective function, This is the cost of geometric continuity in the boundary transition region. The price paid for the stability of environmental elements, The cost of scene relationship constraints , , These are the weighting coefficients;

[0030] The geometric continuity cost of the boundary transition zone is determined based on at least one of the height difference, normal difference, curvature difference, and side length change rate between adjacent grid cells or adjacent environmental elements within the boundary transition zone.

[0031] The environmental element stability cost is determined based on at least one of the following: changes in the category, density, position offset, or state of existence of the environmental element before and after editing.

[0032] The cost of the scene relationship constraint is determined based on at least one of the following: road or traffic network connectivity status, entrance and exit reachability status, environmental element overlap status, security zone intrusion status, and unexpected hole status.

[0033] Based on the fusion optimization objective function, the positions, boundaries, or densities of environmental elements within the local editing influence domain are iteratively adjusted.

[0034] Furthermore, the cost of the scenario relationship constraint is determined according to the following model:

[0035]

[0036] in, Penalties for road or traffic network disruptions. Penalties for entrances and exits being inaccessible. For overlapping environmental elements, Penalties for intrusion into secure areas. Penalties are imposed for unexpected holes or isolated areas. , , , , For the corresponding weights;

[0037] During the fusion optimization process, when road or traffic network breaks, entrances and exits are unreachable, buildings and roads overlap, obstacles block traffic areas, bunkers intrude into safe areas, mesh damage, unexpected holes or isolated areas are detected, at least one of the following is performed on the environmental elements within the local editing influence domain: position adjustment, boundary smoothing, mesh repair, conflict element removal and connectivity path completion, to obtain the optimized environmental element distribution.

[0038] A hybrid environment building system combining procedural generation and manual editing includes:

[0039] The data acquisition module is used to acquire the basic spatial data and environmental element data of the environment to be built;

[0040] The initial scene generation module is used to construct an environmental weight field based on the basic spatial data and environmental element data, and to generate an initial environmental element distribution and a corresponding initial environmental scene based on the environmental weight field.

[0041] The editing and parsing module is used to receive manual editing operations from the user for the initial environment scene, and convert the manual editing operations into editing control data, which includes editing location, editing type, editing object category, and editing influence range;

[0042] The influence domain determination module is used to determine the local editing influence domain based on the editing control data and the environmental weight field, and to determine the boundary transition zone between the local editing influence domain and the unedited area;

[0043] The fusion optimization module is used to construct a fusion optimization objective based on the local editing influence domain and the boundary transition region, including geometric continuity constraints, environmental element stability constraints and scene relationship constraints, and to perform fusion optimization on the initial environmental element distribution to obtain the optimized environmental element distribution;

[0044] The scene reconstruction module is used to reconstruct and output the target environment scene based on the optimized distribution of environmental elements.

[0045] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for building an environment that combines procedural generation with manual editing.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] 1. This solution constructs an environmental weight field after acquiring basic spatial data and environmental element data, enabling the initial environmental scene generation process to simultaneously consider factors such as road extension direction, building boundaries, safe zone boundaries, obstacle distribution, and passage areas. Compared to generation methods that rely solely on random rules or fixed templates, this solution ensures that environmental elements such as buildings, roads, obstacles, shelters, entrances and exits, and safe zones have a more reasonable spatial distribution relationship during the generation stage, reducing issues such as element overlap, passage obstruction, and unreasonable safe zone layout in the initial scene.

[0048] 2. After receiving manual editing operations from users, this invention does not directly overlay the editing results onto the initial environment scene. Instead, it converts the manual editing operations into editing control data, including editing location, editing type, editing object category, and editing influence range. Combined with the environmental weight field, it determines the local editing influence domain and boundary transition zone, so that the influence of editing operations on the distribution of environmental elements can be propagated differently according to the passage cost, direction constraints, and editing sensitivity. This avoids the problem of sudden changes in local scene or abrupt boundary transitions caused by manual editing.

[0049] 3. This invention optimizes the distribution of environmental elements in the local editing influence domain and boundary transition zone by constructing a fusion optimization objective that includes geometric continuity constraints, environmental element stability constraints, and scene relationship constraints. This enables the edited environmental elements to maintain a good connection with the unedited area in terms of position, boundary, density, or existence state, reducing mesh damage, boundary abrupt changes, and abnormal offset of environmental elements, and improving the naturalness of the fusion between procedurally generated areas and manually edited areas.

[0050] 4. This invention further incorporates the connectivity status of roads or access networks, the accessibility status of entrances and exits, the overlapping status of environmental elements, the intrusion status of safe zones, and the status of unexpected holes into scene relationship constraints. During the fusion optimization process, it can detect abnormal situations such as road breaks, unaccessible entrances and exits, obstacles blocking passage areas, bunkers intruding into safe zones, and unexpected holes or isolated areas. It can also correct these abnormal situations through methods such as position adjustment, boundary smoothing, mesh patching, removal of conflicting elements, or completion of connecting paths, thereby improving the usability and reliability of the target environment scene in applications such as security training and emergency drills. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0052] Figure 2 This is a schematic diagram of the system modules of the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] Example 1

[0055] like Figure 1-2 As shown, this invention provides a method for constructing an environment that combines procedural generation with manual editing, which can be used to build security training environments for key facilities. The environment to be constructed can be a factory area, industrial park, warehouse area, substation, port, public building complex, or other virtual environment requiring security training, patrol drills, or emergency response drills. The environment can include environmental elements such as buildings, roads, obstacles, shelters, entrances and exits, safe zones, patrol routes, fences, and checkpoints.

[0056] First, the system acquires the basic spatial data and environmental element data of the environment to be constructed. The basic spatial data may include environmental boundary data, terrain elevation data, existing building outline data, road centerline data, traffic area data, and safety boundary data. Environmental element data may include building models, road models, obstacle models, bunker models, entrance and exit points, safety zone boundaries, and patrol routes. This data can be derived from existing 2D plans, 3D models, GIS data, BIM data, manually entered data, or training task configuration files.

[0057] After acquiring the aforementioned data, the system constructs an environmental weight field based on the basic spatial data and environmental element data. The environmental weight field describes the generation density, directional constraints, passage cost, and edit sensitivity of environmental elements at different locations within the environment to be constructed. For example, near the centerline of a road, the generation weight of roads and passage areas is increased, while the generation weight of elements affecting passage, such as obstacles and enclosed shelters, is decreased; within safe zones, the generation weight of obstacles or enclosed elements is reduced to prevent unreasonable occupation of safe zones; near building boundaries, the generation relationships of roads, passages, and obstacles are adjusted based on the building's outer contour and entrance / exit locations to retain necessary passage space near entrances / exits; near patrol routes, the generation weight of elements related to security training, such as roads, checkpoints, and shelters, is increased to make the initial environment more closely match the training task requirements.

[0058] Specifically, the system can use road centerline sampling points, building boundary points, obstacle center points, entrance / exit locations, and safe zone boundary points as environmental feature centers, and set different environmental feature weights, influence range parameters, and principal direction vectors for different types of environmental feature centers. For example, the principal direction vector of the road centerline sampling point can be the road extension direction, the principal direction vector of the building boundary point can be the building boundary normal, and the principal direction vector of the safe zone boundary point can be the safe zone boundary normal. Based on these environmental feature centers and their parameters, the system forms an environmental weight field, so that the subsequent scene generation and editing impact propagation are no longer based solely on ordinary spatial distance, but can reflect environmental constraints such as road direction, safety boundaries, obstacle distribution, and traffic costs.

[0059] Then, the system generates an initial distribution of environmental elements based on the environmental weight field, and generates an initial environmental scene based on this distribution. During the generation process, the system can generate roads or traffic areas based on road centerline data, building areas based on building outline data, define the scope of safe zones based on safe zone boundary data, and generate checkpoints or path markers related to the training task based on patrol routes. For elements such as obstacles and shelters, the system can determine their candidate placement positions based on the environmental weight field and exclude positions that conflict with roads, entrances / exits, and safe zones. The initial environmental scene generated in this way can form a basically usable virtual training environment in a short time, while reducing problems such as road blockage, entrance / exit obstruction, and element overlap in the initial stage.

[0060] After the initial environment scene is generated, users can manually edit the environment through the interactive interface. Manual editing operations can include adding, deleting, moving, scaling, adjusting paths, and restricting areas. For example, users can add temporary cover outside a building, move an obstacle near a designated checkpoint, delete obstacles blocking entrances and exits, adjust patrol routes, or restrict the generation of enclosed elements in a certain safe zone.

[0061] After receiving a manual editing operation, the system converts it into editing control data. This data can include editing location, editing type, editable object category, editing influence range, editing control points, and displacement vectors. Specifically, editing location indicates the location where the user's edit occurred; editing type distinguishes between operations such as adding, deleting, moving, scaling, path adjustment, or area restriction; editable object category indicates whether the edited element belongs to a building, road, obstacle, shelter, entrance / exit, or safe zone; and editing influence range indicates the radius or area of ​​influence of the editing operation on the surrounding environment.

[0062] Subsequently, the system determines the local editing influence domain based on editing control data and the environmental weight field. The local editing influence domain is not simply a fixed-radius area centered on the editing location, but rather determined by combining access costs, directional constraints, and editing sensitivity within the environmental weight field. For example, when a user moves an obstacle along a road, the system can make the editing influence propagate further along the road direction and shorter in the direction perpendicular to the road; when a user adds cover near the boundary of a safe zone, the system can reduce the extent to which the influence domain expands into the safe zone; when a user edits an obstacle near a building entrance, the system can increase the editing sensitivity of areas related to the accessibility of the entrance, making subsequent optimizations focus on checking the accessibility of that area.

[0063] After determining the local editing influence domain, the system extends it outward by a preset distance, forming a boundary transition zone between the local editing influence domain and the unedited area. This boundary transition zone buffers local changes caused by manual editing, allowing for a smooth transition in the position of environmental elements, boundary shapes, mesh structure, or element density between the edited and unedited areas. For example, if a user moves an obstacle, the terrain, road edges, or adjacent shelters near that obstacle may need to be adjusted simultaneously. The boundary transition zone limits the scope of these adjustments, preventing local editing from abruptly affecting the entire scene.

[0064] In one embodiment, the system can calculate the editing influence weights at each location within the local editing influence domain based on editing control data and the environmental weight field. The editing influence weights are determined according to the following model:

[0065]

[0066] in, For position Editing at a certain point affects the weight. For the first One editing control point, To edit the number of control points, The location determined based on the environmental weight field With the The weighted distance between each edit control point For the first The influence range parameter corresponding to each editing control point For the first Each edit control point corresponds to a weight for the edit type. For position Belongs to the category of environmental elements The corresponding element weights. The weighted distance can be determined based on travel cost, directional constraints, and obstacle distribution. Compared to ordinary Euclidean distance, this weighted distance can reflect the impact of road direction, safety boundaries, and obstacle obstruction on editing propagation, making editing adjustments more consistent with the environmental structure.

[0067] For example, when a user moves a cover on one side of a road, if the cost of passage in the road direction is low, the editing effect can extend appropriately along the road direction; if the cost of passage or the restriction weight in the direction of the safe zone boundary is high, the editing effect is less likely to cross the safe zone boundary. In this way, the weight of the editing effect gradually decreases from the editing position to the boundary transition area, so that the local editing effect can cover the necessary area without excessively disturbing scene elements far away from the editing position.

[0068] After obtaining the local editing influence domain and boundary transition zone, the system constructs a fusion optimization objective to optimize the initial distribution of environmental elements. This fusion optimization objective includes geometric continuity constraints, environmental element stability constraints, and scene relationship constraints. Geometric continuity constraints are used to reduce abrupt changes in height difference, normal direction, curvature, or abnormal changes in mesh edge length between the edited and unedited regions; environmental element stability constraints are used to avoid unnecessary large changes in the category, density, location, or existence state of environmental elements; scene relationship constraints are used to maintain the connectivity of roads or traffic networks, the accessibility of entrances and exits, the overlapping state of environmental elements, the intrusion state of safe zones, and the state of unexpected holes, all of which meet preset conditions.

[0069] In one embodiment, the fusion optimization objective function can be:

[0070]

[0071] in, To integrate and optimize the objective function, This is the cost of geometric continuity in the boundary transition region. The price paid for the stability of environmental elements, The cost of scene relationship constraints , , These are the weighting coefficients. The system can adjust these weighting coefficients according to the application scenario. For example, in a security training environment, the weight of the scene relationship constraint cost can be appropriately increased to prioritize ensuring road connectivity, accessibility of entrances and exits, and non-intrusion into safe areas; in scenarios with high visual display requirements, the weight of the geometric continuity cost can be appropriately increased to make scene transitions more natural.

[0072] The geometric continuity cost of the boundary transition zone can be determined based on at least one of the following: height difference, normal difference, curvature difference, and edge length change rate between adjacent grid cells or adjacent environmental elements within the boundary transition zone. For example, if the difference between the terrain height at the edge of the edited area and the height of the unedited area exceeds a preset threshold, the geometric continuity cost is increased; if the grid normal change is too large or the curvature abrupt change is obvious, the cost is reduced through boundary smoothing or local grid patching. The environmental element stability cost can be determined based on the changes in the category, density, position offset, or existence state of the environmental element before and after editing, to avoid the system unnecessarily changing a large number of surrounding road or building elements when the user moves only one obstacle.

[0073] In one embodiment, the cost of scene relationship constraints can be determined according to the following model:

[0074]

[0075] in, Penalties for road or traffic network disruptions. Penalties for entrances and exits being inaccessible. For overlapping environmental elements, Penalties for intrusion into secure areas. Penalties are imposed for unexpected holes or isolated areas. , , , , The corresponding weights can be adjusted accordingly. For example, in training scenarios where rapid evacuation is required, the weights of the unreachable entrance / exit penalty and the network disruption penalty can be increased; in scenarios with high security zone protection requirements, the weight of the security zone intrusion penalty can be increased.

[0076] During the fusion optimization process, the system can iteratively adjust the position, boundary, or density of environmental elements within the local editing influence domain. After each iteration, the system checks whether the fusion optimization objective function meets the preset convergence condition, or whether each constraint meets the preset threshold. When a road or traffic network is broken, the system can generate a connecting path at the break or adjust the position of blocking elements; when an entrance or exit is unreachable, the system can remove or move obstacles blocking the entrance or exit and complete the traffic area between the entrance / exit and the road; when a building overlaps with a road, the system can adjust the building boundary or road boundary; when a bunker intrudes into a safe area, the system can fine-tune the bunker along the outer direction of the safe area boundary; when mesh damage, unexpected holes, or isolated areas occur, the system can perform mesh repair, boundary smoothing, or local reconstruction.

[0077] After fusion optimization, the system reconstructs the target environment scene based on the optimized distribution of environmental elements. The reconstruction process may include generating building models based on the optimized building distribution, generating road meshes based on the road and traffic area distribution, placing corresponding 3D models based on the obstacle and shelter distribution, generating marked areas or path markers based on safe zones and patrol routes, and performing local mesh patching and texture mapping on the editing influence domain and boundary transition areas. For scenarios requiring simulation training, the system can also generate a navigation mesh based on the optimized traffic network for virtual personnel, vehicles, or training objects to perform path planning.

[0078] For example, in a specific application, the initial scenario involves a road and several bunkers in front of a building entrance. The user moves a bunker near the entrance to simulate a temporary protective point. Upon receiving this move operation, the system converts the start and end points of the move, the bunker type, and the area of ​​influence into editing control data, and determines the local editing influence domain by combining the entrance location and road access cost. Because this area is close to the building entrance, the system focuses on calculating the accessibility of the entrance and the connectivity of the road network during fusion optimization. If the moved bunker blocks the path between the entrance and the road, the system increases the penalty for entrance inaccessibility and corrects it by fine-tuning the bunker position, completing detour paths, or expanding the passage space. The final output target environment retains the user's editing intention to add temporary protective points while avoiding the problem of completely blocking the entrance.

[0079] For example, in another specific application, a user adds multiple obstacles near the boundary of a safe zone to simulate perimeter security measures. The system determines the local editing influence domain based on the safe zone boundary weights and editing sensitivity in the environmental weight field, and detects whether obstacles intrude into the safe zone during the fusion optimization process. If an obstacle intrudes into the safe zone, the system adjusts the obstacle's position by moving it outward or scaling it according to the safe zone intrusion penalty term, and smooths the boundary of the terrain mesh around the obstacle, so that it achieves the effect of a security deployment without violating the preset spatial constraints within the safe zone.

[0080] Through the above implementation methods, the present invention can support users to perform local manual editing on the basis of procedurally generated initial environment. By using environmental weight field, editing influence weight, boundary transition area and fusion optimization target, it can achieve a more natural transition between the edited area and the unedited area. At the same time, it can reduce problems such as road breakage, inaccessible entrances and exits, element overlap, security area intrusion, mesh damage and unexpected holes, thereby improving the usability and construction efficiency of the target environment scene in security training, emergency drills and 3D simulation construction.

[0081] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for constructing an environment that combines procedural generation with manual editing, characterized in that, Includes the following steps: S1, acquire the basic spatial data and environmental element data of the environment to be constructed, construct an environmental weight field based on the basic spatial data and environmental element data, and generate an initial environmental element distribution and corresponding initial environmental scene based on the environmental weight field; S2, receiving manual editing operations from the user for the initial environment scenario, and converting the manual editing operations into editing control data, the editing control data including editing location, editing type, editing object category, and editing influence range; S3, determine the local editing influence domain based on the editing control data and the environmental weight field, and determine the boundary transition zone between the local editing influence domain and the unedited area; S4. Based on the local editing influence domain and the boundary transition region, a fusion optimization objective including geometric continuity constraints, environmental element stability constraints and scene relationship constraints is constructed to perform fusion optimization on the initial environmental element distribution to obtain the optimized environmental element distribution. S5, Reconstruct and output the target environment scene based on the optimized distribution of environmental elements; The scenario relationship constraints include at least one of the following: road or traffic network connectivity status, entrance / exit reachability status, environmental element overlap status, safe zone intrusion status, and unexpected hole status.

2. The method for constructing an environment that combines procedural generation and manual editing according to claim 1, characterized in that, The basic spatial data includes at least one of the following: environmental boundary range data, terrain elevation data, existing building outline data, road centerline data, traffic area data, and safety boundary data; The environmental element data includes at least one of buildings, roads, obstacles, shelters, entrances and exits, safe zones, and patrol routes; When generating the initial environment scene, the generation area, prohibited area, adjacency relationship and passage constraint relationship of different environment elements are determined according to the basic spatial data and environment element data, so that the environment elements in the initial environment scene meet the preset spatial distribution conditions.

3. The method for constructing an environment that combines procedural generation and manual editing according to claim 2, characterized in that, The environmental weight field is used to characterize the generation density, orientation constraints, passage cost, and editing sensitivity of environmental elements at different locations in the environment to be constructed; When constructing the environmental weight field, an environmental feature center is selected, and the environmental weight field is determined based on the environmental feature weight, influence range parameter, and main direction vector corresponding to the environmental feature center. The environmental feature center includes at least one of the following: road centerline sampling point, building boundary point, obstacle center point, entrance / exit location point, and safe zone boundary point. The main direction vector includes at least one of the following: road extension direction, building boundary normal, safe zone boundary normal, or obstacle arrangement direction.

4. The method for constructing an environment that combines procedural generation and manual editing according to claim 3, characterized in that, In step S1, generating the initial environmental scene based on the environmental weight field includes: Increase the generation weight of roads and traffic areas based on road centerline sampling points and entrance / exit locations; reduce the generation weight of obstacles, shelters, or enclosed elements within safe zones based on safe zone boundary points; control the spacing between buildings, obstacles, and shelters based on building boundary points and obstacle center points; adjust the generation differences of environmental elements along and perpendicular to the road direction based on road extension direction and traffic area data to reduce environmental element overlap and traffic obstruction in the initial environmental scene.

5. The method for constructing an environment that combines procedural generation and manual editing according to claim 1, characterized in that, In step S2, the manual editing operation includes at least one of adding, deleting, moving, scaling, path adjustment, and area restriction; when converting the manual editing operation into editing control data, the editing control point, editing type, displacement vector, editing object category, and editing influence range corresponding to the manual editing operation are extracted. In step S3, the local editing influence domain is determined based on the editing control point, the editing influence range, and the passage cost, direction constraint, and editing sensitivity in the environmental weight field, and the local editing influence domain is extended outward by a preset distance to form the boundary transition zone.

6. The method for constructing an environment that combines procedural generation and manual editing according to claim 5, characterized in that, In step S3, the editing influence weights at each location within the local editing influence domain are calculated based on the editing control data and the environmental weight field. The editing influence weights are determined according to the following model: in, For position Editing at a certain point affects the weight. For the first One editing control point, To edit the number of control points, The location determined based on the environmental weight field With the The weighted distance between each edit control point For the first The influence range parameter corresponding to each editing control point For the first Each edit control point corresponds to a weight for the edit type. For position Belongs to the category of environmental elements The corresponding element weights; The weighted distance is determined based on the passage cost, directional constraints, and obstacle distribution in the environment to be constructed; the editing influence weight is used to determine the adjustment range of the distribution of environmental elements within the local editing influence domain, and to make the adjustment range gradually decrease from the editing position to the boundary transition area.

7. The method for constructing an environment that combines procedural generation and manual editing according to claim 6, characterized in that, In step S4, a fusion optimization objective function is established to optimize the distribution of environmental elements within the local editing influence domain and boundary transition zone. The fusion optimization objective function is: in, To integrate and optimize the objective function, This is the cost of geometric continuity in the boundary transition region. The price paid for the stability of environmental elements, The cost of scene relationship constraints , , These are the weighting coefficients; The geometric continuity cost of the boundary transition zone is determined based on at least one of the height difference, normal difference, curvature difference, and side length change rate between adjacent grid cells or adjacent environmental elements within the boundary transition zone. The environmental element stability cost is determined based on at least one of the following: changes in the category, density, position offset, or state of existence of the environmental element before and after editing. The cost of the scene relationship constraint is determined based on at least one of the following: road or traffic network connectivity status, entrance and exit reachability status, environmental element overlap status, security zone intrusion status, and unexpected hole status. Based on the fusion optimization objective function, the positions, boundaries, or densities of environmental elements within the local editing influence domain are iteratively adjusted.

8. The method for constructing an environment that combines procedural generation and manual editing according to claim 7, characterized in that, The cost of the scenario relationship constraint is determined according to the following model: in, Penalties for road or traffic network disruptions. Penalties for entrances and exits being inaccessible. For overlapping environmental elements, Penalties for intrusion into secure areas. Penalties are imposed for unexpected holes or isolated areas. , , , , For the corresponding weights; During the fusion optimization process, when road or traffic network breaks, entrances and exits are unreachable, buildings and roads overlap, obstacles block traffic areas, bunkers intrude into safe areas, mesh damage, unexpected holes or isolated areas are detected, at least one of the following is performed on the environmental elements within the local editing influence domain: position adjustment, boundary smoothing, mesh repair, conflict element removal and connectivity path completion, to obtain the optimized environmental element distribution.

9. A system for building environments that combines procedural generation with manual editing, characterized in that, include: The data acquisition module is used to acquire the basic spatial data and environmental element data of the environment to be built; The initial scene generation module is used to construct an environmental weight field based on the basic spatial data and environmental element data, and to generate an initial environmental element distribution and a corresponding initial environmental scene based on the environmental weight field. The editing and parsing module is used to receive manual editing operations from the user for the initial environment scene, and convert the manual editing operations into editing control data, which includes editing location, editing type, editing object category, and editing influence range; The influence domain determination module is used to determine the local editing influence domain based on the editing control data and the environmental weight field, and to determine the boundary transition zone between the local editing influence domain and the unedited area; The fusion optimization module is used to construct a fusion optimization objective based on the local editing influence domain and the boundary transition region, including geometric continuity constraints, environmental element stability constraints and scene relationship constraints, and to perform fusion optimization on the initial environmental element distribution to obtain the optimized environmental element distribution; The scene reconstruction module is used to reconstruct and output the target environment scene based on the optimized distribution of environmental elements.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements an environment construction method that combines procedural generation with manual editing as described in any one of claims 1 to 8.