Virtual component classification method, apparatus and device, and computer readable storage medium

By re-meshing the virtual components and analyzing the sampling point ratio, the problem of complex and low accuracy of virtual components in the prior art is solved, and high accuracy and general virtual component classification is achieved.

CN120219782APending Publication Date: 2025-06-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311812400.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The prior art is complex and has low accuracy in classification of virtual components, especially for elongated virtual components.

Method used

By re-meshing the virtual components to be classified, multiple initial sampling points are determined and square grids are constructed, target sampling points are determined using the characteristics of the target square grid, and classification results of virtual components are determined based on the ratio of the target sampling points.

Benefits of technology

It realizes unified algorithm recognition of various types of virtual components, avoids secondary detection, and improves classification accuracy and universality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219782A_ABST
    Figure CN120219782A_ABST
Patent Text Reader

Abstract

The invention provides a virtual component classification method, device and equipment and a computer readable storage medium. The method comprises the following steps: obtaining a to-be-classified virtual component, and carrying out re-gridding processing on the virtual component to obtain a processed virtual component; a plurality of initial sampling points are determined on the basis of the processed virtual part, square grids corresponding to the initial sampling points are constructed, and the sampling points serve as centers of the square grids; a target square grid is determined from the square grids, sampling points corresponding to the target square grid are determined as target sampling points, intersection points exist between straight lines passing through the four vertexes of the target square grid and the processed virtual part, and the direction of the straight lines is the normal direction of the target square grid; and determining a classification result of the virtual component based on a ratio of the first number of the target sampling points to the second number of the initial sampling points. According to the invention, the classification efficiency and accuracy of the virtual parts can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technologies, and in particular, to a method, apparatus, device, and computer-readable storage medium for classifying virtual components. Background Art

[0002] Virtual models are widely used in scenarios such as games, augmented reality, and virtual reality. A virtual model is generally composed of virtual components of different sizes and levels of detail. After completing the design of the virtual model and obtaining the topological structure of the virtual model, for the multiple virtual components that make up the virtual model, different processing methods may be adopted according to their fineness. Therefore, before performing model processing, it is often necessary to classify the multiple virtual parts included in the virtual model according to their fineness. In related technologies, when classifying the fineness of virtual components, multiple detections are often required, the classification process is complex, and the classification accuracy is low. Accurate classification cannot be performed on some slender virtual components. Summary of the Invention

[0003] Embodiments of this application provide a method, apparatus, device, and computer-readable storage medium for classifying virtual components, which can use a unified algorithm to identify various types of fine parts without secondary detection, and have very good versatility and recognition effects.

[0004] The technical solution of the embodiments of this application is implemented as follows:

[0005] Embodiments of this application provide a method for classifying virtual components, the method includes:

[0006] Obtain a virtual component to be classified, and perform remeshing processing on the virtual component to obtain a processed virtual component;

[0007] Based on the processed virtual component, determine a plurality of initial sampling points, and construct respective square grids corresponding to the respective initial sampling points, where the square grids are centered on the initial sampling points;

[0008] Determine a target square grid from the respective square grids, and determine the initial sampling point corresponding to the target square grid as a target sampling point, where a straight line passing through four vertices of the target square grid has intersections with the processed virtual component, and the direction of the straight line is the normal direction of the target square grid;

[0009] Based on the ratio of the first number of the target sampling point to the second number of the initial sampling point, determine the classification result of the virtual component, where the classification result is a first type of component or a second type of component, the surface area of the first type of component is smaller than the surface area of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component.

[0010] An embodiment of the present application provides a virtual component classification device, including:

[0011] A remeshing module, configured to obtain a virtual component to be classified, perform remeshing processing on the virtual component, and obtain a processed virtual component;

[0012] A first determination module, configured to determine a plurality of initial sampling points based on the processed virtual component, and construct respective square grids corresponding to the respective initial sampling points, where the square grids are centered on the initial sampling points;

[0013] A second determination module, configured to determine a target square grid from the respective square grids, and determine the initial sampling point corresponding to the target square grid as a target sampling point, where a straight line passing through four vertices of the target square grid has intersections with the processed virtual component, a direction of the straight line is a normal direction of the target square grid, and each straight line passes through one vertex of the target square grid;

[0014] A component classification module, configured to determine a classification result of the virtual component based on a ratio of a first number of the target sampling points to a second number of the initial sampling points, where the classification result is a first type of component or a second type of component, a surface area of the first type of component is smaller than a surface area of the second type of component, and a fineness of a texture structure of the first type of component is higher than that of the second type of component.

[0015] An embodiment of the present application provides an electronic device, where the electronic device includes:

[0016] A memory, configured to store computer-executable instructions;

[0017] A processor, configured to implement the virtual component classification method provided by the embodiment of the present application when executing the computer-executable instructions stored in the memory.

[0018] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, which are configured to implement the virtual component classification method provided by the embodiment of the present application when being executed by a processor.

[0019] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions, where when the computer program or computer-executable instructions are executed by a processor, the virtual component classification method provided by the embodiment of the present application is implemented.

[0020] The embodiment of the present application has the following beneficial effects:

[0021] In a first aspect, after obtaining a virtual component to be classified, first perform remeshing on the virtual component, so that multiple triangular facets in the processed virtual component are isotropic and as close as possible to equilateral triangles. In this way, it can be ensured that multiple initial sampling points determined from the processed virtual component can be relatively uniform. Then, construct a square grid corresponding to each initial sampling point, and emit straight lines with directions normal to the square grid from the four vertices of the square grid. Since for a large flat area, the straight lines emitted from the four vertices of the square grid will surely intersect with the virtual component; however, for a relatively fine virtual component, because its local geometry is smaller than the given square grid, it is difficult to ensure that the straight lines emitted from its four vertices will all intersect with the virtual component. Therefore, in the embodiments of the present application, determine a target square grid whose straight lines passing through the four vertices of the square grid and with directions normal to the square grid all have intersections with the processed virtual component. Then, based on the proportion of the target sampling points corresponding to the target square grid among the initial sampling points, it is possible to determine whether the local and global geometric structures of the virtual component are fine, and thus determine the classification result of the virtual component, which can ensure the accuracy of the classification result.

[0022] In a second aspect, the virtual component classification method provided by the embodiments of the present application has no pre-requirements for the virtual component to be classified, does not need to perform smoothing processing on the virtual component in advance to flatten non-flat areas, and does not need to perform secondary detection. Therefore, both the classification efficiency and generality are significantly higher than those of the virtual component classification methods in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1A is a schematic diagram of a game character model and components on the game character model;

[0024] Figure 1B is a schematic diagram of some fine-structured components in the game character model;

[0025] Figure 1C is a comparison schematic diagram of an anisotropic grid model and an isotropic grid model;

[0026] Figure 1D is a schematic diagram of a relatively slender fine structure;

[0027] Figure 2 is a schematic diagram of the network architecture of the model processing system 100 provided by the embodiments of the present application;

[0028] Figure 3 is a schematic diagram of the structure of the server 400 provided by the embodiments of the present application;

[0029] Figure 4It is a schematic diagram of an implementation process of the virtual component classification method provided by an embodiment of the present application;

[0030] Figure 5 It is a schematic diagram of an implementation process of re-meshing the virtual component provided by an embodiment of the present application;

[0031] Figure 6 It is a schematic diagram of an implementation process of determining the target length of the re-meshing process provided by an embodiment of the present application;

[0032] Figure 7A It is a schematic diagram of an implementation process of determining the initial sampling points and constructing a square grid corresponding to the initial sampling points provided by an embodiment of the present application;

[0033] Figure 7B It is another schematic diagram of an implementation process of determining the initial sampling points and constructing a square grid corresponding to the initial sampling points provided by an embodiment of the present application;

[0034] Figure 8 It is a schematic diagram of an implementation process of the model processing method provided by an embodiment of the present application;

[0035] Figure 9 It is a schematic diagram of virtual component classification based on grid sampling intersection provided by an embodiment of the present application;

[0036] Figure 10 It is a schematic diagram of some fine structures obtained on the game character model set A by using the virtual component classification method provided by an embodiment of the present application;

[0037] Figure 11 It is a schematic diagram of some fine structures obtained on the game character model set B by using the virtual component classification method provided by an embodiment of the present application. Detailed implementation manners

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0039] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.

[0040] In the following description, the terms "first", "second", and "third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first", "second", and "third" can be interchanged in a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0041] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the art to which the present application belongs. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0042] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0043] 1) Component: In the embodiments of the present application, a component refers to an independent connected body mesh, which can usually represent an independent semantics (such as shoelaces, necklace straps, etc.), but does not share geometric elements (such as faces, edges, vertices, etc.) with other components.

[0044] 2) Model: Refers to a multi-connected body mesh set composed of one or more components that can express higher-level semantics. For example, it can be Figure 1A a virtual character model in a game, which can include multiple components such as shoelaces, necklace straps, clothing laces, tops, pants, and nude models.

[0045] 3) Fine Structure: On game character models, there are relatively fine components such as necklaces, bracelets, earrings, shoelaces, etc. These components need to be preprocessed in advance because of their small volume and surface area and fine texture structure, so that they can be re-topologized in subsequent processes. In the embodiments of the present application, such components are referred to as fine structures. Figure 1B It is a schematic diagram of some fine structure components in a game character model.

[0046] 4) Axis-Aligned Bounding Box (AABB Tree): A spatial search tree implemented based on the principle of K-d tree, where each node represents the spatial bounding box of a three-dimensional geometric primitive. This data structure can quickly report whether the query primitive intersects with the primitives in the tree, as well as the specific intersection type, intersection position, etc.

[0047] 5) Isotropic mesh. The mesh models in the embodiments of the present application all refer to models whose surfaces are composed of triangular patches. The isotropic mesh model means that the triangular patches on the mesh model are close to equilateral triangles, and the distribution of their vertices is relatively uniform, without varying with the principal curvature direction of the model surface. In contrast, there is the anisotropic mesh model, whose triangular patch orientation is consistent with the principal curvature direction of the model surface. Figure 1C It is a comparison schematic diagram of the anisotropic mesh model and the isotropic mesh model. Among them, Figure 1C 001 in it is the anisotropic mesh model, and the triangles in its cylindrical part are slender and consistent with the principal curvature direction of the model surface; Figure 1C 002 in it is the isotropic mesh model, and its triangles are basically equilateral triangles.

[0048] To better understand the virtual component classification method provided by the embodiments of the present application, first, the virtual component classification method in the related art and its existing drawbacks will be described.

[0049] The fine structure classification of virtual components can be applied to various scenarios. For example, it can be applied in the automatic retopology process, the low-level model generation process, etc. Taking the application in the automatic retopology process as an example, first, multiple virtual components in the virtual model are classified to identify the fine structures with high fineness, so that different strategies can be adopted for the fine structures and non-fine structures in the subsequent processing flow.

[0050] At present, a relatively intuitive method for identifying fine structures is based on two-dimensional projection approximation. The specific approach is as follows: First, detect the types of connected components, such as single-layer, double-layer, and columnar. Then, perform corresponding processing according to different types: For single-layer connected components, first approximate them with a set of bounded small planes. Then, for each bounded small plane, calculate its inward offset in two dimensions. Next, calculate the reduced area near its true boundary (i.e., the boundary that is also the boundary of the original fine structure). Sum the reduced areas of all small planes and divide by the area of the original connected component. If the result is less than a given threshold, then the single-layer connected component is determined to be a fine structure. For double-layer connected components, a normal clustering method can be used. First, cut it into two single-layer connected components, and then use the determination method for single-layer connected components for processing. The above processing method based on two-dimensional projection approximation has several obvious disadvantages: First, this classification may not cover all component types. For example, for spherical components, it is difficult to classify them as double-layer structures or columnar connected components. Second, for single-layer connected components, although the component approximation method can be used to approximate with multiple small planes, it is relatively difficult to calculate the true boundary. In addition, it is also difficult to control the size of the small planes, which is very crucial for calculating the final proportion of the reduced area. Third, for double-layer connected components, if there are uneven surfaces, the existing detection methods are likely to fail.

[0051] In the related art, to overcome the problems existing in the above processing method based on two-dimensional projection approximation, a virtual component classification method based on the simplest approximation of components is proposed. The main idea of this method is: Calculate how large a triangle can be used to approximate it on average within a given error range. If the triangles used for approximation are generally small, it means that the component has a fine local or global structure, that is, it belongs to a fine structure.

[0052] Although the method based on the simplest approximation of components can achieve good recognition results in most cases, for a type of relatively slender fine structure, this method cannot correctly identify it, as Figure 1D shown. Since this type of fine structure is relatively long, both its surface area and volume are relatively large, resulting in a relatively large minimum error reduction threshold used in the method based on the simplest approximation of components, which is likely to generate relatively large approximation triangles, causing the recognition to fail. However, this type of slender fine structure is very common in virtual models, which greatly reduces the applicable range of the method based on the simplest approximation of components.

[0053] Based on this, the embodiments of the present application provide a virtual component classification method, apparatus, device, computer-readable storage medium, and computer program product, which can solve the problems in the related art that the classification process is complex and the slender and fine components cannot be accurately classified. The following describes the exemplary applications of the electronic devices provided by the embodiments of the present application. The electronic devices provided by the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable game devices), smart phones, smart speakers, smart watches, smart TVs, in-vehicle terminals, etc., or can be implemented as servers. Hereinafter, the exemplary applications when the device is implemented as a server will be described.

[0054] Refer to Figure 2 , Figure 2 FIG. is a schematic architecture diagram of the model processing system 100 provided by the embodiments of the present application. As Figure 2 shown, the model processing system 100 includes a terminal 200, a network 300, and a server 400. Among them, the terminal 200 is connected to the server 400 through the network 300. The network 300 can be a wide area network, a local area network, or a combination of the two. The model processing system 100 may further include a database 500 for storing data. The database 500 can be independent of the server 400 or integrated with the server 400. In Figure 2 this case, the database 500 is taken as an example of being independent of the server 400 for illustration.

[0055] The terminal 200 is used for model design and model rendering. In response to the received model design operation, the terminal determines the three-dimensional model of the designed virtual object, and then the terminal 200 sends the three-dimensional model to the server. The server 400 obtains the model information and determines each component included in the three-dimensional model, which may include clothing components, accessory components, model body components, etc. The server 400 determines each component in the three-dimensional model as a virtual component to be classified, performs re-meshing processing on the virtual component to obtain the processed virtual component, then determines a plurality of initial sampling points based on the processed virtual component, and constructs each square grid corresponding to each initial sampling point. Then, straight lines with the normal direction of the square grid are emitted through the four vertices of each square grid, and the square grid where all four straight lines intersect with the processed virtual component is determined as the target square grid, and the initial sampling point corresponding to the target square grid is determined as the target sampling point. Finally, based on the ratio of the first number of the target sampling point to the second number of the initial sampling point, the classification result of the virtual component is determined. The classification result of the virtual component is the first type of component or the second type of component. The surface area of the first type of component is smaller than that of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component. The server 400 sends the classification result of the virtual component to the terminal 200. The terminal 200 divides the multiple virtual components constituting the virtual model into a first type of component set and a second type of component set based on the classification result, and then performs automatic re-topology or other processing on the first type of component set and the second type of component set in different processing manners.

[0056] In some embodiments, the server 400 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal 200 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.

[0057] See Figure 3 , Figure 3 is a schematic structural diagram of the server 400 provided by the embodiments of the present application. Figure 3The illustrated server 400 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the terminal 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to implement connection communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 3 all kinds of buses are labeled as the bus system 440.

[0058] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0059] The user interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls.

[0060] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices that are physically located away from the processor 410.

[0061] The memory 450 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM), and the volatile memory can be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0062] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.

[0063] An operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0064] A network communication module 452 for reaching other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), Universal Serial Bus (USB), etc.;

[0065] A presentation module 453 for enabling the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (such as a display screen, a speaker, etc.);

[0066] An input processing module 454 for detecting and translating one or more user inputs or interactions from one of one or more input devices 432.

[0067] In some embodiments, the device provided by the embodiments of the present application may be implemented in software. Figure 3 A virtual component classification device 455 stored in the memory 450 is shown. It may be software in the form of a program and a plug-in, etc., including the following software modules: a remeshing module 4551, a first determination module 4552, a second determination module 4553, and a component classification module 4554. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.

[0068] In other embodiments, the device provided by the embodiments of the present application may be implemented in hardware. As an example, the device provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the virtual component classification method provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate Arrays (FPGAs), or other electronic components.

[0069] The virtual component classification method provided by the embodiments of the present application will be described in combination with the exemplary applications and implementations of the server provided by the embodiments of the present application.

[0070] Next, the virtual component classification method provided by the embodiments of the present application will be described. As mentioned above, the electronic device implementing the virtual component classification method of the embodiments of the present application can be a terminal, a server, or a combination of both. Therefore, the execution subject of each step will not be repeated hereinafter.

[0071] See Figure 4 , Figure 4 which is a schematic flowchart of the virtual component classification method provided by the embodiments of the present application, and will be described in combination with the steps shown in Figure 4 . Figure 4 The subject of the step is the server.

[0072] In step 101, the virtual components to be classified in the virtual model are obtained, and the virtual components are re-meshed to obtain the processed virtual components.

[0073] In some embodiments, first, the virtual model to be processed is obtained. The virtual model to be processed can be a virtual character model, a virtual building model, a virtual prop model, etc. The virtual model to be processed is composed of multiple components. Exemplarily, for a virtual character model, it includes components such as virtual clothing, virtual accessories, and virtual characters. Each component in the virtual model to be processed is sequentially determined as the virtual component to be classified. The virtual component is a kind of connected body component. The virtual component can be composed of multiple initial triangular patches connected to each other.

[0074] In some embodiments, after the virtual component is obtained, see Figure 5 , "re-mesh the virtual component to obtain the processed virtual component" in step 101 can be implemented through the following steps 1011 to 1012, which will be specifically described below.

[0075] In step 1011, determine the target length for re-meshing the virtual component.

[0076] In some embodiments, the target length corresponding to each initial triangular patch can be understood as the length to be referred to for re-meshing. See Figure 6 , step 1011 can be implemented through the following steps 111 to 115, which will be described in combination with Figure 6 .

[0077] In step 111, determine the length of the connecting edges in each initial triangular patch included in the virtual component.

[0078] In some embodiments, the coordinates of each vertex in the initial triangular patch can be obtained first, and then according to the coordinates of two vertices in the initial triangular patch, the length of the connecting edge between the two vertices can be determined through the Euclidean distance formula.

[0079] In step 112, the average connection edge length is determined based on the lengths of multiple connection edges.

[0080] In some embodiments, the lengths of multiple connection edges can be arithmetically averaged to obtain the average connection edge length.

[0081] In step 113, it is determined whether the average connection edge length is less than a preset length threshold.

[0082] Among them, when the average connection edge length is less than the preset length threshold, step 114 is entered; when the average connection edge length is greater than or equal to the preset length threshold, step 115 is entered.

[0083] In step 114, the preset length is determined as the target length.

[0084] Among them, the preset length is less than the length threshold. Exemplarily, the length threshold can be 1, the preset length can be 0.4. Assuming the average connection edge length is 0.5, that is, the average connection edge length is less than this length threshold. At this time, the target length corresponding to the initial triangular patch is determined to be 0.4.

[0085] In step 115, the average connection edge length is determined as the target length.

[0086] In some embodiments, when the average connection edge length is greater than or equal to the length threshold, the average connection edge length is directly determined as the target length.

[0087] In the above steps 111 to 115, the target length for re-meshing the virtual component can be dynamically determined according to the magnitude relationship between the average connection edge length of the virtual component and the preset length threshold, so as to ensure that for extremely rough virtual components, relatively uniform processing results can also be obtained.

[0088] In step 1012, based on the target length, the virtual component is re-meshed to obtain the processed virtual component.

[0089] In some embodiments, the Remesh function provided by CGAL can be used to re-mesh the virtual component to obtain the processed virtual component. Among them, the processed virtual component includes a plurality of isotropic triangular patches that are as close as possible to equilateral triangles, so that in subsequent steps, as long as the centroid of each triangular patch is sampled, or the vertices of each triangular patch are sampled, a relatively uniform initial sampling point set can be obtained, and the situation where the sampling points of extremely rough virtual components are too few and cause statistical distortion can be avoided.

[0090] Continue to refer to the following Figure 4, continue to describe based on the above step 101.

[0091] In step 102, based on the processed virtual component, multiple initial sampling points are determined, and each square grid corresponding to each initial sampling point is constructed.

[0092] Among them, the processed virtual component includes multiple triangular patches, and the triangular patches are isotropic and close to equilateral triangles.

[0093] In some embodiments, step 102 can be implemented through Figure 7A the steps 1021A to 1024A shown below. The following is a specific description.

[0094] In step 1021A, the coordinates of the vertices in each triangular patch are obtained.

[0095] Here, the coordinates of the three vertices in each triangular patch are obtained. The coordinates of each vertex include an x coordinate, a y coordinate, and a z coordinate.

[0096] In step 1022A, based on the coordinates of the vertices, the centroid of the triangular patch is determined, and the centroid of the triangular patch is determined as the initial sampling point.

[0097] Since the centroid coordinates are the arithmetic mean of the vertex coordinates, in this step, the x coordinates of the three vertices of the triangular patch are calculated by arithmetic mean to obtain the x coordinate of the centroid, the y coordinates of the three vertices of the triangular patch are calculated by arithmetic mean to obtain the y coordinate of the centroid, and similarly, the z coordinates of the three vertices of the triangular patch are calculated by arithmetic mean to obtain the z coordinate of the centroid. After determining the x coordinate, y coordinate, and z coordinate of the centroid, that is, after determining the position of the centroid, the centroid of the triangular patch is determined as the initial sampling point.

[0098] In step 1023A, the side length of the square grid corresponding to the initial sampling point is obtained, and the normal direction of the triangular patch where the initial sampling point is located is determined.

[0099] In some embodiments, the side length of the square grid corresponding to the initial sampling point can be set according to actual project requirements. If the virtual component classification method provided in the embodiments of the present application is applied to an automatic retopology application, the side length of the square grid corresponding to the initial sampling point can be the target length for retopology. The normal direction of the triangular patch where the initial sampling point is located refers to the direction of the straight line passing through the centroid of the triangular patch and perpendicular to the triangular patch.

[0100] In step 1024A, with the initial sampling point as the center, with the normal direction as the normal direction of the square grid, based on the side length, the square grid corresponding to the initial sampling point is constructed.

[0101] In some embodiments, given the center coordinates, side length, and normal direction of a known square grid, the four vertex coordinates of the square grid can be determined. Given the four vertex coordinates of the square grid, that is, the square grid corresponding to the initial sampling points is constructed.

[0102] In the above steps 1021A to 1024A, determining the centroid of each triangular patch in the re-meshed virtual component as the initial sampling point can ensure that a relatively uniform set of initial sampling points can be obtained regardless of whether the virtual component is an extremely rough component or a relatively smooth component, thereby ensuring the accuracy of subsequent classification of the virtual component.

[0103] In some embodiments, step 102 can also be implemented through Figure 7B the steps 1021B to 1024B shown below, which will be specifically described.

[0104] In step 1021B, obtain the vertices in each of the triangular patches.

[0105] In step 1022B, determine the vertices in each of the triangular patches as the initial sampling points.

[0106] In step 1023B, obtain the side length of the square grid corresponding to the initial sampling point.

[0107] In some embodiments, similar to step 1023A, the side length of the square grid corresponding to the initial sampling point can be set according to actual project requirements. If the virtual component classification method provided in the embodiments of the present application is applied to an automatic re-topology application, the side length of the square grid corresponding to the initial sampling point can be the target length for re-topology. The normal direction of the triangular patch where the initial sampling point is located refers to the direction of the straight line passing through the centroid of the triangular patch and perpendicular to the triangular patch.

[0108] In step 1024B, on the tangent plane of the initial sampling point, construct a square grid centered on the initial sampling point based on the side length.

[0109] In the above steps 1021B to 1024B, using each vertex in the processed virtual component as the initial sampling point, since the processed virtual component is obtained through re-meshing, the distribution of each vertex of the processed virtual component is also relatively uniform. Then, directly using each vertex of the virtual component as the initial sampling point can also obtain a uniformly distributed set of initial sampling points, and can also reduce the complexity of determining the initial sampling point, thereby improving the processing efficiency of the entire classification process.

[0110] Next, continue to refer to Figure 4 and continue to describe step 102.

[0111] In step 103, a target square grid is determined from each square grid, and the initial sampling point corresponding to the target square grid is determined as the target sampling point.

[0112] In some embodiments, first, a spatial search tree corresponding to the processed virtual component is created. In practical applications, the library function of the spatial search tree in CGAL can be called to generate the spatial search tree corresponding to the processed virtual component. Each node in the spatial search tree represents the spatial bounding box of a three-dimensional geometric primitive. This data structure can quickly report whether the query primitive intersects with the primitives in the tree, as well as the specific intersection type, intersection position, etc., so that all subsequent query operations can be completed within a time complexity of O(logF), where F represents the total number of triangular patches in the processed virtual component. Then, for each square grid, four lines passing through the four vertices of the square grid and in the normal direction of the square grid are constructed, and based on this spatial search tree, it is determined whether all four lines intersect with the processed virtual component. When all four lines intersect with the processed virtual component, it indicates that the square grid is located in a large flat area. Then, the initial sampling point corresponding to the square grid (i.e., the center of the square grid) is a routable sampling point. At this time, the square grid is determined as the target square grid, and the initial sampling point corresponding to the target square grid is determined as the target sampling point.

[0113] In step 104, based on the ratio of the first number of the target sampling point to the second number of the initial sampling point, the classification result of the virtual component is determined.

[0114] For a fine virtual component, there are very few large flat areas on its surface. That is to say, its local geometry is mostly smaller than the constructed square grid. Therefore, there are fewer routable sampling points (i.e., target sampling points). In some embodiments, the proportion of target sampling points can be used to indirectly understand whether the local and global geometric structures of the virtual component are fine, so as to determine whether it is a fine structure.

[0115] In some embodiments, when implementing step 104, first determine the ratio of the first number of the target sampling point to the second number of the initial sampling point, that is, the proportion of the target sampling point in the initial sampling point. This ratio is a real number between 0 and 1. Then determine whether the ratio of the first number of the target sampling point to the second number of the initial sampling point is less than a preset ratio threshold. Among them, when the ratio of the first number of the target sampling point to the second number of the initial sampling point is less than the preset ratio threshold, it indicates that there are fewer areas on the surface of the virtual component that are larger than the area of the square grid, that is, there are fewer target sampling points where wiring can be performed. At this time, determine that the classification result of the virtual component is the first type of component; when the ratio of the first number of the target sampling point to the second number of the initial sampling point is greater than or equal to the ratio threshold, it indicates that there are more areas on the surface of the virtual component that are larger than the area of the square grid, that is, there are more target sampling points where wiring can be performed. At this time, determine that the classification result of the virtual component is the second type of component. Among them, the surface area of the first type of component is smaller than that of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component. Therefore, the first type of component can be understood as a fine structure component, and the second type of component can be understood as a non-fine structure component.

[0116] This ratio threshold is a preset real number between 0 and 1. Exemplarily, this ratio threshold can be 0.1, 0.15, etc. In the embodiments of the present application, the ratio threshold is set to 0.15, that is, if the proportion of the target sampling points where wiring can be performed exceeds 15%, it is considered that the virtual component is not a fine structure. This is because through observation, it is found that even for non-fine structures, due to factors such as edge sampling points, there are still a large number of sampling points where wiring cannot be performed. Using 15% as the threshold, the detection result is most consistent with the manual observation result.

[0117] The virtual component classification method provided by the embodiments of this application has no pre-requirements for the virtual component to be classified, does not need to smooth the virtual component in advance to flatten non-flat areas, and does not need to perform secondary detection. When implemented, first, the virtual component is re-meshed, so that multiple triangular patches in the processed virtual component are isotropic and as close as possible to equilateral triangles. In this way, it can be ensured that multiple initial sampling points determined from the processed virtual component can be relatively uniform. Then, a square grid corresponding to each initial sampling point is constructed, and straight lines with the normal direction of the square grid are emitted from the four vertices of the square grid. Since for a large flat area, the straight lines emitted from the four vertices of the square grid will surely intersect with the virtual component; however, for a relatively fine virtual component, because its local geometry is smaller than the given square grid, it is difficult to ensure that the straight lines emitted from its four vertices will all intersect with the virtual component. Therefore, in the embodiments of this application, by constructing a spatial search tree of the processed virtual component, a target square grid is determined, where the straight lines passing through the four vertices of the square grid and with the normal direction of the square grid all have intersections with the processed virtual component. Determining the target square grid through the spatial search tree has a low computational complexity, so the classification efficiency of the virtual component can be improved. Then, based on the proportion of the target sampling points corresponding to the target square grid in the initial sampling points, it is determined whether the local and global geometric structures of the virtual component are fine, that is, the classification result of the virtual component is determined, so as to ensure the accuracy of the classification result.

[0118] Based on the foregoing embodiments, the embodiments of this application provide a model processing method. Figure 8 It is a schematic implementation flowchart of the model processing method provided by the embodiments of this application. The following is combined with Figure 8 for description.

[0119] In step 201, the terminal obtains the model to be processed and sends a low-level detail model processing request to the server.

[0120] In some embodiments, the model to be processed may be a new virtual model designed by the terminal based on received model design operations. For example, it may be a virtual character model, a virtual building model, a virtual prop model, etc. The model to be processed may also be a virtual model sent by other electronic devices to the terminal, or a virtual model obtained by the terminal from the server. The low-level detail model processing request sent by the terminal to the server carries the model information of the model to be processed or the model identifier of the model to be processed. Specifically, if the model to be processed is obtained from the server, then the model identifier is carried in the low-level detail model processing request. If the model to be processed is not obtained from the server, then the model information of the model to be processed is carried in the low-level detail model processing request. The low-level detail model processing request is used to request the server to blur the details of the model to be processed, so as to obtain the processed model. When the distance between the viewpoint and the processed model is greater than a certain distance threshold, the processed model can be rendered and displayed, thereby avoiding wasting time due to drawing those relatively meaningless details.

[0121] In step 202, the server parses the received low-level detail model processing request to obtain the model to be processed.

[0122] In some embodiments, after receiving the low-level detail model processing request, the server parses the low-level detail model processing request to obtain the model information or model identifier of the model to be processed. When the model identifier is carried in the low-level detail model processing request, the server can obtain the model to be processed from its own storage space based on the model identifier. When the model information is carried in the low-level detail model processing request, the server parses the low-level detail model processing request to obtain the model to be processed.

[0123] In step 203, the server obtains the virtual components to be classified in the model to be processed, and performs re-meshing processing on the virtual components to obtain the processed virtual components.

[0124] In some embodiments, the server determines each virtual component in the model to be processed as the virtual component to be classified.

[0125] In step 204, the server determines a plurality of initial sampling points based on the processed virtual components, and constructs each square grid corresponding to each initial sampling point.

[0126] Among them, the square grid is centered on the initial sampling point.

[0127] In step 205, the server determines the target square grid from each square grid, and determines the initial sampling point corresponding to the target square grid as the target sampling point.

[0128] Among them, the straight line passing through the four vertices of the target square grid has intersections with the processed virtual components, and the direction of the straight line is the normal direction of the target square grid.

[0129] In step 206, the server determines the classification result of the virtual component based on the ratio of the first number of the target sampling point to the second number of the initial sampling point.

[0130] Among them, the surface area of the first type of component is smaller than that of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component.

[0131] It should be noted that the implementation processes of the above steps 203 to 206 are the same as those of steps 101 to 104. In actual application, the implementation processes of steps 101 to 104 can be referred to.

[0132] In step 207, the server deletes the virtual components in the model to be processed whose classification results are the first type of components, and obtains a low-level detail model.

[0133] In some embodiments, since the first type of component is a fine structure component, in order to obtain a low-level detail model, the fine structure components in the model to be processed can be deleted.

[0134] In step 208, the server sends the low-level detail model to the terminal.

[0135] In some embodiments, after receiving the low-level detail model, the terminal can perform subsequent processing operations based on the low-level detail model. For example, it can perform UV unwrapping processing on the low-level detail model to obtain the two-dimensional unwrapping result of the low-level detail model, and then perform two-dimensional rendering based on this two-dimensional unwrapping result. Since the fine structure components are no longer included in the low-level detail model, the complexity of model processing can be greatly simplified, thereby improving the processing efficiency of UV unwrapping and two-dimensional rendering.

[0136] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.

[0137] The virtual component classification method provided by the embodiments of this application can be applied to any application that requires special processing of fine structures (or fine components). Exemplarily, it can be applied to automatic retopology applications, level of details (LOD) generation applications, etc. For example, in an LOD generation application, the virtual component classification method provided by the embodiments of this application can be used to first identify the first type of components, that is, to identify fine structures. Then, these fine structures can be directly deleted at a low level of detail, which can achieve the goal of better simplifying the model or scene and also conform to the common practice of artists.

[0138] For another example, in an automatic retopology application, the virtual component classification method provided by the embodiments of this application can be first used to decompose the multiple components included in the virtual model into a set of fine structures (i.e., the first type of component set) and a set of non-fine structures (i.e., the second type of component set). Among them, the set of non-fine structures can be directly processed using existing retopology methods. However, for fine structure items, preprocessing such as simplification needs to be done in advance. Generally, the manual preprocessing methods are mainly divided into the following four categories: 1) Coplanar simplification, that is, using a surface to fit the original fine structure or a combination of fine structures; 2) Deletion, for some relatively small fine structures or fine structures that are very close to non-fine structures, artists will directly delete them in the low-poly model; 3) General simplification, that is, directly simplifying the original fine structure using mesh simplification, but retaining the characteristics of its independent connected body; 4) General simplification and merging, after simplifying the original fine structure using mesh simplification, merging it with adjacent structures.

[0139] To simulate the above various manual practices, a key link is to accurately identify fine structures. In the related art, a virtual component classification method based on the simplest approximation of components can be used to identify fine structures, but this method cannot correctly identify a type of slender fine structure. Therefore, a virtual component classification method based on grid sampling intersection is proposed. The test results show that the virtual component classification method based on grid sampling intersection provided by the embodiments of this application can perfectly overcome the problems existing in the simplest approximation fine structure identification method, and the identification result is very close to the manual result. It can be used as the input for subsequent cross-connected body simplification tools (including coplanar fitting, coaxial fitting, and general merging simplification tools), so as to achieve art automation in this link and achieve the goal of reducing labor costs.

[0140] The core idea of the virtual component classification method provided by the embodiments of this application also comes from an observation result: Although the manifestations of fine structures are diverse, such as slender objects, tiny objects, porous objects, etc., their essential feature is that they have fine local or global structures, resulting in the inability to perform retopology using grids with a given side length. This means that if sampling is performed on the surface of the model, then at most sampling points, their local geometry is so fine that wiring cannot be performed using grids with a given side length. On the contrary, if the proportion of routable sampling points on the surface of a model exceeds a given threshold, it indicates that the geometry of most areas of the model is relatively flat and can be retopologized using squares of a given size, so it does not belong to the fine structure. Figure 9 is a schematic diagram of virtual component classification based on grid sampling intersection provided by the embodiments of this application. In Figure 9 square grid 901 and square grid 902 are shown. The straight lines emitted from the four corner points of square grid 901 in the direction of the normal of square grid 901 all intersect with model 903, indicating that the center point of square grid 901 is the target sampling point for routing; for the straight lines emitted from the four corner points of square grid 902 in the direction of the normal of square grid 902, two straight lines do not intersect with model 903, indicating that the center point of square grid 902 is a non-routable sampling point.

[0141] Based on this idea, taking the virtual component classification method provided by the embodiments of this application applied to automatic retopology as an example for illustration. After the user gives the target grid side length d for retopology, the virtual component classification method provided by the embodiments of this application can be implemented through the following steps:

[0142] Step 1A), perform isotropic remeshing on the original virtual component to generate an isotropic mesh model M.

[0143] In some embodiments, an isotropic remeshing of the original virtual component can be performed using the remeshing function provided in CGAL, with the aim of generating isotropic triangles that are as close as possible to equilateral triangles, so that in subsequent steps, by simply sampling the centroid of each triangle, a relatively uniform set of sampling points can be obtained; another advantage of remeshing is that it can avoid the situation where an extremely rough mesh model leads to too few sampling points, resulting in distorted statistics. To achieve this goal, in the embodiments of the present application, the target side length of remeshing is dynamically determined: if the average side length of the original triangular facets is greater than 1, the target side length is the average side length of the original triangular facets; if the average side length of the original triangular facets is less than or equal to 1, the target side length is determined to be 0.3. This can ensure that even for an extremely rough mesh model, a sufficient number of uniform sampling points can be obtained. Tests show that using this strategy, the number of sampling points is between 200 and 2000.

[0144] Step 2A), construct a spatial query tree (AABB Tree) T of the isotropic mesh model M.

[0145] In some embodiments, the interface provided by CGAL can be called to construct the spatial query tree T, so that all subsequent query operations can be completed within a time complexity of O(logF), where F represents the number of faces in M. Generally speaking, F will be less than 10,000.

[0146] Step 3A), for each triangular facet in the isotropic mesh model M, execute Steps 4A) to 6A).

[0147] Step 4A), centered at the centroid of the current triangular facet and with the normal of the triangular facet as the normal, construct a square grid with side length d.

[0148] Step 5A), for each corner point of the square grid, construct a line passing through it and in the direction of the normal of the current triangular face, and then test whether the line intersects with the spatial query tree T.

[0149] In some embodiments, the library function in CGAL can be called to determine whether the line intersects with the spatial query tree T.

[0150] Step 6A), if the four lines passing through the four corner points of the square grid all intersect with T, mark the centroid of the current triangular facet as a routable sampling point, which means that the local geometry of this point supports quadrilateral retopology with a target side length of d.

[0151] In some embodiments, if the four lines passing through the four corner points of the square grid do not all intersect with T, then the centroid of the current triangular facet is not marked.

[0152] In the above steps 4A) to 6A), at the centroid of the current triangle, check whether a grid with side length d can be wired. In practical applications, the method of finding the intersection of square grids can be used to check whether the straight lines emitted from the four corner points of the square grid intersect the virtual component itself. Generally, for a large flat area, the straight lines emitted from the four corner points will definitely intersect the virtual component; however, for a fine structure, since its local geometry is smaller than the given square grid, it is difficult to ensure that the straight lines emitted from its four corner points will all intersect the virtual component. Therefore, finally, by counting the proportion of wireable sampling points, the local and global geometric structures of the virtual component can be indirectly understood, so as to determine whether it is a fine structure.

[0153] Step 7A), count the proportion of wireable sampling points among all sampling points (i.e., the centroid points of all triangles). If this proportion is lower than the given threshold, mark the original virtual component as a fine structure (corresponding to the first type of component in other embodiments), otherwise mark it as a non-fine structure (corresponding to the second type of component in other embodiments).

[0154] In some embodiments, the threshold is a real number between 0 and 1. For example, the default threshold can be 0.15, that is, if the proportion of wireable sampling points exceeds 15%, it is considered that the current component is not a fine structure. This is because, through observation, it is found that even for non-fine structures, due to factors such as edge sampling points, there are still a large number of sampling points that cannot be wired. Using 15% as the threshold, the detection result is most consistent with the manual observation result.

[0155] Step 8A), output the identification of whether all the original virtual components are fine structures for subsequent tools to use.

[0156] After discriminating all virtual components, finally, in step 8), output the identification of whether each virtual component is a fine structure. For different identifications, subsequent processing tools will perform different processes.

[0157] In the above virtual component classification method, after isotropic remeshing, the centroid of each triangular patch is used as a sampling point to calculate the proportion of wireable sampling points in the total sampling points. In some embodiments, each vertex of the triangular patch can also be used as a sampling point to calculate the proportion of wireable sampling points. The implementation process of classifying virtual components with each vertex of the triangular patch as a sampling point is described below.

[0158] Step 1B), perform isotropic remeshing on the original virtual component to generate an isotropic mesh model M.

[0159] Step 2B), construct a spatial query tree (AABB Tree) T of the isotropic grid model M.

[0160] It should be noted that the implementation processes of Step 1B and Step 2B are the same as those of Step 1A and Step 2A. Here, the implementation processes of Step 1A and Step 2A can be referred to.

[0161] Step 3B), for each vertex in the isotropic grid model M, execute Step 4B) to Step 6B).

[0162] Step 4B), with the current vertex as the center, construct a square grid with a side length of d on the tangent plane of the current vertex.

[0163] Step 5B), for each corner point of the square grid, construct a straight line passing through it and with a normal vector being the normal of the square, and then test whether all four straight lines have intersections with the spatial query tree T.

[0164] Step 6B), if the straight lines passing through the four corner points of the square grid all have intersections with the spatial query tree T, mark the current vertex as a routable sampling point.

[0165] Step 7B), calculate the proportion of routable sampling points among all sampling points (i.e., all vertices of triangular patches). If this proportion is lower than a given threshold, mark the virtual component as a fine structure, otherwise mark it as a non - fine structure.

[0166] Step 8B), output the identification of whether all original virtual components are fine structures for subsequent tools to use.

[0167] Compared with Step 1A to Step 8A, when classifying virtual components with a boundary using Step 1B to Step 8B, the error in calculating whether the sampling points at the boundary are routable is relatively larger. However, for virtual components without a boundary, the results obtained by the two schemes are basically the same.

[0168] The virtual component classification method provided by the embodiments of this application can be applied to the fine structure recognition and detection module of an automatic retopology project. The effectiveness of this method and its advantages over the virtual component classification based on the simplest approximation of components have been verified on some game character models.

[0169] Figure 10It is a schematic diagram of some fine structures obtained by using the virtual component classification method provided in the embodiments of the present application on the game character model set A. Among them, 1001, 1004, 1007, and 1010 are original models, 1002 is a fine structure identified from the original model 1001 by using the virtual component classification method based on the simplest approximation of components, and 1003 is a fine structure identified from the original model 1001 by using the virtual component classification method proposed in the embodiments of the present application. 1005 is a fine structure identified from the original model 1004 by using the virtual component classification method based on the simplest approximation of components, and 1006 is a fine structure identified from the original model 1004 by using the virtual component classification method proposed in the embodiments of the present application. 1008 is a fine structure identified from the original model 1007 by using the virtual component classification method based on the simplest approximation of components, and 1009 is a fine structure identified from the original model 1007 by using the virtual component classification method proposed in the embodiments of the present application. 1011 is a fine structure identified from the original model 1010 by using the virtual component classification method based on the simplest approximation of components, and 1012 is a fine structure identified from the original model 1010 by using the virtual component classification method proposed in the embodiments of the present application.

[0170] Figure 10 It shows the result comparison of the fine structures obtained by the virtual component classification method proposed in the embodiments of the present application and the virtual component classification method based on the simplest approximation of components on the game character model set A. On the original model 1001, it can be seen that the virtual component classification method provided in the embodiments of the present application can successfully identify the small particles on the belt and the fine annular strip above the belt, while the recognition results of the rest are basically the same. The result comparison on the other models also shows that the virtual component classification method provided in the embodiments of the present application can not only correctly identify all the fine structures obtained by the virtual component classification method based on the simplest approximation of components, but also correctly identify the slender fine structures. Such slender fine structures often appear in game character models, and manual processing often simplifies them specially, so it is crucial to correctly identify them.

[0171] Figure 11It is a schematic diagram of some fine structures obtained by using the virtual component classification method provided in the embodiments of the present application on the game character model set B. Among them, 1101, 1104, 1107, and 1110 are original models, 1102 is a fine structure identified from the original model 1101 by using the virtual component classification method based on the simplest approximation of components, and 1103 is a fine structure identified from the original model 1101 by using the virtual component classification method proposed in the embodiments of the present application. 1105 is a fine structure identified from the original model 1104 by using the virtual component classification method based on the simplest approximation of components, and 1106 is a fine structure identified from the original model 1104 by using the virtual component classification method proposed in the embodiments of the present application. 1108 is a fine structure identified from the original model 1107 by using the virtual component classification method based on the simplest approximation of components, and 1009 is a fine structure identified from the original model 1107 by using the virtual component classification method proposed in the embodiments of the present application. 1111 is a fine structure identified from the original model 1110 by using the virtual component classification method based on the simplest approximation of components, and 1112 is a fine structure identified from the original model 1110 by using the virtual component classification method proposed in the embodiments of the present application. Figure 11 It shows the result comparison of the fine structures obtained by the virtual component classification method proposed in the embodiments of the present application and the virtual component classification method based on the simplest approximation of components on the game character model B. It can be clearly seen that, compared with the fine structure recognition method based on the simplest model approximation, the virtual component classification method proposed in the embodiments of the present application can obviously identify more slender fine structures. By observing the way of manual processing of these slender fine structures, it is found that in most cases, manual workers will merge these slender fine structures with the nearby non-fine structures. If these slender fine structures are not correctly identified in advance, then the subsequent cross-connected body simplification tool in the automatic retopology project cannot simulate the manual simplification method.

[0172] In the virtual component classification method provided in the embodiments of the present application, first, uniform sampling is performed on the surface of the virtual component, and then, with each sampling point as the center, it is judged whether wiring can be carried out using a grid of a given size at that place; finally, the proportion of the sample points where wiring is possible in all the sample points is counted. If the proportion is less than the given threshold, it is judged that the virtual component is a fine structure. The virtual component classification method provided in the embodiments of the present application has no any pre-requirements for the virtual component to be detected, does not need to smooth the flat area of the virtual component in advance, and is even applicable to triangle soup. Therefore, the virtual component classification method provided in the embodiments of the present application can identify various types of fine structures by using a unified algorithm without the need for secondary detection, and has very good versatility and recognition effect.

[0173] Next, the exemplary structure of the virtual component classification device 455 provided in the embodiments of the present application implemented as a software module will be further described. In some embodiments, as Figure 3 shown, the software modules in the virtual component classification device 455 stored in the memory 450 may include:

[0174] A remeshing module 4551, configured to obtain virtual components to be classified in a virtual model, perform remeshing processing on the virtual components, and obtain processed virtual components;

[0175] A first determination module 4552, configured to determine a plurality of initial sampling points based on the processed virtual components, and construct respective square grids corresponding to the respective initial sampling points, with the initial sampling points as the centers of the square grids;

[0176] A second determination module 4553, configured to determine a target square grid from the respective square grids, and determine the initial sampling point corresponding to the target square grid as the target sampling point, where a straight line passing through four vertices of the target square grid has intersections with the processed virtual component, and the direction of the straight line is the normal direction of the target square grid;

[0177] A component classification module 4554, configured to determine a classification result of the virtual component based on a ratio of a first number of the target sampling points to a second number of the initial sampling points, where the surface area of the first type of component is smaller than that of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component.

[0178] In some embodiments, the first determination module 4552 is further configured to: obtain coordinates of vertices in each of the triangular patches; determine a centroid of the triangular patch based on the coordinates of the vertices, and determine the centroid of the triangular patch as the initial sampling point.

[0179] In some embodiments, the first determination module 4552 is further configured to: obtain a side length of the square grid corresponding to the initial sampling point, determine a normal direction of the triangular patch where the initial sampling point is located; with the initial sampling point as the center and the normal direction as the normal direction of the square grid, construct a square grid corresponding to the initial sampling point based on the side length.

[0180] In some embodiments, the processed virtual component includes a plurality of triangular patches, and the first determination module 4552 is further configured to: obtain vertices in each of the triangular patches; determine the vertices in each of the triangular patches as the initial sampling points.

[0181] In some embodiments, the first determination module 4552 is further configured to: obtain the side length of the square grid corresponding to the initial sampling point; and construct a square grid centered at the initial sampling point on the tangent plane of the triangular patch corresponding to the initial sampling point based on the side length.

[0182] In some embodiments, the second determination module 4553 is further configured to: for each of the square grids, construct four straight lines passing through the four vertices of the square grid and in the normal direction of the square grid; and when all of the four straight lines intersect with the processed virtual component, determine the square grid as a target square grid.

[0183] In some embodiments, the component classification module 4554 is further configured to: when the ratio of the first number of the target sampling point to the second number of the initial sampling point is less than a preset ratio threshold, determine that the classification result of the virtual component is a first type of component; and when the ratio of the first number of the target sampling point to the second number of the initial sampling point is greater than or equal to the ratio threshold, determine that the classification result of the virtual component is a second type of component.

[0184] In some embodiments, the re-meshing module 4551 is further configured to: determine the target length corresponding to each initial triangular patch included in the virtual component; and perform re-meshing processing on each initial triangular patch based on the target length corresponding to each initial triangular patch to obtain a processed virtual component.

[0185] In some embodiments, the re-meshing module 4551 is further configured to: determine the connection edge lengths of the three connection edges in each initial triangular patch; determine the average connection edge length of the initial triangular patch based on the connection edge lengths of the three connection edges; when the average connection edge length is greater than or equal to a preset length threshold, determine the average connection edge length as the target length corresponding to the initial triangular patch; and when the average connection edge length is less than the length threshold, determine a preset length as the target length corresponding to the initial triangular patch, where the preset length is less than the length threshold.

[0186] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions, and the computer program or computer-executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the virtual component classification method described above in the embodiments of the present application.

[0187] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the virtual component classification method provided by the embodiment of the present application. For example, as Figure 4 shown in the virtual component classification method.

[0188] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0189] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0190] As an example, the computer-executable instructions may or may not correspond to files in the file system, and may be stored as part of a file storing other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (for example, files storing one or more modules, subroutines, or code portions).

[0191] As an example, the computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed at multiple locations and interconnected by a communication network.

[0192] As described above, the above are only embodiments of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.

Claims

1. A method for classifying virtual components, characterized in that, The method includes: Obtaining a virtual component to be classified in a virtual model, and performing remeshing processing on the virtual component to obtain a processed virtual component; Determining a plurality of initial sampling points based on the processed virtual component, and constructing respective square meshes corresponding to the respective initial sampling points, with the square meshes centered on the initial sampling points; Determining a target square mesh from the respective square meshes, and determining the initial sampling point corresponding to the target square mesh as a target sampling point, wherein a straight line passing through four vertices of the target square mesh has intersections with the processed virtual component, the direction of the straight line is the normal direction of the target square mesh, and each straight line passes through one vertex of the target square mesh; Determining a classification result of the virtual component based on a ratio of a first number of the target sampling point to a second number of the initial sampling point, the classification result being a first type of component or a second type of component, the surface area of the first type of component being smaller than that of the second type of component, and the fineness of the texture structure of the first type of component being higher than that of the second type of component.

2. The method according to claim 1, characterized in that, The processed virtual component includes a plurality of triangular patches. The determining a plurality of initial sampling points based on the processed virtual component includes: Obtaining the coordinates of vertices in each of the triangular patches; Determining the centroid of the triangular patch based on the coordinates of the vertices, and determining the centroid of the triangular patch as an initial sampling point.

3. The method according to claim 2, wherein For each of the initial sampling points, constructing the square mesh corresponding to the initial sampling point includes: Obtaining the side length of the square mesh corresponding to the initial sampling point, and determining the normal direction of the triangular patch where the initial sampling point is located; Centering on the initial sampling point, with the normal direction as the normal direction of the square mesh, and constructing the square mesh corresponding to the initial sampling point based on the side length.

4. The method according to claim 1, characterized in that, The processed virtual component includes a plurality of triangular patches. The determining a plurality of initial sampling points based on the processed virtual component includes: Obtaining the vertices in each of the triangular patches; Determining the vertices in each of the triangular patches as sampling points.

5. The method according to claim 4, characterized in that, For each of the initial sampling points, constructing the square mesh corresponding to the initial sampling point includes: Obtaining the side length of the square mesh corresponding to the initial sampling point; On the tangent plane of the triangular patch corresponding to the initial sampling point, constructing a square mesh centered on the initial sampling point based on the side length.

6. The method according to claim 5, wherein The determining the target square mesh from the respective square meshes includes: For each of the square meshes, constructing four straight lines passing through four vertices of the square mesh and with the direction being the normal direction of the square mesh; When the four straight lines all intersect with the processed virtual component, determining the square mesh as the target square mesh.

7. The method according to any one of claims 1 to 6, characterized in that The determining the classification result of the virtual component based on the ratio of the first number of the target sampling point to the second number of the initial sampling point includes: When the ratio of the first number of the target sampling point to the second number of the initial sampling point is less than a preset ratio threshold, determine that the classification result of the virtual component is the first type of component; When the ratio of the first number of the target sampling point to the second number of the initial sampling point is greater than or equal to the ratio threshold, determine that the classification result of the virtual component is the second type of component.

8. The method according to any one of claims 1 to 6, characterized in that The re-meshing the virtual component to obtain a processed virtual component includes: Determining a target length for re-meshing the virtual component; Based on the target length, re-meshing the virtual component to obtain a processed virtual component.

9. The method according to claim 8, wherein The determining a target length for re-meshing the virtual component includes: Determining the lengths of the connecting edges in each initial triangular patch included in the virtual component; Determining an average connecting edge length based on the edge lengths of multiple said connecting edges; When the average connecting edge length is greater than or equal to a preset length threshold, determine the average connecting edge length as the target length; When the average connecting edge length is less than the length threshold, determine a preset length as the target length, and the preset length is less than the length threshold.

10. A virtual component classification device, characterized in that, The apparatus includes: A re-meshing module, configured to obtain a virtual component to be classified in a virtual model, and re-mesh the virtual component to obtain a processed virtual component; A first determining module, configured to determine a plurality of initial sampling points based on the processed virtual component, and construct respective square grids corresponding to each of the initial sampling points, where the square grid is centered on the initial sampling point; A second determining module, configured to determine a target square grid from each of the square grids, and determine the initial sampling point corresponding to the target square grid as the target sampling point, where a straight line passing through the four vertices of the target square grid has intersections with the processed virtual component, the direction of the straight line is the normal direction of the target square grid, and each straight line passes through one vertex of the target square grid; A component classification module, configured to determine the classification result of the virtual component based on the ratio of the first number of the target sampling point to the second number of the initial sampling point, where the classification result is the first type of component or the second type of component, the surface area of the first type of component is less than the surface area of the second type of component, and the fineness of the texture structure of the first type of component is higher than that of the second type of component.

11. An electronic device, characterized in that, The electronic device includes: A memory, configured to store computer-executable instructions; A processor, configured to implement the virtual component classification method according to any one of claims 1 to 9 when executing the computer-executable instructions stored in the memory.

12. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, The computer-executable instructions or computer program, when executed by the processor, implement the virtual component classification method according to any one of claims 1 to 9.

13. A computer program product, comprising computer-executable instructions or a computer program, characterized in that, The computer-executable instructions or computer program, when executed by the processor, implement the virtual component classification method according to any one of claims 1 to 9.