Physical plane extraction method and related apparatus for electromagnetic simulation preprocessing

By independently calculating the external normal vector and combining it with topological connectivity and normal consistency constraints for region search clustering, the problems of incorrect normal direction and erroneous region merging in traditional methods are solved, achieving accurate and efficient preprocessing of conductor boundaries in electromagnetic simulation.

CN123119082APending Publication Date: 2026-11-17BEIJING DAOPOWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611602313.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

When dealing with complex concave and convex geometries, traditional methods tend to have the outward normal direction pointing into the interior of the solid, leading to inaccurate electric field calculations. Furthermore, they can easily merge regions with the same normal direction but not connected in space, affecting the accuracy of capacitance matrix and electric field calculations.

Method used

By acquiring the mesh data of the target 3D model, the external normal vector is independently calculated using the topological node sorting information. Based on the topological connectivity and normal consistency constraints, region search clustering is performed to ensure that the external normal vector is determined only by the vertex index order of the face element itself, and that adjacent face elements satisfy the conditions of shared edges and normal differences.

Benefits of technology

This solves the problem of difficulty in determining the normal direction in complex concave structures, avoids errors in the normal direction, ensures the independence and accuracy of conductor boundaries in electromagnetic simulation, and improves preprocessing efficiency and simulation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123119082A_ABST
    Figure CN123119082A_ABST
Patent Text Reader

Abstract

This application discloses a method and related apparatus for physical plane extraction in electromagnetic simulation preprocessing, belonging to the field of electromagnetic simulation technology. The method includes: acquiring mesh data of a target 3D model; independently calculating the external normal vector of each facet based on a preset normal pointing rule followed by the topological node sorting information of each facet in the mesh data; and performing region search clustering on multiple facets based on topological connectivity constraints and normal consistency constraints to obtain at least one independent physical plane of the target 3D model. The topological connectivity constraints require adjacent facets participating in the clustering to share edges, and the normal consistency constraints require that the difference between the external normal vector of adjacent facets participating in the clustering and the external normal vector of the seed facet of the clustering meets preset conditions. This solution solves the problem of difficulty in determining the normal direction in complex concave structures and avoids the problem of mistakenly merging spatially disconnected but uniformly normal facets into the same plane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electromagnetic simulation technology, and more specifically, to a physical plane extraction method and related apparatus for electromagnetic simulation preprocessing. Background Technology

[0002] In the field of electromagnetic simulation, algorithms such as the surface charge method and the method of moments require arranging surface elements on the outer surface of a conductor and calculating the spatial electric field by calculating the surface charge distribution of each surface element. Before performing the above simulation calculations, the 3D model to be simulated must be preprocessed to extract the independent physical planes that constitute the outer surface of the model and obtain the accurate outward normal direction of each surface element. The accuracy of the outward normal direction directly determines the correctness of the charge sign of the surface element, while the accuracy of the physical plane division determines whether the boundaries of different conductors are correctly distinguished.

[0003] Traditional 3D model surface processing techniques primarily rely on discrete meshes and normal clustering for plane extraction, which presents the following technical problems: First, for complex convex and concave geometries such as cavities and inner walls of umbrella skirts, the outward normal direction extracted by traditional methods may point inwards, leading to incorrect boundary condition settings in the surface charge method and affecting the accuracy of electric field calculations. Second, traditional implementations tend to incorrectly merge spatially disconnected regions with the same normal direction into a single plane, forcing the boundaries of conductors with different potentials that should be independent into equipotentials in the surface charge method, resulting in a reduction in the order of the capacitance matrix and distortion in the calculation of the electric field along the surface. Summary of the Invention

[0004] In view of the above, this application provides the following technical solution: The first aspect of this application provides a method for physical plane extraction in electromagnetic simulation preprocessing, including: Obtain mesh data of the target 3D model, wherein the mesh data contains multiple facets and the topological node sorting information of each facet; Based on the preset normal pointing rules followed by the topological node sorting information, the external normal vector of each face element is calculated independently, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself. Based on topological connectivity constraints and normal consistency constraints, region search clustering is performed on the multiple surface elements to obtain at least one independent physical plane of the target 3D model. The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

[0005] In one possible implementation, the preset normal pointing rule is the right-hand rule; the independent calculation of the external normal vector of each surface element includes: Analyze the vertex index arrangement order of each face element; Based on the vertex index arrangement order, the external normal vector of each face element is calculated using the vector cross product rule.

[0006] In one possible implementation, calculating the external normal vector of each surface element using the vector cross product rule includes: For any target surface element, the first vertex, second vertex, and third vertex of the target surface element are determined according to the vertex index arrangement order of the target surface element; Based on the first vertex, the second vertex, and the third vertex, construct the first edge vector and the second edge vector; Perform a cross product operation on the first edge vector and the second edge vector, and normalize the result of the cross product operation to obtain the unit outward normal vector of the target surface element.

[0007] In one possible implementation, the region search clustering of the multiple surface elements based on topological connectivity constraints and normal consistency constraints includes: Select an unvisited face element from the plurality of face elements as a seed face element; Starting from the seed face, a diffusion search is performed. During the search, if the neighbor face of the current face shares an edge with the current face, and the difference between the outer normal vector of the neighbor face and the outer normal vector of the seed face is less than a preset tolerance, then the neighbor face is assigned to the independent physical plane to which the seed face belongs, and the search continues for the neighbor face of the neighbor face until the search ends, thus completing the extraction of an independent physical plane.

[0008] In one possible implementation, the diffusion search starting from the seed element includes: Initialize the label array and assign new planar identifiers to the seed face elements; Add the seed element to the search queue; Take a face element from the search queue as the current face element, and obtain the neighbor face elements of the current face element; If the neighboring face element satisfies the topological connectivity constraint and the normal consistency constraint, and has not been assigned a plane identifier, then the new plane identifier is assigned to the neighboring face element, and the neighboring face element is added to the search queue; The step of retrieving face elements from the search queue is repeated until the search queue is empty, thus completing the search for an independent physical plane; Return to the step of selecting an unvisited face from the plurality of face elements as a seed face element, until all face elements are assigned a plane identifier.

[0009] In one possible implementation, before performing region search clustering on the plurality of surface elements based on topological connectivity constraints and normal consistency constraints, the method further includes: Based on a preset coordinate threshold, the face elements located at the bottom of the target 3D model are removed from the plurality of face elements; After removing the face elements located at the bottom of the target 3D model, extract the vertex indices referenced by the remaining face elements and construct a vertex index mapping relationship; Based on the vertex index mapping relationship, the vertex indexes of the remaining face elements are reconstructed to delete unreferenced isolated vertices.

[0010] In one possible implementation, after obtaining at least one independent physical plane of the target 3D model, the method further includes: For any target independent physical plane, extract the set of local surface elements and the set of local vertices belonging to the target independent physical plane; Create a local index mapping such that the face elements in the local face element set reference the vertex coordinates in the local vertex set through the local index mapping; The output contains structured data including the identifier of the target independent physical plane, the set of local vertices, the set of local surface elements, and the unified external normal vector, which can be used for surface charge method simulation.

[0011] A second aspect of this application provides a physical plane extraction system for electromagnetic simulation preprocessing, comprising: The data reading module is used to acquire the mesh data of the target 3D model. The mesh data includes multiple facets and the topological node sorting information of each facet. The normal vector calculation module is used to independently calculate the external normal vector of each face element based on the preset normal pointing rules followed by the topological node sorting information, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself. The planar clustering module is used to perform region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints to obtain at least one independent physical plane of the target 3D model. The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

[0012] A third aspect of this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the above-described physical plane extraction methods for electromagnetic simulation preprocessing.

[0013] The fourth aspect of this application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements a physical plane extraction method for electromagnetic simulation preprocessing.

[0014] As can be seen from the above technical solutions, this application discloses a physical plane extraction method and related apparatus for electromagnetic simulation preprocessing. The solution fundamentally solves the problem of difficulty in determining the normal direction in complex concave structures by independently calculating the external normal vector using the topological node sorting information inherent in the mesh data, without relying on error-prone centroid correction algorithms. Simultaneously, by introducing topological constraints based on shared edges and normal constraints based on fixed seed normals, it effectively avoids the problem of mistakenly merging spatially disconnected but identically normalized surface elements into the same plane, ensuring the independence and accuracy of different conductor boundaries in electromagnetic simulation. Furthermore, the physical plane data output by this method has a clear structure and can be directly called by electromagnetic simulation algorithms such as the surface charge method, significantly improving preprocessing efficiency and simulation accuracy. Attached Figure Description

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

[0016] Figure 1 This is a flowchart of a physical plane extraction method for electromagnetic simulation preprocessing disclosed in an embodiment of this application; Figure 2 This is a flowchart illustrating the calculation of the external normal vector of a surface element, as disclosed in an embodiment of this application. Figure 3 This is a flowchart of region search clustering for face elements disclosed in an embodiment of this application; Figure 4 This is a flowchart of bottom face culling and vertex remapping disclosed in an embodiment of this application; Figure 5 This is a schematic diagram of a physical plane extraction system for electromagnetic simulation preprocessing disclosed in an embodiment of this application. Detailed Implementation

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

[0018] Figure 1 This is a flowchart illustrating a physical plane extraction method for electromagnetic simulation preprocessing disclosed in an embodiment of this application. See also... Figure 1 As shown, the physical plane extraction method used for electromagnetic simulation preprocessing may include: Step 101: Obtain the mesh data of the target 3D model. The mesh data includes multiple facets and the topological node sorting information of each facet.

[0019] In the field of electromagnetic simulation, geometric models are typically stored in a specific mesh format. Unlike the STL (Stereolithography) format, which only contains discrete triangle information, this embodiment preferably uses the MSH format. When storing triangular elements, the MSH format not only records the coordinate indices of the three vertices but also strictly defines the arrangement order of these three vertices. This arrangement order is not arbitrarily set but follows specific geometric rules, implicitly containing the orientation information of the elements in space. By parsing this mesh file, a vertex coordinate matrix and a triangle topology matrix can be constructed. Each row in the topology matrix represents a element and contains three integer values, corresponding to the row indices of the three vertices in the coordinate matrix. This mesh data, containing node ordering information, forms the basis for subsequent accurate normal calculations.

[0020] Step 102: Based on the preset normal pointing rule followed by the topology node sorting information, independently calculate the external normal vector of each face element, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself.

[0021] In traditional mesh processing, to achieve a smooth visual effect, the normals of adjacent facets are often averaged, or the "centroid method" is used to correct the normal direction. However, in electromagnetic simulations, this smoothing process disrupts the geometric step characteristics of the conductor surface, leading to errors in electric field calculations. In this embodiment, the external normal vector of each facet is calculated independently; that is, the normal of each facet is determined only by its three vertices, completely independent of the geometric information of neighboring facets. This design ensures that the normal maintains its true physical orientation at edges where the geometry changes abruptly, thus providing accurate boundary conditions for the surface charge method. Predefined normal pointing rules guarantee that the calculated normal always points outward from the solid, avoiding the problem of normals flipping inward due to unevenness in the model.

[0022] Step 103: Based on topological connectivity constraints and normal consistency constraints, perform region search clustering on the multiple surface elements to obtain at least one independent physical plane of the target 3D model.

[0023] The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

[0024] The clustering process can employ region growing or graph search algorithms. Topological connectivity constraints require that adjacent facets participating in the clustering must share a complete common edge (i.e., share two vertices), not just a single vertex. This constraint effectively prevents facets that are only connected by vertices but not actually connected from being incorrectly merged. The outer normal vector of the seed facet remains unchanged throughout the clustering process, always serving as the baseline for the entire clustering process, rather than being dynamically updated to the average normal vector within the region as the clustering range expands. This mechanism ensures a high degree of consistency in the normal direction within the same physical plane and prevents the normal vector of the entire plane from drifting due to the introduction of slightly tilted facets. Through the rigorous selection of these two constraints, the system can aggregate spatially connected and uniformly normal triangular facets into an independent physical plane, thereby accurately reconstructing the model's geometry.

[0025] The physical plane extraction method for electromagnetic simulation preprocessing described in this embodiment fundamentally solves the problem of difficult-to-determine normal directions in complex concave structures by independently calculating the external normal vector using the topological node sorting information inherent in the mesh data, without relying on error-prone centroid correction algorithms. Simultaneously, by introducing topological constraints based on shared edges and normal constraints based on fixed seed normals, it effectively avoids the problem of mistakenly merging spatially disconnected but identically normalized surface elements into the same plane, ensuring the independence and accuracy of different conductor boundaries in electromagnetic simulation. Furthermore, the physical plane data output by this method has a clear structure and can be directly used by electromagnetic simulation algorithms such as the surface charge method, significantly improving preprocessing efficiency and simulation accuracy.

[0026] In one implementation, the preset normal pointing rule is the right-hand rule. The independent calculation of the external normal vector of each facet may include: resolving the vertex index arrangement order of each facet; and calculating the external normal vector of each facet based on the vertex index arrangement order using the vector cross product rule.

[0027] In applications, the system can read a row of data from the topology matrix and parse the index order of the three vertices corresponding to that facet. For example, for the i-th facet, its vertex indices are P1, P2, and P3. In the MSH format, the order of these three indices is strictly set by the mesh generation software (such as Gmsh) during the meshing process according to the right-hand rule. This order information implicitly contains the physical meaning of the facet's orientation and is key to obtaining the correct outward normal without subsequent additional corrections.

[0028] Based on the vertex index arrangement obtained from the analysis, the system can calculate the outward normal vector of each facet element using the vector cross product rule. In 3D space, the cross product of two non-collinear vectors results in a new vector perpendicular to the plane formed by these two vectors, and its direction is determined by the right-hand rule. Since the rotation direction of the vertices is locked during mesh data generation, the direction of the vector obtained through the cross product operation is definite and naturally points outward from the solid. This calculation method is entirely based on geometric topology and does not depend on the geometric center position of the model. Therefore, even for complex models with deep holes or grooves, it can ensure that the calculated outward normal direction is correct and will not point inward from the solid.

[0029] This embodiment explicitly adopts the right-hand rule as the preset normal direction rule and uses vector cross product for mathematical implementation, ensuring the mathematical rigor and geometric correctness of the external normal vector calculation. This method eliminates the need for posterior judgment, directly guaranteeing the correctness of the normal direction from the source. It is particularly suitable for electromagnetic field simulations with high requirements for boundary condition accuracy, effectively avoiding simulation results divergence or distortion caused by incorrect normal direction.

[0030] Figure 2 This is a flowchart illustrating the calculation of the exterior normal vector of a surface element, as disclosed in an embodiment of this application. See also... Figure 2 As shown, in one implementation, calculating the external normal vector of each surface element using the vector cross product rule can include: Step 201: For any target surface element, determine the first vertex, second vertex, and third vertex of the target surface element according to the vertex index arrangement order of the target surface element.

[0031] For any target surface element, the system extracts the corresponding spatial coordinates from the global vertex coordinate matrix according to the parsed vertex index arrangement. Specifically, based on the vertex index arrangement of the target surface element, the system determines the first vertex P1, the second vertex P2, and the third vertex P3 of the target surface element. These three vertices form a triangular plane in space, and their coordinate values ​​are usually floating-point numbers, representing the geometry of the model surface.

[0032] Step 202: Based on the first vertex, the second vertex, and the third vertex, construct the first edge vector and the second edge vector.

[0033] Based on the extracted coordinates of the three vertices, the system constructs two edge vectors located within the triangular plane. Specifically, based on the first vertex P1, the second vertex P2, and the third vertex P3, a first edge vector V1 = P2 – P1 and a second edge vector V2 = P3 – P1 are constructed. Both vectors originate from the first vertex and point to the second and third vertices, respectively.

[0034] Step 203: Perform a cross product operation on the first edge vector and the second edge vector, and normalize the result of the cross product operation to obtain the unit outward normal vector of the target surface element.

[0035] Perform a cross product operation on the constructed first side vector V1 and second side vector V2 to obtain the original normal vector N = V1 × V2. According to the right-hand rule of the cross product, when the vertex order is P1→P2→P3, the direction of N is perpendicular to the triangle plane and points outward. Subsequently, the cross product result N can be normalized to obtain the unit outward normal vector of the target surface element. The normalization process eliminates the influence of the triangle area size on the normal vector magnitude, making the normal vector of all surface elements a unit vector of length 1, which facilitates subsequent comparison of normal angles and clustering operations.

[0036] This embodiment transforms the abstract normal calculation into a concrete mathematical operation through specific edge vector construction and cross product operations. This not only ensures the numerical stability of the calculation process but also makes the calculation results of the outward normal direction repeatable and highly accurate. This calculation method based on the original vertex coordinates and a fixed vertex order completely avoids the geometric feature ambiguity problem caused by the use of neighborhood average normals in traditional implementations, perfectly preserving the angular features of the model surface and meeting the stringent requirements of geometric fidelity in electromagnetic simulation.

[0037] Figure 3 This is a flowchart illustrating the region search and clustering of face elements disclosed in an embodiment of this application. See also... Figure 3 As shown, in one implementation, the region search clustering of the multiple surface elements based on topological connectivity constraints and normal consistency constraints may include: Step 301: Select unvisited face elements from the plurality of face elements as seed face elements.

[0038] The system iterates through all facets, searching for unvisited facets (i.e., those not assigned a plane identifier). Once found, these facets are used as seed facets. Seed facets are the starting point for initiating a clustering growth process, representing the initial facets of a new, independent physical plane to be extracted. The order in which seed facets are selected does not affect the final clustering result, and the scheme guarantees that every facet on the model surface is ultimately classified into a specific physical plane without omission.

[0039] Step 302: Starting from the seed face, perform a diffusion search. During the search, if the neighbor face of the current face shares an edge with the current face, and the difference between the outer normal vector of the neighbor face and the outer normal vector of the seed face is less than a preset tolerance, then the neighbor face is assigned to the independent physical plane to which the seed face belongs, and the search continues for the neighbor face of the neighbor face until the search ends, thus completing the extraction of an independent physical plane.

[0040] Specific search methods can include Breadth-First Search (BFS) or Depth-First Search (DFS). When determining normal consistency, the outward normal of the initially selected seed element can always be used as the reference, rather than comparing it with the outward normal of the current element (parent node). This mechanism ensures that the fluctuation of the normal direction throughout the plane is always controlled within the tolerance range based on the seed element, preventing error accumulation. If a neighboring element satisfies the above two constraints, it is added to the growth queue of the current plane, and the search continues for the neighboring elements of that neighboring element until the search ends, completing the extraction of an independent physical plane.

[0041] This embodiment achieves automated segmentation of the model surface through a diffusion search mechanism. In particular, by adhering to the core principle of comparing with seed elements, it effectively overcomes the problem of blurred planar boundaries caused by the use of dynamically updated average normals in traditional region growing algorithms. This method can accurately identify all regions in the model that have consistent normals and are topologically connected. Even if these regions have complex geometries, it can ensure the accuracy of the clustering results and the clarity of their physical meaning, providing reliable geometric input for subsequent electromagnetic simulations.

[0042] In one implementation, the diffusion search starting from the seed element may include: 1. Initialize the label array and assign new planar identifiers to the seed facets.

[0043] The system first initializes a label array, the length of which is equal to the total number of face elements, to record the plane identifier (ID) assigned to each face element. For example, initially, all face elements have IDs of 0 or -1, indicating that they have not been visited. Next, a new plane identifier (e.g., an integer starting from 1 and incrementing) is assigned to each newly selected seed face element. Simultaneously, the system initializes a search queue to manage the face elements to be processed.

[0044] 2. Add the seed face to the search queue.

[0045] Add the seed face element to the search queue. At this point, the queue contains only one element, namely the seed face element itself.

[0046] 3. Take a face element from the search queue as the current face element, and obtain the neighbor face elements of the current face element; if the neighbor face element satisfies the topological connectivity constraint and the normal consistency constraint, and has not been assigned a plane identifier, then assign the new plane identifier to the neighbor face element and add the neighbor face element to the search queue.

[0047] The system retrieves all neighboring face elements (i.e., face elements sharing a single edge) of the current face element based on the mesh's topological connectivity. For each neighboring face element, the system performs a double check: first, it checks whether the neighboring face element satisfies the topological connectivity constraint; second, it checks whether the neighboring face element satisfies the normal consistency constraint (i.e., whether the difference between its outward normal and the seed face element's outward normal is less than a preset tolerance). Additionally, it checks whether the neighboring face element has been assigned a plane identifier. If the neighboring face element satisfies all the above conditions (topological connectivity, normal consistency, and unvisited), a new plane identifier (i.e., the same ID as the seed face element) is assigned to the neighboring face element, and the neighboring face element is added to the end of the search queue.

[0048] 4. Repeat the step of retrieving face elements from the search queue until the search queue is empty, thus completing the search for an independent physical plane.

[0049] When the queue is empty, it means that starting from the current seed face, all reachable faces that satisfy the double constraints have been found and marked, thus completing the search for an independent physical plane.

[0050] 5. Return to the step of selecting unvisited face elements as seed face elements from the plurality of face elements until all face elements are assigned a plane identifier.

[0051] After traversing all face elements, the label array will record the plane ID to which each face element belongs, thus completing the plane extraction of the entire model surface.

[0052] This embodiment achieves an efficient and stable region clustering process by employing a breadth-first search (BFS) algorithm and a queue data structure. The algorithm has clear logic and ensures that nodes closer to the seed element are visited first during traversal, which is beneficial for handling geometric models with complex boundaries. Strict enqueue condition control ensures the purity of the clustering results, preventing topologically disconnected elements from being mixed into the same plane, greatly improving the automation level and reliability of electromagnetic simulation preprocessing.

[0053] In one implementation, before performing region search clustering on multiple face elements, bottom face removal and vertex remapping steps may also be included. Figure 4 This is a flowchart of bottom face culling and vertex remapping disclosed in an embodiment of this application, combined with... Figure 4As shown, before performing region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints, the following may also be included: Step 401: Based on a preset coordinate threshold, remove the facets located at the bottom of the target 3D model from the plurality of facets.

[0054] In specific applications such as high-voltage electrical equipment, the bottom of the model is usually a fixed reference surface. The part of this surface in contact with the air often does not need to participate in electromagnetic field calculations, or its electric field distribution is known. The preset coordinate threshold is usually set to the model's global lowest Z-coordinate (Z_min). The system traverses all surface elements and determines whether the Z-coordinates of its three vertices are all equal to or approximately equal to Z_min. If so, the surface element is determined to be the bottom surface and discarded. This step effectively reduces the amount of data that subsequent clustering algorithms need to process, improving computational efficiency.

[0055] Step 402: After removing the facets located at the bottom of the target 3D model, extract the vertex indices referenced by the remaining facets and construct a vertex index mapping relationship.

[0056] After removing the facets located at the bottom of the target 3D model, the original vertex index list will contain many isolated vertices that are no longer referenced by any of the remaining facets. To optimize the data structure, the system extracts the vertex indices referenced by the remaining facets and constructs a vertex index mapping relationship. The system iterates through all remaining facets, collecting all the vertex indices they reference, forming a unique index set. Then, a new consecutive integer index (e.g., starting from 0) is assigned to each old index in this set, forming a mapping table.

[0057] Step 403: Based on the vertex index mapping relationship, reconstruct the vertex index of the remaining face elements to delete unreferenced isolated vertices.

[0058] Based on the vertex index mapping relationship, the system reconstructs the vertex indices of the remaining face elements to delete unreferenced isolated vertices. The system traverses the topology matrix of the remaining face elements, replacing the old vertex indices stored in each face element with the corresponding new indices in the mapping table. Simultaneously, according to the new index sequence, the global vertex coordinate matrix is ​​rearranged, deleting unreferenced rows. After reconstruction, the vertex coordinate matrix and topology matrix become more compact, with continuous indices, which is beneficial for improving the cache hit rate and computation speed of subsequent simulation calculations.

[0059] This embodiment effectively reduces the computational complexity of subsequent algorithms and optimizes memory usage by performing bottom face culling and vertex remapping before clustering. In particular, the vertex remapping step transforms discrete, potentially void-filled mesh data into a continuous, compact data structure. This method significantly improves the overall performance of the preprocessing workflow, enabling the system to more efficiently handle the processing needs of large-scale, high-precision 3D models.

[0060] In one implementation, after obtaining at least one independent physical plane of the target 3D model, the method may further include: 1. For any target independent physical plane, extract the set of local surface elements and the set of local vertices belonging to the target independent physical plane.

[0061] In implementation, based on the plane identifiers recorded in the clustering results, all facets are traversed, and facets with the same plane ID are grouped into the same set. Simultaneously, all vertices referenced by these facets are collected to form a local vertex set for that plane. At this point, these local vertices still reference indices in the global vertex coordinate matrix.

[0062] 2. Create a local index mapping so that the face elements in the local face element set reference the vertex coordinates in the local vertex set through the local index mapping.

[0063] To facilitate use by the simulation software, a mapping relationship from global to local indices is established for the vertices within each independent physical plane. This allows the face elements in the local face element set to reference the vertex coordinates in the local vertex set through the local index mapping. For example, plane k is composed of global node numbers 1, 16, 39, 45, and 48, and these points are locally indexed sequentially as 1, 2, 3, 4, and 5, thus facilitating subsequent loop operations.

[0064] 3. Output structured data including the identifier of the target independent physical plane, the set of local vertices, the set of local surface elements, and the unified external normal vector, for use in surface charge method simulation.

[0065] The output data structure typically includes: plane ID, local vertex coordinate array, local topology array, uniform external normal vector of the plane, area of ​​each triangle, and total area of ​​the plane. The surface charge method usually requires knowledge of the total charge on each conducting plane, and this plane-encapsulated data structure greatly simplifies the calculation. Furthermore, the uniform external normal vector information simplifies the initialization process of the simulation algorithm.

[0066] This embodiment transforms the originally chaotic global mesh data into logically clear and structurally independent physical plane units through local encapsulation output. This data organization greatly facilitates the implementation of subsequent electromagnetic simulation algorithms, enabling simulation software to directly apply boundary conditions, calculate capacitance parameters, or solve for electric field distributions on each independent physical plane.

[0067] To better understand the technical solution of this application, the implementation methods and corresponding technical effects of the solution of this application and traditional solutions will be introduced in detail below.

[0068] In traditional 3D mesh segmentation and plane extraction techniques, neighborhood average normals, Laplacian smoothing, or dynamically updated region normals are typically used as clustering benchmarks to ensure visual continuity and algorithm robustness of the segmentation results. However, in electromagnetic simulation preprocessing, especially in surface charge method calculations, these traditional techniques can introduce serious physical errors. This invention deliberately deviates from these traditional methods, achieving a significant improvement in technical performance.

[0069] First, traditional region growing algorithms generally determine normal consistency by comparing the normal vector with the parent node or the average normal vector of the region. While this sliding datum strategy can tolerate mesh discretization errors, it leads to a gradual drift of the normal direction. For geometrically abrupt regions such as flange faces and skirt edges commonly found in high-voltage electrical equipment, the sliding datum will gradually absorb adjacent facets with small angles (e.g., 1°~3°) into the same plane, causing ambiguity of the physical plane boundary. In contrast, this invention strictly limits the normal consistency constraint, requiring that the difference between the external normal vectors of adjacent facets participating in clustering and the external normal vector of the cluster seed facet meets a preset condition, and that the external normal vector of the seed facet remains unchanged during the clustering process. Since the original external normal vector of the seed facet is the geometric truth value obtained by cross product of the MSH mesh topology node sorting information using the right-hand rule, and is not updated during the entire clustering process, the cumulative error of the normal direction is effectively avoided, ensuring strict consistency of the normal direction within the same physical plane, thus meeting the stringent requirements of the surface charge method for boundary condition accuracy.

[0070] Secondly, traditional techniques for processing discrete meshes often correct normal directions using the "centroid deviation" rule (correcting the model / object's center point (axis / origin) when it deviates from its geometric or actual center of gravity through a series of operations) or neighborhood averaging to eliminate the problem of inward-facing normals caused by poor mesh generation quality. However, for models with deep cavities, inner walls of umbrella skirts, or complex assembly gaps, the centroid method easily and incorrectly corrects outward-pointing normals to inward-pointing ones, and neighborhood averaging smooths out geometric edges. This invention takes the opposite approach, utilizing the inherent topological node sorting information of the MSH format to directly and independently calculate the external normal vector of each facet based on the right-hand rule, ensuring that the external normal vector of each facet is determined solely by the vertex index order of that facet itself. While this strategy of independent calculation and rejection of averaging is considered sensitive to noise in general computer graphics, it is the only correct path to ensure the physical realism of conductor surface normals in electromagnetic simulation. It fundamentally eliminates the possibility of normal reversal caused by abnormal center of gravity position or complex neighborhood topology, ensuring the correctness of surface charge sign.

[0071] Furthermore, traditional normal-based clustering algorithms often use only the angle between normal vectors as a criterion, easily leading to the incorrect merging of spatially isolated regions with the same normal vector (e.g., horizontal planes at different floor heights (first-floor ceiling and second-floor floor), independent mounting holes or ventilation openings on equipment casings). This mismerging only affects visual grouping in general CAD models, but in electromagnetic simulations, it can have disastrous consequences: it forces the boundaries of conductors with different potentials to be equipotential, causing a reduction in the order of the capacitance matrix, distortion in the calculation of the electric field distribution along the surface, and even rendering the simulation results completely invalid. This invention introduces the hard geometric condition that "topological connectivity constraints require adjacent surface elements participating in clustering to share edges," forcing clustering to be topologically continuous in space. This accurately distinguishes independent physical planes with the same normal vector but spatially disconnected, solving the long-standing problem of mismerging planes with the same normal vector in electromagnetic simulation preprocessing.

[0072] Furthermore, considering the numerical characteristics of grid data, this invention employs a coordinate threshold-based judgment logic in the bottom face removal step, rather than strict numerical equality. Given the discrete errors in floating-point storage and mesh generation, the vertex coordinates near the model's lowest point Z_min may have slight deviations (e.g., floating-point errors within 0.1%). Using strict equality judgment would lead to the omission of some bottom face elements or the creation of dangling nodes. This invention, by setting a preset tolerance (e.g., the difference between the Z coordinate and Z_min is less than a preset threshold δ), effectively removes bottom faces that do not participate in electromagnetic calculations while ensuring algorithm stability, thus optimizing memory usage and computational efficiency.

[0073] In summary, this invention is not a simple superposition of traditional mesh segmentation techniques, but rather achieves high precision and high reliability in physical plane extraction by a series of counterintuitive designs (fixed seed normal, independent calculation of external normal, and shared edge constraints) to meet the physical requirements of electromagnetic simulation. This provides high-quality input data for subsequent electromagnetic field numerical calculations such as the surface charge method and the method of moments.

[0074] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0075] The methods described in the above-disclosed embodiments of this application are detailed in terms of the methods. The methods of this application can be implemented by various forms of apparatus. Therefore, this application also discloses an apparatus. Specific embodiments are given below for detailed description.

[0076] Figure 5 This is a schematic diagram of a physical plane extraction system for electromagnetic simulation preprocessing disclosed in an embodiment of this application. See also... Figure 5 As shown, the physical plane extraction system 50 for electromagnetic simulation preprocessing may include: The data reading module 501 is used to acquire the mesh data of the target 3D model. The mesh data includes multiple facets and the topological node sorting information of each facet.

[0077] The normal vector calculation module 502 is used to independently calculate the external normal vector of each face element based on the preset normal pointing rule followed by the topological node sorting information, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself.

[0078] The planar clustering module 503 is used to perform region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints to obtain at least one independent physical plane of the target 3D model.

[0079] The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

[0080] The physical plane extraction system for electromagnetic simulation preprocessing described in this embodiment fundamentally solves the problem of difficult-to-determine normal directions in complex concave structures by independently calculating external normal vectors using the topological node sorting information inherent in the mesh data, eliminating the need to rely on error-prone centroid correction algorithms. Simultaneously, by introducing topological constraints based on shared edges and normal constraints based on fixed seed normals, it effectively avoids the problem of mistakenly merging spatially disconnected but identically normalized surface elements into the same plane, ensuring the independence and accuracy of different conductor boundaries in electromagnetic simulation. Furthermore, the physical plane data output by this method has a clear structure and can be directly used by electromagnetic simulation algorithms such as the surface charge method, significantly improving preprocessing efficiency and simulation accuracy.

[0081] The specific implementation of the physical plane extraction system for electromagnetic simulation preprocessing and its various modules, as well as other possible implementations, can be found in the relevant sections of the method embodiments, and will not be repeated here.

[0082] The physical plane extraction system for electromagnetic simulation preprocessing described in the above embodiments includes a processor and a memory. The data reading module, normal vector calculation module, plane clustering module, etc. in the above embodiments are all stored as program modules in the memory, and the processor executes the above program modules stored in the memory to realize the corresponding functions.

[0083] The processor contains a kernel, which retrieves the corresponding program modules from memory. One or more kernels can be configured, and the processing of backtracking data can be achieved by adjusting kernel parameters.

[0084] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0085] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer, and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any embodiment of the physical plane extraction method for electromagnetic simulation preprocessing.

[0086] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any embodiment of the physical plane extraction method for electromagnetic simulation preprocessing described above.

[0087] Furthermore, this application provides a computer device. The computer device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the above-described physical plane extraction method for electromagnetic simulation preprocessing.

[0088] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0089] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0090] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0091] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for physical plane extraction in electromagnetic simulation preprocessing, characterized in that, include: Obtain mesh data of the target 3D model, wherein the mesh data contains multiple facets and the topological node sorting information of each facet; Based on the preset normal pointing rules followed by the topological node sorting information, the external normal vector of each face element is calculated independently, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself. Based on topological connectivity constraints and normal consistency constraints, region search clustering is performed on the multiple surface elements to obtain at least one independent physical plane of the target 3D model. The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

2. The method according to claim 1, characterized in that, The preset normal pointing rule is the right-hand rule; The independent calculation of the external normal vector of each surface element includes: Analyze the vertex index arrangement order of each face element; Based on the vertex index arrangement order, the external normal vector of each face element is calculated using the vector cross product rule.

3. The method according to claim 2, characterized in that, The calculation of the external normal vector of each surface element using the vector cross product rule includes: For any target surface element, the first vertex, second vertex, and third vertex of the target surface element are determined according to the vertex index arrangement order of the target surface element; Based on the first vertex, the second vertex, and the third vertex, construct the first edge vector and the second edge vector; Perform a cross product operation on the first edge vector and the second edge vector, and normalize the result of the cross product operation to obtain the unit outward normal vector of the target surface element.

4. The method according to claim 1, characterized in that, The method of performing region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints includes: Select an unvisited face element from the plurality of face elements as a seed face element; Starting from the seed face, a diffusion search is performed. During the search, if the neighbor face of the current face shares an edge with the current face, and the difference between the outer normal vector of the neighbor face and the outer normal vector of the seed face is less than a preset tolerance, then the neighbor face is assigned to the independent physical plane to which the seed face belongs, and the search continues for the neighbor face of the neighbor face until the search ends, thus completing the extraction of an independent physical plane.

5. The method according to claim 4, characterized in that, The diffusion search starting from the seed element includes: Initialize the label array and assign new planar identifiers to the seed face elements; Add the seed element to the search queue; Take a face element from the search queue as the current face element, and obtain the neighbor face elements of the current face element; If the neighboring face element satisfies the topological connectivity constraint and the normal consistency constraint, and has not been assigned a plane identifier, then the new plane identifier is assigned to the neighboring face element, and the neighboring face element is added to the search queue; The step of retrieving face elements from the search queue is repeated until the search queue is empty, thus completing the search for an independent physical plane; Return to the step of selecting an unvisited face from the plurality of face elements as a seed face element, until all face elements are assigned a plane identifier.

6. The method according to claim 1, characterized in that, Before performing region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints, the method further includes: Based on a preset coordinate threshold, the face elements located at the bottom of the target 3D model are removed from the plurality of face elements; After removing the face elements located at the bottom of the target 3D model, extract the vertex indices referenced by the remaining face elements and construct a vertex index mapping relationship; Based on the vertex index mapping relationship, the vertex indexes of the remaining face elements are reconstructed to delete unreferenced isolated vertices.

7. The method according to claim 1, characterized in that, After obtaining at least one independent physical plane of the target 3D model, the method further includes: For any target independent physical plane, extract the set of local surface elements and the set of local vertices belonging to the target independent physical plane; Create a local index mapping such that the face elements in the local face element set reference the vertex coordinates in the local vertex set through the local index mapping; The output contains structured data including the identifier of the target independent physical plane, the set of local vertices, the set of local surface elements, and the unified external normal vector, which can be used for surface charge method simulation.

8. A physical plane extraction system for electromagnetic simulation preprocessing, characterized in that, include: The data reading module is used to acquire the mesh data of the target 3D model. The mesh data includes multiple facets and the topological node sorting information of each facet. The normal vector calculation module is used to independently calculate the external normal vector of each face element based on the preset normal pointing rules followed by the topological node sorting information, so that the external normal vector of each face element is determined only by the vertex index order of the face element itself. The planar clustering module is used to perform region search clustering on the multiple surface elements based on topological connectivity constraints and normal consistency constraints to obtain at least one independent physical plane of the target 3D model. The topological connectivity constraint requires that adjacent face elements participating in clustering share edges, and the normal consistency constraint requires that the difference between the external normal vector of the adjacent face elements participating in clustering and the external normal vector of the seed face element meets a preset condition, and the external normal vector of the seed face element remains unchanged during the clustering process.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.