Method and apparatus for projecting curves based on intersection of cutting planes along a given direction onto a terrain surface
By using a method based on the intersection of cutting planes, combined with patch raster indexing and a two-level filtering strategy, the problems of large computational load and poor continuity in curve projection in existing technologies are solved, and fast, continuous curve projection on large and complex terrain surfaces is realized.
Patent Information
- Application Number
- CN202611700250.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-30
- Publication Date
- 2026-11-27
AI Technical Summary
In engineering design and 3D modeling, existing line-mesh projection methods involve large computational loads, poor continuity, and complex engineering implementation, making it difficult to efficiently project curves onto large and complex terrain surfaces.
The method based on the intersection of cutting planes is adopted. By constructing the intersection of the cutting plane and the triangular mesh model, and combining the face grid index and two-level filtering strategy, the target triangular face is selected. Then, the intersection of the triangular face-cutting plane and the endpoint ray-triangular face is calculated and reconnected to obtain the continuous projection line.
It achieves fast and continuous curve projection on large and complex terrain surfaces, reduces computational load, improves computational efficiency, and outputs continuous polylines that naturally fit the surface of the triangular mesh model without relying on complex sweep surface Boolean operations.
Smart Images

Figure CN123181785A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of engineering design and 3D modeling, and in particular to a projection method and apparatus based on the curves of intersecting cutting planes pressing onto a terrain surface in a given direction. Background Technology
[0002] In engineering design and 3D modeling, it is often necessary to overlay geometric lines such as road centerlines, contour lines, boundary lines, survey lines, and text outlines onto large and complex terrain surfaces to form curves that fit the grid surface. These curves are then used for subsequent segmentation, demarcation, decal application, analysis and calculation, or to generate construction blueprints.
[0003] Common line-grid projection methods in the prior art include: (1) Point-by-point ray projection: First, the curve is discretized into a large number of points, and then the ray-triangle intersection is performed on each point along the projection direction to obtain the projection points and then connect them into a polyline.
[0004] (2) Nearest point / nearest triangle projection: Find the nearest face through KD tree or BVH and project the point onto the plane of the face or its centroid neighborhood.
[0005] (3) After constructing the swept surface / projection surface, perform Boolean intersection: sweep the curve along the projection direction into a surface or volume, and then find the intersection with the mesh to obtain the intersection line.
[0006] The above methods have at least the following shortcomings in engineering practice: (1) Large computational load: Point-by-point ray projection requires a large number of ray-triangle intersections, which can easily become a bottleneck when dealing with large-scale grids (hundreds of thousands to tens of millions of facets) and long line strings.
[0007] (2) Poor continuity: The discrete projection points obtained by point-by-point intersection are difficult to guarantee the consistency of cross-surface connection, and are prone to breakage, jump or self-intersection, requiring additional topology repair.
[0008] (3) Complex engineering implementation: Constructing the swept surface and performing Boolean intersection is costly, has a strong dependence on the geometric kernel, and is not stable enough for non-closed / non-manifold meshes. Summary of the Invention
[0009] The purpose of this application is to provide a projection method and apparatus based on the curves of intersecting cutting planes pressing onto the terrain surface in a given direction, which can solve the problems of large computational load, poor continuity and complex engineering implementation in existing methods.
[0010] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a projection method based on the curves of intersecting cutting planes pressing onto a terrain surface along a given direction, including: Obtain the target input line segment; the target input line segment is obtained by discretizing the input curve to be projected onto the target terrain body. Establish a patch raster index for the triangular mesh model corresponding to the target terrain body; The cutting plane is determined based on the direction vector of the target input line segment and the given projection direction vector; Using a two-level filtering strategy of grid level and patch level, based on the patch grid index, target triangular patches that intersect with the cutting plane are filtered from the triangular mesh model corresponding to the target terrain. For each target triangular facet, perform triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection to obtain the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body; The target line segments in the target line segment set are reconnected in an orderly manner, and the reconnected projection lines are output onto the target terrain body.
[0011] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described projection method based on the curves of intersecting cutting planes pressing onto the terrain surface in a given direction.
[0012] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described projection method based on the curves of intersecting cutting planes pressing onto the terrain surface in a given direction.
[0013] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described projection method based on the curves of intersecting cutting planes pressing onto a terrain surface in a given direction.
[0014] According to the specific embodiments provided in this application, this application has the following technical effects: (1) For the target input line segment, construct a cutting plane that includes both the line segment direction and the projection direction, so that the curve to be projected falls on the intersection line of the three-dimensional mesh model of the target terrain and the cutting plane, realizing the transformation from "multi-ray intersection" to "single-plane intersection + connection reconstruction". Under the condition of a given projection direction, the target input line segment (spatial line string / curve) can be quickly projected (imprinted) on the surface of a large complex terrain, and output continuous polylines (which can be multiple) located on the surface of the triangular mesh.
[0015] (2) By using the patch grid index and the two-level filtering strategy of grid level and patch level, the intersection calculation is restricted to the local area related to the cutting plane, avoiding full grid traversal. This can reduce the number of triangular patch traversals and intersection calculations in large-scale grid and large coordinate scale scenarios, thereby improving the overall computational efficiency.
[0016] (3) The final output reconnection projection line is reconstructed from the intersection of the triangular mesh model and the cutting plane, which naturally fits the surface of the triangular mesh model and has cross-patch continuity; at the same time, the ordered polyline is obtained through ordered reconnection, and the final output reconnection projection line has better continuity.
[0017] (4) The project is feasible: it does not rely on complex sweep surface Boolean operations, can be implemented without relying on any third-party libraries, and can directly output reconnection projection lines. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an application environment diagram of a projection method based on the intersecting curves of cutting planes pressing onto the terrain surface in a given direction, according to an embodiment of this application. Figure 2 A schematic flowchart illustrating a projection method based on a curve of intersecting cutting planes pressing onto a terrain surface along a given direction, according to an embodiment of this application; Figure 3 A schematic diagram illustrating the technical concept of a projection method based on the curves of intersecting cutting planes pressing onto a terrain surface in a given direction, according to an embodiment of this application; Figure 4 This is a schematic diagram of the intersection projection of the cutting plane and the mesh provided in one embodiment of this application; Figure 5 A schematic diagram of dam axis, gravity dam, and terrain projection operation provided for an embodiment of this application; Figure 6 A side view of the projected line connecting the dam axis provided in an embodiment of this application; Figure 7 A schematic diagram of the projection of the borehole point connection line onto the ground plane according to an embodiment of this application; Figure 8 This is a schematic diagram of a geological surface generated by surface constraints from a set of projection points, provided as an embodiment of this application. Figure 9A schematic diagram of the functional modules of a projection device based on a curve of intersecting cutting planes pressing onto a terrain surface in a given direction, according to an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0020] 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.
[0021] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] The projection method provided in this application, which involves projecting a curve of intersecting cutting planes onto a terrain surface along a given direction, can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send the target input line segment (obtained by discretizing the input curve to be projected onto the target terrain body) to server 104. After receiving the target input line segment, server 104 establishes a patch grid index for the triangular mesh model corresponding to the target terrain body; determines the cutting plane based on the direction vector of the target input line segment and the given projection direction vector; uses a two-level filtering strategy of grid level and patch level, based on the patch grid index, filters out the target triangular patches that intersect with the cutting plane from the triangular mesh model corresponding to the target terrain body; for each target triangular patch, performs triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection to obtain the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body; performs ordered reconnection of each target line segment in the target line segment set, and outputs the reconnected projection lines projected onto the target terrain body. Server 104 can feed back the obtained reconnected projection lines projected onto the target terrain body to terminal 102. Furthermore, in some embodiments, the projection method based on the curves intersecting the cutting planes along a given direction onto the terrain surface can also be implemented separately by the server 104 or the terminal 102. For example, the terminal 102 can directly project the target input line segment onto the terrain surface based on the curves intersecting the cutting planes along a given direction, or the server 104 can obtain the target input line segment from the data storage system and project it onto the terrain surface based on the curves intersecting the cutting planes along a given direction.
[0023] Among them, terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices and portable wearable devices, and server 104 can be implemented by independent servers or server clusters composed of multiple servers, or it can be a cloud server.
[0024] In one exemplary embodiment, such as Figure 2 and Figure 3 As shown, a method is provided for projecting a curve, based on the intersection of cutting planes, onto a terrain surface along a given direction. This method is executed by a computer device, specifically a terminal or server, or both. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 206.
[0025] Step 201: Obtain the target input line segment; the target input line segment is obtained by discretizing the input curve to be projected onto the target terrain.
[0026] Before executing step 201, it is necessary to perform a validity check on the target input curve, the target terrain body, and the given projection direction (projection vector). The validity check refers to checking whether the input elements are meshes, line strings, normals, etc.
[0027] Step 202: Establish a patch raster index for the triangular mesh model corresponding to the target terrain body.
[0028] Before creating the patch raster index, it is necessary to unify the grid coordinates of the triangular mesh model corresponding to the target terrain.
[0029] Step 203: Determine the cutting plane based on the direction vector of the target input line segment and the given projection direction vector.
[0030] Step 204: Using a two-level filtering strategy of grid level and patch level, based on the patch grid index, target triangular patches that intersect with the cutting plane are filtered from the triangular mesh model corresponding to the target terrain.
[0031] Step 205: For each target triangular facet, perform triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection to obtain the target line segment set projected onto the surface of the triangular mesh model corresponding to the target terrain body.
[0032] Step 206: Perform ordered reconnection of each target line segment in the target line segment set, and output the reconnection projection line (at least one reconnection projection line) projected onto the target terrain.
[0033] As an example, reconnected projected lines can be output as CAD line objects / polyline objects or as point sequences.
[0034] By implementing steps 201 to 206 above, this application provides a method for overlaying an input curve onto the surface of a large complex terrain triangular mesh along a given projection direction in a computer device: a cutting plane is constructed based on the line segments discretized from the input curve and the specified projection direction; candidate triangular patches are quickly filtered by combining the patch grid index; and continuous projection lines located on the surface of the triangular mesh are output by finding the intersection of the cutting plane and the triangular patches, finding the intersection of the endpoints along the projection direction, and connecting the resulting line segments.
[0035] This application is applicable to curve overlay, surface deposition, attachment, and spatial area analysis and constraints in terrain meshes, geological models, BIM scene meshes, and other large irregular triangular mesh objects.
[0036] In another exemplary embodiment of this application, in step 201, the input curve to be projected onto the target terrain is discretized into a point sequence {P} according to linear deflection and / or angular deflection. i}, forming several line segments (P) i P i+1 ), which is the target input line segment.
[0037] The input curve to be projected onto the target terrain can be a parametric curve, edge, wire, or existing polyline, such as a road centerline, contour line, boundary line, or survey line. To facilitate subsequent triangulation, the input curve is discretized into a point sequence {P} based on linear deflection and / or angular deflection. i}, forming several line segments (P) i P i+1 The target input line segment is the line segment. As an example, discretization can be controlled by both linear deflection (maximum chord height of the line segment) and angular deflection (angle between adjacent tangents) to achieve a balance between accuracy and efficiency.
[0038] Among them, the linear deflection δ is used to control the density of discrete points. The smaller the linear deflection δ, the more the projected curve is discretized into straight line segments, the higher the accuracy, and the more the line string fits the projected curve, but the amount of calculation increases. The linear deflection range is 0.001~10 (the unit is consistent with the three-dimensional mesh model).
[0039] Angular deflection α is used to control the subdivision of high curvature regions; as an example range, such as 1° to 60°.
[0040] In another exemplary embodiment of this application, step 202, establishing a patch raster index for the triangular mesh model corresponding to the target terrain body, specifically includes: (a1) The overall bounding box of the triangular mesh model corresponding to the target terrain is meshed to obtain several mesh cells, and a raster index is established for the mesh cells.
[0041] When meshing, the overall bounding box of the triangular mesh model can be divided into several mesh cells along the X / Y / Z directions (e.g., 10×10×10 or divided according to a side length threshold). The grid resolution can be set to a fixed number (e.g., 5~100 per axis) or a fixed cell side length.
[0042] (a2) For each triangular facet in the triangular mesh model corresponding to the target terrain, associate the facet index of the triangular facet with the grid index of the mesh cell that intersects with the corresponding triangular facet bounding box to obtain the facet grid index.
[0043] In another exemplary embodiment of this application, to avoid traversing all triangular faces of the triangular mesh model of the target terrain, in step 203, a cutting plane is determined based on the direction vector of the target input line segment and the given projection direction vector. Specifically, let the direction vector of the target input line segment be dir = (P2 - P1); and the given projection direction vector be v. A cutting plane Π is constructed such that it simultaneously contains both the direction vector dir and the direction vector v. The normal vector n of this cutting plane can be taken as: n = v × dir (cross product), and the normal vector n is normalized. The cutting plane Π can be represented in the form of "passing through point P1, normal vector n".
[0044] When the direction vector v is approximately parallel to the direction vector dir, causing |n| to approach 0, the following optional strategies can be used to ensure that the cutting plane Π can be defined: (1) Calculate the normal vector n of the cutting plane using the local normal of the triangular mesh (the normal of the local triangular facet) or the average normal m. Where, n = m × dir.
[0045] (2) Select a reference axis a that is not collinear with the direction vector dir (such as the axis with the largest angle with the direction vector dir in the global X / Y / Z axis), and let n = a × dir.
[0046] When a target input line segment (such as line segment (P1, P2)) is very short, and endpoints P1 and P2 are very close, the cutting plane cannot be numerically determined. In this case, the line segment projection is degenerated into endpoint projection (projecting only P1 and P2) or the nearest point projection is used as compensation. Line segment (P1, P2) is directly processed as a point projection; therefore, line segments with an endpoint distance less than a preset distance are processed as point projections. The projection effect of short line segments is the same as the point projection effect.
[0047] In another exemplary embodiment of this application, to reduce the computational cost of intersection calculation, this application employs a two-level filtering method to determine the target triangular facets intersecting the cutting plane. Specifically, in step 204, a two-level filtering strategy at the grid level and the facet level is used to filter the target triangular facets intersecting the cutting plane from the triangular mesh model corresponding to the target terrain body based on the facet grid index. This specifically includes: (b1) Traverse each grid cell in the triangular mesh model corresponding to the target terrain body, determine whether the bounding box of each grid cell intersects with the cutting plane, and obtain the first judgment result.
[0048] (b2) Based on the first judgment result, select the mesh cells that intersect with the cutting plane, and based on the patch grid index, add all the triangular patches (pattern index) in the mesh cells that intersect with the cutting plane to the candidate triangular patch set.
[0049] (b3) For each candidate triangle in the candidate triangle set, determine whether the bounding box of the candidate triangle intersects with the cutting plane, and obtain the second judgment result.
[0050] (b4) Based on the second judgment result, remove the candidate triangular facets that do not intersect with the cutting plane from the candidate triangular facet set to obtain the updated candidate triangular facet set.
[0051] (b5) Within the cutting plane, determine the constraint direction based on the given projection direction vector and the normal vector of the cutting plane.
[0052] Within the cutting plane, construct a direction vector dir2=v×n that is orthogonal to the projection direction vector v, which is the direction vector of the constraint direction.
[0053] (b6) For each candidate triangle in the updated candidate triangle set, determine whether the center of the bounding box of the candidate triangle falls within the strip region defined by the two endpoints of the target input line segment in the constraint direction, and obtain the third judgment result.
[0054] Taking line segment (P1, P2) as an example, determine whether the center of the bounding box of the facet falls within the strip region defined by P1 and P2 in the dir2 direction.
[0055] (b7) Based on the third judgment result, remove the candidate triangular facets in the current updated candidate triangular facet set that do not fall within the strip region defined by the two endpoints of the target input line segment, and obtain the target triangular facet that intersects with the cutting plane.
[0056] In this application, for each candidate triangular facet, in addition to determining whether the bounding box of the candidate triangular facet intersects with the cutting plane Π, an "endpoint range constraint" is introduced, which can eliminate triangular facets that are far from the effective projection area of the target input line segment (P1, P2). This endpoint range constraint can further exclude irrelevant facets, improving the screening speed and stability.
[0057] In this application, during projection calculation, it first determines whether the bounding box of the mesh cell intersects with the cutting plane Π. If they intersect, the patch index within that mesh cell is extracted; then, a secondary filtering at the patch level is performed. Large regions are first filtered out at the mesh cell level, and then candidate patches are filtered at the patch bounding box level based on "cuttable bounding box of the cutting plane + endpoint range constraint," significantly reducing the number of intersection calculations and the number of candidate patches, making it particularly suitable for large-scale meshes.
[0058] In another exemplary embodiment of this application, in step 205, for each target triangular facet, the intersection of the triangular facet and the cutting plane, and the intersection of the endpoint ray and the triangular facet are performed to obtain the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body, specifically including: (c1) Traverse the target triangular facets, calculate the intersection line between each target triangular facet and the cutting plane, and obtain the intersection line segment corresponding to each target triangular facet, such as... Figure 4 The broken line segment in the text.
[0059] For each target triangular facet, calculate its intersection with the cutting plane Π. If they intersect, the intersection line segment (e1, e2) is generally obtained (intersections at vertices / boundaries may degenerate into points or produce repeated segments).
[0060] (c2) Draw rays along the given projection direction at the two endpoints of the target input line segment to obtain the first ray and the second ray.
[0061] (c3) Determine the intersection results of the first ray and the second ray with the target triangular facet currently being traversed based on the adaptive tolerance.
[0062] The system determines whether the first and second rays are perpendicular to the normal of the currently traversed target triangle facet based on the adaptive tolerance. If they are not perpendicular, the first and second rays intersect with the target triangle facet respectively to obtain the intersection point. If they are perpendicular, there is no intersection result, and the intersection operation is not performed. The system then checks whether the absolute value of the dot product of the ray vectors (first and second ray vectors) and the normal of the currently traversed target triangle facet is less than the adaptive tolerance value. If it is less, they are considered perpendicular.
[0063] Considering the scale differences in triangular mesh models, this application introduces an adaptive tolerance `tol` for the geometric determination of ray-triangular face intersection. The adaptive tolerance `tol` is adaptively selected based on the order of magnitude of the diagonal length `D` of the bounding box of the triangular facet, with `D` being within 10... 0 ~10 1 When the order of magnitude is 1e-3, D is in the range of 10. 2 For the first order of magnitude, use 1e-2; for larger orders of magnitude, use 1e-1 (units consistent with the model).
[0064] (c4) Based on the intersection result, determine the endpoint projection points of the two endpoints of the target input line segment onto the currently traversed target triangle. For example... Figure 4 As shown.
[0065] To ensure that the endpoints of the projected polyline accurately fall on the grid surface, this application emits rays along the projection direction v to the endpoints P1 and P2 of the target input line segment, and intersects them with the target triangular facets currently being traversed to obtain the corresponding endpoint projection points.
[0066] (c5) Based on the intersection line segments and corresponding endpoint projection points of the target triangle facets currently being traversed, the target line segments projected onto the target triangle facets currently being traversed are obtained; the target line segments corresponding to each target triangle facet constitute the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body.
[0067] Each target line segment is connected according to its direction (dir). The resulting line string is the projection result of the target input line segment, such as... Figure 4 The part connecting the broken line segments in the text.
[0068] When rays pass near the vertices / boundaries of a patch or when the model coordinates differ significantly (e.g., terrain coordinates are on the order of meters / kilometers), a fixed tolerance can easily lead to missed intersections, misintersections, or duplicate intersections, resulting in insufficient projection robustness. This application employs an adaptive tolerance mechanism, dynamically selecting the tolerance based on the diagonal magnitude of the patch bounding box. This reduces missed and misintersections caused by scale differences and boundary / vertex neighborhoods, improving projection robustness and enabling compatibility with different coordinate scales and mesh resolutions.
[0069] In another exemplary embodiment of this application, endpoint ray intersection is used to identify the start and end faces and the constructed end line segments. In step (c4), the endpoint projection points of the two endpoints of the target input line segment projected onto the currently traversed target triangular face are determined according to the intersection result, including at least the following case processing: (d1) If both the first ray and the second ray intersect the target triangle facet being traversed, then the two intersection points of the first ray and the second ray in the target triangle facet being traversed are regarded as the endpoint projection points of the two endpoints of the target input line segment onto the target triangle facet being traversed.
[0070] If both the first and second rays intersect the currently traversed triangular facets (intersection points V1 and V2 both exist), then the intersection line segment (V1, V2) can be directly used as the final projection result line segment of the target input line segment without relying on other intersection line segments.
[0071] If the first ray and / or the second ray have multiple intersections with the target triangular facet currently being traversed, the nearest intersection point is selected as the corresponding endpoint projection point based on the distance in the given projection direction (front surface principle) to obtain a result that better conforms to the semantics of "overlay".
[0072] (d2) If only the first ray intersects the currently traversed target triangle, then the intersection point of the first ray and the currently traversed target triangle, and the endpoint of the plane intersection line of the triangle (currently traversed target triangle) (e1 or e2, selected by the line segment direction dir), are considered as the endpoint projection points of the two endpoints of the target input line segment. The endpoint of the plane intersection line of the currently traversed target triangle refers to the endpoint of the intersection line between the currently traversed target triangle and the cutting plane.
[0073] (d3) If only the second ray intersects with the target triangle currently being traversed, then the intersection point of the second ray with the target triangle currently being traversed and the endpoint of the plane intersection line (e1 or e2) of the triangle (the line segment direction dir is selected) are regarded as the endpoint projection points of the two endpoints of the target input line segment.
[0074] (d4) If neither the first ray nor the second ray intersects with the target triangle currently being traversed, then the endpoints (e1, e2) of the intersection line between the target triangle currently being traversed and the cutting plane determine the endpoint projection points.
[0075] If neither of the rays at endpoints P1 and P2 intersects the target triangle currently being traversed, then the endpoints (e1, e2) of the line segment intersecting the target triangle and the cutting plane are retained.
[0076] As an optional implementation, it is further possible to determine whether the intersection point (e1,e2) is within the valid range of the line segment (P1,P2) by projecting from point to line segment. If it is, it is regarded as the endpoint projection point. If not, the target input line segment being traversed does not have a projection line segment in the target triangle facet being traversed, and the next target triangle facet is traversed.
[0077] In this application, the endpoints of the target input line segment are specially processed: ray-triangle intersection is performed on the endpoints of the line segment along the projection direction to identify the start and end faces and ensure that the endpoints of the polyline fall accurately on the mesh surface; in the case where the endpoints belong to the same triangle face, the endpoint projection connection is directly output to avoid unnecessary face traversal.
[0078] In another exemplary embodiment of this application, since the intersection of the cutting plane and the triangular mesh at the vertices / boundaries may generate duplicate line segments or forward and reverse representations of the same line segment, this application performs deduplication processing on the target line segment set. Deduplication determination can be based on an endpoint distance threshold ε1: when the corresponding endpoint distances of two line segments are both less than ε1, or the corresponding endpoint distances of their intersections are both less than ε1, the two line segments are considered equivalent and duplicates are deleted. Deduplication reduces erroneous connections caused by duplicate intersections. Specifically, in step 206, each target line segment in the target line segment set is reconnected in an ordered manner, and the reconnected projection lines projected onto the target terrain are output, specifically including: (1) Remove duplicates from the target line segments in the target line segment set to obtain the target line segment set after deduplication.
[0079] (2) Perform ordered reconnection of each target line segment in the deduplicated target line segment set, and output the reconnection projection line projected onto the target terrain body.
[0080] Specifically, the target line segments in the target line segment set are deduplicated to obtain the deduplicated target line segment set, which includes: (e1) For the first target line segment and the second target line segment in the target line segment set, determine whether the distance between the first endpoints of the first target line segment and the distance between the second endpoints of the first target line segment and the second target line segment are both less than the first endpoint distance threshold (i.e., ε1), and obtain the fourth judgment result; the first target line segment and the second target line segment are any two target line segments in the target line segment set. As an example, the value range of ε1 is from 1e-6 to 1e-4.
[0081] (e2) If the fourth judgment result is yes, then the first target line segment and the second target line segment are duplicate line segments, and the first target line segment or the second target line segment is eliminated.
[0082] (e3) If the fourth judgment result is negative, then determine whether the endpoint distance between the first endpoint of the first target line segment and the second endpoint of the second target line segment, and the endpoint distance between the second endpoint of the first target line segment and the first endpoint of the second target line segment are both less than the first endpoint distance threshold, and obtain the fifth judgment result.
[0083] (e4) If the result of the fifth judgment is yes, then the first target line segment and the second target line segment are duplicate line segments, and the first target line segment or the second target line segment is eliminated.
[0084] (e5) If the result of the fifth judgment is negative, then the first target line segment and the second target line segment are not repeated line segments and are retained.
[0085] In another exemplary embodiment of this application, the target line segments in the target line segment set are usually unordered. This application reconstructs ordered polylines by endpoint matching and connection: A target line segment is randomly selected as the initial polyline, and the first and last endpoints of the polyline are maintained; the remaining target line segments are traversed, and if the distance between one of its endpoints and the first / last endpoint of the polyline is less than the endpoint distance threshold ε2, the line segment is spliced to the first / last endpoint of the polyline in the corresponding direction; this is repeated until no further connections are possible. If there are still remaining line segments, a new polyline is started using them, thereby obtaining one or more polylines output. Specifically, in step 207, each target line segment in the target line segment set is reconnected in an ordered manner, and at least one reconnected projection line projected onto the target terrain is output, including: (f1) Select any one of the unpaired target segments in the current target segment set (or the target segment set after deduplication if deduplication is performed) as the initial polyline.
[0086] (f2) Traverse the unattached target segments in the current target segment set. If the distance between any endpoint of the currently traversed unattached target segment and any endpoint of the current initial polyline is less than the second endpoint distance threshold (i.e., ε2), then attach the currently traversed unattached target segment to the beginning or end of the current initial polyline according to the segment direction to update the current initial polyline; return to step "Traverse the currently unattached target segments in the target segment set". As an example, the value of ε2 ranges from 1e-6 to 1e-4. In this step, the current target segment set does not contain the current initial polyline.
[0087] (f3) When none of the unpaired target segments in the current target segment set can be spliced to the beginning or end of the current initial polyline, output a reconnection projection line and return to the step "Select any target segment from the unpaired target segments in the current target segment set as the initial polyline".
[0088] In this application, the endpoints are automatically spliced into ordered polylines (reconnected projected lines) according to their proximity, and multiple polylines are supported for output.
[0089] This application proposes a high-efficiency, high-robustness line string overlay method based on "cutting plane-3D mesh intersection" for engineering meshes: the projection plane (or cutting plane) formed by the target input line segment along the given projection direction is intersected with the 3D mesh model, and the line segment projection problem is transformed into the problem of screening and reconstructing the "set of polyline segments obtained by the intersection of triangular mesh and cutting plane". The projection efficiency and robustness are improved by using patch grid acceleration and adaptive tolerance mechanism.
[0090] The following example 1 uses the construction of a topographic profile of a gravity dam to illustrate the projection method of this application. In the 3D view, the user selects multiple mesh objects formed by the components of the gravity dam and a topographic mesh object meshObjs, and selects the dam axis line as the projection baseline. The projection direction is set to projVec=(0,0,-1), and the target terrain is the terrain of the area where the dam is built.
[0091] For each mesh object, the calculation of the curve being pressed onto the mesh surface along a given direction is performed. Specifically, for each mesh object `meshObj`, the algorithm interface `LinePressOntoMesh(meshObj, line, projVec)` is called to press the dam axis onto the corresponding mesh surface along the given projection direction, obtaining the projection curve results located on the surface of each mesh object; then, the projection results of each mesh object are uniformly collected into the dam axis profile view. For example... Figure 5 As shown.
[0092] Finally, users add elevation, structural zoning, stratigraphic boundaries, or other engineering annotations to the dam axis profile drawing to complete the gravity dam topographic profile drawing. For example... Figure 6 The image shown is a side view of the projection lines. Figure 6 Part (a) is Figure 5 The projection of the central dam axis onto the terrain. Figure 6 Part (b) is Figure 5 The projection lines of the central dam axis onto various parts of the dam body.
[0093] Example 1 is applicable to: profile mapping, generating bounding boxes for selected areas, overlaying road centerlines, river lines, and contour lines onto terrain triangular meshes, generating ground-hugging lines for analysis, segmentation, or visualization, and other engineering application scenarios that require overlaying spatial lines onto the surface of large and complex terrain meshes along specified directions and outputting continuous projection curves.
[0094] The following example, using the three-dimensional automatic layer-connection preprocessing of geological boreholes as Example 2, illustrates the projection method of this application. The user selects multiple exploration borehole objects and corresponding ground surface mesh objects in the three-dimensional view. Based on the layer correspondence between boreholes, connection lines between pairs of exploration boreholes are automatically generated, and these connection lines are overlaid onto the corresponding ground surface along a preset projection direction, obtaining a set of projection line points on the surface of the ground surface. For example... Figure 7 As shown. Figure 7 Part (a) in the text is the connecting line that is pressed onto the corresponding ground plane; Figure 7 Part (b) is the set of projection line points located on the surface of the stratigraphic grid.
[0095] Projection calculations are performed on each connecting line, and the resulting set of points along the projection line is used as the constraint condition for generating the surface, serving as input data for subsequent geological layer generation, layer tracking, stratigraphic boundary fitting, or 3D layer modeling algorithms.
[0096] Finally, based on the projected line string point set, continuous geological interfaces are further generated or geological model construction is completed. For example... Figure 8 As shown.
[0097] Example 2 is applicable to outlines of overlay planning paths / construction areas on grid models, used for geological 3D visualization and analysis. In a GIS geographic information system, survey lines and feature lines are projected onto the scanned terrain to assist in reconstruction and feature extraction.
[0098] Based on the same inventive concept, this application also provides a projection device for implementing the above-described projection method based on the curves intersecting cutting planes pressing onto a terrain surface in a given direction. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the projection device based on the curves intersecting cutting planes pressing onto a terrain surface in a given direction provided below can be found in the limitations of the projection method based on the curves intersecting cutting planes pressing onto a terrain surface in a given direction described above, and will not be repeated here.
[0099] In one exemplary embodiment, such as Figure 9 As shown, a projection device is provided that projects a curve based on the intersection of cutting planes onto a terrain surface along a given direction, comprising: The data acquisition module M1 is used to acquire the target input line segment; the target input line segment is obtained by discretizing the input curve to be projected onto the target terrain.
[0100] The index building module M2 is used to create a patch raster index for the triangular mesh model corresponding to the target terrain body.
[0101] The cutting plane construction module M3 is used to determine the cutting plane based on the direction vector of the target input line segment and the given projection direction vector.
[0102] The patch filtering module M4 is used to filter target triangular patches that intersect with the cutting plane from the triangular mesh model corresponding to the target terrain body using a two-level filtering strategy of grid level and patch level, based on the patch grid index.
[0103] The projection line segment filtering module M5 is used to perform triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection on each target triangular facet to obtain the target line segment set projected onto the surface of the triangular mesh model corresponding to the target terrain body.
[0104] The projection reconnection module M6 is used to reconnect each target line segment in the target line segment set in an orderly manner and output the reconnection projection line projected onto the target terrain body.
[0105] In one exemplary embodiment, a computer device, also known as a computer apparatus, is provided. This computer device may be a server or a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores projection data of curves intersecting cutting planes along a given direction onto a terrain surface. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a projection method based on curves intersecting cutting planes along a given direction onto a terrain surface.
[0106] Figure 10 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0107] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0108] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations and be authorized by the owner of the corresponding device.
[0110] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0111] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0112] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A projection method based on the curves of intersecting cutting planes overlaying a terrain surface along a given direction, characterized in that, include: Obtain the target input line segment; The target input line segment is obtained by discretizing the input curve to be projected onto the target terrain body; Establish a patch raster index for the triangular mesh model corresponding to the target terrain body; The cutting plane is determined based on the direction vector of the target input line segment and the given projection direction vector; Using a two-level filtering strategy of grid level and patch level, based on the patch grid index, target triangular patches that intersect with the cutting plane are filtered from the triangular mesh model corresponding to the target terrain. For each target triangular facet, perform triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection to obtain the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body; The target line segments in the target line segment set are reconnected in an orderly manner, and the reconnected projection lines are output onto the target terrain body.
2. The projection method according to claim 1, which involves projecting a curve formed by the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... Using a two-level filtering strategy of raster level and patch level, based on the patch raster index, target triangular patches intersecting with the cutting plane are filtered from the triangular mesh model corresponding to the target terrain body. Specifically, this includes: Traverse each grid cell in the triangular mesh model corresponding to the target terrain, determine whether the bounding box of each grid cell intersects with the cutting plane, and obtain the first judgment result; Based on the first judgment result, the mesh cells that intersect with the cutting plane are selected, and based on the patch grid index, all triangular patches in the mesh cells that intersect with the cutting plane are added to the candidate triangular patch set. For each candidate triangle in the candidate triangle set, determine whether the bounding box of the candidate triangle intersects with the cutting plane, and obtain the second judgment result; Based on the second judgment result, candidate triangles that do not intersect with the cutting plane are removed from the candidate triangle set, resulting in an updated candidate triangle set. Within the cutting plane, the constraint direction is determined based on the given projection direction vector and the normal vector of the cutting plane; For each candidate triangle in the updated candidate triangle set, determine whether the center of the bounding box of the candidate triangle falls within the strip region defined by the two endpoints of the target input line segment in the constraint direction, and obtain the third judgment result. Based on the third judgment result, candidate triangular faces that do not fall within the strip region defined by the two endpoints of the target input line segment in the current updated candidate triangular face set are removed, and the target triangular face that intersects with the cutting plane is obtained.
3. The projection method according to claim 1 or 2, which involves projecting a curve based on the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... For each target triangular facet, perform triangular facet-cutting plane intersection and endpoint ray-triangular facet intersection to obtain the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body. Specifically, this includes: Traverse each target triangle, calculate the intersection line between each target triangle and the cutting plane, and obtain the intersection line segment corresponding to each target triangle. Draw rays along the given projection directions from the two endpoints of the target input line segment to obtain the first ray and the second ray; The intersection results of the first and second rays with the target triangular facets being traversed are determined based on the adaptive tolerance. Based on the intersection result, determine the two endpoints of the target input line segment projected onto the endpoint projection points on the currently traversed target triangle facet; Based on the intersection line segments and corresponding endpoint projection points of the target triangular facets currently being traversed, the target line segments projected onto the target triangular facets currently being traversed are obtained; the target line segments corresponding to each target triangular facet constitute the set of target line segments projected onto the surface of the triangular mesh model corresponding to the target terrain body.
4. The projection method according to claim 3, which involves projecting a curve formed by the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... Based on the intersection result, determine the endpoint projection points of the two endpoints of the target input line segment onto the currently traversed target triangle facet. Specifically, this includes: If both the first ray and the second ray intersect the target triangle facet being traversed, then the two intersection points of the first ray and the second ray in the target triangle facet being traversed are regarded as the endpoint projection points of the two endpoints of the target input line segment onto the target triangle facet being traversed. If only the first ray intersects with the currently traversed target triangle, then the intersection point of the first ray with the currently traversed target triangle and the endpoint of the plane intersection line of the currently traversed target triangle are regarded as the endpoint projection points of the two endpoints of the target input line segment onto the currently traversed target triangle; the endpoint of the plane intersection line of the currently traversed target triangle refers to the endpoint of the intersection line between the currently traversed target triangle and the cutting plane. If only the second ray intersects with the currently traversed target triangle, then the intersection point of the second ray with the currently traversed target triangle and the endpoint of the plane intersection line of the currently traversed target triangle are regarded as the endpoint projection points of the two endpoints of the target input line segment projected onto the currently traversed target triangle. If neither the first ray nor the second ray intersects with the target triangle currently being traversed, then the endpoint of the intersection line between the target triangle currently being traversed and the cutting plane is regarded as the endpoint projection point.
5. The projection method according to claim 3, which involves projecting a curve formed by the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... The target line segments in the target line segment set are reconnected in an ordered manner, and the reconnected projection lines projected onto the target terrain are output. Specifically, this includes: Remove duplicate target line segments from the target line segment set to obtain the deduplicated target line segment set. The target line segments in the deduplicated target line segment set are reconnected in an ordered manner, and the reconnected projection lines are projected onto the target terrain body. Specifically, the target line segments in the target line segment set are deduplicated to obtain the deduplicated target line segment set, as follows: For the first target line segment and the second target line segment in the target line segment set, determine whether the distance between the first endpoints of the first target line segment and the distance between the second endpoints of the first target line segment and the second target line segment are both less than the first endpoint distance threshold, and obtain the fourth judgment result; the first target line segment and the second target line segment are any two target line segments in the target line segment set; If the fourth judgment result is yes, then the first target line segment and the second target line segment are duplicate line segments, and the first target line segment or the second target line segment is eliminated; If the fourth judgment result is negative, then determine whether the endpoint distance between the first endpoint of the first target line segment and the second endpoint of the second target line segment, and the endpoint distance between the second endpoint of the first target line segment and the first endpoint of the second target line segment are both less than the first endpoint distance threshold, and obtain the fifth judgment result. If the fifth judgment result is yes, then the first target line segment and the second target line segment are duplicate line segments, and the first target line segment or the second target line segment is eliminated; If the fifth judgment result is negative, then the first target line segment and the second target line segment are not overlapping line segments.
6. The projection method according to claim 1 or 5, which involves projecting a curve based on the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... The target line segments in the target line segment set are reconnected in an ordered manner, and the reconnected projection lines projected onto the target terrain are output. Specifically, this includes: Select any one of the unjoined target line segments in the current target line segment set as the initial polyline; Traverse the unpaired target segments in the current target segment set. If the distance between any endpoint of the currently traversed unpaired target segment and any endpoint of the current initial polyline is less than the second endpoint distance threshold, then pair the currently traversed unpaired target segment to the beginning or end of the current initial polyline according to the segment direction to update the current initial polyline; return to the step "traverse the currently unpaired target segments in the target segment set"; When none of the unjoined target segments in the current target segment set can be joined to the beginning or end of the current initial polyline, output a reconnection projection line and return to the step "Select any target segment from the unjoined target segments in the current target segment set as the initial polyline".
7. The projection method according to claim 1, which involves projecting a curve formed by the intersection of cutting planes onto a terrain surface along a given direction, is characterized in that... Establish a patch raster index for the triangular mesh model corresponding to the target terrain body, specifically including: The bounding box of the triangular mesh model corresponding to the target terrain is meshed to obtain several mesh cells, and a raster index is established for the mesh cells. For each triangular facet in the triangular mesh model corresponding to the target terrain, the facet index of the triangular facet is associated with the grid index of the mesh cell that intersects with the corresponding triangular facet bounding box to obtain the facet grid index.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the projection method of any one of claims 1-7, which involves overlaying a curve of intersecting cutting planes onto a terrain surface in a given direction.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the projection method of any one of claims 1-7, which involves pressing a curve of intersecting cutting planes onto a terrain surface in a given direction.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the projection method of any one of claims 1-7, which involves pressing a curve of intersecting cutting planes onto a terrain surface in a given direction.
