A virtual topology-based hull combined curved surface mesh generation method and system

By establishing a virtual topology layer on the hull CAD surface, identifying and eliminating common boundaries, reconstructing topological relationships, and constructing a unified two-dimensional parameter domain in the three-dimensional background mesh, the problem of mesh generation between multiple curved surfaces is solved, and efficient and stable hull surface mesh generation is achieved.

CN123179802APending Publication Date: 2026-11-27QINGDAO INNOVATION & DEV CENT OF HARBIN ENG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611322287.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies struggle to unify the common boundaries between multiple curved surfaces when generating meshes for ship hull surfaces, and they are highly dependent on the underlying CAD geometry and topology, resulting in high processing complexity and poor stability.

Method used

By establishing a virtual topology layer on the hull CAD surface, identifying and eliminating common boundaries, reconstructing topological relationships, and constructing a unified two-dimensional parameter domain in the three-dimensional background mesh, a unified mesh generation for multiple surfaces is achieved.

Benefits of technology

It reduces the difficulty of geometric preprocessing for mesh generation, improves the stability and automation of processing, and can generate high-quality three-dimensional hull surface meshes, which are suitable for ship potential hydrodynamic analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123179802A_ABST
    Figure CN123179802A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of ship and ocean engineering, computer graphics and computer aided engineering (CAE), and discloses a hull combined curved surface grid generation method and system based on virtual topology. The method comprises the following steps: a virtual surface and a virtual edge are established for a hull CAD curved surface, and a host surface is registered to form a virtual topology layer; after determining a to-be-occluded common boundary, the host surface is removed and combined, a ring is reconstructed to form a fusion virtual surface; the boundary of the fusion virtual surface is discretized, and triangular data is combined to obtain a three-dimensional background grid; a three-dimensional background grid is parameterized to obtain a unified two-dimensional parameter domain, and a target two-dimensional grid node and topology are generated; three-dimensional positions are calculated according to a background unit corresponding relationship, and a three-dimensional hull surface grid is formed by connection according to the target topology. The application can organize multiple hull CAD curved surfaces into logical curved surface domains which can be uniformly processed while keeping the bottom layer geometry definition of the host surface unchanged, and reduce the dependence of subsequent grid generation on the original curved surface topology consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of shipbuilding and ocean engineering, computer graphics and computer-aided engineering (CAE), and particularly relates to a method and system for generating composite surface meshes of ship hulls based on virtual topology. Background Technology

[0002] Ship potential-current hydrodynamic analysis is a numerical analysis method used in the study of ship hydrodynamic performance. This analysis typically treats the hull surface as the boundary of the fluid domain and discretizes the hull surface into a computational model composed of mesh nodes and mesh elements. The corresponding boundary conditions are then solved based on this computational model. Therefore, the geometric fit, topological continuity, and element connectivity of the hull surface mesh affect the establishment of the subsequent numerical computational model.

[0003] Ship hull CAD (Computer-Aided Design) geometric models are typically formed by stitching together multiple surfaces, each with its own geometric definition, topological boundary, and local parameter domain. Due to the modeling process, surface trimming methods, and data exchange processes, adjacent surfaces may have corresponding but non-shared topological boundaries, or one boundary may be represented by a single curve while the other is represented by multiple continuous curves. If meshes are generated directly from the existing surfaces and boundaries, it is necessary to maintain the discrete boundary points, parameter coordinates, and mesh connectivity for each surface separately, and to handle node correspondence and element connections at surface intersections.

[0004] High-quality hull surface mesh generation requires balancing geometric fit and topological continuity. On one hand, mesh nodes need to be located on the corresponding hull surfaces to reflect the hull shape; on the other hand, boundary nodes and element connections at the intersection of adjacent surfaces need to be consistent to avoid duplicate nodes, local gaps, or mismatched mesh boundaries. When the hull model contains many surfaces and fragmented spliced ​​boundaries, using the local parameter domains of individual surfaces as the mesh generation region increases the difficulty of organizing cross-surface boundary constraints.

[0005] Current surface mesh generation processes typically involve first performing geometric and topological preprocessing on the CAD surface, and then generating the mesh in the surface parameter domain or a two-dimensional region formed by surface discretization. For a single parametric surface, two-dimensional mesh nodes can be generated using the local parametric coordinates of the surface, and these nodes can be mapped to the three-dimensional surface. For a model composed of multiple surfaces, the parameter domains of each surface need to be processed separately, and the boundary nodes and mesh topology of adjacent surfaces need to be stitched together after mesh generation. Since the parameter domains of different surfaces are independent of each other, their parameter scales, directions, and boundary representations may differ, and the mesh generation results from a single surface cannot be directly used as a unified mesh across surfaces.

[0006] Another approach is to modify the original surface topology, perform surface intersection, or reconstruct the geometric boundaries to ensure that the surfaces that need to generate the mesh together have connectivity that can be used for subsequent processing. This type of processing requires manipulation of the underlying CAD geometry and topology data, and its process is affected by the number of surfaces, boundary integrity, and geometric tolerances in the input model. When the model or target mesh scale changes, it may also be necessary to re-execute the corresponding geometric processing and boundary organization processes.

[0007] To reduce the processing complexity caused by directly modifying the underlying CAD geometry and topology data, existing technologies have further proposed composite surface processing methods based on virtual topology. These methods typically maintain the original surface geometry while adjusting or reorganizing the topological relationships between surfaces, logically organizing several adjacent surfaces into a composite surface. Furthermore, traditional mesh generation methods such as leading-edge advancement are extended to composite surfaces. Some existing methods also perform two-dimensional parameterization of the discrete representation of the composite surface, generating or validating mesh nodes in the two-dimensional parameter plane, and then determining the three-dimensional positions of the mesh nodes by combining the continuous CAD surfaces. These methods avoid directly modifying the underlying surface geometry, providing a technical foundation for the overall mesh generation of multiple surfaces.

[0008] However, for ship CAD models composed of numerous independently clipped surfaces, mesh generation of composite surfaces still requires addressing issues such as organizing common boundaries between multiple surfaces, maintaining effective boundaries after fusion, and coordinating different local parameter domains. Especially when the representation of common boundaries is inconsistent and the parameter domains of multiple host surfaces are independent, there is still room for improvement in how to form a consistent geometric and topological data foundation that can permeate the processes of boundary discretization, 2D mesh generation, and 3D mapping.

[0009] Based on the above analysis, the problems and shortcomings of the existing technology are as follows: (1) When generating meshes for individual surfaces, it is difficult to ensure consistent mesh continuity across surface regions. This is because each hull CAD surface has an independent local parameter domain, and the parameter scale, parameter direction, and boundary curve representation may differ between different surfaces. Furthermore, adjacent surfaces may have geometrically corresponding but non-shared topological relationships, or one side may correspond to multiple continuous edges on the other side. Therefore, the number of boundary nodes, node positions, and mesh sizes generated after each surface is independently discretized may be inconsistent. Node matching and element splicing need to be performed again after mesh generation, which easily increases the difficulty of handling duplicate nodes, local gaps, node misalignment, and inconsistent mesh connections.

[0010] (2) When establishing surface connections by directly modifying the underlying CAD geometry, re-performing surface intersection, or reconstructing geometric boundaries, the geometric preprocessing process is highly dependent on the state of the input model. This is because such methods directly act on the original B-Rep surface and its boundaries, and the processing results are affected by factors such as the number of surfaces, local gaps, narrow surfaces, short sides, and geometric tolerances. When the input model, feature retention requirements, or target mesh scale change, the original surface intersection, boundary reconstruction, and topology organization results may no longer be reusable, requiring corresponding geometric processing to be performed again, increasing the complexity of preprocessing and reducing the stability of automated processing.

[0011] (3) Existing methods for generating composite surface meshes based on virtual topology mainly adapt specific mesh generation algorithms to composite surfaces, such as modifying the generation of new nodes, cross-surface advancement, and validity judgment during the leading edge propulsion process. For virtual fused surfaces composed of multiple host surfaces, their underlying local parameter domains remain independent of each other. Although existing methods can complete part of the mesh generation or validity check with the help of discrete parameter planes, for ship hull composite surfaces, it is still necessary to further establish a processing mechanism that can uniformly describe the correspondence between the fused boundary, the two-dimensional parameter position, and the three-dimensional host surface position, so that common boundary identification, boundary discretization, different target mesh generation paths, and three-dimensional inverse mapping can share a consistent data foundation.

[0012] Therefore, the technical problem to be solved by this invention is: while keeping the underlying hull CAD surface geometry unchanged, to address the difficulties in uniformly identifying and continuously maintaining the common boundaries between multiple surfaces, the continued independence of the local parameter domains of multiple host surfaces after virtual fusion, and the difficulty in uniformly organizing the correspondence between 2D mesh nodes and different 3D host surfaces. Specifically, it is necessary to identify and eliminate the continuous common boundaries between multiple surfaces, and simultaneously reconstruct the outer loop, inner loop, and related topological relationships during the fusion process; based on this, a continuous 2D computational domain covering multiple host surfaces and the correspondence between this 2D computational domain and the 3D hull surface are established, so that different target meshes can be generated in a unified boundary constraint and 2D computational domain, and form a continuous 3D hull surface mesh across surfaces according to a consistent mapping relationship. Summary of the Invention

[0013] To overcome the problems existing in related technologies, the present invention discloses a method and system for generating composite surface meshes of ship hulls based on virtual topology, the technical solution of which is as follows: To achieve the above objectives, the present invention adopts the following technical solution: a method for generating composite surface meshes for ship hulls based on virtual topology, comprising the following steps: S1. Obtain the geometric model and surface boundaries containing multiple hull CAD surfaces, establish virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; establish virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer; S2. Generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, extract candidate paths bidirectionally along the boundary ring, and after filtering the path validity, determine the continuous boundary paths that correspond to each other on both sides as the common boundaries to be hidden. S3. Remove the common boundary to be hidden in the two virtual surfaces to be merged, and merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before merging with the resulting merged virtual surfaces, and update the association between the hull CAD surface and the virtual surfaces. S4. The outer and inner rings of the fused virtual surface are discretized in an orderly manner, and triangular discrete data are generated on each host surface and merged. After validity processing, a three-dimensional background mesh covering multiple host surfaces is obtained. S5. While maintaining the connection relationship of triangular elements in the three-dimensional background mesh, the three-dimensional background mesh is parameterized in two dimensions to generate one-to-one corresponding two-dimensional parameter coordinates for each background mesh node. The parameterized two-dimensional triangular elements are then checked for directed area. The correspondence between the checked two-dimensional parameter coordinates and the three-dimensional background mesh nodes is saved to obtain the unified two-dimensional parameter domain of the fused virtual surface. S6. Transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring order; based on the ordered two-dimensional boundary constraints, generate the target two-dimensional mesh nodes and target mesh cell topology using the selected target mesh generation path; S7. Determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, obtain the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit. Connect the three-dimensional mesh nodes according to the topology of the target mesh unit to form a three-dimensional ship hull surface mesh.

[0014] Another objective of this invention is to provide a virtual topology-based system for generating composite hull surface meshes. This system is used to implement the virtual topology-based method for generating composite hull surface meshes. The system includes: The virtual topology construction module is used to acquire the geometric model and surface boundaries of multiple hull CAD surfaces, create virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; create virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; and establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer. The common boundary determination module is used to generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, candidate paths are extracted bidirectionally along the boundary ring, and after path validity screening, the continuous boundary paths corresponding to each other on both sides are determined as the common boundaries to be hidden. The virtual surface fusion and topology reconstruction module is used to remove the common boundary to be hidden in two virtual surfaces to be fused, merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before fusion with the resulting fused virtual surfaces, and update the association relationship between the hull CAD surface and the virtual surfaces. The three-dimensional background mesh construction module is used to perform ordered discretization of the outer and inner rings of the fused virtual surface, generate triangular discrete data on each host surface and merge them, and obtain a three-dimensional background mesh covering multiple host surfaces after validity processing. The unified two-dimensional parameter domain acquisition module is used to parameterize the three-dimensional background mesh in two dimensions while maintaining the connection relationship of triangular elements in the three-dimensional background mesh. It generates one-to-one corresponding two-dimensional parameter coordinates for each background mesh node, performs directed area verification on the parameterized two-dimensional triangular elements, saves the correspondence between the verified two-dimensional parameter coordinates and the three-dimensional background mesh nodes, and obtains the unified two-dimensional parameter domain of the fused virtual surface. The target two-dimensional mesh generation module is used to transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring sequence; based on the ordered two-dimensional boundary constraints, the target two-dimensional mesh nodes and target mesh cell topology are generated using the selected target mesh generation path; The inverse mapping module is used to determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit is obtained. The three-dimensional mesh nodes are connected according to the topology of the target mesh unit to form a three-dimensional ship hull surface mesh.

[0015] Combining all the above technical solutions, the beneficial effects of this invention are as follows: First, this invention employs a virtual topology-based method for generating ship hull surface meshes to handle geometric models composed of multiple ship hull CAD surfaces, where adjacent surfaces have splicing boundaries and each surface possesses its own local parameter domain. This method includes virtual topology initialization, common boundary confirmation, virtual surface fusion, 3D background mesh construction, unified 2D parameterization, target 2D mesh generation, and 3D inverse mapping. During this process, the underlying CAD surfaces serving as host surfaces are not modified; instead, composable and traceable virtual topology objects are created on top of them, allowing multiple host surfaces to participate in subsequent discretization and mesh generation as a single fused virtual surface. This invention can eliminate the common boundaries between multiple surfaces without altering the underlying ship hull CAD surface geometry, forming a surface domain that can be uniformly discretized, parameterized, and meshed. This reduces the geometric preprocessing difficulty for generating composite surface meshes and enables the generation of complex composite surface meshes from spliced ​​multiple ship hull surfaces.

[0016] Secondly, by establishing virtual surfaces, virtual edges, and boundary loops on the hull CAD surface, and reconstructing the topological relationship of the merged virtual surfaces after the common boundary is hidden, multiple hull CAD surfaces can be organized into a unified logical surface domain while keeping the underlying geometric definition of the host surface unchanged, thus reducing the dependence of subsequent mesh generation on the topological consistency of the original surface.

[0017] The common boundary to be hidden is determined by spatial proximity, corresponding endpoints and continuous paths of boundary loops. During the fusion process, the host surface set, remaining virtual edges, outer loop, inner loop and the relationship between real surface and virtual surface are updated simultaneously. This allows the identification results of the common boundary to be continuously transmitted to the boundary discretization and background mesh construction process, maintaining the consistency of cross-surface boundary data source and processing order.

[0018] By merging the triangular discrete data of multiple host surfaces into a three-dimensional background mesh and establishing a unified two-dimensional parameter domain while maintaining the connection relationship of triangular elements, multiple hull CAD surfaces that originally had different local parameter coordinates can share the same two-dimensional mesh generation area, thereby avoiding the need to generate target meshes separately in the local parameter domains of each host surface and then process the cross-surface splicing relationship.

[0019] By enabling unstructured mesh generation paths and regular mesh generation paths to share ordered two-dimensional boundary constraints, unified two-dimensional parameter domains, and two-dimensional-three-dimensional inverse mapping relationships, triangular or quadrilateral target meshes can be generated according to a predetermined mesh type without changing the preceding virtual topology fusion and background mesh parameterization process.

[0020] By locating the two-dimensional background triangular unit where the target two-dimensional mesh node is located, and calculating the three-dimensional mesh node according to the correspondence between the two-dimensional background triangular unit and the corresponding three-dimensional triangular unit, while preserving the topology of the target mesh unit, the node distribution and unit connection relationship in the unified two-dimensional parameter domain can be converted into a three-dimensional hull surface mesh, forming a complete data processing closed loop from multiple hull CAD surfaces, fused virtual surfaces, three-dimensional background mesh, unified two-dimensional parameter domain to three-dimensional target mesh.

[0021] Third, a quantitative verification was conducted using a KCS half-ship model as a typical object. Under the condition of a half-ship hybrid surface mesh with a mesh count of 2429, the geometric quality of the mesh generated by this method was compared with that of meshes of the same magnitude generated by GAMBIT and HyperMesh. The ratio of the inscribed circle radius to the circumscribed circle radius of the mesh generated by this method is 0.924, which is higher than GAMBIT's 0.913 and HyperMesh's 0.908; the twist rates are 0.793, 0.787, and 0.790, respectively, and the results of the three methods are quite close; the side length ratio, dimensional skewness, and dimensional change rate of the mesh generated by this method are 0.703, 0.766, and 0.900, respectively. The above results show that while achieving unified processing and mesh generation of multiple hull CAD surfaces, the resulting mesh can maintain good unit shape quality and continuous mesh scale transition, verifying the effectiveness of the proposed technical solution in the generation of composite hull surface meshes.

[0022] Fourth, this invention can form a combined surface mesh generation software module or an independent mesh preprocessing system for preprocessing of potential flow hydrodynamic analysis of ships, and can be integrated into ship design, numerical tank, potential flow hydrodynamic analysis and related CAE software platforms. By automatically identifying and virtually fusing the common boundaries of multiple hull CAD surfaces, and establishing a unified two-dimensional parameter domain and two-dimensional-three-dimensional mapping relationship, the repeated boundary confirmation, surface adjustment, parameter setting and mesh splicing operations for single surfaces in traditional combined surface processing can be reduced, thus reducing the reliance on manual experience in mesh preprocessing of complex hull models.

[0023] This invention performs logical topology reorganization while maintaining the underlying CAD surface geometry definition. When the mesh type or mesh scale changes, the target mesh can be regenerated based on the existing fused virtual surfaces, boundary constraints, and unified parameter domain, without repeatedly modifying the original hull geometry. This improves model reusability and preprocessing efficiency under multiple working conditions and multiple mesh schemes. The method can generate both unstructured triangular meshes and regular quadrilateral meshes. Both types of target meshes can share the preceding virtual topology processing and 2D-3D mapping data, which helps reduce the cost of redundant software function development and data maintenance.

[0024] Fifth, existing technologies already include methods for virtual topology, combined surface processing, and composite surface mesh generation. Therefore, the technical contribution of this invention is not to propose virtual topology or surface parameterization separately, but rather to construct a combined surface mesh generation method that addresses the characteristics of ship hull CAD models, which consist of a large number of independently trimmed surfaces, have complex common boundary relationships, and have independent local parameter domains. This method integrates common boundary determination, virtual surface fusion, topology reconstruction, 3D background mesh construction, unified 2D parameterization, target 2D mesh generation, and 3D inverse mapping.

[0025] This invention enables multiple host surfaces to form a unified logical surface domain without altering the underlying geometric definition. Furthermore, it integrates the fused topological relationships, unified two-dimensional computational domain, and two-dimensional-three-dimensional positional correspondences, providing a common geometric and topological processing foundation for different target mesh generation methods. Therefore, this invention primarily addresses the shortcomings of existing technologies in the integrated virtual fusion, unified parameterization, and multi-type target mesh generation technology chain for multi-surface ship hull models.

[0026] Sixth, this invention establishes an independent virtual topology layer on top of the real CAD surface, separating the geometric entities from the logical topological relationships required for mesh generation. This allows for the elimination of hidden common boundaries and the reconstruction of fused surface topology without modifying the host surface geometry. Furthermore, a unified two-dimensional parameter domain is established by covering multiple host surfaces with a three-dimensional background mesh. This transforms previously independent local parameter domains into a two-dimensional computational region capable of jointly generating nodes, determining validity, and organizing topology. The two-dimensional-three-dimensional correspondence of the background mesh is then used to complete the inverse mapping of the target mesh. This forms a complete processing path from multi-surface input to continuous three-dimensional surface mesh output, solving the problem of unifying the organization of cross-surface boundaries, parameter domains, and mesh topology.

[0027] Seventh, the technological advancement of this invention is mainly reflected in changing the technical path of directly relying on underlying CAD geometry modification or independent processing of single surfaces during the generation of composite surface meshes. By establishing a dynamically reconfigurable virtual topology layer on top of the real geometry, and further establishing a unified two-dimensional parameter domain covering multiple host surfaces, the geometric definition, logical topology, and target mesh generation processes are decoupled. While maintaining the original hull surface geometry, unified mesh generation of multiple surfaces is achieved, thereby improving the integrity, repeatability, and engineering applicability of composite surface processing. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the disclosure of this invention and, together with the description, serve to explain the principles of the disclosure of this invention. Figure 1 This is a flowchart of a method for generating composite hull surface mesh based on virtual topology provided in an embodiment of the present invention; Figure 2 This is a flowchart of the public boundary confirmation and virtual fusion process provided in the embodiments of the present invention; Figure 3 This is a flowchart of the unified two-dimensional parameter domain mesh generation and three-dimensional inverse mapping provided in the embodiments of the present invention; Figure 4 This is an external boundary diagram provided by the embodiments of the present invention, in which the original common boundary no longer constitutes a fused virtual surface after fusion; wherein, (a) is a virtual fusion diagram of adjacent boundaries, and (b) is a topology modification diagram of the original boundary; Figure 5 This is a diagram showing multiple host surfaces organized by a fused virtual surface, provided in an embodiment of the present invention; wherein, (a) is a schematic diagram of virtual fusion of adjacent surfaces, and (b) is a schematic diagram of topological modification of the original surfaces; Figure 6 This is a diagram of the actual boundary changes before and after fusion provided by an embodiment of the present invention; wherein, (a) is a schematic diagram of the original KCS surface model, and (b) is a schematic diagram of the surface model after virtual fusion; Figure 7 This is a three-dimensional geometric shape diagram of the virtual fused surface provided in the embodiments of the present invention; Figure 8 This is a unified two-dimensional parameter domain diagram of fused virtual surfaces provided in the embodiments of the present invention; Figure 9 This is a diagram showing the unstructured 3D mesh generation result provided in an embodiment of the present invention; Figure 10 This is a diagram showing the generated three-dimensional mesh structure provided in an embodiment of the present invention; Figure 11 This is a three-dimensional hull surface hybrid mesh result diagram provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0030] The core innovations of the virtual topology-based hull composite surface mesh generation method and system provided in this invention are mainly reflected in the following aspects: (1) Constructing a virtual topology fusion and continuous common boundary processing mechanism for ship hull composite surfaces. Addressing the issues of inconsistent boundary representations, independent local parameter domains, and difficulty in directly using the original topological relationships for overall mesh generation between adjacent surfaces in the ship hull CAD model, this invention establishes a virtual topology layer composed of virtual surfaces, virtual edges, and boundary rings on top of the underlying real CAD surfaces, allowing the real surfaces to retain their original geometric definitions as host surfaces. For common boundaries between different virtual surfaces, candidate boundaries are determined not only based on the spatial proximity between virtual edges but also by combining the corresponding endpoints and their order within the boundary ring, extracting continuous candidate paths bidirectionally along the boundary ring from the corresponding endpoints, and determining the common boundaries to be hidden by filtering based on path validity. After completing the hidden boundary removal, the remaining virtual edges, host surface sets, and outer and inner rings are synchronously reorganized, ensuring that the fused virtual surfaces maintain complete boundaries and topological relationships. Thus, the ship hull region, originally composed of multiple independent CAD surfaces, is organized into a fused surface domain that can be processed as a whole at the logical layer, without requiring surface reconstruction or trimming of the underlying geometry of the host surfaces.

[0031] (2) Establishing a unified two-dimensional parameter domain for multiple host surfaces based on a three-dimensional background mesh. After virtual topology fusion, although multiple host surfaces form a continuous region in logical topology, the local parameter domains of each host surface are still independent of each other and cannot be directly used as a unified two-dimensional mesh generation space. To address this problem, this invention first forms triangular discrete data for multiple host surfaces according to the outer and inner ring constraints of the fused virtual surface, and performs node merging, element direction processing, and degenerate element checking to construct a three-dimensional background mesh covering the entire fused virtual surface; then, while maintaining the connection relationship of the triangular elements of the three-dimensional background mesh, the background mesh is parameterized in two dimensions, so that each three-dimensional background node obtains a one-to-one corresponding two-dimensional parameter coordinate, and the validity of the parameterization result is ensured by the directed area verification of the two-dimensional triangular elements. Thus, the three-dimensional background mesh is used as a common discrete carrier for multiple host surfaces, and the originally independent local parameter domains are transformed into a unified two-dimensional computational domain consistent with the topology of the fused virtual surface, providing a common computational basis for node generation, position determination, and target mesh topology organization across host surfaces.

[0032] (3) Constructing a unified generation and inverse mapping mechanism that separates background mesh positioning from target mesh topology. This invention uses the three-dimensional background mesh and its unified two-dimensional parameter domain as the location mapping carrier, while the target two-dimensional mesh to be generated is used as the node distribution and unit topology carrier. The two types of meshes perform different functions. After the ordered boundary constraints of the fused virtual surface are transformed into the unified two-dimensional parameter domain, the unstructured mesh generation path or the regular mesh generation path can be selected according to the target mesh type. The two paths share the preceding virtual topology fusion, three-dimensional background mesh and unified two-dimensional parameter domain, and also share the subsequent two-dimensional to three-dimensional inverse mapping relationship. For each generated target two-dimensional mesh node, its triangular element in the two-dimensional background triangular mesh is determined and the centroid coordinates are calculated. Then, the corresponding three-dimensional position is obtained using the three-dimensional background triangular element with the same element index. During the inverse mapping process, the target two-dimensional mesh node index and unit topology remain unchanged, so there is no need to re-determine the connection relationship between target nodes in three-dimensional space. This processing method realizes the data connection between common boundary processing, unified parameterization, different target mesh generation paths and two-dimensional to three-dimensional mapping, and enables different types of target meshes to reuse the same combined curved surface preprocessing and inverse mapping framework.

[0033] In practical applications, hull CAD surfaces are real surface objects in the geometric model; host surfaces are hull CAD surfaces registered by virtual surfaces and carrying actual geometric evaluation; virtual surfaces are topological objects that logically organize one or more host surfaces; virtual edges are logical boundary objects that reference one or more real boundaries and record direction, endpoints, and stability identifiers. A merged virtual surface is formed by completing the common boundary culling and reorganizing the remaining boundaries of two virtual surfaces, and its host surface set includes the host surfaces of the two virtual surfaces before merging. Thus, virtual fusion changes the logical relationships between surfaces, edges, and boundary loops, without altering the geometric definition of the host surfaces. Through these operations, without changing the underlying hull CAD surface geometric definition, the common boundaries between multiple surfaces are culled, forming a surface domain that can be uniformly discretized, parameterized, and meshed. This reduces the difficulty of geometric preprocessing for generating composite surface meshes, enabling the generation of complex composite surface meshes from multiple hull surfaces.

[0034] Example 1, such as Figure 1 As shown, the method for generating ship hull composite surface mesh based on virtual topology provided in this embodiment of the invention includes the following steps: S1. Obtain the geometric model and surface boundaries containing multiple hull CAD surfaces, establish virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; establish virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer; The input geometric model can be in the form of CAD data that provides surfaces, boundaries, endpoints, and geometric evaluation capabilities. This embodiment does not require a specific file format. The hull CAD surfaces in the geometric model are traversed, and a virtual surface is created for each hull CAD surface. This hull CAD surface is then registered as the host surface of the corresponding virtual surface. Initially, one virtual surface corresponds to one host surface; after virtual fusion, one fused virtual surface can correspond to multiple host surfaces.

[0035] Virtual edges are created for the real boundaries of each host surface. Each virtual edge references the corresponding real boundary, records the direction and two endpoints of the real boundary in the current boundary ring, and saves its associated virtual surface and its in-surface edge index. The virtual edges are organized according to the ring order of the real boundaries on the host surface to form the outer ring of the virtual surface; when the host surface has holes or other internal closed boundaries, an inner ring is also formed accordingly. The boundary ring is represented by an ordered sequence of virtual edges, and adjacent virtual edges are connected by sharing endpoints.

[0036] Assign a stable identifier to each virtual edge. This stable identifier is independent of the virtual edge's temporary position within the current container and is used to locate the current virtual edge and cached historical virtual edges after virtual face merging, removal, or reorganization. Establish a first mapping from hull CAD surface identifiers to virtual surface indices, and a second mapping from virtual surface indices to hull CAD surface identifiers. The first mapping is used to locate the virtual surface to which the virtual surface currently belongs based on the real surface, and the second mapping is used to trace the host surface set from the virtual surface. This step yields virtual surfaces, virtual edges, boundary loops, and bidirectional mapping relationships separated from the underlying geometry.

[0037] S2. Generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, extract candidate paths bidirectionally along the boundary ring, and after filtering the path validity, determine the continuous boundary paths that correspond to each other on both sides as the common boundaries to be hidden. Adjacent hull CAD surfaces may be connected by a single real boundary, or they may each have multiple boundaries that are geometrically close but not topologically shared. Therefore, in this embodiment, candidate boundary combinations are first generated based on spatial proximity, and then the endpoints and continuous paths of the boundary loop are used to confirm the common boundaries to be hidden, without requiring the input model to have a complete and consistent original topological adjacency relationship.

[0038] An axis-aligned bounding box is constructed based on the spatial extent of the real boundary referenced by each virtual edge, and a virtual edge spatial index is built from each axis-aligned bounding box. A query threshold is determined based on a preset distance tolerance, and virtual edge pairs with mutually adjacent spatial extents are queried using the spatial index. For each queried virtual edge pair, the virtual edge index is converted into a virtual face index and an edge index within that virtual face, respectively. Cases where two virtual edges belong to the same virtual face are excluded, and the remaining virtual edge pairs are registered as candidate boundary combinations across virtual faces.

[0039] Endpoints are extracted from the virtual edges on both sides involved in the candidate boundary combination. The spatial distance between the two endpoints is calculated, and endpoints with a distance not greater than a preset distance threshold are identified as the corresponding endpoints. If multiple endpoints map to the same boundary ring vertex, they are merged into the same corresponding position to avoid repeated segmentation due to multiple virtual edges sharing vertices. The endpoints are sorted according to their positions in the boundary ring of one side of the virtual face, so that subsequent path search follows the actual connection order of the boundary ring.

[0040] For adjacent corresponding endpoints, candidate paths connecting the two endpoints are extracted along the forward and reverse directions in the boundary rings of the virtual faces on both sides. It is checked whether the candidate paths consist of consecutive virtual edges from the aforementioned candidate boundary combinations; if only one direction meets the condition, the path in that direction is selected; if both directions meet the condition, the path with fewer virtual edges is selected. After obtaining consecutive boundary paths on both sides, the two paths are determined as the common boundary to be hidden. This process can adapt to situations where the common boundary consists of multiple consecutive virtual edges, but it does not consider the fusion scenario covering the entire boundary ring as an execution condition in this embodiment.

[0041] This step currently uses spatial proximity, corresponding endpoints, and continuous path relationships of boundary loops to confirm the common boundary, without using normal continuity criteria or boundary midpoint distance criteria as necessary judgment conditions. The resulting output includes two virtual faces participating in the fusion, sequences of virtual edges to be hidden on both sides, and stable markers for subsequent tracking.

[0042] S3. Remove the common boundary to be hidden in the two virtual surfaces to be merged, and merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before merging with the resulting merged virtual surfaces, and update the association between the hull CAD surface and the virtual surfaces. like Figure 2 , Figure 4 Figures (a) and (b) in the text Figure 5 Figures (a) and (b) in the text Figure 6As shown in Figures (a) and (b), before fusion, the virtual edges, stability identifiers, and existing discrete information corresponding to the common boundaries to be hidden on both sides are cached. Then, the corresponding common boundaries are removed from the virtual edge sets and boundary rings of the two virtual surfaces to be fused. The removed virtual edges no longer constitute the external boundaries of the fused virtual surfaces, but can be located by subsequent boundary discretization or constraint propagation processes through stability identifiers.

[0043] Merge the host surface sets of two virtual surfaces. For the virtual edges remaining after removing the common boundary, check their endpoint connectivity; for adjacent virtual edges that share endpoints and satisfy the connection conditions, adjust their directions according to the actual connection order, and combine the real boundaries they reference into new virtual edges in sequence. The new virtual edge records the start point, end point, direction, and the sequence of real boundaries referenced after the combination, so that a logical virtual edge can cross multiple consecutive real boundaries.

[0044] Construct a closed boundary loop based on the endpoint connectivity of the remaining virtual edges. Connect the virtual edges sequentially along the shared endpoints until returning to the starting point to obtain a closed loop; distinguish the outer loop and inner loop based on the inclusion relationship of the closed loop. Replace the two original virtual surfaces participating in the fusion with the newly created fused virtual surface, and register the merged host surface set, the remaining virtual edges, and the reconstructed outer and inner loops into the fused virtual surface.

[0045] Update the first and second mappings so that all host surfaces of the two original virtual surfaces point to the new merged virtual surface, and enable the merged virtual surface to retrieve all host surface identifiers in reverse. Update expired temporary indexes while preserving the association between stable identifiers and cached virtual edges. After one fusion is completed, reconstruct the virtual edge space index based on the updated virtual surface and virtual edge set to continue searching for other candidate boundaries across virtual surfaces. Iterate through the above process for fusionable virtual surfaces until no more common boundaries satisfying the conditions for culling are generated in this process.

[0046] After this step, multiple hull CAD surfaces retain their individual geometric definitions, but are uniformly organized by the same merged virtual surface in the virtual topology layer. The original common boundary is replaced by the internal association of the merged virtual surface and no longer serves as an external boundary constraint that the target mesh must conform to line by line.

[0047] S4. The outer and inner rings of the fused virtual surface are discretized in an orderly manner, and triangular discrete data are generated on each host surface and merged. After validity processing, a three-dimensional background mesh covering multiple host surfaces is obtained. The outer and inner rings of the fused virtual surface are discretized in an ordered manner. First, the tangential angle between adjacent virtual edges in the same boundary ring at their common endpoint is calculated. Based on the tangential angle, the boundary ring is divided into one or more boundary segments. The boundary segments maintain their order and orientation within the boundary ring and are used to recover the closed boundary constraints in the two-dimensional parametric domain.

[0048] For each virtual edge, its stability identifier is used to check if a suitable boundary discrete point for the current discrete scale has already been stored. If it exists, the corresponding discrete point is reused; otherwise, discrete points are generated according to the set discrete scale and stored with the stability identifier. When the discrete scale changes, the original boundary discrete points under the corresponding stability identifier are cleared, and then regenerated according to the new discrete scale to prevent inconsistencies between the old discrete constraints and the current mesh size.

[0049] Preferably, the continuous real boundaries referenced by the virtual edges are dispersed at equal intervals according to their cumulative arc lengths. Let the sum of the arc lengths of the real boundaries referenced by the virtual edges be... The number of discrete segments is Then the first The cumulative arc length of the target at each boundary discrete point for: ; in, This represents the total arc length of all consecutive real boundaries referenced by the current virtual edge. This represents the total number of segments along the virtual edge that are discrete with equal arc lengths, and It is a positive integer. Indicates the index of the discrete point on the boundary. This indicates the distance from the starting point of the virtual edge along the specified direction to the first... The cumulative arc length of the target at each boundary discrete point; the number of discrete segments The spacing between the resulting discrete points is determined based on the total arc length of the virtual edge and the currently set boundary discrete scale, so that the spacing between the discrete points is adapted to the current boundary discrete scale.

[0050] When a virtual edge is formed by multiple consecutive real boundaries, the actual arc length of each real boundary in three-dimensional physical space is calculated separately, and then accumulated according to the connection order of each real boundary in the virtual edge. The accumulated arc length is taken as the total arc length of the virtual edge. During the discretization process, the entire virtual edge is treated as a uniform arc length object, instead of independently recalculating the discrete distance for each real boundary.

[0051] For adjacent real boundaries that make up a virtual edge, when advancing to the end of a real boundary according to the current discrete spacing, if the current accumulated arc length has not yet reached the next target discrete position, then discrete points are not forcibly generated at the end of the real boundary. Instead, the remaining arc length is extended to the next connected real boundary, and points are accumulated along the overall direction of the virtual edge to avoid excessively dense or sparse local discrete points due to the segmentation of the real boundary. When performing equal arc length discretization, the 0th discrete point corresponds to the starting point of the virtual edge, and the 1st discrete point corresponds to the starting point of the virtual edge. Each discrete point corresponds to a virtual edge endpoint, and the arc length interval between each adjacent discrete target position is... .

[0052] according to The actual boundary segment into which it falls, the direction of this segment relative to the virtual edge, and the initial cumulative arc length of this segment will... Converted to local parameters corresponding to the true boundary, and then the first parameter is obtained through geometric evaluation of the true boundary. There are three-dimensional boundary discrete points. The discrete points are arranged according to the direction of the boundary segment in the boundary ring, and the shared endpoints of adjacent virtual edges are retained only once, thus obtaining an ordered three-dimensional boundary point sequence of the outer ring and each inner ring.

[0053] Subsequently, regarding such Figure 7 The host surfaces of the fused virtual surface are used to generate triangular discrete data. Each set of data records at least the three-dimensional node coordinates, triangular element connection relationships, and host surface information corresponding to the node or element. The triangular discrete data of each host surface are merged, and nodes corresponding to spatial locations are identified and merged according to a preset distance threshold. At the same time, the triangular element index referencing the merged node is updated.

[0054] The degenerate state and orientation of the merged triangular elements are checked. If a triangular element has duplicate nodes or its area does not meet the validity criteria, it is deleted as a degenerate element. For valid triangular elements whose orientation is inconsistent with the overall convention, the node arrangement is adjusted to unify the orientation of the valid triangular elements. This yields a 3D background mesh covering the merged virtual surface. This background mesh is used for parameterization and inverse mapping, and its triangular element topology is not identical to the final target mesh topology.

[0055] S5. While maintaining the connection relationship of triangular elements in the three-dimensional background mesh, the three-dimensional background mesh is parameterized in two dimensions to generate one-to-one corresponding two-dimensional parameter coordinates for each background mesh node. The parameterized two-dimensional triangular elements are then checked for directed area. The correspondence between the checked two-dimensional parameter coordinates and the three-dimensional background mesh nodes is saved to obtain the unified two-dimensional parameter domain of the fused virtual surface. While maintaining the connection relationships of the triangular elements in the 3D background mesh, we obtain the corresponding 2D parametric coordinates for each background mesh node. First, we determine the first constraint node from the boundary nodes of the background mesh. Then, we calculate the 3D distance between the other boundary nodes and the first constraint node, and determine the boundary node with the largest distance as the second constraint node. We constrain the 2D parametric coordinates of the first constraint node to the origin, and constrain the second constraint node to the 2D coordinate axes, ensuring that the 2D distance between the two constraint nodes corresponds to their 3D distance, thus eliminating translation, rotation, and scale uncertainties in the parametric solution.

[0056] Under the above constraints, least-squares conformal parameterization is performed on the 3D background mesh. The 2D parametric coordinates of all background mesh nodes are then combined to form a parameter vector. The coefficient matrix is ​​established based on the discrete conformal condition of the triangular element. And establish constraint vectors based on the two constraint nodes. The parameter vector is obtained by solving the following equation. : ; Wherein, the coefficient matrix Assembly is performed based on the discrete conformal conditions of each triangular element in the 3D background mesh. For each triangular element, a corresponding local conformal constraint is established based on the geometric relationship of its three nodes in the 3D background mesh, and the coefficients of the local conformal constraint are written into the coefficient matrix according to the global node index of the three nodes of the triangular element. The corresponding positions are determined; all triangular elements are traversed and the local conformal constraints are assembled to form a global least-squares equation system with respect to the two-dimensional parametric coordinates of all background mesh nodes. This construction couples adjacent triangular elements to each other through the shared two-dimensional parametric coordinates of nodes, thereby minimizing discrete conformal errors within the overall background mesh.

[0057] When assembling the global least squares equation system, the two-dimensional parametric coordinates of two pre-determined constraint nodes are added as known constraints to the parametric solution, and constraint vectors are formed accordingly. This eliminates the rigid body degrees of freedom and scale uncertainty in the two-dimensional parameterization process. Parameter vector Organize the two two-dimensional parametric coordinate components of each node according to the background grid node index, coefficient matrix Columns and parameter vectors The coordinate components of the two-dimensional parameter to be determined correspond to each other, and their rows are jointly determined by the discrete conformal constraints of all triangular elements and the constraint processing adopted.

[0058] After the solution is completed, the two-dimensional coordinates of each node are obtained according to the background mesh node index. To check whether there is any flipping or degradation in the unified two-dimensional parameter domain, the directed area is calculated for each parameterized triangular element. For the ... Let there be three triangular elements, and let the two-dimensional parametric coordinates of their three nodes be respectively... , and Its directed area for: ; This formula is a classic algorithm in the field of finite element and geometric processing.

[0059] When any If the area is not greater than a preset area threshold, the parameterization result is deemed invalid and will not be used as the unified two-dimensional parameter domain for subsequent mesh generation; when all When all values ​​exceed a preset area threshold, the corresponding two-dimensional parameter coordinates are saved according to the background mesh node index. The two-dimensional to three-dimensional background mesh correspondence is formed by the three-dimensional background nodes, the two-dimensional parameter coordinates, and the unchanging triangular unit connection relationship.

[0060] Through this step, the discrete data, originally located in the local parameter domains of multiple host surfaces, are expressed as... Figure 8 Within the same two-dimensional coordinate domain, the outer and inner rings of the fused virtual surface can be projected onto this unified two-dimensional parameter domain according to the correspondence of background mesh nodes. Subsequent two-dimensional mesh generation does not need to be limited by the original local parameter domains of each host surface.

[0061] S6. Transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring order; based on the ordered two-dimensional boundary constraints, generate the target two-dimensional mesh nodes and target mesh cell topology using the selected target mesh generation path; This embodiment provides both unstructured mesh paths and regular mesh paths. One of the two paths can be executed, both taking a unified two-dimensional parameter domain and ordered boundary constraints as input, and both outputting the target two-dimensional mesh nodes and the target mesh cell topology. This embodiment does not require the program to automatically identify the hull region and automatically select a path; the calling process can specify one of the paths based on the boundary form of the virtual surface to be processed or the predetermined mesh requirements.

[0062] In the unstructured mesh path, the discrete boundary points of the outer and inner rings are projected onto a unified two-dimensional parameter domain based on the correspondence between 2D and 3D background nodes. Two-dimensional boundary points are sequentially pieced together according to the direction of each boundary segment in its corresponding boundary ring, retaining only one repeated endpoint of adjacent boundary segments, forming a closed 2D boundary point sequence for the outer ring and each inner ring. An initial advancing front is established using this closed 2D boundary point sequence, and the advancing front is iteratively advanced within the unified 2D parameter domain. During the advancing process, new 2D nodes are generated, and a triangular target mesh element topology is established based on the connection relationships between the already generated nodes. When the advancing process stops, the 2D nodes and their corresponding element connection relationships are stored in the target 2D mesh data, resulting in the unstructured target 2D mesh.

[0063] In the regular mesh path, the discrete boundary points of the fused virtual surface are transformed into a unified two-dimensional parameter domain. The two-dimensional boundary points are organized into four ordered boundary point columns according to the boundary ring sequence, allowing adjacent ordered boundary point columns to share corner points. The number of nodes in two parameter directions is determined based on the two relative boundary point columns, and internal two-dimensional mesh nodes are generated between the relative boundaries. A quadrilateral target mesh cell topology is established according to the connection relationships between adjacent nodes in the two parameter directions, and the two-dimensional nodes and quadrilateral cell connection relationships are stored in the target two-dimensional mesh data to obtain the regular target two-dimensional mesh.

[0064] Both paths generate target 2D meshes that are distinct from the triangular background mesh obtained in step S4. The background mesh provides unified parameterization and a 2D-3D positional correspondence, while the target 2D mesh determines the node distribution and element type of the final hull surface mesh. Therefore, different 2D mesh generation methods can be selected without changing the background mesh data organization and inverse mapping interface. Figure 9 and Figure 10 The 3D results after inverse mapping of unstructured mesh paths and regular mesh paths are shown respectively.

[0065] S7. Determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, obtain the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit. Connect the three-dimensional mesh nodes according to the topology of the target mesh unit to form a three-dimensional hull surface mesh. like Figure 3 As shown, for each target 2D mesh node, the 2D triangular element containing that node is determined in the 2D background mesh. The triangular elements of the 3D background mesh can be traversed, and the coordinates of each triangular element node in a unified 2D parameter domain can be read. Elements whose 2D parameter coordinates form degenerate triangles are first excluded, and then the centroid coordinates of the target 2D mesh node relative to the current 2D triangular element are calculated.

[0066] For the target two-dimensional grid node and the nodes of the current two-dimensional triangular unit , and centroid coordinates , and satisfy: ; This formula is also a classic formula in the field of finite element and geometric processing. It calculates the new node coordinates by linear interpolation using the coordinates of existing nodes.

[0067] when , and When all values ​​are not less than zero, the target 2D mesh node is determined to be located within the current 2D triangular element, and this element is designated as the corresponding 2D triangular element. When the target 2D mesh node is located on the edge or vertex of the current 2D background triangular element, such that one or more centroid coordinates are equal to zero while the remaining centroid coordinates are not less than zero, the inclusion relationship determination condition is still satisfied, and the current 2D background triangular element is designated as the corresponding 2D background triangular element of the target 2D mesh node. When a node falls within the determination range of multiple triangular elements simultaneously due to floating-point errors, the centroid coordinates are allowed to be not less than -1×10⁻¹⁰, and negative values ​​within the allowed range are truncated to zero. The centroid coordinates are then normalized and interpolated. If no triangular element satisfying the condition is found, the boundary of the triangle closest to the node is selected; adsorption is performed only if this distance is not greater than the UV mapping tolerance; otherwise, mapping is deemed to have failed.

[0068] Obtain 3D triangular elements with the same element index from the 3D background mesh, and let their three 3D nodes be... , and Then the three-dimensional coordinates of the target node for: ; For each target 2D mesh node, a corresponding 3D mesh node is generated, ensuring both have the same node index. For unstructured target 2D meshes, 3D mesh nodes are connected according to their triangular target mesh element topology; for regular target 2D meshes, 3D mesh nodes are connected according to their quadrilateral target mesh element topology. This forms a triangular or quadrilateral 3D hull surface mesh covering multiple host surfaces, which can be combined to obtain, for example... Figure 11 The three-dimensional hull surface hybrid mesh is shown.

[0069] During the inverse mapping process, the element topology of the target 2D mesh is reused, and the 3D position of the nodes is calculated only through the one-to-one correspondence between the 2D background triangular elements and the 3D background triangular elements. Therefore, the target mesh connectivity across the common boundary of the original host surface in the unified 2D parameter domain can be preserved in the 3D result, and the hidden common boundary is no longer forced to become the final mesh element boundary.

[0070] Furthermore, this embodiment can be implemented in the following manner to address different ship hull CAD model states and target mesh generation requirements.

[0071] When the input ship hull CAD model consists of multiple independent surfaces, and although adjacent surfaces are spatially connected, reliable shared topological relationships are not preserved, the common boundary is not determined directly based on the topological adjacency information between the original surfaces. Instead, virtual surfaces, virtual edges, and boundary loops are established separately according to step S1, and candidate boundary relationships are re-established according to step S2 using the spatial proximity relationship of the virtual edges. For ship hull models obtained through data exchange, even if adjacent surfaces are saved as independent surfaces, virtual topological objects can be established based on their respective real boundaries, and the common boundaries to be hidden on both sides can be determined through endpoint correspondence and continuous paths of boundary loops. This reduces the dependence of the combined surface mesh generation on the original topological integrity of the input CAD model and solves the problem of not being able to directly establish cross-surface mesh connection relationships due to the lack of shared topological information.

[0072] When the common splicing position of two adjacent host surfaces is represented by different boundary segmentation methods—for example, one side is represented by a single real boundary, while the other side is represented by multiple consecutive real boundaries—the equal number of boundaries on both sides is not used as a condition for confirming the common boundary. First, a set of potentially corresponding virtual edges is obtained through spatial proximity query. Then, the corresponding endpoints on both sides are determined, and continuous paths connecting adjacent corresponding endpoints are extracted according to the order of the endpoints in their respective boundary rings. For one side composed of multiple consecutive virtual edges, the continuous path is treated as a whole and a correspondence is established with the path on the other side. This allows for handling common boundary relationships between one-to-one, one-to-many, and multiple consecutive boundaries, avoiding missed identification of common boundaries and surface fusion failures caused by different CAD model surface trimming and boundary segmentation methods.

[0073] When the region to be processed consists of three or more hull CAD surfaces continuously stitched together, after each round of common boundary culling and virtual surface fusion, the host surface set, remaining virtual edges, outer loop, inner loop, and the mapping relationship between real surfaces and virtual surfaces are updated, and the virtual edge space index is re-established based on the updated virtual topology. Fusion continues as long as there are still common boundaries to be culled that satisfy the conditions of step S2, until no new common boundaries to be culled are obtained. Through successive fusion and topology reconstruction, multiple originally independent surfaces can form one or more continuous fused virtual surfaces in the virtual topology layer, without changing the underlying geometric definition of each host surface. This solves the problems of a large number of boundaries, fragmented mesh constraints, and difficulty in uniformly organizing cross-surface data in multi-surface continuous stitching regions.

[0074] When a merged virtual edge references multiple consecutive real boundaries, the cumulative arc length of the entire virtual edge in 3D physical space is used as a unified metric, without restarting discretization on each real boundary separately. If the end of a real boundary has not yet reached the next target discretization position, the remaining arc length is passed to the next real boundary. When the local parameter direction of the real boundary is opposite to the specified direction of the virtual edge, local parameter conversion is performed based on the directional relationship, but the order of the final discretization points along the overall direction of the virtual edge remains unchanged. This method reduces the occurrence of node concentration, abrupt spacing changes, or repeated endpoints at the original boundary segmentation positions, ensuring that the final boundary node distribution is primarily controlled by the target mesh scale, rather than by the original CAD boundary segmentation method.

[0075] When the boundary shape of the virtual surface to be processed is complex, the curvature changes significantly, or it is difficult to organize it into a regular quadrilateral region, an unstructured target mesh generation path can be selected in step S6. Within a unified two-dimensional parameter domain, a propulsion front is established according to closed boundary constraints, and a triangular target mesh is generated. This method can be used for areas with significant local geometric changes, such as the bow, stern, bulbous bow, or other areas with large local geometric changes. For areas with relatively gentle geometric changes and whose boundaries can be organized into four sets of ordered boundary point sequences, a regular mesh generation path can be selected. By coordinating the number of relative boundary nodes, internal nodes and quadrilateral topology are generated within a unified two-dimensional parameter domain according to two parameter directions. This method can be used for areas such as the midsection of a ship.

[0076] In this embodiment, to ensure continuous data transfer between steps, different levels of identification relationships are used for the real geometry, virtual topology, background mesh, and target mesh.

[0077] The real geometry layer stores the hull CAD surface identifiers and real boundary references; the virtual topology layer stores the virtual surface index, virtual edge stability identifiers, host surface set, and outer and inner loops; the background mesh layer stores the 3D node index, triangular element node index, and 2D parameter coordinates corresponding to the 3D nodes; and the target mesh layer stores the target 2D node index and target element connection relationships.

[0078] The first and second mappings are used to connect the real geometry layer and the virtual topology layer. Virtual edge stability identifiers are used to connect the boundary data before and after virtual topology fusion, and to obtain or update boundary discrete points. Background mesh node indices are used to connect 3D background nodes and 2D parametric coordinates; the same background triangular element uses the same three node indices in both 3D space and the unified 2D parametric domain. The target 2D node indices remain unchanged before and after the inverse mapping, allowing the target element connectivity to be directly reused in the 3D hull surface mesh.

[0079] For example, a target 2D triangular element records three target 2D node indices in the 2D mesh data. After performing barycentric coordinate inverse mapping on these three nodes, three 3D nodes with the same index are generated. In the output stage, there is no need to re-determine the connection relationships between the 3D nodes; it is only necessary to build the 3D triangular element according to the original three indices. Regular quadrilateral meshes retain four node indices in the same way. This data organization separates the two functions of the background mesh for positioning and the target mesh for topology definition.

[0080] In this embodiment, the boundary order simultaneously affects the confirmation of the common boundary path, the discretization of the background mesh boundary, and the closure constraint of the two-dimensional target mesh. Therefore, the boundary loop direction is retained in each processing stage.

[0081] In step S2, the corresponding endpoints are sorted according to their positions in the boundary ring, and consecutive candidate paths are selected in the two directions of the boundary ring; in step S3, the virtual edge directions are adjusted according to the shared endpoints before connecting the remaining virtual edges, so that the end point of the previous virtual edge corresponds to the start point of the next virtual edge; in step S4, the discrete points are arranged according to the direction of the reconstructed boundary ring.

[0082] After converting the boundary points to a unified two-dimensional parameter domain, the splicing continues according to the original boundary segment order. For two adjacent boundary segments, if the endpoint of the first segment and the starting point of the second segment represent the same shared endpoint, only one two-dimensional point is retained; for a closed boundary point sequence, the endpoint of the last segment and the starting point of the first segment are treated as the same closed position. This avoids the same corner point from appearing repeatedly in the target two-dimensional mesh boundary, and also avoids intersecting initial advancing fronts or incorrect four-boundary organization caused by the reversal of the local boundary point order.

[0083] When a virtual edge is formed by combining multiple real boundaries, each real boundary can have the same or opposite local parameter direction as the virtual edge. Cumulative arc length discretization first determines the target arc length under the overall direction of the virtual edge, and then calculates the local parameters based on the segment containing the target arc length and its direction. Therefore, the different directions of parameter increase of the real boundaries themselves do not change the overall order of the discrete points of the virtual edge arranged along the boundary ring.

[0084] This embodiment also performs validity checks on data states that could compromise subsequent processing at different stages.

[0085] When constructing candidate boundary combinations, virtual edge pairs belonging to the same virtual face are excluded to prevent the interior of the same boundary loop from being incorrectly identified as a cross-face common boundary. When confirming a common boundary, it is required that both sides can form a continuous path composed of candidate virtual edges between their corresponding endpoints; candidate combinations that cannot form a continuous path do not proceed to the fusion step.

[0086] When constructing the merged virtual surface, closed loops are reconstructed based on the endpoint connectivity of the remaining virtual edges. Only virtual edge sequences that can form closed connections are used as outer or inner loops for subsequent discretization. When constructing the 3D background mesh, after merging corresponding nodes, the triangular elements are checked for duplicate nodes and for consistent element orientations. Degenerate elements are deleted, and the node order of valid elements is adjusted to prevent invalid triangular elements from entering the parametric solution.

[0087] After 2D parameterization, a unified check is performed using the directed area of ​​triangular elements. A preset area threshold is used to exclude 2D degenerate elements and orientation-flipped elements; if any elements do not meet the conditions, the parameterization result is not considered a valid unified 2D parameter domain and is not included in the target 2D mesh generation. During 3D inverse mapping, background elements forming degenerate triangles with 2D coordinates are also excluded first, and only inclusion relationships where all three centroid coordinates are not less than zero are accepted. The above checks apply to the common boundary path, fused boundary loop, background triangular elements, 2D parameterization result, and 2D point localization respectively, and should not be combined into a single, unverified boundary correction step.

[0088] The following is combined Figures 1 to 11 To further explain a complete processing procedure.

[0089] First, input a model composed of multiple ship hull CAD surfaces, and establish initial virtual surfaces and virtual edges based on each surface and its real boundaries. Figure 1 The output corresponding to the virtual topology layer constructed in the middle is a set of virtual surfaces, a set of virtual edges, a boundary loop, and a bidirectional mapping between real surfaces and virtual surfaces, rather than a new CAD surface.

[0090] Then, a virtual edge space index is established to query the adjacent virtual edge pairs across the virtual face, and continuous boundary paths are extracted based on the positions of the corresponding endpoints in the boundary rings on both sides. Figure 2 The result of the common boundary confirmation process shown is the sequence of virtual edges that need to be hidden on both sides. After removing these virtual edges, the host surface sets on both sides are merged, and the remaining boundary is reconstructed by connecting and closing loops to form a merged virtual surface. Figure 4 Figure (a) shows the virtual merging of adjacent boundaries. Figure 4 Figure (b) shows the topological modification of the original boundary, illustrating that the original common boundary no longer constitutes the outer boundary of the merged virtual surface after merging. Figure 5 Figure (a) shows the virtual fusion of adjacent surfaces. Figure 5 Figure (b) shows the topological modification of the original surface, used to illustrate that multiple host surfaces are jointly organized by the fused virtual surface. Figure 6 Figure (a) shows the original KCS surface model. Figure 6Figure (b) shows the virtual fused surface model, used to compare the actual boundary changes before and after fusion. The above schematic relationships and results do not indicate that the underlying host surface has been refitted into a new geometric surface.

[0091] Again Figure 7 The outer and inner rings of the fused virtual surface, along with each host surface, are discretized. The triangular discretized data of the host surfaces are merged to obtain a 3D background mesh with common node indices and element connectivity. Two-dimensional parameterization is then performed on this background mesh, giving each 3D background node two-dimensional parametric coordinates. These coordinates are then checked using a directed area check to form... Figure 8 The unified two-dimensional parameter domain is shown. At this point, the node connection relationships of the background triangular elements remain unchanged; only the node coordinates have been expanded from three-dimensional coordinates to include corresponding two-dimensional parameter coordinates.

[0092] Finally, select according to the predetermined grid type. Figure 3 The unstructured or regular paths in the model are used. Both paths use ordered 2D boundaries with fused virtual surfaces to generate target 2D nodes and target cell topologies distinct from the background mesh. The background triangular cells containing each target 2D node are located one by one, the 3D node positions are calculated using barycentric coordinates, and the 3D nodes are connected according to the target cell topology to obtain the desired result. Figure 9 The unstructured mesh results shown are or Figure 10 The shown regular grid result can be formed. Figure 11 The image shows a hybrid mesh on the 3D hull surface. The data changes in this complete process are as follows: multiple real surfaces and independent boundaries, merging virtual surfaces and reconstructing boundaries, 3D background mesh, unified 2D parameter domain, target 2D mesh, and 3D target mesh.

[0093] In this embodiment, the preset distance tolerance, boundary discrete scale, and preset area threshold can all be determined based on the geometric scale of the input model and the target mesh scale.

[0094] When distance tolerance is used for spatial proximity queries, endpoint mapping, or background node merging, it should serve its respective processing purpose; the same value can be used in the same implementation, or they can be set separately. When the boundary discrete scale changes, the corresponding cache should be invalidated synchronously to avoid mixing discrete points of different scales in the same boundary ring.

[0095] As a method of determining the model scale, a basic tolerance can be set first. And based on the diagonal length of the overall enclosure box of the hull l and relative scaling factor Calculate the distance tolerance used for endpoint consistency and vertex cluster merging. .in, As the set basic tolerance, This is the relative scaling factor. lThis refers to the diagonal length of the overall enclosure box of the hull. In the implementation using this scale-related method, the preset distance threshold corresponding to the endpoints can be taken as described above. ; and As an implementation parameter setting, this embodiment does not limit its specific numerical range.

[0096] For virtual edge space proximity queries, the aforementioned distance tolerance can be used as the inflation amount of the axis-aligned bounding box. ,Right now Expand the bounding boxes of the real boundaries referenced by each virtual edge along each coordinate direction, and use the minimum distance between the expanded bounding boxes as the basis for the expansion. With search radius Compare; when When this happens, the corresponding virtual edge pair is included in the spatial neighbor candidate set. The search radius for range queries can be set separately according to the current spatial query purpose. When spatial proximity queries and endpoints are processed using different scales, the corresponding parameters should be set separately, and the two should not be forced to be the same value.

[0097] The boundary discretization scale is determined based on the target mesh scale and the actual arc length of the virtual boundary to be discretized. For the entire virtual boundary, its total arc length in three-dimensional physical space is first calculated, and the target discretization length is determined in conjunction with the preset number of boundary nodes; the number of boundary nodes and the discretization length simultaneously consider the boundary geometric resolution and subsequent mesh topology matching requirements. For regions with regular mesh generation, the number of discretization segments relative to the two boundaries remains consistent, and the discretization length is adjusted in coordination according to the boundary arc length and the number of nodes when necessary; for virtual boundaries composed of multiple continuous boundary segments, the cumulative arc length is discretized uniformly along the entire composite boundary.

[0098] Virtual edge space indexing can employ a hierarchical structure based on axis-aligned bounding boxes, or other spatial retrieval structures capable of returning neighboring boundary pairs based on spatial extent. Two-dimensional parameterization can utilize a solution method that satisfies a one-to-one correspondence between background nodes, preserves triangular element connectivity, and accepts boundary constraints. Unstructured mesh generation can be implemented using a closed boundary leading-edge propagation approach, while regular mesh generation can be implemented by interpolating internal nodes based on four sets of ordered boundaries. All these alternative implementations do not alter the input, output, or constraint propagation relationships of each step.

[0099] Example 2: This embodiment of the invention provides a stable identifier-driven boundary discrete multiplexing method.

[0100] This embodiment adopts the same overall process as Embodiment 1, from steps S1 to S7, with the difference being a further explanation of the boundary constraint transfer before and after virtual surface fusion. During virtual topology initialization, a stability identifier is assigned to each virtual edge, and this stability identifier is used as the query key for the boundary discrete data. When performing common boundary culling, the removed virtual edges, along with their stability identifiers, are stored in a cache; when connecting the remaining virtual edges, the order and direction of the real boundaries referenced by the newly formed virtual edges are recorded.

[0101] Before constructing the 3D background mesh, the discrete data corresponding to the stable identifier is queried based on the currently set discrete scale. If the virtual edges have been discretized before fusion and the discrete scale has not changed, the original discrete points are reused, and the point order is adjusted according to the direction of the current virtual edge or boundary segment. If multiple virtual edges are connected into a new virtual edge, the corresponding discrete points are spliced ​​according to the connection order of the real boundaries they reference, and repeated endpoints of adjacent segments are only retained once. If the discrete scale changes, the old discrete data is deleted and the cumulative arc length equal-distance dispersion is re-executed.

[0102] By using stable identifiers instead of temporary array indices to locate boundary data, the corresponding boundaries can continue to be identified even after the virtual face index and virtual edge container have changed due to the fusion operation. This ensures that boundary discretization, background mesh generation, and 2D boundary organization use a consistent boundary source. This implementation further limits the boundary data organization method of Example 1 and does not change the processing relationship of common boundary confirmation, unified parameterization, and 3D inverse mapping.

[0103] The following sections, in conjunction with steps S1 to S7, further explain the specific usage of the stability identifier at different processing stages.

[0104] In step S1, a stable identifier is assigned to each virtual edge, and the association between the stable identifier and the current virtual edge, and between the stable identifier and cached historical virtual edges are maintained respectively. The position of the virtual edge in the current container or the in-face edge index is used for access in the current processing; when virtual face merging causes the container position or temporary index to change, the temporary index is updated while maintaining the association between the stable identifier and the corresponding boundary data, so that the current virtual edge or cached historical virtual edge can be found according to the stable identifier in the future.

[0105] In steps S2 and S3, after determining the common boundary to be hidden, the stable identifiers of the virtual edge sequences to be hidden on both sides are cached along with the corresponding virtual edges and existing discrete information. After performing common boundary removal and remaining virtual edge reorganization, the association between the stable identifier and the current virtual edge is updated according to the stable identifier, and the historical association between the stable identifier and the removed virtual edge is retained; when it is necessary to track boundary data later, the current virtual edge and the cached historical virtual edges can be found based on the stable identifier. The stable identifier is used for tracking boundary objects and their data, and candidate boundaries across virtual surfaces are still determined by querying the virtual edge space index.

[0106] In step S4, the stability identifier is used as the query key for the boundary discrete data, and the applicability of the queried data is determined based on the current boundary discrete scale. If the cached discrete points are consistent with the current discrete scale, the corresponding point list is obtained and reused; if no corresponding point list is found, discrete points are generated along the continuous real boundary referenced by the virtual edge and stored with the stability identifier; if the discrete scale changes, the original discrete points under the stability identifier are cleared and regenerated. For the recombined virtual edge, reusable boundary discrete data is first obtained based on the stability identifier, and then the point order is adjusted, the point list is spliced, and duplicate endpoints are removed according to the connection order and direction of the real boundary recorded by the current virtual edge.

[0107] In steps S5 and S6, the stabilization identifier is used to maintain the correspondence between the virtual edges in the current boundary ring and the discrete boundary point list obtained in step S4. When transforming the outer or inner ring to a unified two-dimensional parameter domain, the discrete boundary point list corresponding to each virtual edge is obtained sequentially according to the boundary ring order, and then projection and ordered stitching are completed based on the two-dimensional-three-dimensional correspondence of the background mesh nodes; virtual edges that have been removed as common boundaries are no longer used as outer or inner ring constraints for the fused virtual surface. Thus, boundary discretization, background mesh generation, and two-dimensional boundary organization use a consistent boundary source.

[0108] In step S7 of this embodiment, the stability identifier is not used to determine the two-dimensional background triangular cell where the target two-dimensional mesh node is located. The positioning is still completed based on the background mesh node index, the triangular cell node index, and the centroid coordinates. The stability identifier and the background mesh node index are used to associate the virtual boundary data and the background mesh data, respectively, thereby distinguishing the boundary tracing of the virtual topology layer from the two-dimensional-three-dimensional background mesh mapping.

[0109] Example 3: This embodiment of the invention provides a processing interface that can be shared by two target mesh paths.

[0110] This embodiment uses the unified two-dimensional parameter domain obtained in Embodiment 1, and sets the two-dimensional target mesh generation step as a replaceable processing interface. The input of this interface includes the ordered two-dimensional boundary of the fused virtual surface, the two-dimensional background mesh nodes, the background triangular element connection relationship, and the mesh scale requirements. The output is uniformly represented as a two-dimensional node array and a target element connection array.

[0111] When an unstructured path is selected, the target element connectivity array records the three node indices of the triangular elements; when a regular path is selected, the target element connectivity array records the four node indices of the quadrilateral elements. Both results retain the stable indices of each 2D node and are then processed by the same inverse mapping steps to locate the 2D background triangular elements, calculate the centroid coordinates, and generate the 3D nodes. After inverse mapping, the corresponding triangular or quadrilateral topology is restored only based on the target element connectivity array, without changing the parameterization results of the background mesh.

[0112] This embodiment illustrates that two mesh paths can share a preprocessing chain from virtual topology fusion and background mesh construction to 2D parameterization, and can also share a postprocessing chain from 2D to 3D inverse mapping. Which path is used can be specified in advance by the application process, and should not be construed as including automatic classification steps for complex and regular regions in this method.

[0113] In the above embodiments, spatial indexing, two-dimensional parametric solving, and two-dimensional mesh generation can be accomplished by implementations with the same input-output relationship; these existing algorithms or software libraries are used to implement the corresponding functions, but do not change the technical relationship of the present invention, which involves hiding common boundaries through virtual topology, constructing a unified two-dimensional parameter domain, and back-mapping the target two-dimensional mesh into a three-dimensional hull surface mesh.

[0114] Without altering the input, processing constraints, and output relationships, those skilled in the art can adjust the storage format of the virtual topology object, the spatial proximity retrieval method, the two-dimensional parametric solver, or the target two-dimensional mesh generator. As long as it still uses virtual faces and virtual edges to organize multiple host faces, eliminates common boundaries and reconstructs the boundary relationships of the merged virtual faces, generates the target mesh within a unified two-dimensional parameter domain, and forms the hull surface mesh based on the two-dimensional-three-dimensional correspondence of the background mesh, it can all be considered a specific implementation of the technical concept of this invention.

[0115] Example 4: The virtual topology-based hull composite surface mesh generation system provided in this embodiment of the invention includes: The virtual topology construction module is used to acquire the geometric model and surface boundaries of multiple hull CAD surfaces, create virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; create virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; and establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer. The common boundary determination module is used to generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, candidate paths are extracted bidirectionally along the boundary ring, and after path validity screening, the continuous boundary paths corresponding to each other on both sides are determined as the common boundaries to be hidden. The virtual surface fusion and topology reconstruction module is used to remove the common boundary to be hidden in two virtual surfaces to be fused, merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before fusion with the resulting fused virtual surfaces, and update the association relationship between the hull CAD surface and the virtual surfaces. The three-dimensional background mesh construction module is used to perform ordered discretization of the outer and inner rings of the fused virtual surface, generate triangular discrete data on each host surface and merge them, and obtain a three-dimensional background mesh covering multiple host surfaces after validity processing. The unified two-dimensional parameter domain acquisition module is used to parameterize the three-dimensional background mesh in two dimensions while maintaining the connection relationship of triangular elements in the three-dimensional background mesh. It generates one-to-one corresponding two-dimensional parameter coordinates for each background mesh node, performs directed area verification on the parameterized two-dimensional triangular elements, saves the correspondence between the verified two-dimensional parameter coordinates and the three-dimensional background mesh nodes, and obtains the unified two-dimensional parameter domain of the fused virtual surface. The target two-dimensional mesh generation module is used to transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring sequence; based on the ordered two-dimensional boundary constraints, the target two-dimensional mesh nodes and target mesh cell topology are generated using the selected target mesh generation path; The inverse mapping module is used to determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit is obtained. The three-dimensional mesh nodes are connected according to the topology of the target mesh unit to form a three-dimensional ship hull surface mesh.

[0116] This invention uses a KCS ship hull model as a typical input model for mesh generation verification. For the original ship hull model, without virtual surface fusion, each adjacent surface generates a mesh separately. Due to the numerous fragmented common boundaries between the original surfaces, abrupt changes in mesh size, discontinuous node distribution, and local element shape distortion easily occur at the surface splicing locations. After adopting the virtual topology processing described in this embodiment, redundant common boundaries are identified and hidden, and multiple host surfaces are organized into continuous fused virtual surfaces in the virtual topology layer, and the target mesh is generated in a unified two-dimensional parameter domain. The comparative results show that the boundary regions of the virtually fused surfaces maintain a continuous distribution of nodes and elements, and the phenomena of abrupt changes in local mesh size and element distortion are significantly reduced.

[0117] Further quantitative verification was conducted on the KCS half-ship model. A hybrid surface mesh with 2429 meshes was selected for the half-ship, and the geometric quality of the mesh obtained using the above hull mesh generation process was compared with that of meshes of the same magnitude generated by GAMBIT and HyperMesh. The ratio of inscribed circle to circumscribed circle radius, twist, side length ratio, dimensional skewness, and dimensional change rate were used as mesh quality evaluation indicators, and the results are shown in Table 1.

[0118] Table 1

[0119] Comparative results show that, under the same scale of hull surface mesh conditions, the ratio of the inscribed circle radius to the circumscribed circle radius of the mesh obtained by this method is 0.924, which is higher than GAMBIT's 0.913 and HyperMesh's 0.908, indicating that the overall shape of the obtained triangular elements is closer to a regular triangle. The distortion indices of the three methods are similar, indicating that they all have good control over element angular distortion. Combining the indices such as side length ratio, dimensional skewness, and dimensional change rate, it can be seen that this method can maintain a relatively continuous mesh scale transition while ensuring the quality of element shape.

[0120] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention and within the spirit and principles of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for generating composite surface meshes for ship hulls based on virtual topology, characterized in that, The method includes the following steps: S1. Obtain the geometric model and surface boundaries containing multiple hull CAD surfaces, establish virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; establish virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer; S2. Generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, extract candidate paths bidirectionally along the boundary ring, and after filtering the path validity, determine the continuous boundary paths that correspond to each other on both sides as the common boundaries to be hidden. S3. Remove the common boundary to be hidden in the two virtual surfaces to be merged, and merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before merging with the resulting merged virtual surfaces, and update the association between the hull CAD surface and the virtual surfaces. S4. The outer and inner rings of the fused virtual surface are discretized in an orderly manner, and triangular discrete data are generated on each host surface and merged. After validity processing, a three-dimensional background mesh covering multiple host surfaces is obtained. S5. While maintaining the connection relationship of triangular elements in the three-dimensional background mesh, the three-dimensional background mesh is parameterized in two dimensions to generate one-to-one corresponding two-dimensional parameter coordinates for each background mesh node. The parameterized two-dimensional triangular elements are then checked for directed area. The correspondence between the checked two-dimensional parameter coordinates and the three-dimensional background mesh nodes is saved to obtain the unified two-dimensional parameter domain of the fused virtual surface. S6. Transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring order; based on the ordered two-dimensional boundary constraints, generate the target two-dimensional mesh nodes and target mesh cell topology using the selected target mesh generation path; S7. Determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, obtain the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit. Connect the three-dimensional mesh nodes according to the topology of the target mesh unit to form a three-dimensional ship hull surface mesh.

2. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S1, establishing the association between the hull CAD surface, virtual surface, and virtual edge to form a virtual topology layer includes: The virtual edges are organized according to the ring sequence of the real boundary on the host surface to form the outer ring of the virtual surface; when the host surface has an internal closed boundary, an inner ring is also formed. A stable identifier is assigned to each virtual edge. The stable identifier is used to find the current virtual edge and the cached historical virtual edges after virtual face merging, virtual edge removal or virtual edge reorganization. Establish a first mapping from the hull CAD surface identifier to the virtual surface index, and establish a second mapping from the virtual surface index to the hull CAD surface identifier.

3. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S2, determining the corresponding continuous boundary paths on both sides as the common boundary to be hidden includes: A bounding box is established based on the spatial range of the real boundary referenced by each virtual edge, and a virtual edge spatial index is established based on each bounding box; virtual edge pairs that are spatially adjacent are queried according to the preset distance tolerance, virtual edge pairs that belong to the same virtual face are excluded, and the remaining virtual edge pairs are registered as candidate boundary combinations across virtual faces. The endpoints are extracted from the two virtual edges involved in the candidate boundary combination, and the endpoints with a distance not greater than a preset threshold are determined as the corresponding endpoints. The boundary ring of one virtual face is used as the sorting benchmark, and the corresponding endpoints are matched to the boundary ring vertices. The index of the vertex in the boundary ring vertex sequence is used as the position identifier, and the corresponding endpoints are sorted according to the position identifier. When multiple corresponding endpoints are mapped to the same index, only one is retained. For the sorted adjacent corresponding endpoints, candidate paths are extracted bidirectionally along the boundary ring. It is checked whether the candidate path is composed of continuous virtual edges in the candidate boundary combination. When there are two corresponding endpoints, the path must be non-empty. If only one path satisfies the condition, the path is selected. If both paths satisfy the condition, the path with fewer virtual edges is selected. When there are at least three corresponding endpoints, the path containing the other corresponding endpoints is selected. When both sides obtain valid paths and do not cover the entire boundary loop, the continuous boundary paths on both sides are determined as the common boundary to be hidden.

4. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S3, updating the association between the hull CAD surface and the virtual surface includes: Before performing the fusion, the virtual edges and stability identifiers corresponding to the common boundaries to be hidden are cached, and the common boundaries to be hidden are removed from the virtual edge sets and boundary rings of the two virtual faces to be fused. Merge the host surface sets of two virtual surfaces: Write all the host surfaces of the first virtual surface into the host surface set of the merged virtual surface in the original order, and then append all the host surfaces of the second virtual surface to it in sequence. For the remaining virtual edges after removing the common boundary, check the endpoint connectivity. Combine adjacent virtual edges that share endpoints and meet the connection conditions into new virtual edges according to the actual connection order. Connect the virtual edges sequentially along the shared endpoints until returning to the starting point to obtain a closed loop. Distinguish between the outer loop and the inner loop based on the inclusion relationship of the closed loop. The two original virtual surfaces participating in the fusion are replaced with newly created fused virtual surfaces, and the merged host surface set, the remaining virtual edges, and the reconstructed outer and inner rings are registered in the fused virtual surface; Update the first mapping from the hull CAD surface identifier to the virtual surface index and the second mapping from the virtual surface index to the hull CAD surface identifier, so that all host surfaces of the two original virtual surfaces point to the new fused virtual surface, and make the fused virtual surface obtain all host surface identifiers in reverse. After one fusion is completed, the virtual edge space index is reconstructed based on the updated virtual face and virtual edge set, and candidate boundary combinations across virtual faces are regenerated according to step S2. The corresponding endpoint matching and candidate path validity screening are re-executed. When the set of hidden common boundaries to be eliminated is determined to be non-empty, virtual face fusion and topology reconstruction are performed on the hidden common boundaries in it. When the set of hidden common boundaries to be eliminated is determined to be empty, it is determined that there are no hidden common boundaries to be eliminated in the current virtual topology that meet the conditions described in step S2, and the iterative fusion is terminated.

5. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step 4, the virtual surfaces before fusion are replaced with the resulting fused virtual surfaces, and the relationship between the hull CAD surfaces and the virtual surfaces is updated, including: Calculate the tangential angle between adjacent virtual edges in the same boundary ring at their common endpoint, and divide the boundary ring into one or more boundary segments based on the tangential angle; For each virtual edge, query whether a boundary discrete point suitable for the current discrete scale has been stored based on the stability identifier. If it exists, it is reused; otherwise, discrete points are generated according to the set discrete scale and stored with the stability identifier. The continuous real boundaries referenced by the virtual edge are scattered at equal intervals according to their cumulative arc lengths. Let the sum of the arc lengths of the real boundaries referenced by the virtual edge be... The number of discrete segments is Then the first The cumulative arc length of the target at each boundary discrete point for: ; In the formula, The total arc length of all continuous real boundaries referenced by the current virtual edge. Let be the total number of segments discretized along the virtual edge with equal arc length, and It is a positive integer. The index of the discrete point on the boundary. From the virtual edge starting point along the specified direction to the first... The cumulative arc length of the target at each discrete boundary point; according to The real boundary segments that fall into the boundary are converted into the local parameters of the corresponding real boundary to obtain the discrete points of the three-dimensional boundary. The discrete points are arranged according to the direction of the boundary segment in the boundary ring, and the shared endpoints of adjacent virtual edges are retained only once to obtain the ordered three-dimensional boundary point sequence of the outer ring and each inner ring. Triangular discrete data is generated on each host surface and then merged. The merged nodes and triangular elements are then merged, element orientation is processed, and degradation status is checked. Degraded triangular elements are deleted and the orientation of valid triangular elements is unified to obtain a three-dimensional background mesh covering multiple host surfaces.

6. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S5, the unified two-dimensional parameter domain of the fused virtual surface is obtained, including: The first constraint node is determined from the boundary nodes of the 3D background mesh. Then, the 3D distance between the other boundary nodes and the first constraint node is calculated, and the boundary node with the largest distance is determined as the second constraint node. The 2D parametric coordinates of the first constraint node are constrained to the origin, and the second constraint node is constrained on the 2D coordinate axis, so that the 2D distance between the two constraint nodes corresponds to the 3D distance. Under constraints, least-squares conformal parameterization is performed on the 3D background mesh, and the 2D parametric coordinates of all background mesh nodes are used to form a parameter vector. The coefficient matrix is ​​established based on the discrete conformal condition of the triangular element. And establish constraint vectors based on the two constraint nodes. The parameter vector is obtained by solving the following equation. : ; In the formula, A parameter vector consisting of the two-dimensional parametric coordinates of all background mesh nodes. The coefficient matrix is ​​established based on the discretization conformal conditions and constraint handling of the triangular element. The right-hand constraint vector is formed by introducing the discrete conformal equation from the known two-dimensional parametric coordinates of the two constraint nodes. After the solution is completed, the two-dimensional coordinates of each node are obtained according to the background mesh node index; The validity of the directed area calculation for each parameterized triangular element is verified. For the first... There are three triangular elements, and the two-dimensional parametric coordinates of the three nodes are as follows: , and directional area for: ; In the formula, The index of the two-dimensional background triangular unit. , , The first The first parameter coordinate components of the three nodes of the two-dimensional background triangular element. , , These are the second parameter coordinate components of the corresponding nodes. For the first The directed area is calculated from the two-dimensional background triangular unit according to the specified node arrangement direction; When any If the area is not greater than a preset area threshold, the parameterization result is considered invalid; if all When all values ​​are greater than a preset area threshold, the corresponding relationship is saved to form the unified two-dimensional parameter domain.

7. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S6, generating the target 2D mesh nodes and target mesh cell topology using the selected target mesh generation path includes: The ordered 3D boundary discrete points of the outer and inner rings of the fused virtual surface are transformed into a unified 2D parameter domain: For each 3D boundary point, the nearest boundary line segment is determined on the ordered boundary of the 3D background mesh, and the 2D parameter coordinates of the nodes at both ends of the line segment are interpolated according to the projection position to obtain the corresponding 2D point column, while maintaining the boundary ring direction and closure relationship; adjacent 2D points are connected in sequence to form ordered 2D boundary constraints. Generate the target two-dimensional mesh nodes and target mesh cell topology based on the ordered two-dimensional boundary constraints: For unstructured mesh generation paths, an initial advancing front is established using a closed two-dimensional boundary point sequence. Within a unified two-dimensional parameter domain, the advancing front iteratively generates two-dimensional nodes and triangular element topology. During the advancing process, candidate two-dimensional nodes are generated according to the target mesh size. After checking their position within the domain, directed area of ​​elements, node spacing, and intersection with the front, they are inserted into the front. The iteration continues until the active front converges to an empty set. For the regular grid generation path, the four sets of ordered boundary point columns are oriented according to the relationship between adjacent endpoints. After verifying that the number of relative boundary nodes is consistent, two parameter directions are defined by two sets of relative boundary node sequences to generate internal two-dimensional nodes through linear interpolation. The internal nodes are smoothed by elliptical iteration with local parameter metric weighting. When the directional area of ​​adjacent quadrilaterals meets the effective threshold, the nodes are updated. The four adjacent nodes are connected according to the row and column indices to form a quadrilateral cell topology. Choose one of the two paths to use, and output the target 2D mesh node and the target mesh cell topology.

8. The method for generating ship hull composite surface mesh based on virtual topology according to claim 1, characterized in that, In step S7, connecting the three-dimensional mesh nodes according to the target mesh cell topology to form a three-dimensional hull surface mesh includes: For each target 2D mesh node, traverse the triangular elements of the 3D background mesh and read the coordinates of each triangular element node in a unified 2D parameter domain, and calculate the centroid coordinates of the target 2D mesh node relative to the current 2D triangular element. Let the two-dimensional coordinate vector of the target two-dimensional mesh node be... The two-dimensional coordinate vectors of the three nodes of the current two-dimensional background triangular unit are as follows: , and The centroid coordinates of the target 2D mesh node relative to the three nodes are respectively , and ,but: ; when , and When all values ​​are not less than zero, the current two-dimensional triangular element is determined as the corresponding two-dimensional triangular element; Obtain 3D triangular elements with the same element index from the 3D background mesh, and let the three 3D nodes be... , and Then the three-dimensional coordinates of the target node for: ; In the formula, , and Respectively represent and , and One-to-one correspondence of 3D background triangular unit node coordinate vectors This represents the three-dimensional coordinate vector of the target node obtained by linear interpolation using the same centroid coordinates. For each target 2D mesh node, generate a corresponding 3D mesh node, so that the resulting 3D mesh node retains the index of the target 2D mesh node; connect the 3D mesh nodes according to the topology of the target mesh cell to form a 3D hull surface mesh.

9. A system for generating composite hull surface meshes based on virtual topology, characterized in that, This system is used to implement the virtual topology-based hull composite surface mesh generation method as described in any one of claims 1 to 8, and the system comprises: The virtual topology construction module is used to acquire the geometric model and surface boundaries of multiple hull CAD surfaces, create virtual surfaces for each hull CAD surface, and register the hull CAD surfaces as the host surfaces of the corresponding virtual surfaces; create virtual edges for each real boundary, so that the virtual edges reference the corresponding real boundaries and record the boundary directions and endpoints; and establish the association relationship between the hull CAD surfaces, virtual surfaces and virtual edges to form a virtual topology layer. The common boundary determination module is used to generate candidate boundary combinations across virtual surfaces based on the spatial proximity of virtual edges of different virtual surfaces, extract corresponding endpoints from the candidate boundary combinations, and sort them according to the position of the corresponding endpoints in the boundary ring; for the sorted adjacent corresponding endpoints, candidate paths are extracted bidirectionally along the boundary ring, and after path validity screening, the continuous boundary paths corresponding to each other on both sides are determined as the common boundaries to be hidden. The virtual surface fusion and topology reconstruction module is used to remove the common boundary to be hidden in two virtual surfaces to be fused, merge the host surface sets of the two virtual surfaces; connect the remaining virtual edges that share endpoints and meet the connection conditions, and reconstruct the outer and inner loops according to the endpoint connectivity of the remaining virtual edges; replace the virtual surfaces before fusion with the resulting fused virtual surfaces, and update the association relationship between the hull CAD surface and the virtual surfaces. The three-dimensional background mesh construction module is used to perform ordered discretization of the outer and inner rings of the fused virtual surface, generate triangular discrete data on each host surface and merge them, and obtain a three-dimensional background mesh covering multiple host surfaces after validity processing. The unified two-dimensional parameter domain acquisition module is used to parameterize the three-dimensional background mesh in two dimensions while maintaining the connection relationship of triangular elements in the three-dimensional background mesh. It generates one-to-one corresponding two-dimensional parameter coordinates for each background mesh node, performs directed area verification on the parameterized two-dimensional triangular elements, saves the correspondence between the verified two-dimensional parameter coordinates and the three-dimensional background mesh nodes, and obtains the unified two-dimensional parameter domain of the fused virtual surface. The target two-dimensional mesh generation module is used to transform the discrete points of the outer and inner ring boundaries of the fused virtual surface to a unified two-dimensional parameter domain, and form ordered two-dimensional boundary constraints according to the boundary ring sequence; based on the ordered two-dimensional boundary constraints, the target two-dimensional mesh nodes and target mesh cell topology are generated using the selected target mesh generation path; The inverse mapping module is used to determine the two-dimensional background triangular unit where each target two-dimensional mesh node is located. Based on the correspondence between the two-dimensional background triangular unit and the corresponding triangular unit in the three-dimensional background mesh, the three-dimensional position of each target two-dimensional mesh node in the corresponding three-dimensional triangular unit is obtained. The three-dimensional mesh nodes are connected according to the topology of the target mesh unit to form a three-dimensional ship hull surface mesh.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the virtual topology-based hull composite surface mesh generation method as described in any one of claims 1 to 8.