Method for determining spatial position of three-dimensional pipeline model label

By predicting slip and force field adjustment, and using globally unique identifiers and depth buffer comparison analysis, the anchor point is driven to slide to the view window, and a virtual force field is constructed to coordinate the label layout. This solves the problem of occlusion of labels on 3D pipeline models in dynamic visual environments, and achieves stable mapping between labels and pipeline targets and clarity of information display.

CN121982247APending Publication Date: 2026-05-05NANJING TOWNGAS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING TOWNGAS CO LTD
Filing Date
2026-04-08
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In a 3D dynamic visual environment, the visual association between the labels of a 3D pipeline model and the pipeline target is easily affected by spatial depth, which reduces the effectiveness of information display. Especially in the dynamic display of high-density, multi-dimensional information, the labels and the model, as well as different labels, are prone to occlusion and visual stacking, which affects the clear display of information.

Method used

By predicting slippage and force field adjustment, using globally unique identifiers to associate pipe diameter, medium pressure, risk level and burial depth business metadata, and combining depth buffer comparison analysis to analyze occlusion trends, the anchor point is driven to slide along the central ridge to the visible window, and a virtual force field with semantic weights is constructed to coordinate label layout conflicts and ensure the spatiotemporal mapping relationship of the label.

Benefits of technology

It effectively eliminates label flickering and visual jumps caused by sudden changes in perspective, ensuring that the mapping relationship between labels and pipeline targets always maintains visual continuity and stability, optimizing the observation experience under dynamic monitoring, and realizing automatic optimization of information display hierarchy and accuracy of depth perception.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121982247A_ABST
    Figure CN121982247A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of three-dimensional digital visualization, in particular to a method for determining the spatial position of a label of a three-dimensional pipeline model, which comprises the following steps of: analyzing geometric data, associating pipe diameter, medium pressure, risk level and burial depth business metadata by using a global unique identifier, sampling a camera pose transformation matrix to solve a moving velocity vector, and determining the spatial position of the label of the three-dimensional pipeline model. The method comprises the following steps of: carrying out wavefront propagation by taking a pipeline grid boundary as a starting surface by utilizing a fast marching algorithm, determining a central ridge line, executing equal-arc-length resampling according to a pipe diameter to generate discrete seed points and packaging attribute vectors, analyzing the visibility of the seed points in combination with depth buffer comparison, pre-judging a shielding trend caused by view angle transformation, and carrying out wave-front propagation. And driving the anchor points to actively slide to a visual window along the central ridge line, constructing a virtual force field based on semantic weight to coordinate label layout conflicts, and correcting depth offset according to pipeline burial depth mapping to ensure a time-space mapping relationship to be labeled. According to the invention, stable presentation of the pipe network label is realized through slip prediction and force field adjustment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of three-dimensional digital visualization technology, specifically a method for determining the spatial location of annotation labels on a three-dimensional pipeline model. Background Technology

[0002] With the acceleration of industrial digitalization, 3D visualization technology has become a core support tool for the operation and maintenance of petrochemical, underground pipeline networks and large-scale energy facilities. In the digital twin scenario, the 3D pipeline model not only needs to restore the physical geometry, but also needs to carry multi-dimensional business attribute information such as operating parameters, safety level, and geographical depth. In order to achieve efficient human-computer interaction, a combination of labeling and leader lines is usually used to attach these abstract business data to the corresponding spatial location of the pipeline model.

[0003] However, in practical applications, due to the extremely high spatial distribution density and complex topology of industrial pipeline networks, the visual presentation of three-dimensional scenes faces severe challenges. When observers perform dynamic interactive operations such as rotation, translation or scaling through virtual cameras, the visual association between the label and the pipeline target is easily affected by spatial depth due to changes in perspective projection relationships.

[0004] Specifically, in the dynamic display of high-density, multi-dimensional information, frequent mutual occlusion and visual stacking occur between labels and models, as well as between different labels, which greatly reduces the effectiveness of information display. How to coordinate the real-time presentation of high-density business information in a three-dimensional dynamic visual environment and maintain a clear and stable spatiotemporal mapping relationship between the labeled content and the complex pipeline network target is a technical problem that urgently needs to be solved in the current field of three-dimensional digital visualization.

[0005] To address this, a method for determining the spatial location of labels on a 3D pipeline model is proposed. Summary of the Invention

[0006] The purpose of this invention is to provide a method for determining the spatial position of labels on a 3D pipeline model. This method achieves stable pipeline network labeling through predicted slippage and force field adjustment. The process includes parsing geometric data and using globally unique identifiers to associate pipe diameter, medium pressure, risk level, and burial depth metadata; sampling the camera pose transformation matrix to calculate the movement velocity vector; using a fast traversal algorithm with the pipeline mesh boundary as the starting surface for wavefront propagation to determine the central ridge line; performing equal arc length resampling based on the pipe diameter to generate discrete seed points and encapsulating attribute vectors; combining depth buffer comparison analysis to determine the visibility of seed points; predicting occlusion trends caused by viewpoint changes; driving anchor points to actively slide along the central ridge line to the visible window; constructing a virtual force field based on semantic weights to coordinate label layout conflicts; and correcting depth offsets based on pipeline burial depth mapping to ensure the spatiotemporal mapping relationship of the labels.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for determining the spatial location of annotation labels on a 3D pipeline model includes: Acquire mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model; pipeline metadata includes pipe diameter, medium pressure, risk level, and burial depth; virtual camera parameters include real-time observation position, line-of-sight parameters, and movement speed vector; The central ridge of the 3D pipeline is extracted based on the grid vertex data. Discrete seed points are distributed on the central ridge of the 3D pipeline according to the pipe diameter. Pipeline metadata is associated with the corresponding seed points, and the initial anchor point is determined from the discrete seed points. Based on the real-time observation position and viewing parameters, the visibility of the seed point is analyzed, and the initial anchor point is driven to slide to the coordinates of the unobstructed view window to obtain the real-time anchor point position. Input the moving speed vector, medium pressure, and risk level into the strategy network to calculate the predicted slippage and adjust the real-time coordinates of the anchor point.

[0008] Preferably, the acquisition of the mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model includes: parsing triangular mesh geometric data files in OBJ, FBX, and 3D Tiles formats, extracting discrete vertex spatial coordinates from them to obtain the mesh vertex data; using globally unique identifiers to semantically associate the pipe diameter, medium pressure, risk level, and burial depth stored in the structured attribute database with the pipe segment mesh components in the 3D pipeline model; acquiring the real-time observation position and gaze parameters of the virtual camera in real time, and sampling the pose transformation matrix of the virtual camera between the current frame and the previous frame in real time, calculating the displacement difference of the observation position based on the pose transformation matrix, and calculating the movement velocity vector in combination with the frame interval time.

[0009] Preferably, the process of associating pipeline metadata with corresponding seed points includes: based on the mesh vertex data, using a fast traversal algorithm with the pipeline model mesh boundary as the starting surface, performing wavefront propagation calculations into the pipeline to obtain the distance field from each voxel to the pipeline model mesh boundary; obtaining the set of local maxima points in the distance field, i.e., the set of the centers of the largest inscribed spheres, to obtain the three-dimensional pipeline central ridge; determining the sampling step size for equal arc length resampling based on the pipe diameter; using the sampling step size to perform discrete sampling on the three-dimensional pipeline central ridge to generate discrete seed points; storing the medium pressure, risk level, and burial depth as attribute vectors for each discrete seed point, and determining the initial anchor point from them.

[0010] Preferably, the process of driving the initial anchor point to slide towards the coordinates of the unobstructed view window includes: constructing a view projection transformation matrix based on the real-time observation position and the viewing parameters, transforming the three-dimensional coordinates of each discrete seed point to the normalized device coordinate system, and obtaining the screen pixel coordinates and corresponding projection depth values ​​of each discrete seed point; reading back the buffer depth value that matches the screen pixel coordinates from the screen space depth buffer, and comparing the projection depth value with the buffer depth value; if the projection depth value is greater than the buffer depth value, determining that the discrete seed point is in an occluded state and performing culling; performing a topological neighborhood search on the central ridge line of the three-dimensional pipeline, starting from the culled discrete seed point, and identifying the seed point with the closest topological distance and in an unobstructed state; determining the three-dimensional spatial position of the unobstructed seed point as the coordinates of the view window, and sliding the initial anchor point along the central ridge line of the three-dimensional pipeline to that coordinate.

[0011] Preferably, the process of adjusting the real-time coordinates of the anchor point includes: combining the moving speed vector, the medium pressure, and the risk level into a feature vector describing the current labeling state; inputting the feature vector into a pre-trained reinforcement learning policy network, predicting the occlusion trend caused by camera movement through the reinforcement learning policy network, and outputting a predicted sliding offset value along the direction of the central ridge of the three-dimensional pipeline; obtaining the current parameterized arc length coordinates of the real-time anchor point on the central ridge of the three-dimensional pipeline, accumulating and updating the current parameterized arc length coordinates using the predicted sliding offset value, and converting the updated parameterized arc length coordinates into the real-time coordinates in three-dimensional space; establishing a spatial virtual force field with the real-time anchor point as the center of gravity, and calculating the gravitational constraint of the real-time anchor point on the label and the mutual repulsion force between adjacent labels.

[0012] Preferably, the process of calculating the gravitational constraint of the real-time anchor point on the label and the mutual repulsion between adjacent labels includes: mapping the medium pressure to a pressure level score, mapping the risk level to a risk weight coefficient, calculating the product of the pressure level score and the risk weight coefficient to obtain the physical weight of the label; constructing a spatial virtual force field with different energy levels; within the spatial virtual force field, with the real-time anchor point as the center of gravity, calculating the elastic gravitational force generated by the real-time anchor point on the label as a force-bearing mass, causing the force-bearing mass to converge towards the center of gravity; within the spatial virtual force field, calculating the repulsion between adjacent force-bearing masses, causing overlapping labels to push each other away; wherein, the magnitude of the repulsion is determined by the physical weight; under the combined action of the gravitational constraint and the mutual repulsion, through iterative calculation, the total energy of the force-bearing mass in the spatial virtual force field reaches a dynamic equilibrium, determining the stable position of the label in three-dimensional space, projecting the label onto a two-dimensional display plane, calculating the overlapping area of ​​the label text box on the screen, adjusting the depth offset of the label based on the overlapping area and burial depth, and correcting the spatial coordinates.

[0013] Preferably, the process of adjusting the depth offset of the label along the line of sight in the three-dimensional world coordinate system based on the overlap area and burial depth includes: transforming the three-dimensional coordinates of the label to screen space using the projection matrix of the virtual camera, and constructing a two-dimensional bounding box rectangle based on the text length and font height of the label; calculating the intersection area between each pair of the two-dimensional bounding box rectangles to obtain the overlap area on the screen; arranging each label in ascending order according to the burial depth value in the pipeline metadata to establish a depth priority list, wherein the label with the smaller burial depth value corresponds to a higher depth priority; when the overlap area is greater than zero, obtaining the original Z-axis coordinate value of the label in the viewpoint space coordinate system, subtracting a preset depth displacement step size from the original Z-axis coordinate value based on the depth priority to calculate the adjusted depth offset; applying the depth offset to the position component of the label in the viewpoint space coordinate system using the inverse observation matrix of the virtual camera, restoring it to the world coordinate system, correcting the spatial coordinates, and smoothing the spatial coordinates to output the world coordinates of the label center, orientation data, and turning path coordinates of the leader line.

[0014] Preferably, the process of outputting the world coordinates of the label center, orientation data, and turning path coordinates of the leader line includes: using a preset smoothing coefficient to perform a weighted average calculation of the spatial coordinates of the label at the current moment and the output coordinates at the previous moment to obtain the world coordinates of the label center; obtaining the gaze vector of the virtual camera, adjusting the normal vector direction of the label so that the normal vector direction is parallel to the opposite direction of the gaze vector to obtain the orientation data, ensuring that the label is always facing the observation position of the virtual camera in three-dimensional space; taking the real-time anchor point on the central ridge of the three-dimensional pipeline as the path start point, and the world coordinates of the label center as the path end point, detecting and extracting non-collision intermediate turning point coordinates between the path start point and the path end point according to the geometric space boundary of the three-dimensional pipeline model, and generating the turning path coordinates composed of the path start point, the intermediate turning point coordinates, and the path end point connected sequentially.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By introducing a reinforcement learning policy network to predict the trend of camera pose change, compared with the passive offset mode that is triggered after occlusion occurs, this method combines the movement velocity vector and pipeline business attributes to predict potential occlusion and drive the anchor point to slide along the central ridge to the optimal viewing window in advance. This effectively eliminates label flickering and visual jump caused by sudden changes in viewpoint, ensuring that the mapping relationship between the label and the pipeline target always maintains visual continuity and real-time stability during high-speed or continuous interaction, and significantly optimizes the observation experience under dynamic monitoring.

[0016] 2. By establishing a semantic weight virtual force field centered on real-time anchor points, and constructing physical weights using the product of medium pressure and risk level, the labels of core business objectives have a stronger repulsive energy level in the force field. This allows them to actively push away surrounding secondary labels to occupy the visual center position, avoiding the technical dilemma of key information being submerged due to the uniform distribution of labels in traditional algorithms. It achieves automatic optimization of information display hierarchy within limited screen space, ensuring the visual salience and recognizability of key pipeline labels under high-density distribution conditions, and maintaining a clear hierarchy in the transmission of complex information.

[0017] 3. By mapping the physical burial depth of pipelines to the spatial depth offset of the viewpoint and correcting the spatial coordinates accordingly, and establishing depth priority using the physical burial depth values, it ensures that pipelines with shallower burial depths are always at the forefront of the visual hierarchy. This achieves a high degree of unity between three-dimensional spatial logic and two-dimensional display effects. This depth layering process not only eliminates the visual blurring and depth flickering caused by multiple overlapping labels, but also preserves the three-dimensional stability of the labels through precise coordinate space transformation. This helps observers establish correct depth perception in the background of complex and interwoven pipeline networks and ensures the accuracy of spatiotemporal mapping relationships in complex overlapping areas. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of a method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to the present invention. Figure 2 This is a schematic diagram of the process of driving the initial anchor point to slide towards the coordinates of an unobstructed view window according to the present invention. Figure 3 This is a schematic diagram illustrating the process of adjusting the labeling based on the overlapping area and burial depth according to the present invention. Detailed Implementation

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

[0020] Please see Figures 1 to 3 This invention provides a method for determining the spatial position of annotation labels on a three-dimensional pipeline model, the technical solution of which is as follows:

[0021] Example 1 A method for determining the spatial location of annotation labels in a 3D pipeline model, the specific process of which is as follows: Figure 1 As shown, it includes: Acquire mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model; pipeline metadata includes pipe diameter, medium pressure, risk level, and burial depth; virtual camera parameters include real-time observation position, line-of-sight parameters, and movement speed vector; The central ridge of the 3D pipeline is extracted based on the grid vertex data. Discrete seed points are distributed on the central ridge of the 3D pipeline according to the pipe diameter. Pipeline metadata is associated with the corresponding seed points, and the initial anchor point is determined from the discrete seed points. Based on the real-time observation position and viewing parameters, the visibility of the seed point is analyzed, and the initial anchor point is driven to slide to the coordinates of the unobstructed view window to obtain the real-time anchor point position. Input the moving speed vector, medium pressure, and risk level into the strategy network to calculate the predicted slippage and adjust the real-time coordinates of the anchor point. A virtual spatial force field is established with the real-time anchor point as the center of gravity, and the gravitational constraint of the real-time anchor point on the label and the mutual repulsion between adjacent labels are calculated. The label is projected onto a two-dimensional display plane, the overlapping area of ​​the label text box on the screen is calculated, the depth offset of the label is adjusted according to the overlapping area and the embedding depth, and the spatial coordinates are corrected; the spatial coordinates are smoothed and the world coordinates of the label center, orientation data and the turning path coordinates of the leader line are output.

[0022] Furthermore, the acquisition of mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model includes: parsing triangular mesh geometric data files in OBJ, FBX, and 3D Tiles formats, extracting discrete vertex spatial coordinates from them to obtain the mesh vertex data; using globally unique identifiers to semantically associate pipe diameter, medium pressure, risk level, and burial depth stored in the structured attribute database with the pipe segment mesh components in the 3D pipeline model; acquiring the real-time observation position and gaze parameters of the virtual camera, and sampling the pose transformation matrix of the virtual camera between the current frame and the previous frame in real time, calculating the displacement difference of the observation position based on the pose transformation matrix, and calculating the movement velocity vector by combining the frame interval time.

[0023] First, the triangular mesh geometry data files in OBJ, FBX, and 3D Tiles formats are parsed at the low level. During the processing, the discrete vertex spatial coordinates that constitute the geometric surface of the pipe are accurately extracted by reading the vertex index list and coordinate array in the file. After these are aggregated, the mesh vertex data is obtained. For the 3D Tiles format, the geometric buffer in its tile dataset needs to be further parsed to obtain the fine mesh information of specific pipe segments in large-scale scenes, ensuring that the subsequent center ridge extraction step has complete geometric topology input.

[0024] Next, a semantic mapping between the 3D pipeline model and non-geometric business attributes is established using globally unique identifiers. During implementation, business records corresponding to the unique identifiers of each pipe segment component are retrieved from the pre-set structured attribute database. Pipe diameter, medium pressure, risk level, and burial depth data are extracted from these records. These metadata are then bound to the corresponding pipe segment mesh components in the 3D pipeline model as attribute fields. This semantic association process transforms discrete physical attributes into attribute components that can participate in algorithm calculations, providing a data-driven basis for subsequent pressure-based stress analysis and depth-based depth-level correction.

[0025] In this embodiment, the pressure range is divided into five technical levels: Level 1 (normal pressure): pressure value less than or equal to 0.1 MPa, mapped to score 1; Level 2 (low pressure): pressure value between 0.1 MPa and 1.6 MPa (inclusive), mapped to score 2; Level 3 (medium pressure): pressure value between 1.6 MPa and 10.0 MPa (inclusive), mapped to score 3; Level 4 (high pressure): pressure value between 10.0 MPa and 100.0 MPa (inclusive), mapped to score 4; Level 5 (ultra-high pressure): pressure value greater than 100.0 MPa, mapped to score 5. In this embodiment, four risk weights are defined: low risk (such as ordinary water supply and drainage pipelines): weight coefficient is set to 1.0; medium risk (such as industrial water, general chemicals): weight coefficient is set to 1.2; high risk (such as flammable and explosive gas pipelines): weight coefficient is set to 1.5; and extremely high risk (such as pipelines containing highly toxic or radioactive media): weight coefficient is set to 2.0.

[0026] Subsequently, in a real-time rendering environment, the real-time observation position and view parameters of the virtual camera are continuously sampled. Within each frame rendering cycle, the pose transformation matrix of the virtual camera at the current frame is obtained, and the pose transformation matrix of the previous frame stored in memory is retrieved. By performing a difference operation on the translation vectors in the pose transformation matrices of two adjacent frames, the displacement difference of the observation position in three-dimensional space is calculated. At the same time, the sampling timestamps between two adjacent frames are recorded to determine the frame interval. The displacement difference is used to calculate the ratio between the frame interval to determine the camera's movement velocity vector at the current moment. This vector is used to quantify the severity of the viewpoint change caused by camera motion in real time, serving as the core input parameter for subsequent prediction of occlusion trends and calculation of slippage.

[0027] By parsing various mainstream geometric formats and using globally unique identifiers to achieve semantic association between models and business metadata, the accuracy of pipeline attribute mapping is ensured. At the same time, the pose matrix is ​​sampled in real time and the motion velocity vector is calculated, quantifying the dynamic characteristics of camera interaction. This data acquisition method enhances the ability to perceive complex scenes and dynamic changes, laying a reliable data foundation for achieving stable and continuous annotation position determination.

[0028] Furthermore, the process of associating pipeline metadata with corresponding seed points includes: based on the mesh vertex data, using a fast traversal algorithm with the pipeline model mesh boundary as the starting surface, performing wavefront propagation calculations into the pipeline to obtain the distance field from each voxel to the pipeline model mesh boundary; obtaining the set of local maxima points in the distance field, i.e., the set of the centers of the largest inscribed spheres, to obtain the three-dimensional pipeline central ridge; determining the sampling step size for equal arc length resampling based on the pipe diameter; using the sampling step size to perform discrete sampling on the three-dimensional pipeline central ridge to generate discrete seed points; storing the medium pressure, risk level, and burial depth as attribute vectors for each discrete seed point, from which the initial anchor point is determined.

[0029] First, based on the acquired mesh vertex data, a voxel space covering the geometry of the pipe model is constructed. Using a fast traversal algorithm, the mesh boundary of the pipe model is defined as the initial wavefront, and a velocity field is set for the wavefront propagation into the pipe interior. By simulating the wavefront propagation process from the boundary to the central region of the pipe interior, the propagation time for each voxel to be reached by the wavefront is calculated. This time is numerically equivalent to the shortest Euclidean distance from the center of the voxel to the boundary of the pipe mesh, thus generating a spatial distance field covering the entire pipe region. For voxelization, the lengths of the pipe mesh bounding box in three dimensions are first obtained, and the voxel size is set to 1 / 512 of the minimum of the three dimensions to balance computational efficiency and accuracy. The separation axis theorem is used to detect the intersection of the triangular mesh and voxels, marking intersecting voxels as boundaries. The distance values ​​of all boundary voxels are set to 0, and non-boundary voxels are set to infinity. A priority queue is constructed using a binary heap. During wavefront propagation, a uniform velocity field is used, and the shortest distance from neighboring voxels to the boundary is calculated using the standard Godunov scheme until all voxels have been processed.

[0030] Next, central axis topology extraction is performed in the generated distance field. By comparing the values ​​of each voxel point in the distance field with their local neighbors, local maxima are searched and identified. Geometrically, these local maxima represent points in the pipe's internal space that are equidistant from the surrounding boundaries, i.e., the centers of the pipe's largest inscribed sphere. These centers with local maxima characteristics are then topologically connected and curve-fitted according to the pipe's orientation to obtain a 3D pipe central ridge line that accurately describes the pipe's central axis position. The search and filtering process for local maxima involves obtaining the six-neighbor distance values ​​for each non-boundary voxel in the distance field. If the central voxel's distance value is not less than all neighbor values, it is marked as a candidate point. To eliminate spurious maxima in flat regions, the difference between the central voxel and the average value of its neighbors must be greater than one-quarter of the voxel size, ensuring that only significant peaks reflecting the pipe's central axis characteristics are retained.

[0031] Subsequently, the mounting points are discretized to obtain the pipe diameter parameters from the pipeline metadata. Based on these parameters, the sampling step size for equal arc length resampling is determined. In this embodiment, the step size is set to a fixed proportion of the pipe diameter value to ensure a reasonable sampling density on pipes of different diameters. Using this sampling step size, arc length step sampling is performed along the central ridge of the three-dimensional pipeline to generate a series of discrete seed points uniformly distributed along the ridge. The obtained maximum point set is processed using a density clustering algorithm, with the neighborhood radius set to twice the size of a voxel and the minimum number of points set to 3, to separate different pipe segments. For each point cluster, the topological order of the points is determined by establishing an adjacency graph and performing a breadth-first traversal. A cubic spline interpolation algorithm is used to perform smooth curve fitting on the ordered point sequence, setting natural spline boundary conditions to ensure that the second derivative at both ends of the curve is zero. For pipelines with branches, information is recorded at the branch points and the fitting of the branch pipelines is recursively performed, ultimately generating first-order and second-order continuous parametric spline curves.

[0032] Finally, the deep binding of business attributes and the determination of initial mounting points are performed. The medium pressure, risk level and burial depth data of the corresponding pipe section are formatted and encapsulated, and stored as a multi-dimensional attribute vector for each discrete seed point. In this way, a strong correlation is established between spatial location information and physical business attributes for each discrete seed point. Based on this, according to the preset label display rules, one or more points are selected from the generated discrete seed points to be determined as initial anchor points. These initial anchor points not only serve as the geometric mounting reference for the label leader line, but also carry the business attribute components that drive subsequent force field calculations and location predictions.

[0033] By extracting the set of the largest inscribed sphere centers using a fast traversal algorithm, the geometric topology of the pipeline can be accurately reconstructed from complex grid data, ensuring the spatial centralization and rationality of the label mounting benchmark. The sampling step size is determined by adaptive pipe diameter, and multi-dimensional metadata is stored in combination with attribute vectors, realizing the deep integration of business attributes and geometric space. This provides discretized support with business semantics for subsequent label avoidance and visibility analysis, significantly improving the automation and logical accuracy of label positioning in large-scale pipeline network environments.

[0034] Further, the process of sliding the driving anchor point along the central ridge of the three-dimensional pipeline towards the coordinates of the unobstructed viewport includes: constructing a view projection transformation matrix based on the real-time observation position and the viewing parameters, transforming the three-dimensional coordinates of each discrete seed point to the normalized device coordinate system, and obtaining the screen pixel coordinates and corresponding projection depth values ​​of each discrete seed point; reading back the buffer depth value that matches the screen pixel coordinates from the screen space depth buffer, and comparing the projection depth value with the buffer depth value; if the projection depth value is greater than the buffer depth value, it is determined that the discrete seed point is in an occluded state and is culled; on the central ridge of the three-dimensional pipeline, a topological neighborhood search is performed starting from the culled discrete seed point to identify the seed point with the closest topological distance and in an unoccluded state; the three-dimensional spatial position of the unoccluded seed point is determined as the coordinates of the viewport, and the initial anchor point is slid along the central ridge of the three-dimensional pipeline to that coordinate, the specific process is as follows. Figure 2 As shown.

[0035] First, in each frame of rendering calculation, based on the real-time observation position and view parameters of the virtual camera, combined with the near clipping plane and far clipping plane parameters of the current viewport, a view projection transformation matrix is ​​constructed. This matrix is ​​used to perform coordinate transformation processing on the 3D coordinates of each discrete seed point, transforming them from the world coordinate system to the normalized device coordinate system. Then, the viewport pixel size of the current rendering engine is obtained, and the normalized device coordinates are mapped to discrete pixel coordinates (such as (u, v) coordinates) consistent with the screen resolution through linear scaling. The depth component obtained by perspective division after the projection matrix operation is extracted and used as the projection depth value of each discrete seed point.

[0036] Next, visibility detection based on pixel depth is performed. The system reads back the corresponding buffer depth value from the screen space depth buffer of the graphics hardware, using the mapped screen pixel coordinates as the index address. During the comparison process, the projected depth value and the buffer depth value are placed in the same value range (such as the [0, 1] interval) for numerical comparison. In order to eliminate self-occlusion artifacts caused by floating-point conversion and depth precision limitations, a small depth deviation value is preset during the comparison. If the projected depth value minus the deviation value is still greater than the buffer depth value, it is determined that the discrete seed point is in an occluded state, marked as invisible, and removed.

[0037] Subsequently, the mounting position is redirected on the central ridge of the 3D pipeline. A topological neighborhood search is performed using the ordered index sequence of the central ridge (i.e., a linked list of point sets arranged according to the ridge direction) established in the preprocessing stage. Starting from the index of the removed seed point, the search proceeds sequentially to the adjacent indexes before and after the index in the sequence. The visibility markers of the seed points corresponding to each neighborhood index are queried in real time. By comparing the number of nodes in the search steps on both sides, the coordinates of the seed point with the shortest topological distance and the visibility marker "non-occluded" are identified as the target point. If no non-occluded point is found within the preset search radius (50 index units in this embodiment), the current anchor point position remains unchanged.

[0038] Finally, the three-dimensional spatial position of the identified seed point in the non-occluded state is determined as the view window coordinates. The current coordinates of the initial anchor point are obtained. Using linear interpolation or spline curve interpolation algorithms, and combined with a preset smoothing factor coefficient (such as 0.1), the initial anchor point is incrementally displaced in the view window coordinate direction in each frame. This drives the initial anchor point to smoothly slide along the ordered sequence path of the central ridge to the view window coordinates. This sliding process ensures that the anchor point can smoothly avoid occlusions along the physical structure of the pipe when the dynamic viewpoint changes, ensuring that the logical starting position of the labeled leader line is always within the visible range, and eliminating the visual jitter caused by sudden position changes.

[0039] By employing depth buffering comparison and view transformation, precise perception of anchor point occlusion status is achieved, effectively preventing information loss caused by scene objects obscuring annotation information. Topological neighborhood search is performed using the central ridge line, enabling anchor points to dynamically find the optimal visible position following the pipeline route when encountering occlusion, thus solving the problem of blindly changing annotation point positions. While ensuring annotation visibility, the geographical consistency between annotations and pipeline targets is maintained, ensuring the continuity and stability of the spatiotemporal mapping relationship during dynamic interactions.

[0040] Furthermore, the process of driving the initial anchor point to slide towards the coordinates of the unobstructed view window includes: combining the movement speed vector, the medium pressure, and the risk level into a feature vector describing the current annotation state; inputting the feature vector into a pre-trained reinforcement learning policy network, predicting the occlusion trend caused by camera movement through the reinforcement learning policy network, and outputting a predicted sliding offset value along the direction of the central ridge of the three-dimensional pipeline; obtaining the current parameterized arc length coordinates of the real-time anchor point on the central ridge of the three-dimensional pipeline, accumulating and updating the current parameterized arc length coordinates using the predicted sliding offset value, and converting the updated parameterized arc length coordinates into the real-time coordinates in the three-dimensional space.

[0041] First, a feature vector describing the current labeled state is constructed. The virtual camera's movement velocity vector, obtained through real-time sampling, is acquired and combined with the current pipe segment's medium pressure and risk level. To enable the neural network to effectively handle data of different dimensions, the three-dimensional components of the movement velocity vector are standardized, and the medium pressure and risk level are mapped to numerical weight coefficients (in this embodiment, medium pressure is mapped to a pressure score between 0 and 1, and risk level is mapped to a discrete risk score according to a preset level). The processed parameters are then concatenated sequentially to form a multi-dimensional feature vector, which serves as the input state for the reinforcement learning policy network.

[0042] Next, a pre-trained reinforcement learning policy network is used for decision-making reasoning. In this embodiment, the reinforcement learning policy network employs a deep neural network structure, specifically including an input layer, multiple fully connected hidden layers, and an output layer. The number of neurons in the input layer is consistent with the dimension of the feature vector. The hidden layers use ReLU as the activation function and introduce a dropout method to prevent overfitting. The output layer uses the hyperbolic tangent function as the activation function to output a continuous value in the interval [-1, 1]. After quantization mapping, this output value yields a predicted sliding offset value along the central ridge of the three-dimensional pipeline. This offset value reflects the network's predictive judgment of future occlusion based on the current camera motion trend.

[0043] In this embodiment, the reinforcement learning policy network adopts a deep neural network structure, specifically designed as follows: The input layer contains nine neurons, corresponding to the three components of the camera's velocity vector, the three components of the relative distance vector between the camera's viewpoint and the initial anchor point, and the three components of the normalized current camera gaze parameter. The network includes two fully connected hidden layers: the first hidden layer has 128 neurons, and the second hidden layer has 64 neurons. Both use rectified linear units as activation functions and employ a dropout mechanism with a random dropout rate of 30% to prevent overfitting. The output layer contains one neuron, using the hyperbolic tangent function as activation, limiting the output range to between plus and minus 1, and ultimately mapping it to the proportion of the maximum sliding distance.

[0044] A proximal strategy optimization algorithm was employed, with an initial learning rate of 0.0003 and a batch size of 32. The training dataset contained 50,000 time-step interaction trajectories, covering various motion modes such as rapid rotation and scaling. The model was considered converged when the average cumulative reward on the validation set increased by less than 0.001 over 50 consecutive training epochs.

[0045] In the reconstruction from parameter space to three-dimensional coordinates, a cubic spline interpolation algorithm is used to fit the seed points of the central ridge, employing natural spline boundary conditions (i.e., the second derivative at both endpoints is 0). When the parameterized coordinates exceed the legal interval of 0 to 1, modular arithmetic is used for ring pipelines, while a boundary truncation strategy is adopted for chain pipelines to force the parameters to be constrained within the legal interval.

[0046] During the model training phase, a near-end policy optimization algorithm based on an actor-critic architecture is used for training. A simulation environment consisting of a virtual camera, a pipeline model, and labeled tags is constructed. Sampling is performed using randomly generated camera movement paths. The reward function during training consists of a weighted sum of visibility score and motion stability score: a positive reward is given when the anchor point slides to an unobstructed position, and a negative reward is given when the anchor point undergoes a drastic change within a short period of time. Specifically, the visibility score is quantified by the proportion of unobstructed pixels corresponding to the label determined in the aforementioned depth comparison step, and the motion stability score is calculated by using a negative correlation function based on the second derivative of the anchor point sliding displacement between adjacent frames. This constrains the smoothness of the network output. Through extensive iterative training, the policy network learns to output smooth and forward-looking sliding amounts while ensuring label visibility.

[0047] Subsequently, the coordinates on the central ridge are updated to obtain the current parameterized arc length coordinates of the real-time anchor point on the central ridge of the 3D pipeline. Since the central ridge of the 3D pipeline has been mapped to a normalized arc length parameter space (e.g., a scalar range from 0 to 1) during the preprocessing stage, the predicted sliding offset value output by the policy network is accumulated onto the current parameterized arc length coordinates. If the accumulation result exceeds the valid range, the updated parameterized arc length coordinates are obtained through modulo or boundary truncation.

[0048] Finally, the coordinate restoration from parameter space to 3D space is completed. A pre-fitted 3D spline curve function is used, which is generated in advance by a cubic spline interpolation algorithm using a sequence of discrete seed points extracted along the central ridge of the pipe as geometric control points. This function establishes a continuous analytical mapping relationship between the arc length parameter space and the world coordinate system space, and remaps the updated parameterized arc length coordinates back to the world coordinate system to obtain the real-time coordinates in 3D space. Through this dynamic adjustment based on AI prediction, the anchor points can be optimized in position before visual occlusion occurs, thereby ensuring the display continuity of the labels during the dynamic interaction process in the 3D scene.

[0049] By introducing a reinforcement learning policy network to predict the camera pose transformation trend, the camera motion vector is deeply coupled with the pipeline business attributes, realizing the active avoidance of potential occlusion. This effectively eliminates label flickering and jumps caused by sudden changes in viewpoint. Compared with the passive offset mode, the predictive sliding mechanism ensures the visual continuity of the label during high-speed interaction, maintains a stable spatiotemporal mapping relationship between complex pipeline targets and business information, and significantly improves the observation stability in the 3D monitoring environment.

[0050] Furthermore, the process of calculating the gravitational constraint of the real-time anchor point on the label and the mutual repulsion between adjacent labels includes: mapping the medium pressure to a pressure level score, mapping the risk level to a risk weight coefficient, calculating the product of the pressure level score and the risk weight coefficient to obtain the physical weight of the label; constructing a spatial virtual force field with different energy levels; within the spatial virtual force field, with the real-time anchor point as the center of gravity, calculating the elastic gravitational force generated by the real-time anchor point on the label as a force-bearing mass, causing the force-bearing mass to converge towards the center of gravity; within the spatial virtual force field, calculating the repulsion between adjacent force-bearing masses, causing overlapping labels to push each other away; wherein, the magnitude of the repulsion force is determined by the physical weight; under the combined action of the gravitational constraint and the mutual repulsion, through iterative calculation, the total energy of the force-bearing mass in the spatial virtual force field reaches a dynamic equilibrium, determining the stable position of the label in three-dimensional space.

[0051] Specifically, firstly, the pipeline metadata associated with the current pipe segment is obtained, and the medium pressure is mapped to a pressure level score (divided into 1 to 5 points according to the pressure range in this embodiment), and the risk level is mapped to a risk weight coefficient (coefficient of 1.0 to 2.0 according to the risk level in this embodiment). The pressure level score and the risk weight coefficient are multiplied to obtain the physical weight of the label. In order to ensure the numerical stability of the force field iteration, the original weight value is processed by a preset minimum-maximum normalization function and mapped to a standard range between [0, 1.0] to obtain the final physical weight. This weight reflects the importance of the business objective in the visual presentation. The higher the weight, the higher the priority of the label in conflict avoidance.

[0052] Next, in this embodiment, the virtual force field is established within the screen view space coordinate system after view transformation to resolve the visual overlap conflict of labels on the observation plane. Within this force field, each label to be displayed is defined as a force-bearing mass, with the real-time anchor point as the center of gravity. Based on Hooke's Law, the elastic gravitational force generated by the real-time anchor point on the label as a force-bearing mass is established. During calculation, a preset rest length is set. When the label deviates from the center of gravity by more than this length, the elastic gravitational force will pull the force-bearing mass towards the center of gravity, thereby ensuring that the label is always anchored near the corresponding pipe segment. The preset rest length is obtained by obtaining the length and height of the label text box and calculating its diagonal length, specifically set to 1.5 times the diagonal length to ensure a reasonable physical distance between the label and the anchor point. When the Euclidean distance between the label center and the real-time anchor point exceeds this rest length, elastic gravitational force is generated. The elastic coefficient is set to 0.5 (relative to the standardized scene unit). The direction of the gravitational force is defined as a unit vector from the label center to the anchor point, and the magnitude of the gravitational force is proportional to the displacement of the label from the rest length.

[0053] In a 3D scene, a spatial virtual force field with different energy levels is constructed. First, all labels participating in the force field calculation within the current viewport are arranged in ascending order according to their calculated physical weights, and the minimum and maximum weight values ​​are identified. Then, the numerical range between the minimum and maximum weights is equally divided into five sub-ranges. Based on the weight sub-range in which the label is located, it is mapped to five energy levels: labels in the lowest weight range correspond to energy level 1, and labels in the highest weight range correspond to energy level 5. Labels in different energy levels exhibit different behavioral characteristics in the force field. An increasing repulsive force coefficient is set for each energy level: for each increase in energy level, the repulsive force intensity increases by a fixed proportion. This means that the higher the energy level of a tag, the stronger the repulsive force it generates on other tags in the vicinity. In practice, a base repulsive force coefficient (e.g., 1.0) is set for energy level 1. The repulsive force coefficients of each subsequent level are then added in a fixed increment of 20% of the previous level. For example, the coefficient for energy level 2 is 1.2, the coefficient for level 3 is 1.4, and so on, until the coefficient for energy level 5 reaches twice the base coefficient. This quantifiable arithmetic progression ensures that the force field system has a stable numerical evolution basis when calculating the tag's repulsive displacement, avoiding tag motion divergence caused by excessively large differences in repulsive force levels.

[0054] Subsequently, the repulsive force between adjacent force-bearing particles within the same local space is calculated. This embodiment simulates the principle of charge repulsion, establishing an influence radius for each label within a virtual force field. When the bounding boxes of two labels overlap or are too close, the repulsive force between them is calculated, causing the overlapping labels to push each other away. The key is that the magnitude of the repulsive force is affected by the aforementioned physical weights. Specifically, the repulsive force between two force-bearing particles is proportional to the sum of their physical weights and inversely proportional to the square of the Euclidean distance between them, thereby ensuring that high-weight labels can obtain a larger repulsive energy level to occupy the empty area. For core business labels with larger physical weights, the system increases their repulsive energy level, enabling them to actively push away surrounding secondary labels with lower physical weights in the force field, thereby occupying the visual center position within the limited screen space and preventing key information from being buried.

[0055] The specific calculation process of the repulsive force is as follows: the magnitude of the repulsive force between the two tags is calculated according to the Coulomb force model, and the repulsive constant is set to 8.0. The magnitude of the repulsive force is directly proportional to the product of the physical weights of the two tags and inversely proportional to the square of the Euclidean distance between them. The influence radius of the repulsive force is defined as the sum of the radii of the outer spheres of the bounding boxes of the two tags plus 100 pixels. When the distance exceeds this radius, the repulsive force is not calculated. The position is updated frame by frame using the Weylerle integral algorithm, which has better energy conservation characteristics than the ordinary Euler method. The time step is set to one-sixtieth of a second (corresponding to a 60 Hz refresh rate), and the quality of all tags is set to a unit quality of 1.0. In each iteration step, the total kinetic energy of the system is monitored. When the change in kinetic energy between two adjacent iterations is less than one percent of the current total kinetic energy, and the velocity values ​​of all tags are less than 0.1 pixels per frame, it is determined that the force field has reached equilibrium. To prevent overcomputation, the maximum number of iterations is set to 500. The different energy levels refer to the intervals divided into five equal parts according to the physical weight of the tags from the minimum to the maximum. The higher the energy level, the greater the corresponding repulsive force coefficient (the coefficient increases by 0.2 for each level), so that high-priority key tags can generate stronger repulsive energy levels, thereby visually occupying the center position.

[0056] Finally, dynamic equilibrium of the layout is achieved through iterative calculation. Under the combined action of gravitational constraints and mutual repulsion, the system uses numerical integration methods (such as Euler's method or Weylley's method) to update the position of each force-bearing particle frame by frame. By monitoring the total energy change of the force field system, when the displacement increment of all labels is lower than the preset stability threshold, it is determined that the force field has reached a dynamic equilibrium state. At this time, the stable position of each label in three-dimensional space is determined and the final rendering is performed.

[0057] By constructing a virtual force field based on semantic weights, this embodiment achieves intelligent layout and conflict avoidance of labels in high-density scenarios. This mechanism transforms pipeline pressure and risk weights into physical repulsive forces, enabling core information to automatically push away surrounding interfering labels, effectively solving the problem of label overlap. At the same time, the gravitational constraints ensure the spatial consistency between labels and pipelines, achieving dynamic visual balance driven by business logic, and significantly improving the information recognition efficiency in complex pipeline network monitoring.

[0058] Further, the process of adjusting the depth offset of the label along the line of sight in the three-dimensional world coordinate system based on the overlap area and burial depth includes: transforming the three-dimensional coordinates of the label to screen space using the projection matrix of the virtual camera, and constructing a two-dimensional bounding box rectangle based on the text length and font height of the label; calculating the intersection area between each pair of the two-dimensional bounding box rectangles to obtain the overlap area on the screen; sorting each label in ascending order according to the burial depth value in the pipeline metadata to establish a depth priority list, wherein the label with the smaller burial depth value corresponds to a higher depth priority; when the overlap area is greater than zero, obtaining the original Z-axis coordinate value of the label in the viewpoint space coordinate system, subtracting a preset depth displacement step size from the original Z-axis coordinate value based on the depth priority to calculate the adjusted depth offset; applying the depth offset to the position component of the label in the viewpoint space coordinate system using the inverse observation matrix of the virtual camera, and restoring it to the world coordinate system to correct the spatial coordinates. The specific process is as follows: Figure 3 As shown.

[0059] Specifically, firstly, the screen space projection and geometric attribute construction of the labels are performed. Using the projection matrix of the current virtual camera, the coordinates of each label to be displayed in the three-dimensional world coordinate system are transformed to the two-dimensional screen space. Then, the preset text content, font size and line height of each label are obtained. The pixel size occupied by the label on the screen is calculated based on the text length and font height, and a two-dimensional bounding box rectangle is constructed accordingly. During the calculation process, the screen resolution of the current display device and the UI scaling factor need to be combined to map the text pixel size to a consistent viewport coordinate system to ensure the geometric consistency of the bounding box on different terminals.

[0060] Next, quantitative detection of label conflicts is performed. All labels within the current viewport are traversed, and the intersection area between any two 2D bounding box rectangles is calculated using a rectangle intersection algorithm to obtain the overlapping area of ​​each label on the screen. Simultaneously, the burial depth value (i.e., the depth of the pipeline from the ground surface) corresponding to each pipeline is extracted from the pipeline metadata, and all labels involved in the calculation are sorted in ascending order of burial depth value. A depth priority list is then established, where labels with smaller burial depth values ​​(representing the pipeline being closer to the ground or located above it) have higher depth priority (assigned a smaller index value). Specifically, a depth priority index i (i=0, 1, 2...) is created, starting from 0 and increasing. The label with the smallest burial depth value corresponds to index 0, the next deepest corresponds to index 1, and so on, thus providing a discrete step base for subsequent offset accumulation.

[0061] Subsequently, depth offset compensation is performed in the viewpoint space. When the overlapping area of ​​two labels is detected to be greater than zero, the original Z-axis coordinates of the labels in the viewpoint space coordinate system are obtained using the observation matrix. Based on the aforementioned depth priority list, a preset depth displacement step size is subtracted proportionally from the original Z-axis coordinates (in this embodiment, the step size is set to 0.01 to 0.1 length units to ensure the visual sense of front and back hierarchy). In this way, labels with higher priority are pulled closer to the camera in the viewpoint space, while labels with lower priority are pushed relatively further away. The specific depth correction logic is as follows: the depth priority index value corresponding to the label is multiplied by the preset depth displacement step size to obtain the offset unique to the label, and this is accumulated to the original Z-axis coordinate value. Since the increase or decrease of the depth value in the standard viewpoint space directly corresponds to the physical distance of the object relative to the camera observation plane, through this linear accumulation based on index weight, the label with a smaller burial depth value (i.e., a smaller priority index) obtains coordinates closer to the camera's near clipping plane in the viewpoint space coordinate system, thus appearing at the forefront of the overlapping area.

[0062] Finally, the spatial coordinates were restored and corrected. Using the inverse observation matrix of the virtual camera, the adjusted viewpoint spatial coordinates, which include depth offset, were inversely transformed and restored to the three-dimensional world coordinate system. Through this process, the actual mounting position of the labels in the three-dimensional scene was corrected. This correction ensures that even if multiple labels overlap in the screen view, their front-to-back occlusion relationship can strictly follow the actual physical burial depth logic of the underground pipeline, eliminating the visual spatial inversion phenomenon.

[0063] Specifically, the preset depth displacement step size uses an adaptive calculation method: First, the near clipping plane distance and far clipping plane distance of the virtual camera are obtained to calculate the total depth range of the view frustum. Then, the total number of labels that need to be avoided from overlapping in the current screen is counted. The depth range is divided by the sum of the total number of labels and a fixed constant (such as 10) to obtain the basic step size. The effective value of this step size is constrained to between 0.001 and 0.5 coordinate units. If the calculation result exceeds this range, the boundary value is taken. For the i-th label sorted according to burial depth priority, its final Z-axis coordinate value in the viewpoint space coordinate system is obtained by subtracting the product of this step size and the priority index i from the original coordinate. Thus, through linear accumulation, it is ensured that shallower pipeline labels are visually closer to the camera.

[0064] By mapping the physical burial depth of underground pipelines to the positional components of the viewpoint space for correction, this embodiment achieves logical alignment between the occlusion order of annotations and the physical reality. This mechanism, combined with screen overlap detection to dynamically adjust depth offset, effectively solves the problem of visual hierarchy confusion in multi-layered pipeline networks on the projection surface. Without affecting the geographical location of the annotations, it ensures that the visual presentation strictly follows the physical characteristic of "shallow on top, deep on bottom," significantly enhancing the intuitiveness and spatial logic of information display in complex underground scenes.

[0065] Furthermore, the process of outputting the world coordinates of the label center, orientation data, and turning path coordinates of the leader line includes: using a preset smoothing coefficient to perform a weighted average calculation of the spatial coordinates of the label at the current moment and the output coordinates at the previous moment to obtain the world coordinates of the label center; obtaining the gaze vector of the virtual camera, adjusting the normal vector direction of the label so that the normal vector direction is parallel to the opposite direction of the gaze vector to obtain the orientation data, ensuring that the label is always facing the observation position of the virtual camera in three-dimensional space; taking the real-time anchor point on the central ridge of the three-dimensional pipeline as the path start point, and the world coordinates of the label center as the path end point, detecting and extracting non-collision intermediate turning point coordinates between the path start point and the path end point according to the geometric space boundary of the three-dimensional pipeline model, and generating the turning path coordinates composed of the path start point, the intermediate turning point coordinates, and the path end point connected sequentially.

[0066] Specifically, firstly, a smoothing process is performed on the label position. Using a preset smoothing coefficient, the spatial coordinates calculated at the current moment are proportionally fused with the stored output coordinates from the previous moment. Specifically, the current coordinates are multiplied by the coefficient, and then added to the result of multiplying the previous moment's coordinates by the remainder. This yields the final world coordinates of the label center. This weighted, continuous correction effectively filters out visual jumps that may occur during camera interaction. The preset smoothing coefficient employs a dynamic adjustment strategy: real-time monitoring of the camera's movement speed between adjacent frames. When the camera moves at low speed (less than 1 unit per frame), the smoothing coefficient is set to 0.05 to maintain sensitivity; when moving at medium speed (1 to 5 units per frame), the coefficient is set to 0.15; and when moving at high speed (greater than 5 units per frame), the coefficient is set to 0.25 to enhance visual stability. The final smoothed coordinates are composed of the product of the currently calculated coordinates and the coefficient, plus the product of the previous moment's coordinates and the coefficient remainder.

[0067] Next, the orientation data of the label is adjusted, the gaze vector of the virtual camera is extracted in real time, and the direction of the normal vector of the label plane is adjusted according to the vector. By keeping the label normal vector parallel to the opposite direction of the gaze vector, it is ensured that the label can rotate in real time with the viewpoint in the 3D scene. This process ensures that the front of the label is always perpendicular to the observer's gaze, so that the label information is facing the camera at any interactive angle, thus ensuring the readability of the text.

[0068] Subsequently, the non-collision turning path coordinates of the leader line are generated. The real-time anchor point on the central ridge of the 3D pipeline is used as the starting point of the path, and the world coordinates of the label center are used as the ending point of the path. Between the two, the system uses the geometric space boundary of the pipeline model to perform ray projection detection. If the straight path between the starting point and the ending point is detected to pass through the pipeline mesh boundary, the spatial position is offset outward according to the radius of the pipeline bounding box, thereby extracting the coordinates of an intermediate turning point outside the geometric boundary. Specifically, the direction of the spatial position offset is determined based on the surface normal vector direction of the ray collision point, or in the normal direction of the plane formed by the starting point, the ending point of the path and the camera position, thereby ensuring that the generated intermediate turning point not only avoids the pipeline entity, but is also visually outside the envelope of the pipeline edge.

[0069] Finally, the system sequentially connects the coordinates of the path's starting point, intermediate turning points, and path's ending point. Through this obstacle-avoiding path planning, a multi-segment polyline coordinate system is generated that bypasses the surface of the pipe entity. This turning path not only guides the relationship between the annotations and the target but also avoids the visual occlusion problem caused by cables penetrating the model, ultimately achieving standardized output of the annotation data.

[0070] When detecting non-collision intermediate turning points, a ray projection array method is used: a main ray is emitted from the real-time anchor point towards the center of the label, and eight auxiliary rays are evenly emitted vertically around the main ray to form a ray beam. If the main ray collides with the pipe model mesh, the surface normal vector at the collision point is obtained, and the collision point is offset outward along the direction of this normal vector by a safe distance, which is set to 1.2 times the radius of the pipe's outer tangent sphere. The resulting spatial position is the coordinate of the intermediate turning point, ensuring that the leader line can smoothly bypass the pipe entity without visual penetration.

[0071] Furthermore, it also includes: based on the topological adjacency table of the three-dimensional pipe network, identifying upstream and downstream pipe segments that are directly physically connected to the currently labeled pipe segment; when the currently labeled pipe segment is selected or is in the visual center area, triggering the labeling labels of the upstream and downstream pipe segments to enter the pre-rendering state, and generating a guide dashed line with flow direction characteristics at the connection point along the central ridge of the three-dimensional pipe network.

[0072] First, neighborhood identification based on topology is performed. The three-dimensional pipeline network topology adjacency table constructed in the preprocessing stage is called. This table records the physical connection status of each pipe segment and its connecting nodes in the pipeline network. When the user selects a specific pipe segment (hereinafter referred to as "current pipe segment") or the pipe segment enters the visual center area, the identifiers of adjacent pipe segments directly connected to its first and last nodes are retrieved in the topology adjacency table according to the globally unique identifier of the current pipe segment, thereby identifying the upstream and downstream pipe segments that are physically connected to it.

[0073] Next, the system determines the triggering conditions and activates the pre-rendering state, monitoring the current pipe segment's position in screen space in real time and determining whether the center point of its projection bounding box falls within a preset view center area (e.g., a rectangular interval between 40% and 60% of the screen center's horizontal and vertical coordinates). Once the conditions of being selected or located at the visual center are met, the system immediately triggers the identification of upstream and downstream pipe segment labels to enter the pre-rendering state. In the pre-rendering state, the system retrieves the business metadata of adjacent pipe segments from the memory buffer in advance and completes the pre-loading of the label geometry into the video memory, so as to achieve delay-free following rendering as the viewpoint moves.

[0074] Subsequently, the system obtains the sequence of central ridge coordinate points shared by the current pipe segment and the upstream and downstream pipe segments, and generates dynamic guide dashed lines along the ridge direction using the connection nodes of adjacent pipe segments as base points. To reflect the flow direction characteristics, the system introduces an offset parameter in the shader of the dashed lines, causing the texture or color segments of the dashed lines to undergo periodic displacement along the physical flow direction (the upstream to downstream direction defined by the topological adjacency list) on the central ridge line. This dynamic effect visually metaphorically represents the flow trend of the medium inside the pipe, transforming abstract topological logic into intuitive visual guidance.

[0075] Finally, guided by the dotted line, the neighborhood labels in the pre-rendered state are rendered and output in three-dimensional space along with the labels of the current pipe segment. This following mechanism based on physical topology connectivity ensures that when users observe the core pipe segment, the upstream and downstream related information can be presented automatically and orderly, forming a visual link with logical continuity, and solving the problem of information discontinuity caused by isolated labels.

[0076] Furthermore, it also includes: extracting the two-dimensional projection contour of the three-dimensional pipeline model in screen space; obtaining the geometric center of the two-dimensional projection contour and the coordinates of the extreme point relative to the center of the screen; adjusting the real-time coordinates of the label so that the line connecting the center point of the label and the geometric center of the two-dimensional projection contour in screen space points to the extreme point coordinates, ensuring that the label is always located at the outer edge of the projection shape of the pipeline model.

[0077] First, using the current virtual camera's observation transformation and projection matrix, the mesh vertices of the 3D pipeline model are projected onto screen space. Combined with depth test results from the rendering pipeline, the visible pixel range of the model in the current viewpoint is extracted. Using edge detection algorithms (such as the Sobel operator) or by extracting the alpha channel boundary of the rendering buffer, a 2D closed contour curve describing the projected shape of the pipeline model on the screen is constructed. Next, the average screen coordinates of all pixels within the extracted 2D projection contour are calculated to determine its geometric center coordinates. Then, using the screen center point as the reference origin, all discrete points on the contour curve are traversed to find the contour point farthest from the screen center in the current view direction (or farthest from the geometric center at a specific azimuth angle). This point is defined as the extreme point coordinates relative to the screen center. This point represents the farthest physical edge of the pipeline model expanding outwards in the current screen view.

[0078] Subsequently, the direction vector pointing from the geometric center of the aforementioned two-dimensional projected contour to the coordinates of the extreme point is calculated. The initial real-time coordinates of the label are obtained and projected onto the screen space. The projection position of these coordinates on the screen is adjusted so that its center point falls on the extension line of the aforementioned direction vector. Specifically, the label's center point is moved outward along this direction vector by a distance at least equal to the sum of the label's own bounding box radius and a preset safety distance. This ensures that the label always visually fits the outer edge of the pipe's projected contour without obscuring the pipe model entity.

[0079] Finally, the adjusted two-dimensional coordinates of the screen space are restored to three-dimensional space using inverse projection transformation. Through this process, the labels can automatically find the optimal edge mounting position in real time based on the changes in the appearance of the pipeline model on the screen (such as near objects appearing larger than distant ones or rotational deformation). This layout strategy based on projection contours effectively avoids the problem of labels covering entities due to the complexity of the model shape, ensuring a clear separation between the pipeline structure and business information in the monitoring screen.

[0080] Furthermore, it also includes: enabling template buffer testing for annotation labels in the rendering pipeline; when the depth buffer comparison result determines that the annotation label is occluded by other 3D models, switching the rendering state of the annotation label from opaque solid color mode to semi-transparent ray mode, and simultaneously changing the line type of the leader line.

[0081] First, in the rendering pipeline of the graphics rendering engine, a template buffer test is enabled for each label and its associated leader, and a specific template index value is assigned. Simultaneously, the rendering batch of the labels is set after the rendering of regular opaque geometry in the scene to facilitate accurate depth comparison. Next, when rendering the fragment of the current label, the graphics processor compares the label's current depth value with the scene depth values ​​already stored in the depth buffer in real time. If the comparison shows that the label's depth value is greater than the depth value already stored at the current pixel position, it is determined that the label is behind other 3D models (such as ground buildings, mountains, or other occluding objects), indicating visual occlusion.

[0082] Subsequently, once it is determined that the label is occluded, the system immediately modifies the label's material rendering state machine, switching it from "opaque solid color mode" to "semi-transparent ray mode". In semi-transparent ray mode, the system disables depth writing through the shader, adjusts the blending factor to enable alpha transparency blending, and increases the contrast gain, so that the label can be superimposed on the occluded object model with a "X-ray"-like penetration effect, ensuring that the text information remains clearly visible even in complex occlusion environments.

[0083] Finally, as the label enters a semi-transparent state, the geometry shader parameters or texture sampling logic of the leader line are simultaneously modified, switching the line type from a "continuous solid line" representing the visible path to a "discrete dashed line" or "dotted line" representing the hidden path. This dual visual feedback of line type and transparency visually demonstrates the actual spatial occlusion state of the pipe segment to the user. When the camera view shifts to an unoccluded area, the depth test results are automatically updated, and the system instantly switches back to the original opaque rendering state.

[0084] By scaling and blending coordinates, the visual smoothness of label positions in dynamic interactions is significantly improved. Eye alignment logic ensures that labels are always displayed in a positive direction, solving the problem of text deformation under complex viewing angles. Simultaneously, the introduction of turning path planning based on geometric boundary detection effectively avoids the visual paradox caused by leader lines penetrating the pipe model, ensuring the logical clarity of label guidance. Furthermore, spatial avoidance enhances the overall rendering professionalism of the 3D pipe network scene.

[0085] By integrating core technologies such as dynamic pose sampling, reinforcement learning occlusion prediction, and semantic force field layout, this system solves technical challenges such as annotation flickering, occlusion, and logical confusion in complex pipeline environments. An active sliding mechanism ensures information continuity during interaction, while depth correction based on physical burial depth effectively eliminates visual hierarchy conflicts in vertical space for multi-layered pipelines. Combined with non-collision pathfinding and smoothing filtering, it ensures a stable spatiotemporal mapping between annotations and pipeline entities, significantly improving the information recognition efficiency and interaction stability of 3D digital twin scenes, providing reliable technical support for precise monitoring of urban underground pipeline networks.

[0086] Example 2 First, the 3D pipeline network model (3D Tiles format) of the central intersection is loaded, and semantic associations are automatically established. For a high-pressure gas pipeline in this area, its geometric mesh is analyzed, and a fast travel algorithm is used to perform wavefront propagation starting from the pipe diameter boundary to extract the coordinate sequence of the central ridge line of the pipeline. At the same time, the business metadata of the pipeline is retrieved through a globally unique identifier, including: pipe diameter 600mm, medium pressure 0.6MPa, risk level 1 (highest level), and encapsulated into an attribute vector.

[0087] Next, when the monitoring personnel zoom in and out to inspect the intersection, the pose transformation matrix of the virtual camera is sampled in real time, and the camera's moving velocity vector is calculated. At this time, the reinforcement learning policy network detects that the camera is moving towards the projection area of ​​a high-rise building on the northeast side of the intersection. It predicts that the building model will soon obscure the original label position of the pipeline and drives the label anchor point to actively slide along the extracted central ridge line to the open area. During the sliding process, the visibility of the seed point on the sliding path is verified in real time by combining depth buffer comparison to ensure that the anchor point is always within the visible window that is not obscured by the building model.

[0088] Subsequently, the overlapping conflict of labels was handled. From the current perspective, the gas pipeline overlapped with another shallowly buried water supply pipeline on the screen projection surface. The physical weights of the two were calculated: due to the high pressure and risk level of the gas pipeline, its normalized physical weight was 0.85, while that of the water supply pipeline was only 0.3. In the constructed virtual force field, the gas label generated a strong repulsive force on the water supply label, driving the water supply label to avoid it diagonally upward. At the same time, it was found that the overlapping area of ​​the two labels was greater than zero. Based on the burial depth data (5 meters for gas, 2 meters for water), a priority was established. In the viewpoint spatial coordinate system, the depth position component of the water supply label was narrowed and corrected to ensure that the visual appearance conformed to the physical logic of the shallow pipeline label occluding the deep pipeline label.

[0089] Finally, the annotation is smoothly presented and guided for output. The current coordinates of the pipeline label are weighted and fused using a preset smoothing coefficient to eliminate jitter caused by dynamic avoidance. At the same time, the camera's line of sight vector is obtained and the label normal vector is adjusted to be parallel to it, so that the annotation is always facing the observer. When generating the leader line, a street lamp pole model is detected between the label center and the anchor point. The ray projection feedback collision signal is then used to extract the middle turning point outward based on the geometric boundary of the street lamp pole, generating a broken line leader line that bypasses the lamp pole entity, and outputting smooth, unobstructed and logically accurate pipeline annotation information.

[0090] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for determining the spatial location of annotation labels on a three-dimensional pipeline model, characterized in that, include: Acquire mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model; pipeline metadata includes pipe diameter, medium pressure, risk level, and burial depth; virtual camera parameters include real-time observation position, line-of-sight parameters, and movement speed vector; The central ridge of the 3D pipeline is extracted based on the grid vertex data. Discrete seed points are distributed on the central ridge of the 3D pipeline according to the pipe diameter. Pipeline metadata is associated with the corresponding seed points, and the initial anchor point is determined from the discrete seed points. Based on the real-time observation position and viewing parameters, the visibility of the seed point is analyzed, and the initial anchor point is driven to slide to the coordinates of the unobstructed view window to obtain the real-time anchor point position. Input the moving speed vector, medium pressure, and risk level into the strategy network to calculate the predicted slippage and adjust the real-time coordinates of the anchor point.

2. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 1, characterized in that, The acquisition of mesh vertex data, pipeline metadata, and virtual camera parameters of the 3D pipeline model includes: parsing triangular mesh geometric data files in OBJ, FBX, and 3D Tiles formats, extracting discrete vertex spatial coordinates to obtain the mesh vertex data; using globally unique identifiers to semantically associate pipe diameter, medium pressure, risk level, and burial depth stored in the structured attribute database with the pipe segment mesh components in the 3D pipeline model; acquiring the real-time observation position and gaze parameters of the virtual camera, and sampling the pose transformation matrix of the virtual camera between the current frame and the previous frame in real time, calculating the displacement difference of the observation position based on the pose transformation matrix, and calculating the movement velocity vector by combining the frame interval time.

3. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 1, characterized in that, The process of associating pipeline metadata with corresponding seed points includes: based on the mesh vertex data, using a fast traversal algorithm with the pipeline model mesh boundary as the starting surface, performing wavefront propagation calculations into the pipeline to obtain the distance field from each voxel to the pipeline model mesh boundary; obtaining the set of local maxima points in the distance field, i.e. the set of the centers of the largest inscribed spheres, to obtain the three-dimensional pipeline central ridge; determining the sampling step size for equal arc length resampling based on the pipe diameter; using the sampling step size to perform discrete sampling on the three-dimensional pipeline central ridge to generate discrete seed points; storing the medium pressure, risk level, and burial depth as attribute vectors for each discrete seed point, from which the initial anchor point is determined.

4. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 1, characterized in that, The process of driving the initial anchor point to slide towards the coordinates of the unobstructed view window includes: constructing a view projection transformation matrix based on the real-time observation position and the viewing parameters, transforming the three-dimensional coordinates of each discrete seed point to the normalized device coordinate system, and obtaining the screen pixel coordinates and corresponding projection depth values ​​of each discrete seed point; reading back the buffer depth value that matches the screen pixel coordinates from the screen space depth buffer, and comparing the projection depth value with the buffer depth value; if the projection depth value is greater than the buffer depth value, it is determined that the discrete seed point is in an occluded state and is culled; on the central ridge line of the three-dimensional pipeline, a topological neighborhood search is performed with the culled discrete seed point as the starting point to identify the seed point with the closest topological distance and in an unoccluded state; the three-dimensional spatial position of the unoccluded seed point is determined as the coordinates of the view window, and the initial anchor point is slid along the central ridge line of the three-dimensional pipeline to that coordinate.

5. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 1, characterized in that, The process of adjusting the real-time coordinates of the anchor point includes: combining the moving speed vector, the medium pressure, and the risk level into a feature vector describing the current labeling state; inputting the feature vector into a pre-trained reinforcement learning policy network, predicting the occlusion trend caused by camera movement through the reinforcement learning policy network, and outputting a predicted sliding offset value along the direction of the central ridge of the three-dimensional pipeline; obtaining the current parameterized arc length coordinates of the real-time anchor point on the central ridge of the three-dimensional pipeline, accumulating and updating the current parameterized arc length coordinates using the predicted sliding offset value, and converting the updated parameterized arc length coordinates into the real-time coordinates in three-dimensional space; establishing a spatial virtual force field with the real-time anchor point as the center of gravity, and calculating the gravitational constraint of the real-time anchor point on the label and the mutual repulsion force between adjacent labels.

6. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 5, characterized in that, The process of calculating the gravitational constraint of the real-time anchor point on the label and the mutual repulsion between adjacent labels includes: mapping the medium pressure to a pressure level score, mapping the risk level to a risk weight coefficient, calculating the product of the pressure level score and the risk weight coefficient to obtain the physical weight of the label; constructing a spatial virtual force field with different energy levels; within the spatial virtual force field, with the real-time anchor point as the center of gravity, calculating the elastic gravitational force generated by the real-time anchor point on the label as a force-bearing mass, causing the force-bearing mass to converge towards the center of gravity; within the spatial virtual force field, calculating the repulsion between adjacent force-bearing masses, causing overlapping labels to push each other away; wherein, the magnitude of the repulsion force is determined by the physical weight; under the combined action of the gravitational constraint and the mutual repulsion, through iterative calculation, the total energy of the force-bearing mass in the spatial virtual force field reaches a dynamic equilibrium, determining the stable position of the label in three-dimensional space, projecting the label onto a two-dimensional display plane, calculating the overlapping area of ​​the label text box on the screen, adjusting the depth offset of the label based on the overlapping area and burial depth, and correcting the spatial coordinates.

7. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 6, characterized in that, The process of adjusting the depth offset of the label along the line of sight in the three-dimensional world coordinate system based on the overlap area and burial depth includes: transforming the three-dimensional coordinates of the label to screen space using the projection matrix of the virtual camera, and constructing a two-dimensional bounding box rectangle based on the text length and font height of the label; calculating the intersection area between each pair of the two-dimensional bounding box rectangles to obtain the overlap area on the screen; arranging each label in ascending order according to the burial depth value in the pipeline metadata to establish a depth priority list, wherein the label with the smaller burial depth value corresponds to a higher depth priority; when the overlap area is greater than zero, obtaining the original Z-axis coordinate value of the label in the viewpoint space coordinate system, subtracting a preset depth displacement step size from the original Z-axis coordinate value based on the depth priority to calculate the adjusted depth offset; applying the depth offset to the position component of the label in the viewpoint space coordinate system using the inverse observation matrix of the virtual camera, restoring it to the world coordinate system, correcting the spatial coordinates, and smoothing the spatial coordinates to output the world coordinates of the label center, orientation data, and turning path coordinates of the leader line.

8. The method for determining the spatial position of annotation labels on a three-dimensional pipeline model according to claim 7, characterized in that, The process of outputting the world coordinates of the label center, orientation data, and turning path coordinates of the leader line includes: using a preset smoothing coefficient to calculate a weighted average of the label's current spatial coordinates and the previous output coordinates to obtain the world coordinates of the label center; obtaining the virtual camera's gaze vector, adjusting the label's normal vector direction so that the normal vector direction is parallel to the opposite direction of the gaze vector to obtain the orientation data, ensuring that the label is always facing the virtual camera's observation position in three-dimensional space; using the real-time anchor point on the central ridge of the three-dimensional pipeline as the path start point, and the world coordinates of the label center as the path end point, detecting and extracting non-collision intermediate turning point coordinates between the path start point and the path end point based on the geometric space boundary of the three-dimensional pipeline model, generating the turning path coordinates composed of the path start point, the intermediate turning point coordinates, and the path end point connected sequentially.