Geometry component lightweight preprocessing method for three-dimensional scene rendering

By detecting edge points and determining view frustum culling in triangular mesh models, efficient identification and visibility filtering of cylindrical pipelines are achieved, solving the problem of low rendering efficiency in large 3D scenes and improving rendering speed and user experience.

CN122289491APending Publication Date: 2026-06-26JILIN ANIMATION INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JILIN ANIMATION INST
Filing Date
2026-04-08
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies are inefficient at rendering cylindrical pipelines in large 3D scenes, mainly due to the failure to effectively identify and filter visibility from the current viewpoint, resulting in wasted GPU resources and low rendering efficiency.

Method used

By identifying the edge points of the triangular mesh model, the component edge shape and bottom circle fullness are detected and converted into an instantiated reuse matrix. Combined with view frustum culling and occlusion judgment, only the cylindrical pipelines visible in the current view are rendered.

Benefits of technology

It improves the recognition accuracy and preprocessing efficiency of cylindrical pipelines, reduces the amount of data transmitted over the network, increases the rendering initialization speed and frame rate, reduces the burden of invalid GPU rendering, and improves rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289491A_ABST
    Figure CN122289491A_ABST
Patent Text Reader

Abstract

This application discloses a lightweight preprocessing method for geometric components in 3D scene rendering, relating to the field of 3D rendering. The method includes: when there are multiple edge points in a triangular mesh model, performing component edge shape detection based on the position information of the multiple edge points to determine whether the component to be processed is a cylindrical component; when the component to be processed is determined to be a cylindrical component, performing circular fullness detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline; converting the geometric features of each cylindrical pipeline into an instantiated reuse matrix; combining the view frustum parameters of the current viewpoint and the instantiated reuse matrix to perform view frustum culling and occlusion judgment to determine whether each cylindrical pipeline is visible; for cylindrical pipelines, collaborative optimization is achieved in three stages: recognition efficiency, lightweight transmission, and rendering visibility screening. Through the preprocessing mechanism in the early stage of rendering, the overall efficiency of subsequent rendering is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D rendering technology, and in particular to a lightweight preprocessing method for geometric components for 3D scene rendering. Background Technology

[0002] In Web3D applications, especially with the rise of the concepts of digital twins and metaverse, the demand for online rendering of large-scale 3D scenes is increasing. These scenes often contain a large number of cylindrical pipeline structures, such as the piping system of a chemical plant or the ventilation ducts inside a building.

[0003] Existing technologies typically use triangular mesh models to represent and process these pipelines. However, as scene scale continues to expand, this traditional approach has gradually revealed efficiency bottlenecks: to accurately represent the surface details of the pipelines, a large number of triangles need to be generated, resulting in a huge amount of computation for identifying and extracting pipeline components. Furthermore, the massive amount of triangular mesh data severely impacts the initial loading speed of the scene. At the same time, when rendering a large number of pipeline components, existing technologies do not perform fine-grained filtering of visibility from the current viewpoint, causing the GPU to process a large number of pipelines that are not actually visible, resulting in wasted rendering resources and low rendering efficiency. Consequently, the lack of a preprocessing mechanism for cylindrical pipelines that can achieve efficient identification and pre-screening before rendering means that the overall rendering efficiency cannot meet the needs of large-scale Web3D scenes. Summary of the Invention

[0004] The purpose of this application is to provide a lightweight preprocessing method for geometric components in 3D scene rendering, which can solve the problem of "lack of a preprocessing mechanism for cylindrical pipelines that can achieve efficient identification and pre-screening before rendering".

[0005] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a lightweight preprocessing method for geometric components in 3D scene rendering, including: Obtain triangular mesh models of multiple geometric components to be processed in a Web3D scene; The system identifies whether each of the triangular mesh models has multiple edge points. When the triangular mesh model has multiple edge points, it performs component edge shape detection based on the position information of the multiple edge points to determine whether the component to be processed is a cylindrical component. When the component to be processed is determined to be a cylindrical component, it performs circular fullness detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline. The geometric features and material features of each cylindrical pipeline are extracted respectively. The geometric features of each cylindrical pipeline are converted into an instantiated reuse matrix. The common data of the cylindrical pipelines in the same group, the multiple instantiated reuse matrices and the corresponding material features are packaged into a network transmission data packet. Combine the view frustum parameters of the current viewpoint with the instantiated reuse matrix to perform view frustum culling and occlusion judgment, determine whether each cylindrical pipeline is visible, pick the cylindrical pipelines visible in the current viewpoint, and perform rendering operations on all visible cylindrical pipelines based on the network transmission data packets.

[0006] In one embodiment, the step of identifying whether each of the triangular mesh models has multiple edge points specifically includes: Align the center of the triangular mesh model with the origin of the coordinate system; The three principal PCA directions of the triangular mesh model are obtained through principal component analysis, and the three principal PCA directions are aligned with the three principal directions of the coordinate system, respectively. When the normal vector of a vertex of the triangular mesh model is not parallel to any of the main PCA directions, the vertex is determined as an edge point. All vertices are traversed to identify all edge points of the triangular mesh model.

[0007] In one embodiment, the step of performing component edge shape detection based on the position information of the multiple edge points when the triangular mesh model has multiple edge points, in order to determine whether the component to be processed is a cylindrical component, specifically includes: Determine the axisymmetric bounding box of the component to be processed, and detect whether multiple edge points fall on two faces of a pair of parallel planes of the axisymmetric bounding box respectively; When multiple edge points fall on two surfaces of a pair of parallel planes of the axisymmetric bounding box, the distance from each edge point to the center of the component to be processed is calculated. When all the calculated distance values ​​are equal, the component to be processed is determined to be a cylindrical component.

[0008] In one embodiment, the step of performing a circularity detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline when the component to be processed is determined to be a cylindrical component specifically includes: Calculate the area of ​​the circular base of the cylindrical member, and calculate the actual area of ​​the base of the cylindrical member; When the absolute value of the difference between the circular area of ​​the bottom surface and the actual bottom surface area is less than a preset threshold, the cylindrical component is determined to be a cylindrical pipeline.

[0009] In one embodiment, the step of converting the geometric features of each of the cylindrical pipelines into an instantiated reuse matrix specifically includes: Obtain the bottom radius, cylinder height, cylinder axis direction, and geometric center point of the cylindrical pipeline; The scaling matrix of the cylindrical pipeline is obtained based on the bottom radius and the cylinder height; The rotation matrix of the cylindrical pipeline is obtained based on the cylindrical axis direction; The translation matrix of the cylindrical pipeline is obtained based on the geometric center point; An instantiation reuse matrix is ​​obtained based on the scaling matrix, the rotation matrix, and the translation matrix.

[0010] In one embodiment, the step of packaging the common data of the cylindrical pipelines located in the same group, the multiple instantiated reuse matrices, and the corresponding material features into a network transmission data packet specifically includes: Based on the material characteristics, the multiple cylindrical pipelines are grouped, and the common data of each group of cylindrical pipelines includes a basic three-dimensional geometric mesh, shading and rendering code, and texture files; Multiple instantiated reuse matrices located in the same group are grouped into an instantiated pipeline component group; Package multiple material features located in the same group into a material data package; The network transmission data packet is obtained based on the public data, the instantiated pipeline component group, and the material data packet.

[0011] In one embodiment, the step of performing cone culling specifically includes: The positions of the center points of the two bottom surfaces of the cylindrical pipeline are calculated, and it is determined whether the center point positions are inside the viewing cone. If at least one of the center points is inside the viewing cone, it is determined that the cylindrical pipeline intersects with the viewing cone. When the center point is not located inside the viewing cone, the equation of the axis segment is obtained based on the center point positions of the two bottom surfaces. It is then determined whether the axis segment intersects with the viewing cone. When the axis segment intersects with the viewing cone, it is determined that the cylindrical pipeline intersects with the viewing cone. When the axis segment does not intersect the view frustum, verify the three main PCA directions to obtain a directed bounding box, determine whether the directed bounding box intersects the view frustum, and when the directed bounding box intersects the view frustum, determine that the cylindrical pipeline intersects the view frustum.

[0012] In one embodiment, the step of performing occlusion determination specifically includes: When the cylindrical pipeline intersects with the view frustum, a depth map of the non-pipeline component is obtained from the current viewpoint; Rasterization calculation is performed on the cylindrical pipeline to obtain the projection area of ​​the cylindrical pipeline onto the screen, and the depth value corresponding to each pixel of the projection area is calculated. By traversing all pixels within the projection area, if a pixel corresponds to a blank area on the depth map, or if the depth value of a pixel is less than the depth at the corresponding position on the depth map, then the cylindrical pipeline is visible from the current viewpoint.

[0013] Secondly, this application also provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in claim 1.

[0014] Thirdly, this application also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the above-described method.

[0015] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a lightweight preprocessing method for geometric components in 3D scene rendering. By dual detection of component edge shape and circular fullness, it can accurately identify cylindrical pipeline components in complex scenes, avoiding invalid calculations for non-target components, thereby improving recognition accuracy and preprocessing efficiency. By packaging common data of cylindrical pipelines in the same group, multiple instantiated reuse matrices, and corresponding material features into network transmission data packets, it achieves batch transmission of pipeline data, compressing the amount of network transmission data and improving the initialization speed of subsequent rendering. Through view frustum culling and occlusion judgment, it performs refined visibility filtering of pipelines, only picking pipelines actually visible from the current viewpoint for rendering, effectively reducing the GPU's unnecessary rendering burden and improving rendering frame rate and the smoothness of scene interaction. Therefore, this application achieves synergistic optimization in three aspects for cylindrical pipelines: recognition efficiency, lightweight transmission, and rendering visibility filtering. Through the preprocessing mechanism before rendering, it can effectively improve the overall efficiency of subsequent rendering. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1This is a flowchart of a method for lightweight preprocessing of geometric components for 3D scene rendering according to an embodiment of this application; Figure 2 This is a flowchart illustrating the identification of cylindrical pipelines in a lightweight preprocessing method for geometric components in 3D scene rendering, according to an embodiment of this application. Figure 3 This is a flowchart illustrating the visibility determination of a cylindrical pipeline in a lightweight preprocessing method for geometric components in 3D scene rendering, according to an embodiment of this application. Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] See Figure 1 This application provides a lightweight preprocessing method for geometric components in 3D scene rendering, including the following steps: S100: Obtain the triangular mesh model of multiple geometric components to be processed in the Web3D scene; S200: Identify whether each triangular mesh model has multiple edge points. When there are multiple edge points in the triangular mesh model, perform component edge shape detection based on the position information of multiple edge points to determine whether the component to be processed is a cylindrical component. When the component to be processed is determined to be a cylindrical component, perform circular fullness detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline. S300: Extract the geometric features and material features of each cylindrical pipeline, convert the geometric features of each cylindrical pipeline into an instantiated reuse matrix, and package the common data of cylindrical pipelines in the same group, multiple instantiated reuse matrices and corresponding material features into a network transmission data packet; S400: Combines the view frustum parameters of the current viewpoint and the instantiation reuse matrix to perform view frustum culling and occlusion judgment, determines whether each cylindrical pipeline is visible, picks the visible cylindrical pipelines in the current viewpoint, and performs rendering operations on all visible cylindrical pipelines based on network transmission data packets.

[0021] In S100, large-scale Web3D scenes have become increasingly common in Web3D applications, especially with the rise of digital twin computing and the metaverse concept. These scenes often contain a large number of cylindrical pipeline structures, and preprocessing for these cylindrical pipeline structures before rendering has become the key to improving rendering efficiency.

[0022] Obtain the mesh models of multiple geometric components to be processed in the Web3D scene, and convert the mesh models into triangular mesh models. In addition to triangles, the mesh models may also contain other polygons such as quadrilaterals. Therefore, it is necessary to convert all polygons into triangles. For example, a quadrilateral needs to be split into two triangles, and a pentagon needs to be split into three triangles.

[0023] See S200. Figure 2 Specifically, the steps for identifying whether each triangular mesh model has multiple edge points include: aligning the center of the triangular mesh model with the origin of the coordinate system; obtaining the three principal PCA directions of the triangular mesh model through principal component analysis and aligning the three principal PCA directions with the three principal directions of the coordinate system respectively; determining the vertex as an edge point when the normal vector of the vertex of the triangular mesh model is not parallel to any of the principal PCA directions, traversing all vertices, and identifying all edge points of the triangular mesh model.

[0024] In this step, the center of the geometric component to be processed is first aligned with the origin of the coordinate system through translation. Then, Principal Component Analysis (PCA) is used to obtain the three principal PCA directions of the triangular mesh model. The model is rotated to align these three principal PCA directions with the three principal PCA directions of the 3D coordinate system. After PCA alignment, the direction of the cylinder axis has three possibilities: parallel to the X-axis, parallel to the Y-axis, and parallel to the Z-axis. If the normal vector of a vertex is not parallel to any of the three principal PCA directions, the vertex is considered an edge point; otherwise, it is not. Therefore, by traversing all vertices of the triangular mesh model and comparing the vertex normal vectors with the three principal directions, all edge points of the geometric component to be processed can be identified. If there are no edge points in the geometric component, it means that the geometric component is not a cylindrical pipeline, and the cylindrical pipeline identification process ends.

[0025] Specifically, when there are multiple edge points in the triangular mesh model, the step of performing component edge shape detection based on the position information of multiple edge points to determine whether the component to be processed is a cylindrical component includes: determining the axisymmetric bounding box of the component to be processed, detecting whether multiple edge points fall on the two faces of a pair of parallel planes of the axisymmetric bounding box respectively; when multiple edge points fall on the two faces of a pair of parallel planes of the axisymmetric bounding box respectively, calculating the distance value from each edge point to the center of the component to be processed, and determining that the component to be processed is a cylindrical component when all the calculated distance values ​​are equal.

[0026] In this step, if the component to be processed is a cylindrical pipeline, the edge points must fall on the top and bottom surfaces of the cylinder. That is, for a standard cylindrical pipeline, all its edge points (vertices located at the junction of the bottom and side surfaces) can only appear on the circumference of the top and bottom surfaces, and not on the side surface or other positions of the cylinder. After PCA alignment, the two bottom surfaces of the cylinder must coincide with a pair of parallel planes of the axisymmetric bounding box. Therefore, the edge points of the pipeline component must fall on a pair of parallel planes of the axisymmetric bounding box. Calculate the axis-aligned bounding box of the component to be processed, and denote the face where the axisymmetric bounding box intersects the positive X-axis as +X. Similarly, the other five faces are denoteed as -X, +Y, -Y, +Z, and -Z, respectively. First, determine if all edge points fall on +X and -X. If not, determine if all edge points fall on +Y and -Y. If still not, determine if all edge points fall on +Z and -Z. If still not, it means that the component to be processed is not a cylindrical pipeline, and the cylindrical pipeline identification and judgment ends.

[0027] It should be noted that some of the edge points can fall on the +Y plane (upper bottom surface) and some on the -Y plane (lower bottom surface), but all edge points must be distributed only on this pair of parallel planes, and no point can fall on any other plane.

[0028] Furthermore, the edge points of the cylindrical pipeline must fall on a pair of parallel rings (the upper and lower bases of the cylinder), and the distance from any point on these two rings to the center of the component is equal. Therefore, this application needs to calculate the distance from all edge points to the center of the component. If the distance from all edge points to the center of the component is equal, it indicates that the component to be processed is a cylindrical component; otherwise, it indicates that the component is not a cylindrical pipeline.

[0029] Specifically, when the component to be processed is determined to be a cylindrical component, the circular fullness detection of the bottom surface is performed to determine whether the cylindrical component is a cylindrical pipeline. This includes: calculating the circular area of ​​the bottom surface of the cylindrical component and calculating the actual bottom surface area of ​​the cylindrical component; when the absolute value of the difference between the circular area of ​​the bottom surface and the actual bottom surface area is less than a preset threshold, the cylindrical component is determined to be a cylindrical pipeline.

[0030] In this step, the area of ​​the base circle of the cylindrical component is calculated: Assuming that the cylindrical component is a cylindrical pipeline component, since the edge points are all located at the bottom edge of the cylinder and the cylinder axis coincides with the coordinate axis, the direction of the cylinder axis can be determined according to the distribution of the edge points, and the distance from the edge point to the cylinder axis is the radius of the base circle of the cylinder. The area of ​​the base circle can be calculated based on the radius of the base circle.

[0031] To calculate the actual base area of ​​a cylindrical component: First, identify all triangles in the triangular mesh model whose normal vectors are parallel to the cylinder axis. The pattern formed by these triangles represents the actual base of the component. The area of ​​each triangle can be calculated using its coordinates. Finally, summing the areas of all the base triangles gives the actual base area of ​​the component.

[0032] The above steps only ensure that the edge points of the component to be processed fall on a pair of circular rings. However, for a cylindrical component, if its base is a semicircle, square, or crescent shape, the edge points of the component will also fall on a pair of circular rings in these three cases. To exclude these three cases, it is necessary to check the fullness of the circularity of the base. If the actual base area is significantly smaller than the circular area of ​​the base, it means that the base of this cylindrical component is a semicircle, square, or crescent shape, and the component to be processed is not a cylindrical pipeline. The cylindrical pipeline identification and judgment ends here. Otherwise, it means that the component to be processed is a cylindrical pipeline.

[0033] In S300, specifically, the step of converting the geometric features of each cylindrical pipeline into an instantiated reuse matrix includes: obtaining the bottom radius, cylinder height, cylinder axis direction, and geometric center point of the cylindrical pipeline; obtaining the scaling matrix of the cylindrical pipeline based on the bottom radius and cylinder height; obtaining the rotation matrix of the cylindrical pipeline based on the cylinder axis direction; obtaining the translation matrix of the cylindrical pipeline based on the geometric center point; and obtaining the instantiated reuse matrix based on the scaling matrix, rotation matrix, and translation matrix.

[0034] In this step, all identified pipelines are grouped based on their material type. A 3D scene typically contains pipelines of various materials, and different material types require different GPU shading rendering codes, making it impossible to render them using the same GPU instantiation thread. Since this application uses GPU instantiation rendering technology to improve the rendering frame rate, it is necessary to group the cylindrical pipelines, grouping those using the same GPU shading rendering code together to facilitate subsequent rendering operations.

[0035] Cylindrical pipelines need to be accurately described using a set of parameters, which include both material and geometric features. Material features include information such as color, metallicity, and texture map index, which describes all the material properties of the component. Geometric features describe the shape, size, position, and orientation of the cylinder. Since a cylinder is a symmetrical geometry, its position is the center of the component; the geometric center point is... This indicates that, based on the preceding PCA calculations, the cylindrical axis of the component has been identified. The direction of this cylindrical axis is used as the direction of the cylinder, denoted as […]. To describe the shape and size of a cylinder, we also need the radius *r* of its base and the height *h*. The geometric characteristics of a cylindrical component include... , The four data points are r, h, and r.

[0036] The rendering in this application utilizes a higher-performance GPU instantiation technique. This technique requires a standard base mesh shape and then uses a set of instantiation transformation matrices to generate different geometric entities. Therefore, it is necessary to transform the base mesh into a single, high-performance object. , The geometric features composed of the four data points r, h, and r are converted into an instantiated transformation matrix. The base mesh of the standard cylinder used in this application is a cylinder with a radius and height of 1, whose axis coincides with the Y-axis of the coordinate system, and whose midpoint is located at the origin. The specific method for converting the geometric features of the component into an instantiated transformation matrix is ​​to obtain the scaling matrix of the cylinder using r and h. ,pass The rotation matrix of the cylinder can be obtained. ,pass The translation matrix of the cylinder can be obtained. The instantiation transformation matrix of the cylindrical pipeline It is the product of the three matrices mentioned above.

[0037] The following are the calculation expressions for the rotation matrix, scaling matrix, translation matrix, and instantiation transformation matrix about the x, y, and z axes, respectively: ; ; ; Specifically, the step of packaging the common data of cylindrical pipelines in the same group, multiple instantiated reuse matrices, and corresponding material features into a network transmission data packet includes: grouping multiple cylindrical pipelines based on material features, wherein the common data of each group of cylindrical pipelines includes a basic 3D geometric mesh, shading rendering code, and texture files; assembling multiple instantiated reuse matrices in the same group into an instantiated pipeline component group; packaging multiple material features in the same group into a material data packet; and obtaining a network transmission data packet based on the common data, the instantiated pipeline component group, and the material data packet.

[0038] In this step, since the basic unit of rendering in the subsequent 3D scene rendering process is the instantiated pipeline component group, the basic unit of pipeline transport scheduling is also the instantiated pipeline component group. The geometric information of each cylindrical pipeline can be represented using a 4×4 matrix, since the fourth row vector of this matrix is ​​always... Therefore, only the first three rows of data are needed to reconstruct this matrix. The first three rows contain a total of 12 decimals, so the geometric features that each cylindrical pipeline needs to transmit are these 12 values. The geometric features of each instantiated pipeline component group can be represented by a two-dimensional matrix, with the number of rows in the matrix being the number of pipelines in this group of cylindrical pipelines, and the number of columns in the matrix being 12.

[0039] Since the basic unit of pipeline transport scheduling is also an instantiated pipeline component group, the unit of material transport scheduling is also an instantiated pipeline component group. All components in each instantiated pipeline component group use related GPU shading rendering code. To describe the material of this group of components through parameters, we need the index of the shading rendering code, the index of all texture files used in the material, and parameters such as roughness and color of each component. The above information combined constitutes all the material features of an instantiated pipeline component group that needs to be transported. Packing the above data into a material data package constitutes a material data package.

[0040] The subsequent 3D scene instantiation and rendering thread requires three parts of data: first, the basic 3D geometry mesh, shading rendering code, and texture files shared by all components in the instantiation pipeline component group; second, the instantiation reuse matrix for each component in the instantiation pipeline component group; and third, the roughness, color, and other parameters of each component in the instantiation pipeline component group. Web-side decoding of the cylindrical pipeline parameters involves obtaining these three parts of information based on data transmitted to the web interface via the internet. For shared data, all cylindrical pipelines use the same basic 3D geometry mesh; the shading rendering code and texture files are obtained through indexes in the material data package; instantiation geometry information is obtained through the n×12 dimensional instantiation pipeline component group; and instantiation material information is obtained through the component material parameters in the material data package.

[0041] In S400, seeFigure 3 The steps for performing frustum culling specifically include: calculating the center point positions of the two bases of the cylindrical pipeline, determining whether the center point positions are inside the frustum, and confirming that the cylindrical pipeline intersects the frustum if at least one center point position is inside the frustum; if no center point position is inside the frustum, obtaining the axis segment equation based on the center point positions of the two bases, determining whether the axis segment intersects the frustum, and confirming that the cylindrical pipeline intersects the frustum if the axis segment intersects the frustum; if the axis segment does not intersect the frustum, verifying the three PCA principal directions to obtain a directed bounding box, determining whether the directed bounding box intersects the frustum, and confirming that the cylindrical pipeline intersects the frustum if the directed bounding box intersects the frustum.

[0042] The equations for the axis segment and the view frustum are as follows: ; ; In the formula, The spatial point to be judged. As the starting point of the axis segment, The end point of the axis segment, , and These are the unit normal vectors of the three planes of the view frustum. , For the corresponding normal vector boundary constants, , For the corresponding normal vector boundary constants, , For the corresponding normal vector The boundary constants.

[0043] In this step, the principal direction of each cylindrical pipeline component has been obtained based on the PCA calculations described above. Verifying the principal direction yields the component's OBB bounding box. Then, it is determined whether this OBB bounding box intersects with the view frustum. The necessary and sufficient condition for the OBB bounding box to intersect with the view frustum is that some of the eight vertices of the OBB bounding box are within the view frustum. If the bounding box does not intersect with the view frustum, it indicates that the component is not within the view frustum and is invisible; the visibility determination then concludes.

[0044] Specifically, the occlusion determination steps include: when the cylindrical pipeline intersects with the view frustum, obtaining the depth map of the non-pipeline component in the current view; performing rasterization calculation on the cylindrical pipeline to obtain the projection area of ​​the cylindrical pipeline onto the screen, and calculating the depth value corresponding to each pixel in the projection area; traversing all pixels in the projection area, if there is a blank area on the depth map corresponding to a certain pixel, or if the depth value corresponding to a certain pixel is less than the depth at the corresponding position on the depth map, then it indicates that the cylindrical pipeline is visible in the current view.

[0045] In this step, a depth map of non-pipeline components is obtained. All non-pipeline components within the view frustum are selected from the 3D scene. Then, projection and rasterization calculations are performed on the corresponding model triangles to obtain the depth map of the non-pipeline components under the current view frustum. The depth values ​​in the depth map describe the distance from the component to the viewpoint; a larger depth value indicates a greater distance from the viewpoint. Additionally, some areas on the depth map correspond to blank areas. These blank areas do not contain non-pipeline components and therefore will not obstruct pipeline components. These blank areas need to be marked for subsequent operations. Rasterization calculations are performed on the parameterized pipeline components to obtain the area on the screen corresponding to the cylindrical pipeline projected onto it. All pixels within this area are traversed, and the depth value corresponding to the cylindrical pipeline projected onto this pixel is calculated, which is the distance to the viewpoint.

[0046] For a parameterized pipeline component, iterate through all pixels within the pipeline's projection area. If there is a blank area on the depth map corresponding to a pixel in this area, or if the depth value of the pipeline component corresponding to a pixel is less than the depth of the non-pipeline scene, then the parameterized pipeline is visible to the current viewpoint. Otherwise, the parameterized pipeline is completely occluded and is not currently visible.

[0047] In summary, this application significantly reduces the computational load in the preprocessing stage through an efficient recognition algorithm, greatly reduces the amount of data transmitted through parameterized transmission, accelerates system initialization, and improves the picking efficiency and response speed of pipeline components through a lightweight picking algorithm, thereby enhancing the user experience.

[0048] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 4As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection.

[0049] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0050] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0051] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0052] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0053] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0054] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0055] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0056] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0057] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A lightweight preprocessing method for geometric components in 3D scene rendering, characterized in that, include: Obtain triangular mesh models of multiple geometric components to be processed in a Web3D scene; The system identifies whether each of the triangular mesh models has multiple edge points. When the triangular mesh model has multiple edge points, it performs component edge shape detection based on the position information of the multiple edge points to determine whether the component to be processed is a cylindrical component. When the component to be processed is determined to be a cylindrical component, it performs circular fullness detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline. The geometric features and material features of each cylindrical pipeline are extracted respectively. The geometric features of each cylindrical pipeline are converted into an instantiated reuse matrix. The common data of the cylindrical pipelines in the same group, the multiple instantiated reuse matrices and the corresponding material features are packaged into a network transmission data packet. Combine the view frustum parameters of the current viewpoint with the instantiated reuse matrix to perform view frustum culling and occlusion judgment, determine whether each cylindrical pipeline is visible, pick the cylindrical pipelines visible in the current viewpoint, and perform rendering operations on all visible cylindrical pipelines based on the network transmission data packets.

2. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The step of identifying whether each of the triangular mesh models has multiple edge points specifically includes: Align the center of the triangular mesh model with the origin of the coordinate system; The three principal PCA directions of the triangular mesh model are obtained through principal component analysis, and the three principal PCA directions are aligned with the three principal directions of the coordinate system, respectively. When the normal vector of a vertex of the triangular mesh model is not parallel to any of the main PCA directions, the vertex is determined as an edge point. All vertices are traversed to identify all edge points of the triangular mesh model.

3. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, When the triangular mesh model has multiple edge points, the step of performing component edge shape detection based on the position information of the multiple edge points to determine whether the component to be processed is a cylindrical component specifically includes: Determine the axisymmetric bounding box of the component to be processed, and detect whether multiple edge points fall on two faces of a pair of parallel planes of the axisymmetric bounding box respectively; When multiple edge points fall on two surfaces of a pair of parallel planes of the axisymmetric bounding box, the distance from each edge point to the center of the component to be processed is calculated. When all the calculated distance values ​​are equal, the component to be processed is determined to be a cylindrical component.

4. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The step of performing a circularity detection on the bottom surface to determine whether the cylindrical component is a cylindrical pipeline when the component to be processed is determined to be a cylindrical component specifically includes: Calculate the area of ​​the circular base of the cylindrical member, and calculate the actual area of ​​the base of the cylindrical member; When the absolute value of the difference between the circular area of ​​the bottom surface and the actual bottom surface area is less than a preset threshold, the cylindrical component is determined to be a cylindrical pipeline.

5. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The step of converting the geometric features of each of the cylindrical pipelines into an instantiated reuse matrix specifically includes: Obtain the bottom radius, cylinder height, cylinder axis direction, and geometric center point of the cylindrical pipeline; The scaling matrix of the cylindrical pipeline is obtained based on the bottom radius and the cylinder height; The rotation matrix of the cylindrical pipeline is obtained based on the cylindrical axis direction; The translation matrix of the cylindrical pipeline is obtained based on the geometric center point; An instantiation reuse matrix is ​​obtained based on the scaling matrix, the rotation matrix, and the translation matrix.

6. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The step of packaging the common data of the cylindrical pipelines located in the same group, the multiple instantiated reuse matrices, and the corresponding material features into a network transmission data packet specifically includes: Based on the material characteristics, the multiple cylindrical pipelines are grouped, and the common data of each group of cylindrical pipelines includes a basic three-dimensional geometric mesh, shading and rendering code, and texture files; Multiple instantiated reuse matrices located in the same group are grouped into an instantiated pipeline component group; Package multiple material features located in the same group into a material data package; The network transmission data packet is obtained based on the public data, the instantiated pipeline component group, and the material data packet.

7. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The steps for performing cone culling specifically include: The positions of the center points of the two bottom surfaces of the cylindrical pipeline are calculated, and it is determined whether the center point positions are inside the viewing cone. If at least one of the center points is inside the viewing cone, it is determined that the cylindrical pipeline intersects with the viewing cone. When the center point is not located inside the viewing cone, the equation of the axis segment is obtained based on the center point positions of the two bottom surfaces. It is then determined whether the axis segment intersects with the viewing cone. When the axis segment intersects with the viewing cone, it is determined that the cylindrical pipeline intersects with the viewing cone. When the axis segment does not intersect the view frustum, verify the three main PCA directions to obtain a directed bounding box, determine whether the directed bounding box intersects the view frustum, and when the directed bounding box intersects the view frustum, determine that the cylindrical pipeline intersects the view frustum.

8. The lightweight preprocessing method for geometric components in 3D scene rendering according to claim 1, characterized in that, The steps for performing occlusion detection include: When the cylindrical pipeline intersects with the view frustum, a depth map of the non-pipeline component is obtained from the current viewpoint; Rasterization calculation is performed on the cylindrical pipeline to obtain the projection area of ​​the cylindrical pipeline onto the screen, and the depth value corresponding to each pixel of the projection area is calculated. By traversing all pixels within the projection area, if a pixel corresponds to a blank area on the depth map, or if the depth value of a pixel is less than the depth at the corresponding position on the depth map, then the cylindrical pipeline is visible from the current viewpoint.

9. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the lightweight preprocessing method for geometric components for rendering three-dimensional scenes according to any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the lightweight preprocessing method for geometric components for rendering three-dimensional scenes as described in any one of claims 1-8.