A parameterized modeling method and system based on UE4

By using a parametric modeling method based on UE4, the model cross-sectional shapefile data is read and a static mesh model is generated, which solves the problem that existing technologies cannot automatically generate models, and realizes fast and dynamic model generation and reduces manual costs.

CN115984465BActive Publication Date: 2026-01-02WUHAN WISDOM CHANGXIANG INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211676944.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2026-01-02
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

Existing technologies cannot automatically generate models based on parameters during UE runtime, resulting in high manual costs and long processing times, making it impossible to dynamically generate models.

Method used

A parametric modeling method based on UE4 is provided. The method reads the cross-sectional shapefile data of the model into memory, stores it as a set of points, parses and filters duplicate data, modifies the data according to the ring parameters, generates a basic model including all surfaces, and writes it into a static mesh.

Benefits of technology

It enables automatic model generation while running in UE4, reducing manual costs and processing time, improving the visualization of the model, and reducing the difficulty of visual interpretation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115984465B_ABST
    Figure CN115984465B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of parameterized modeling, and specifically provides a parameterized modeling method and system based on UE4, wherein the method comprises the following steps: reading model cross-section shp data into memory and storing the data as a point set; analyzing data of the point set, filtering repeated data, and modifying the data according to ring parameters; generating a basic model including all surfaces by inputting a point set ID; then writing the basic model into a static mesh body and returning a static mesh body model. The scheme can solve the problems of high labor cost and long processing time in automatically generating a model according to parameters when UE cannot run, improve the visualization degree of images, and reduce the interpretation difficulty of visual interpretation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of parametric modeling, and more particularly to a UE4-based parametric modeling method and system. BACKGROUND

[0002] D Studio Max, often referred to as 3d Max or 3ds MAX. Modeling is the first step in the 3D world, and there are many modeling methods in 3dmax. Geometric modeling is the simplest modeling method in 3dmax, and its creation method is similar to "building blocks". 3dmax has built-in many common geometric shapes, such as cuboids, spheres, cylinders, planes, and cones. By combining these geometric shapes, some simple models can be made, such as bookshelves, tables, coffee tables, and cabinets. In addition, 3dmax also has some elements commonly used in interior design, such as doors, windows, and stairs, which can get accurate size model objects by setting simple parameters.

[0003] 3dmax has many commonly used modeling methods, including geometric modeling, spline modeling, composite object modeling, modifier modeling, and polygon modeling.

[0004] Based on the PC system, the low configuration requires the installation of plugins to provide functions that 3D Studio Max does not have (such as hair function before 3DS Max 6 version) and enhance the powerful character animation production capability of the original function. The modeling steps can be stacked, making it very flexible to make models. In terms of application range, it is widely used in advertising, film and television, industrial design, architectural design, three-dimensional animation, multimedia production, games, auxiliary teaching, and engineering visualization.

[0005] However, in the current parametric modeling, no matter which method is used for parametric modeling, only one main feature can be obtained in the modeling process, and other features are attached to the main feature, and are positioned through the main feature reference point and maintain a fixed positional relationship with the main feature. It is impossible to automatically generate a model according to parameters in UE runtime, and basically a model is generated manually, which results in high labor cost and long processing time, and the model cannot be dynamically generated. SUMMARY

[0006] The present application aims at the technical problems in the prior art that the model cannot be automatically generated according to parameters in UE runtime, the labor cost is high, the processing time is long, and the model cannot be dynamically generated.

[0007] The present application provides a UE4-based parametric modeling method, comprising the following steps:

[0008] S1, read the model cross-section shp data into memory, stored as a point set;

[0009] S2, analyze the data of the point set, filter duplicate data, and modify the data according to the ring parameters;

[0010] S3, generate a basic model including all surfaces by inputting the point set ID; then write the basic model into a static mesh body and return the static mesh body model.

[0011] Preferably, the S1 specifically comprises:

[0012] S11, generate shp data memory space;

[0013] S12, read shp data into the generated memory storage space;

[0014] S13, read shp data header file information;

[0015] S14, read shp data boundary information;

[0016] S15, get the offset of each record in the shp data.

[0017] Preferably, the S2 specifically comprises:

[0018] S21, get the read shp data;

[0019] S22, loop through the number of shp data elements for analysis;

[0020] S23, get the element through the shp data element entity id;

[0021] S24, determine whether the obtained shp element is usable data;

[0022] S25, loop to get the point set information in the element to memory;

[0023] S26, determine whether the point set of this element is already in memory;

[0024] S27, if not, add the element point set to memory;

[0025] S28, set the corresponding point set to merge according to whether it is a ring;

[0026] S29, close the shp data.

[0027] Preferably, the S26 specifically comprises: compare the number and all point positions with the previous point set data to determine whether the point set exists, if the number and point positions do not match, normally add to memory, otherwise use this element.

[0028] Preferably, the S28 specifically comprises: if the current file is annular, merging the corresponding inner ring outer ring element clicks and generating the redundant inner ring set.

[0029] Preferably, the S3 specifically comprises:

[0030] S31, creating original mesh data;

[0031] S32, obtaining the corresponding point set in the memory point set according to the point set ID when traversing the incoming point set ID;

[0032] S33, dividing the line segment surface into a triangle set;

[0033] S34, adding the triangle point set to the original mesh data;

[0034] S35, traversing the added original mesh data in triangle units;

[0035] S36, creating an empty static mesh model;

[0036] S37, converting the original mesh data into mesh description;

[0037] S38, constructing a static mesh rendering buffer for the static mesh model;

[0038] S39, obtaining the static mesh rendering data and setting the material slot;

[0039] S40, generating the static mesh and assigning it to the static mesh for use.

[0040] Preferably, the S33 specifically comprises: first estimating the point set to decompose the polygon formed by the point set into a convex polygon, and then decomposing the convex polygon into a triangle; if it is annular, the annular is decomposed into a triangle set by the way of decomposing the annular into two triangles through four points.

[0041] The application also provides a UE4-based parameterized modeling system, which is used to realize the UE4-based parameterized modeling method and comprises:

[0042] A reading module is configured to read model cross-section shp data into memory and store it as a point set;

[0043] An analysis module is configured to analyze the data of the point set, filter duplicate data, and modify the data according to annular parameters;

[0044] A generation module is configured to generate a basic model including all surfaces by inputting the point set ID; then write the basic model into a static mesh, and return a static mesh model.

[0045] The application further provides an electronic device comprising a memory and a processor, wherein the processor is configured to execute a computer management program stored in the memory to implement the steps of the UE4-based parameterized modeling method.

[0046] The application further provides a computer readable storage medium having a computer management program stored thereon, wherein the computer management program is configured to be executed by a processor to implement the steps of the UE4-based parameterized modeling method.

[0047] Beneficial effects: the UE4-based parameterized modeling method and system provided by the application, wherein the method comprises the following steps: reading model cross-section shp data into memory and storing the data as a point set; analyzing the data of the point set, filtering repeated data, and modifying the data according to ring parameters; generating a basic model comprising all surfaces by inputting the point set ID; then writing the basic model into a static mesh body and returning a static mesh body model. The scheme can solve the problems of high labor cost and long processing time in automatically generating a model according to parameters when UE cannot run, improve the visualization degree of images, and reduce the difficulty of visual interpretation. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 A flowchart of the UE4-based parameterized modeling method provided by the application is shown in the figure.

[0049] Figure 2 A hardware structure schematic diagram of a possible electronic device provided by the application is shown in the figure.

[0050] Figure 3 A hardware structure schematic diagram of a possible computer readable storage medium provided by the application is shown in the figure. DETAILED DESCRIPTION

[0051] The specific embodiments of the application are described in further detail below in combination with the drawings and examples. The following examples are used to illustrate the application, but are not used to limit the scope of the application.

[0052] Figure 1 The UE4-based parameterized modeling method provided by the application comprises the following steps:

[0053] S1, reading model cross-section shp data into memory and storing the data as a point set;

[0054] S2, analyzing the data of the point set, filtering repeated data, and modifying the data according to ring parameters;

[0055] S3, generating a basic model comprising all surfaces by inputting the point set ID; then writing the basic model into a static mesh body and returning a static mesh body model.

[0056] It should be noted that the following abbreviations and key terms may be used in the present application:

[0057] Object: In Unreal Engine, the most basic class is called Object. In other words, it is like the most basic building block, containing the basic functionality of an asset. Most classes in Unreal Engine inherit from (or take part of their functionality from) Object. In C++, UObject is the base class of all Objects, containing various functionalities such as garbage collection, exposing variables to the editor through metadata (UProperty), and serialization functionality during saving and loading.

[0058] Class: A class is used to define the behavior and properties of an Actor or Object in Unreal Engine. Classes can be inherited, which means that a class can take information from its parent class (the class from which it is derived or descended) and then pass it on to its child class. Classes can be created in C++ code or in Blueprint.

[0059] Actor: All objects that can be placed in a level are Actors, such as cameras, static meshes, and player start locations. Actors support three-dimensional transformations, such as translation, rotation, and scaling. You can create (spawn) or destroy Actors through game logic code (C++ or Blueprint). In C++, AActor is the base class of all Actors.

[0060] Volume: A 3D space with a bounding box that can be used for different purposes depending on the effects applied to them.

[0061] Static Mesh: A Static Mesh asset is a basic unit in Unreal Engine used to create scene geometry in a level. These 3D models are created in external modeling programs (such as 3dsMax, Maya, Blender, etc.) and imported into the Unreal Editor through the Content Browser. Most of the content in a level made with Unreal Engine is composed of Static Meshes; this content usually exists in the form of Static Mesh Actors.

[0062] Material: Materials in Unreal Engine define the surface properties of objects in a scene. In a broad sense, you can think of materials as "paint" that is applied to meshes to control their visual appearance. More specifically, materials accurately tell the engine how a surface should interact with light sources in the scene. Materials define various characteristics of a surface, including color, reflectivity, roughness, transparency, and more.

[0063] In a specific implementation scenario, the parameterized modeling method based on UE4 specifically includes:

[0064] 1. Reading the model file. Specifically, it includes:

[0065] 1.1 Generate shp data memory space. Create memory space according to shp file size and initialize case generation storage space.

[0066] 1.2 Read shp data to the generated memory storage space. Use C++ binary to read shp data to the newly created memory space, and then close the file handle.

[0067] 1.3 Read shp data header file information. Add shp data structure to analyze shp data header file information, which is important for element information.

[0068] 1.4 Read shp data boundary information. Get the boundary information of shp data by manipulating shp data directly in binary read fixed position memory.

[0069] 1.5 Get the offset of each record in shp data. Get the element offset of shp data to facilitate the subsequent loop to get the information of each element.

[0070] 2. Analyze model data. Specifically including:

[0071] 2.1 Get the read shp data.

[0072] 2.2 Loop analysis by shp data element quantity.

[0073] 2.3 Get the element by shp data element entity id.

[0074] 2.4 Determine whether the obtained shp element is usable data.

[0075] 2.5 Loop to get point set information in the element to memory.

[0076] 2.6 Determine whether the point set of this element is in the memory. Compare the number and all point positions with the previous point set data to determine whether the point set exists. If the number and point position do not match, it can be normally added to the memory, otherwise, through this element.

[0077] 2.7 If not in memory, add the point set of the element to the memory. Add a corresponding point set id to the point set id list to mark the point set of this element while adding the point set element.

[0078] 2.8 Set to merge the corresponding point set according to whether it is annular. If the file is marked as annular, merge the corresponding inner and outer ring elements and generate redundant inner ring sets.

[0079] 2.9 Close the shp data.

[0080] 3. Generating a base model. Specifically comprising:

[0081] 3.1 Creating original mesh data.

[0082] 3.2 Looping through the line segment set. According to the point set ID in the memory point set, the corresponding point set is obtained when traversing the incoming point set ID.

[0083] 3.3 Splitting the line segment surface into a triangle set. First, estimate the point set to decompose the polygon formed by the point set into a convex polygon, and then decompose the convex polygon into triangles. If it is a ring, it is decomposed into a triangle set by decomposing the ring into two triangles through four-point decomposition.

[0084] 3.4 Adding the triangle point set to the original mesh data.

[0085] 3.5 Traversing the triangle added to the original mesh data.

[0086] 3.6 Creating an empty static mesh model.

[0087] 3.7 Converting the original mesh data to mesh description.

[0088] 3.8 Static mesh model constructs a static mesh rendering buffer.

[0089] 3.9 Obtaining static mesh rendering data and setting the material slot.

[0090] 4.0 Taking the generated static mesh and assigning it to the static mesh for use.

[0091] The scheme can generate a model using a custom parameter in the UE4 running state, accelerate the model generation speed and reduce the labor cost, and dynamically generate a UE model, and adding a model does not need to recompile the UE4 project and manually model.

[0092] The embodiment of the application also provides a parameterized modeling system based on UE4, which is used for realizing the parameterized modeling method based on UE4, and comprises:

[0093] A reading module is configured to read model cross-section shp data into memory and store the data as a point set.

[0094] An analysis module is configured to analyze data of the point set, filter duplicate data, and modify the data according to a ring parameter.

[0095] A generation module is configured to generate a base model including all surfaces by inputting a point set ID, write the base model into a static mesh, and return a static mesh model.

[0096] Please refer to Figure 2An embodiment of the electronic device provided by the present application is shown in the figure. Figure 2 As shown in the figure, the embodiment of the present application provides an electronic device, which comprises a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented: S1, reading model cross-section shp data into memory and storing as a point set;

[0097] S2, analyzing data of the point set, filtering duplicate data, and modifying data according to annular parameters;

[0098] S3, generating a basic model comprising all surfaces by inputting point set ID; then writing the basic model into a static mesh body and returning a static mesh body model.

[0099] Please refer to Figure 3 An embodiment of the computer readable storage medium provided by the present application is shown in the figure. Figure 3 As shown in the figure, the embodiment provides a computer readable storage medium 1400, which stores a computer program 1411. When the computer program 1411 is executed by a processor, the following steps are implemented: S1, reading model cross-section shp data into memory and storing as a point set;

[0100] S2, analyzing data of the point set, filtering duplicate data, and modifying data according to annular parameters;

[0101] S3, generating a basic model comprising all surfaces by inputting point set ID; then writing the basic model into a static mesh body and returning a static mesh body model.

[0102] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0103] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.

[0104] While the preferred embodiments of the application have been described, additional variations and modifications can be made to these embodiments by those skilled in the art once they have the benefit of the present disclosure without departing from the spirit and scope of the application. Accordingly, it is intended that the appended claims include all such modifications and variations as fall within the scope of the present application.

[0105] It is apparent that those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. It is therefore intended that the present application cover all such changes and modifications that are within its scope.

Claims

1. A UE4-based parameterized modeling method, characterized in that, The method comprises the following steps: S1, reading model cross-section shp data into memory and storing as a point set; S2, analyzing the data of the point set, filtering duplicate data, and modifying the data according to the ring parameter; S3, generating a basic model including all surfaces by inputting the point set ID; then writing the basic model into a static mesh body, and returning a static mesh body model; specifically comprising: S31, creating original mesh data; S32, obtaining the corresponding point set from the memory point set according to the point set ID when traversing the input point set ID; S33, dividing the line segment surface into a triangle set; specifically comprising: first estimating the point set to decompose the polygon formed by the point set into a convex polygon, and then decomposing the convex polygon into a triangle; if it is a ring, the ring is decomposed into a triangle set by decomposing the ring into two triangles through four points; S34, adding the triangle point set to the original mesh data; S35, traversing and adding to the original mesh data in units of triangles; S36, creating an empty static mesh body model; S37, converting the original mesh data into mesh description; S38, constructing a static mesh rendering buffer for the static mesh body model; S39, obtaining static mesh body rendering data to set the material slot; S40, generating a static mesh body and assigning it to the static mesh body.

2. The UE4-based parameterized modeling method of claim 1, wherein, The S1 specifically comprises: S11, generating shp data memory space; S12, reading shp data into the generated memory storage space; S13, reading shp data header file information; S14, reading shp data boundary information; S15, obtaining the offset of each record in the shp data.

3. The UE4-based parameterized modeling method of claim 1, wherein, The S2 specifically comprises: S21, obtaining the read shp data; S22, circularly analyzing by the number of shp data elements; S23, obtaining the element through the shp data element entity id; S24, judging whether the obtained shp element is usable data; S25, circularly obtaining the point set information in the element to the memory; S26, judging whether the element point set is in the memory; S27, if not, adding the element point set to the memory; S28, setting to merge the corresponding point set according to whether it is a ring; S29, closing the shp data.

4. The UE4-based parametric modeling method of claim 3, wherein, The S26 specifically comprises: comparing the number and all point positions with the previous point set data to judge whether the point set exists, if the number and point positions do not match, the point set is normally added to the memory, otherwise, the element is obtained.

5. The UE4-based parameterized modeling method of claim 3, wherein, The S28 specifically comprises: if the file is marked as a ring, the corresponding inner and outer ring elements are merged and an extra inner ring set is generated.

6. A UE4-based parametric modeling system, comprising: The system is used to implement the UE4-based parameterized modeling method according to any one of claims 1-5, comprising: a reading module for reading model cross-section shp data into memory and storing as a point set; an analysis module for analyzing the data of the point set, filtering duplicate data, and modifying the data according to the ring parameter; a generation module for generating a basic model including all surfaces by inputting the point set ID; then writing the basic model into a static mesh body, and returning a static mesh body model.

7. An electronic device, comprising: A computer program product comprising a memory, a processor for executing a computer management type program stored in the memory to implement the steps of the UE4-based parameterized modeling method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, A computer program product comprising a memory, a processor for executing a computer management type program stored in the memory to implement the steps of the UE4-based parameterized modeling method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method for performing three-dimensional rendering on two-dimensional vector

    CN113421338A