Projection method, device and equipment of three-dimensional mesh model and storage medium

By constructing edge topology information and tree objects, filtering visible edges and projecting them, the problem of loss of original geometric information and poor display effect in the projection of 3D mesh models is solved, realizing the efficient generation of high-quality 2D projection line graphs, which are suitable for applications such as display and feature selection.

CN121357314BActive Publication Date: 2026-05-29HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU QUNHE INFORMATION TECHNOLOGIES CO LTD
Filing Date
2025-12-16
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, pixel images of triangular mesh models suffer from problems such as loss of original geometric information, easy distortion when magnified, and difficulty in editing. Vector graphics have a large number of faces with varying quality, and conventional face vector projection algorithms are difficult to meet the real-time projection performance requirements, resulting in the legend display effect not meeting expectations.

Method used

Construct edge topology information and tree objects for a 3D mesh model. By determining the projection direction and reference plane, visible edges are filtered out and projected to generate a 2D projection line graph. Using edge topology information and tree objects, traversal and recursive calculations are performed to quickly determine candidate edges and perform visibility filtering, generating stable and efficient feature vector legends.

Benefits of technology

It enables the efficient generation of feature vector legends with complete geometric information and good visual effects, which are suitable for high-level application scenarios such as display, feature selection and annotation, and improve the efficiency and quality of 3D mesh model projection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121357314B_ABST
    Figure CN121357314B_ABST
Patent Text Reader

Abstract

The disclosure provides a projection method, device and equipment of a three-dimensional mesh model and a storage medium. The method comprises: constructing edge topology information and a tree object of the three-dimensional mesh model; wherein the three-dimensional mesh model comprises a plurality of face patches, each face patch comprises a plurality of edges and a plurality of vertices; the edge topology information is generated according to the edges and vertices of the plurality of face patches; the tree object is obtained by dividing a bounding box of the three-dimensional mesh model; determining a candidate edge in the edge topology information according to a projection direction and a projection reference plane; wherein the candidate edge is an edge that needs to be subjected to visibility screening; determining a visible edge according to the projection direction, the candidate edge and the tree object; the visible edge is the candidate edge that can be projected onto the projection reference plane; projecting the visible edge according to the projection direction and the projection reference plane to obtain a two-dimensional projection line graph of the three-dimensional mesh model on the projection reference plane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to the fields of 3D model projection and 3D scene projection. Background Technology

[0002] The projection of a triangular mesh model includes pixel and vector images. Pixels Figure 1 Generally generated directly by the graphics rendering pipeline, it suffers from drawbacks such as loss of original geometric information, easy distortion when magnified, and difficulty in editing. Triangular mesh models using vector projection have a large number of faces with inconsistent quality. Conventional face vector projection algorithms not only struggle to meet the performance requirements of real-time projection, but also cause the legend display to fail to meet expectations due to the projection of a large number of non-feature lines. Summary of the Invention

[0003] This disclosure provides a method, apparatus, device, and storage medium for projecting a three-dimensional mesh model to solve or alleviate one or more technical problems in the prior art.

[0004] In a first aspect, this disclosure provides a projection method for a three-dimensional mesh model, including:

[0005] Construct the edge topology information and tree object of the 3D mesh model; wherein, the 3D mesh model includes multiple patches, each patch including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple patches; the tree object is obtained by partitioning the bounding box of the 3D mesh model;

[0006] Candidate edges in the edge topology information are determined based on the projection direction and the projection reference plane; wherein, the candidate edges are those that need to be filtered for visibility.

[0007] Visible edges are determined based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane.

[0008] Based on the projection direction and the projection reference plane, the visible edges are projected to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane.

[0009] Secondly, this disclosure provides a projection device for a three-dimensional mesh model, comprising:

[0010] A construction module is used to construct the edge topology information and tree object of the 3D mesh model; wherein, the 3D mesh model includes multiple patches, each patch including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple patches; the tree object is obtained by partitioning the bounding box of the 3D mesh model;

[0011] The candidate edge determination module is used to determine candidate edges in the edge topology information based on the projection direction and the projection reference plane; wherein, the candidate edges are edges that need to be filtered for visibility.

[0012] The visible edge determination module is used to determine visible edges based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane;

[0013] The projection module is used to project the visible edge according to the projection direction and the projection reference plane to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane.

[0014] Thirdly, an electronic device is provided, comprising:

[0015] At least one processor; and

[0016] The memory is communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0018] Fourthly, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of the present disclosure.

[0019] Fifthly, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of the present disclosure.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0021] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments provided according to this disclosure and should not be construed as limiting the scope of this disclosure.

[0022] Figure 1 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to an embodiment of the present disclosure;

[0023] Figure 2This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0024] Figure 3 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0025] Figure 4 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0026] Figure 5 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0027] Figure 6 This is a flowchart illustrating a recursive approach according to an embodiment of the present disclosure;

[0028] Figure 7 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0029] Figure 8 This is a flowchart illustrating a projection method for a triangular mesh model according to an embodiment of the present disclosure;

[0030] Figure 9 This is a schematic diagram of the structure of a projection device for a three-dimensional mesh model according to an embodiment of the present disclosure;

[0031] Figure 10 This is a schematic diagram of the structure of a projection device for a three-dimensional mesh model according to another embodiment of the present disclosure;

[0032] Figure 11 This is a block diagram of an electronic device used to implement the methods of the embodiments of this disclosure. Detailed Implementation

[0033] The present disclosure will now be described in further detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0034] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0035] Figure 1This is a flowchart illustrating a projection method for a three-dimensional mesh model according to an embodiment of the present disclosure. In one embodiment, the method may include:

[0036] S110. Construct the edge topology information and tree object of the three-dimensional mesh model; wherein, the three-dimensional mesh model includes multiple facets, each facet including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple facets; the tree object is obtained by partitioning the three-dimensional mesh model according to the bounding box.

[0037] S120. Based on the projection direction and the projection reference plane, determine the candidate edges in the edge topology information; wherein, the candidate edges are the edges that need to be filtered for visibility.

[0038] S130. Determine visible edges based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane.

[0039] S140. Based on the projection direction and the projection reference plane, project the visible edge to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane.

[0040] In this embodiment of the disclosure, in computer graphics and computational geometry, a 3D mesh model is a discrete data structure used to digitally represent the surface shape of a 3D object. It approximates or describes a continuous 3D surface through a set of interconnected 2D polygonal patches (typically triangles or quadrilaterals). These patches are defined by shared vertices and edges, collectively forming a polygonal network with topological relationships, i.e., a "mesh". A 3D mesh model can consist of vertices, edges, and patches. The properties of a 3D mesh model can include geometric and topological information. Geometric information can include the specific locations of vertices in space, i.e., the "shape" of the model. Topological information can include the connection relationships between vertices, edges, and patches, i.e., the "structure" of the model. For example, a cube and a sphere may have the same number of vertices, but their connection methods (topological information) are completely different. A high-precision 3D mesh model can also include elements such as normals (which can be vertex normals or patch normals), texture coordinates (also called VR coordinates), material and shader properties. The role of normals can include lighting calculations, determining how light is reflected from the surface. Texture coordinates are two-dimensional coordinates (u, v). Their function includes mapping two-dimensional texture images onto a three-dimensional mesh surface. Material and shader properties can include base color, metallicity, roughness, specular highlights, transparency, normal maps, height maps, etc. These properties define the visual appearance of an object, enabling it to simulate various physical materials such as plastics, metals, glass, and fabrics. Three-dimensional mesh models can be used in fields such as video, games, animation, film special effects, virtual reality, augmented reality, industrial design, architecture, and 3D printing.

[0041] In this embodiment, the projection of a 3D mesh model is a geometric transformation process that transforms the coordinates of 3D vertices from the view space (or camera space) to a normalized clipping space. The view space can include the space of the virtual 3D coordinate system in which the model resides. The purpose of projecting the 3D mesh model is to define a 3D view volume and determine how the geometric primitives within this view volume are mapped onto a 2D display plane (also called a projection reference plane). Projecting a 3D mesh model requires specifying the projection direction and the corresponding projection reference plane. The same 3D mesh model will have different shapes under different projection directions and projection reference planes. For example, for a 3D mesh model of a cone, its projection perpendicular to the base is a circle, and its projection perpendicular to the height is an isosceles triangle. Projection methods can include perspective projection and orthographic projection. In perspective projection, the projection direction intersects the camera (viewpoint), and the farther the object is from the camera, the smaller its image on the projection plane. Orthographic projection, also known as parallel projection, has projection directions that are parallel to each other and perpendicular to the projection plane. The size of the object is independent of its distance from the camera.

[0042] In this embodiment of the disclosure, an edge in a 3D mesh model may include two vertices. A facet in a 3D mesh model may include multiple edges and multiple vertices. Facets in a 3D mesh model may include triangular faces, quad faces, and N-gon faces, etc. For example, a triangular facet may include three edges and three vertices.

[0043] In this embodiment of the disclosure, for any three-dimensional mesh model, the faces in the three-dimensional mesh model can be traversed, and edge topology information can be generated based on the edges, vertices, normals, texture coordinates, material and shader attributes of the faces. The edge topology information can be used to store various information of the faces in a structured manner, and can support operations such as traversal and query.

[0044] In this embodiment of the disclosure, for any 3D mesh model, the bounding box of the model can be obtained first, and the bounding box can be divided into multiple parts to obtain a tree object of the 3D mesh model. The tree object can be used to store the faces of the 3D mesh model in a tree structure, supporting face traversal and recursion.

[0045] In this embodiment of the disclosure, a directional projection line can be used to represent the projection direction. The projection direction indicates the direction from which the 3D mesh model is projected. The projection reference plane, also called the projection plane, can represent the position where the 3D mesh model is projected, such as a virtual camera screen. During the projection process, the vertices, edges, and faces of the 3D mesh model can be projected onto the projection reference plane according to the projection direction to obtain a 2D projection line map. Optionally, texture coordinates, material, and shader attributes of the corresponding faces can be applied to the 2D projection line map on the projection reference plane.

[0046] In this embodiment, edge topology information and a tree object of a 3D mesh model can be generated first, converting the 3D mesh model into a data format that can be traversed and recursively calculated. Then, the edge topology information is traversed and classified to obtain candidate edges for projection calculation. Candidate edges can include edges in the 3D mesh model that need to be projected, which can be obtained by traversing and classifying the edges in the 3D mesh model. Then, the candidate edges are recursively processed according to the tree object to obtain the visible edges that will actually be projected and displayed on the projection reference plane. Visible edges can include edges that can be displayed on the projection reference plane after projection, which can be obtained by calculating the visibility of candidate edges during the projection process. The relationship between the edges, candidate edges, and visible edges of the 3D mesh model can be: candidate edges are a subset of the edges of the 3D mesh model, and visible edges are a subset of candidate edges. After obtaining the visible edges, they can be projected according to the projection direction and the projection reference plane to obtain a two-dimensional projection line graph of the 3D mesh model on the projection reference plane. The two-dimensional projection line graph can be a vector diagram, or a line graph representing the contour of the 3D mesh model in the projection direction.

[0047] According to embodiments of this disclosure, a 3D mesh model can be transformed into edge topology information and tree objects that are easy to traverse. Candidate edges to be projected can be quickly determined from the edge topology information of the 3D mesh model. Then, based on the tree objects, the candidate edges are filtered by visibility to obtain the visible edges that will be projected onto the projection reference plane. This allows for the generation of a 2D projection line graph of the 3D mesh model based on the visible edges. In this way, feature vector legends with complete geometric information and good visual effects can be generated stably and efficiently, and can be used for higher-level application scenarios such as display, feature selection, and annotation.

[0048] Figure 2 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure. The method may include one or more steps of the projection method for the three-dimensional mesh model described above. In one embodiment, constructing the edge topology information of the three-dimensional mesh model includes:

[0049] S210. Traverse the vertex pairs of the edges of each facet of the three-dimensional mesh model, and generate the edge code based on the vertex numbers of the traversed vertex pairs;

[0050] S220. If the edge code of the current edge is not present in the edge topology information, store the edge code of the current edge, the edge adjacent face, and the vertex information of the adjacent face in the edge topology information.

[0051] S230. If the edge code of the current edge exists in the edge topology information, add the corresponding edge adjacent face and adjacent face vertex information to the edge topology information corresponding to the edge code.

[0052] In this embodiment of the disclosure, a vertex pair of an edge may include two vertices on an edge in the 3D mesh model. Vertex numbers can be represented using the indices of vertices in the 3D mesh model. When storing the 3D mesh model after its creation, a vertex list can be created. The vertex list stores information such as the vertex numbers of the 3D mesh model in the form of indices. Vertex numbers can also be obtained by traversing the vertices of each facet of the 3D mesh model and setting the vertex numbers sequentially for each traversed vertex. For example, vertex numbers can be set according to {0,1,2,3…N}.

[0053] In this embodiment, each facet of the 3D mesh model can be traversed according to its facet index. When a facet is reached, its edges can be obtained, and then the vertex pairs of each edge can be acquired. The vertex numbers of the two vertices in each edge pair can be concatenated according to a set concatenation rule to obtain the edge code. For example, the edge code can be obtained by concatenating the vertex numbers according to their size relationship, placing the smaller number first and the larger number last. For example, if the vertex numbers of a triangle facet are 01, 02, and 03, the edge codes of its three edges can be 0102, 0103, and 0203.

[0054] In this embodiment of the disclosure, when an edge code for a certain edge has been generated, the stored edge topology information can be traversed based on this edge code. If the edge code is not present in the edge topology information, it indicates that the information of the edge and its corresponding vertex and face has not yet been included. In this case, an edge topology can be generated based on the edge code, as well as the vertex coordinates and the face it belongs to, and added to the edge topology information.

[0055] In this embodiment of the disclosure, since multiple faces often share a single edge in a 3D mesh model, if an edge already exists in a previously traversed face, its code will already exist in the edge topology information. In this case, a new edge topology can be generated based on vertex coordinates, the face it belongs to, and other information, and added to the edge topology information under this edge code. In the edge topology information, one edge code can correspond to multiple edge topologies. If different edge topologies share the same edge code, it means that the faces corresponding to these edge topologies share a single edge.

[0056] According to embodiments of this disclosure, a three-dimensional mesh model can be converted into edge topology information for storage, facilitating traversal.

[0057] Figure 3This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure. The method may include one or more steps of the above-described projection method for a three-dimensional mesh model. In one embodiment, the tree object is an octree structure, and the tree object includes a root node, child nodes, leaf nodes, and patch information included in the leaf nodes; constructing the tree object of the three-dimensional mesh model includes:

[0058] S310. Calculate the root bounding box based on the three-dimensional mesh model;

[0059] S320. Set the maximum depth and maximum node capacity of the tree object, and use the root bounding box as the root node; wherein, the maximum depth is the maximum number of layers of the tree object's nodes, and the maximum node capacity is the maximum number of faces that a node can hold;

[0060] S330. Divide the root bounding box into eight sub-quadrants along its center. Each sub-quadrant is a child node of the root node. Calculate a sub-bounding box for the child node and store the face information of the face that intersects with the sub-bounding box into the child node.

[0061] S340. Divide the sub-bounding box into eight sub-quadrants along its center. Each sub-quadrant serves as the next-level child node of the child node. Calculate the sub-bounding box for the next-level child node. Store the face information of the face that intersects with the sub-bounding box of the next-level child node into the next-level child node.

[0062] S350, if the depth of a node in the tree object does not reach the maximum depth and / or the number of faces it contains is higher than the maximum capacity of the node, clear the face information of all nodes in the tree object except for the leaf nodes.

[0063] In this embodiment, an octree is a tree-like data structure used for recursively subdividing three-dimensional space. Each node of the octree represents an axis-aligned cube bounding box. If a node contains more geometry or data points than a certain threshold, it is subdivided into eight identical child nodes (i.e., octets), each representing one-eighth of the parent node's space. This process is repeated recursively until a specific termination condition is met. In an octree, the root node can generally be the virtual three-dimensional space of interest. For example, the overall bounding box of a three-dimensional mesh model can be used as the root node bounding box of the octree. Optionally, the overall bounding box of the three-dimensional mesh model can be expanded to serve as the root node bounding box. Child nodes, also known as internal nodes, are nodes that are included among other nodes and have eight child nodes or leaf nodes. Child nodes may not store specific data; they are only responsible for the partitioning and organization of space. Leaf nodes have no child nodes. Leaf nodes are the smallest unit of spatial subdivision and can store actual data falling within this small cube, such as faces of the three-dimensional mesh model.

[0064] In this embodiment, the bounding box of the 3D mesh model is used as the root bounding box. Octree partitioning and recursion are performed continuously until a set maximum octree depth is reached or the number of facets in a child node is less than a set maximum facet capacity. At this point, the partitioning and recursion stop. The resulting 3D mesh model, partitioned and stored in an octree structure, is a tree object. The tree object can store the spatial structure of the 3D mesh model, facilitating subsequent spatial calculations.

[0065] In this embodiment of the disclosure, the maximum depth of the tree object can be pre-defined when constructing the tree object. The maximum depth can represent the maximum number of levels of the tree object's nodes, referring to the number of partitions in the octree. For example, for an octree with a maximum depth of 3, the root node is partitioned for the first time, resulting in eight first-level child nodes; each first-level child node is then partitioned for the second time, resulting in second-level child nodes; and each second-level child node is then partitioned for the third time, resulting in leaf nodes of the last level. The maximum depth of the tree object can also be set according to the scale and size of the 3D mesh model.

[0066] In this embodiment of the disclosure, the maximum node capacity of the tree object can be preset before constructing the tree object. The maximum node capacity can represent the maximum number of faces that a leaf node of the tree object can accommodate. For example, for an octree with a maximum node capacity of 10, the root node is divided multiple times until the number of faces accommodated by each leaf node is no more than 10. After the division is completed, the tree object is obtained. The maximum node capacity of the tree object can also be set according to the scale and size of the 3D mesh model.

[0067] In this embodiment of the disclosure, the maximum depth of the tree object and the maximum capacity of the nodes can be set arbitrarily, or both can be set. When either is set, the octree is partitioned and recursively constructed based on either the maximum depth or the maximum capacity of the nodes. When both are set, they can work together to control the partitioning and recursion of the octree.

[0068] In this embodiment, the root bounding box of the octree can be determined first based on the complete bounding box of the 3D mesh object. Then, the root bounding box is divided into 8 sub-quadrants using its center point. The sub-quadrants obtained can be used as child nodes for this division. A portion of the root bounding box in each sub-quadrant is used as a sub-bounding box. After obtaining the sub-bounding boxes, the information of the faces that intersect with each sub-bounding box can be stored in the child node where the sub-bounding box is located, and the face information stored in the root node can be deleted. A face can be stored multiple times. If a face intersects with multiple sub-bounding boxes, the face information can be stored in the child node where each intersecting bounding box is located.

[0069] In this embodiment, an octagonal partition can be performed based on the center point of the previously partitioned sub-boundary box, dividing the sub-boundary box into 8 sub-quadrants. The resulting sub-quadrants can be used as child nodes for this partition. A portion of the sub-boundary boxes within each sub-quadrant are then used as the sub-boundary boxes for this partition. After obtaining the sub-boundary boxes for this partition, the information of the faces intersecting with each sub-boundary box can be stored in the child node containing the sub-boundary box of this partition, and the face information stored in the child node of the previously partitioned sub-boundary box can be deleted.

[0070] In this embodiment of the disclosure, if the number of times the octree is divided has not reached the maximum depth, the process of determining the bounding box center and performing octree division and patch storage can be continuously performed on each level of nodes until the depth of the tree object's nodes reaches the maximum depth, at which point the octree division and recursion are stopped, and the tree object is obtained.

[0071] In this embodiment of the disclosure, if the number of faces in the child nodes of the octree has not reached the maximum capacity of the node, the process of determining the bounding box center and performing octree partitioning and face storage can be continuously performed on each level of nodes until the number of faces in the child nodes of the tree object reaches the maximum capacity of the node, at which point the partitioning and recursion of the octree are stopped, and the tree object is obtained.

[0072] In this embodiment of the disclosure, the root node and child nodes of the final tree object may only store their corresponding tree structure and spatial structure, without storing specific faces. The leaf nodes may store specific faces and their corresponding face information.

[0073] According to embodiments of this disclosure, an octree can be used to store the spatial information of a three-dimensional mesh model, facilitating the recursive calculation of the projection of the three-dimensional mesh model.

[0074] Figure 4 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure. The method may include one or more steps of the above-described projection method for the three-dimensional mesh model. In one embodiment, the candidate edges include boundary edges, internal feature edges, and projected contour edges; determining the candidate edges in the edge topology information based on the projection direction and the projection reference plane includes one or more of the following steps:

[0075] S410. The edge in the three-dimensional mesh model that has only one adjacent face is taken as the boundary edge;

[0076] S420. The three-dimensional mesh model has multiple adjacent faces, and the multiple adjacent faces are distributed on opposite sides of the plane formed by the vector of the projection direction and the edge vector, and the angle between the two adjacent faces first passed by the vector of the projection direction is within a limited range is taken as the internal feature edge.

[0077] S430. The edges of the plane formed by the vectors and edge vectors of the projection direction in the three-dimensional mesh model, where there are multiple adjacent faces, are taken as the projection contour edges.

[0078] In this embodiment of the disclosure, boundary edges can represent the edges of a 3D mesh model. If an edge in a 3D mesh model has only one adjacent face, it can be considered to be at the edge of the 3D mesh model. Internal feature edges can include edges of non-edge faces in the 3D mesh model. If an edge in a 3D mesh model has multiple adjacent faces, it can be considered not to be at the edge of the 3D mesh model. Projected contour edges can include edges of non-edge faces in the 3D mesh model, but during the projection process, due to the influence of the projection direction, they may be projected as edges of the contour of a 2D projection line graph.

[0079] In this embodiment of the disclosure, an adjacent face of an edge can represent a face that uses that edge as one of its edges. The number of adjacent faces of an edge can be determined based on the number of edge topologies corresponding to the edge's edge code in the edge topology information. The number of edge topologies corresponding to the edge's edge code in the edge topology information indicates how many adjacent faces the edge has. For example, if the edge's edge code has only one edge topology, then the edge has only one adjacent face, and this edge is a boundary edge.

[0080] In this embodiment, edge vectors can be obtained from the edges of the 3D mesh model. For example, edge vectors can be obtained from the direction of the vertex pairs of the edge from the smallest numbered vertex to the largest numbered vertex. A plane can be constructed using the edge vectors and the projection direction vector. The positional relationship between multiple adjacent faces of an edge and this plane can be calculated to distinguish whether the edge is an internal feature edge or a projected contour edge. For example, if an edge encodes two corresponding edge topologies, then this edge has two adjacent faces, face 1 and face 2. Plane A is constructed based on the edge vector and the projection direction vector of this edge. The normals of face 1 and face 2 are obtained, and the angles between each normal and plane A are calculated. If the difference or sum of the angles is within a set range, then face 1 and face 2 are on the same side of the plane, and this edge is a projected contour edge. Otherwise, face 1 and face 2 are on opposite sides of the plane, and this edge is an internal feature edge.

[0081] In this embodiment of the disclosure, the edges of the 3D mesh model can be traversed by iterating through the edge topology information. When determining the type of each edge, the type can be distinguished by setting labels or identifiers.

[0082] According to embodiments of this disclosure, edges of a 3D mesh model can be filtered to obtain the edges that require projection calculation. This reduces the amount of data required for projection calculation and improves the efficiency of projection calculation.

[0083] Figure 5 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure. The method may include one or more steps of the projection method for the three-dimensional mesh model described above. In one embodiment, determining visible edges based on the projection direction, the candidate edges, and the tree object includes:

[0084] S510. Construct a ray based on the midpoint of the candidate edge and the opposite direction of the projection direction;

[0085] S520. Recursively process the tree object according to the ray, and take the candidate edge that satisfies the visible edge condition as the visible edge.

[0086] In this embodiment, the midpoint of the candidate edge can be determined first, and a ray can be constructed using the midpoint of the candidate edge and the opposite direction of the projection direction. After the ray is emitted, if it is not occluded by any facet (i.e., it does not pass through any facet in the 3D mesh model), according to the principle of light path reversibility, it means that the edge is not occluded by other facets in the projection direction and can be projected onto the projection reference plane. If the ray is occluded by a facet (i.e., it passes through other facets in the 3D mesh model), it means that the edge is occluded by other facets and cannot be projected onto the projection reference plane. A visible edge can represent an edge in the 3D mesh model that, in the current projection direction, can be projected onto the projection reference plane and used to generate a 2D projection line graph.

[0087] According to embodiments of this disclosure, the edges in a three-dimensional mesh model can be further filtered, retaining only the edges used to generate a two-dimensional projection line graph, which can improve the efficiency of projecting a three-dimensional mesh model into a two-dimensional vector graphic.

[0088] In one implementation, recursively processing the tree object according to the ray, and selecting candidate edges that satisfy the visible edge condition as visible edges, includes:

[0089] Determine whether the root node of the tree object satisfies the visible edge condition;

[0090] If the root node satisfies the visible edge condition, then the child nodes of the root node are sequentially checked to see if they satisfy the visible edge condition.

[0091] If the child node satisfies the visible edge condition, then the next level child nodes of the child node are sequentially checked to see if they satisfy the visible edge condition.

[0092] If the node does not satisfy the visible edge condition, stop the recursion;

[0093] For all leaf nodes reached in the recursion, the candidate edges that satisfy the visible edge condition are designated as visible edges.

[0094] In one implementation, the visible edge condition includes at least one of the following:

[0095] The candidate edges are not edges of degenerate patches; wherein, the degenerate patches include patches with an area close to 0;

[0096] The ray does not intersect with the bounding box of the node;

[0097] The ray intersects the bounding box of the node, but does not intersect each non-degenerate patch in the node;

[0098] The ray intersects the bounding box of the node and the boundary edge of the non-degenerate patch in the node.

[0099] In this embodiment of the disclosure, recursion can be performed on the tree object according to the candidate edges. Figure 6 This is a flowchart illustrating a recursive approach according to an embodiment of the present disclosure, which may include:

[0100] S610. Select a candidate edge. Starting from the root node of the tree object, first determine whether the candidate edge intersects with the bounding box of the root node.

[0101] S620. If the candidate edge intersects with the bounding box of the root node, then the candidate edge needs further visibility determination, and proceed to S640. Otherwise, proceed to S630.

[0102] S630. If the candidate edge does not intersect with the bounding box of the root node, it means that the candidate edge is not visible in the projection of the 3D mesh model. The visibility judgment of this candidate edge ends, and the visibility calculation of the next candidate edge continues.

[0103] S640. If this candidate edge intersects with the bounding box of the root node, continue to calculate the intersection of this candidate edge with its child nodes.

[0104] S650. If the candidate edge intersects with the bounding box of the child node, it means that the candidate edge needs further visibility judgment, and proceed to S660. If the candidate edge does not intersect with the bounding box of the child node, it means that the candidate edge is not visible in the projection of the 3D mesh model, and proceed to S630 to end the visibility judgment of this candidate edge and continue to perform the visibility calculation of the next candidate edge.

[0105] S660: If the candidate edge intersects with the bounding box of a leaf node, continue calculating the intersection of the candidate edge with the faces in the leaf node. If the candidate edge does not intersect with the bounding box of a leaf node, execute S630 to end the visibility calculation of the candidate edge. The slabs algorithm can be used to determine the intersection of a ray and a bounding box. When calculating the intersection of a candidate edge with a face in a leaf node, each face in the leaf node can be traversed, and the intersection of the midpoint ray of the candidate edge with the face can be calculated to determine whether the candidate edge is occluded by the face. The Möller-Trumbore algorithm can be used to calculate whether the midpoint ray of the candidate edge intersects with the face. During the calculation, if the midpoint ray of the candidate edge intersects with any face, S630 can be executed to end the visibility calculation of the candidate edge, marking it as an invisible edge, and proceeding to the visibility calculation of the next candidate edge.

[0106] In this embodiment of the disclosure, the above process is continued until all candidate edges have been calculated as visible edges, and all candidate edges marked as invisible edges are removed to obtain visible edges. In an optional implementation, all candidate edges can be set as visible edges before recursion, and only the candidate edges that are still visible edges can be retained after recursion is completed.

[0107] In this embodiment of the disclosure, degenerate patches, since their area is close to 0, may be represented as an edge in the 3D mesh model. The influence of degenerate patches can be excluded when determining the visibility of edges. An optional implementation involves marking the edges representing degenerate patches in the 3D mesh model and skipping them directly during visibility determination, marking them as invisible edges.

[0108] According to the embodiments of this disclosure, the visibility of candidate edges can be determined first based on the root bounding box and the sub-bounding boxes. If the bounding box cannot be used to determine the visibility of candidate edges, a small batch of patches that are strongly correlated with the visibility of candidate edges can be used to determine the visibility of candidate edges. This can significantly reduce the amount of data to be calculated, improve the efficiency of visible edge determination, and increase the projection efficiency of the two-dimensional projection line graph of the three-dimensional mesh model.

[0109] In one embodiment, the method may further include: simplifying the topologically continuous polyline segments in the two-dimensional projection line graph.

[0110] In this embodiment of the disclosure, topologically continuous polyline segments can be extracted from a two-dimensional projection line graph, and a simplification algorithm, such as the Douglas-Peukcer algorithm, can be applied to the polyline segments to reduce the inflection points in the polyline segments and smooth them out.

[0111] Figure 7 This is a flowchart illustrating a projection method for a three-dimensional mesh model according to another embodiment of the present disclosure. The method may include one or more steps of the projection method for the three-dimensional mesh model described above. In one embodiment, the method further includes:

[0112] S710. Obtain the vertex and face information of the three-dimensional mesh model;

[0113] S720. Optimize the three-dimensional mesh model based on the vertex and face information to obtain an optimized three-dimensional mesh model.

[0114] In one embodiment, the optimization step based on the vertex and face information of the three-dimensional mesh model includes at least one of the following:

[0115] Delete unused vertices from the 3D mesh model;

[0116] Remove duplicate vertices from faces that have the same position but are not topologically adjacent;

[0117] Mark the degenerate facet.

[0118] In this embodiment of the disclosure, before generating edge topology information and tree objects, the 3D mesh model can be preprocessed to remove noise and invalid information. In one implementation, unused vertices, duplicate vertices, and faces in the 3D mesh model can be removed, and degenerate faces in the 3D mesh model can be marked.

[0119] According to embodiments of this disclosure, the data of a three-dimensional mesh model can be optimized to make it simpler and easier to process. At the same time, it can also reduce the amount of data to be processed and improve the efficiency of generating edge topology information and tree objects.

[0120] In one implementation, the method may further include one or more of the following steps:

[0121] If the projection requirements change, the projection direction and projection reference plane information are updated according to the projection requirements.

[0122] When the three-dimensional mesh model is displaced and rotated, the projection direction and the projection reference plane are transformed inversely according to the parameters of displacement and rotation, so as to keep the relative positional relationship between the projection direction and the projection reference plane and the three-dimensional mesh model unchanged.

[0123] When the 3D mesh model is scaled, the bounding boxes of all nodes in the tree object are scaled accordingly according to the scaling parameters, and the scaling ratio information is maintained in the tree object.

[0124] In this embodiment, if the projection reference plane and projection direction change, as long as the model itself is not deformed or replaced, there is no need to regenerate the edge topology information and tree object. Only the candidate edges need to be re-determined based on the existing edge topology information, and the visible edges need to be re-determined based on the tree object. Then, the new visible edges can be projected onto the new projection reference plane according to the new projection direction to obtain a new two-dimensional projection line graph. Alternatively, using the edge topology information and tree object already determined in S110, S120 can be re-executed to determine new candidate edges based on the new projection direction and the new projection reference plane. Then, S130 can be re-executed on the new candidate edges to obtain new visible edges. Finally, the new visible edges are projected onto the new projection reference plane according to the new projection direction to obtain a new two-dimensional projection line graph.

[0125] In this embodiment, if the 3D mesh model has been translated, as long as the model itself has not been deformed or replaced, there is no need to regenerate edge topology information, tree objects, or redetermine visible edges. Only the projection direction and projection reference plane need to be inversely transformed according to the translation of the 3D mesh model, binding them to the 3D mesh model and maintaining their relative positions. Projection is then performed directly to obtain a 2D projection line diagram of the translated 3D mesh model. For example, when the 3D mesh model has been translated, the inverse transformation process is performed based on the current position of the 3D mesh model to obtain the translation direction and translation amount. The projection direction and projection reference plane are then translated synchronously according to the translation direction and translation amount. This method ensures that the positions of the projection direction and projection reference plane relative to the 3D mesh model remain unchanged, and the 2D projection line diagram obtained in S140 is directly used as the 2D projection line diagram of the translated 3D mesh model.

[0126] In this embodiment of the disclosure, if the 3D mesh model is rotated, as long as the model itself is not deformed or replaced, there is no need to regenerate the edge topology information and tree objects. It is only necessary to redetermine candidate edges based on the existing edge topology information, and then redetermine visible edges based on the tree objects. Projection is then performed according to the newly confirmed visible edges to obtain a 2D projection line diagram of the rotated 3D mesh model. For example, when the 3D mesh model is rotated, candidate edges are redetermined based on the existing edge topology information according to the current pose of the 3D mesh model, and visible edges are redetermined based on the existing tree objects. For the new visible edges, a new 2D projection line diagram is obtained by projecting them onto the original projection reference plane according to the original projection direction.

[0127] In this embodiment, if the 3D mesh model has only been scaled, there is no need to regenerate the edge topology information and tree object. It is only necessary to first maintain a scaling parameter based on the scaling ratio, then scale all bounding boxes of the edge topology information and tree object according to the scaling parameter, determine the scaled candidate edges based on the scaled edge topology information, and then determine the scaled visible edges based on the scaled tree object. Projecting the scaled visible edges yields a 2D projection line graph of the scaled 3D mesh model. For example, if the 3D mesh model is magnified by one time, it is only necessary to maintain a magnification parameter of one time. The edges in the tree object obtained in S110 are magnified by one time according to the magnification parameter to obtain the edges of the new 3D mesh model. For the magnified 3D mesh model, S120 and S130 are re-executed to obtain the magnified candidate edges and visible edges. Then, S140 is executed on the magnified visible edges to obtain a new magnified 2D projection line graph.

[0128] According to embodiments of this disclosure, after generating edge topology information and tree objects for a 3D mesh model, as long as the model itself does not undergo deformation or is not replaced, there is no need to regenerate the edge topology information and tree objects, thus improving computational efficiency. Even when the 3D mesh model has been translated, there is no need to recalculate visible edges, improving projection efficiency and the adaptability and robustness of the projection method.

[0129] Figure 8 This is a flowchart illustrating a projection method for a triangular mesh model according to an embodiment of the present disclosure, which may include:

[0130] S810, Input the vertex and face information of the triangular mesh model.

[0131] S820, Model Preprocessing: Remove unused vertices from the facets, use kd-trees or octrees to remove duplicate vertices, avoid facets with vertices in the same position but not topologically adjacent, and then mark degenerate triangle facets with an area close to 0.

[0132] S830. Construct mesh edge topology information, as follows:

[0133] a. Traverse each face and each vertex pair of each edge, concatenate the smaller vertex number first and the larger vertex number last to form a long integer for unique edge encoding.

[0134] b. If the encoding of the traversed edge does not exist, a new edge object is created, which contains the index information of the two vertices, the adjacent face and vertex information (the adjacent vertex of an edge is the other vertex in a triangle face adjacent to the edge besides the two vertices of the edge).

[0135] c. If the encoding of the traversed edge already exists, obtain the corresponding edge object based on the encoding, and add adjacent face and vertex information.

[0136] S840. Construct the private octree object for this grid, as follows:

[0137] a. Calculate the overall bounding box of the mesh and expand it outward by 1% along each axis to form the bounding box of the root node of the octree.

[0138] b. Define the maximum depth and maximum node capacity of the octree.

[0139] c. Place all non-degenerate faces into the root node and mark it as the current node, then perform the following operations:

[0140] 1) If the current node satisfies the condition that its depth is less than the maximum depth and the number of faces it contains is greater than the node's maximum capacity, then divide the node's bounding box into eight sub-quadrants. Each sub-quadrant forms a new node, which becomes a child node of the current node.

[0141] 2) Traverse all faces contained in the current node. If a face intersects with the bounding box cuboid of a child node, place the face into that child node. The same face can be placed into multiple child nodes. The Tomas Akenne-Moller algorithm is used to determine the intersection of triangles and child nodes.

[0142] 3) Clear all faces contained in the current node; if a child node does not contain any faces, delete the child node.

[0143] 4) Recursively perform the above operations on each child node until the maximum depth is reached or the number of contained faces is less than the maximum capacity.

[0144] S850. After inputting the projection direction and projection reference plane information, iterate through all edge objects (which can be simply referred to as edges) and determine the edges that need to be projected according to one or more of the following rules:

[0145] a. Boundary edge, which is an edge that has only one adjacent face.

[0146] b. Internal feature edges, which are multiple adjacent faces distributed on both sides of the plane composed of the projection vector and the edge vector, and the edges of the two faces closest to the projection direction have an angle greater than or equal to a certain threshold.

[0147] c. Projected contour edge, which is an edge that is multiple on the same side of the plane composed of the projection vector and the edge vector of adjacent faces.

[0148] S860. Traverse each edge object whose projection needs to be calculated in the previous step, and determine the visibility of the edge as follows:

[0149] a. Mark the edge as visible in the initial state.

[0150] b. Calculate the midpoint of the side, which forms a ray with the vector in the opposite direction of the projection direction.

[0151] c. Mark the current node as the root node of the octree, and perform the following operation to determine whether the edge is occluded by a triangle:

[0152] 1) Use the slabs algorithm to determine whether the ray intersects with the current node's bounding box cuboid.

[0153] 2) If the ray does not intersect the current node's bounding box, end the occlusion calculation for the current node; if there are other nodes to be judged in the recursion stack, continue to judge the intersection of the ray with other nodes.

[0154] 3) If the ray intersects the bounding box of the current node and the current node is a leaf node, traverse each triangular facet contained in the node, and use the Möller-Trumbore algorithm to determine whether the ray intersects with the facet. If it intersects, mark the edge as invisible and end the calculation of the edge. In particular, if the ray intersects with a boundary edge of the facet, the calculation does not end.

[0155] 4) If the ray intersects the bounding box of the current node and the current node is not a leaf node, recursively perform the above operations on each child node.

[0156] S870. For all visible edges in the previous step, project them onto the reference plane to form two-dimensional line segments, thereby forming a projection diagram.

[0157] S880. For the generated projection legend, extract the topologically continuous polyline segments and simplify them using the Douglas-Peukcer algorithm to reduce the amount of data and alleviate the pressure of data transmission.

[0158] S890, Octree Structure Reuse: For each triangular mesh model, the octree structure only needs to be built once. When the viewpoint, model pose, or model scaling changes, it does not need to be rebuilt. Only the following quick adjustments and reprojection are required, as follows:

[0159] a. If the viewing angle changes, update the projection direction and projection reference plane information.

[0160] b. If the model undergoes displacement or rotation, the projection direction and projection reference plane will be transformed accordingly to ensure that the relative positional relationship between the projection direction, projection reference plane and the model remains unchanged.

[0161] c. If the model is scaled, the bounding boxes of all nodes in the octree are scaled accordingly, and the current scaling ratio is maintained in the octree object.

[0162] Figure 9 This is a schematic diagram of a projection device for a three-dimensional mesh model according to an embodiment of the present disclosure. In one embodiment, the device may include:

[0163] The construction module 910 is used to construct the edge topology information and tree object of the three-dimensional mesh model; wherein, the three-dimensional mesh model includes multiple patches, each patch including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple patches; the tree object is obtained by partitioning the bounding box of the three-dimensional mesh model;

[0164] The candidate edge determination module 920 is used to determine candidate edges in the edge topology information based on the projection direction and the projection reference plane; wherein, the candidate edges are edges that need to be filtered for visibility.

[0165] The visible edge determination module 930 is used to determine visible edges based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane;

[0166] The projection module 940 is used to project the visible edge according to the projection direction and the projection reference plane to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane.

[0167] Figure 10 This is a schematic diagram of a projection device for a three-dimensional mesh model according to another embodiment of the present disclosure. In one embodiment, the device may include: a construction module 1010, a candidate edge determination module 1020, a visible edge determination module 1030, and a projection module 1040. The functions of the above device can be found in the description of the construction module 910, candidate edge determination module 920, visible edge determination module 930, and projection module 940 in the projection device for a three-dimensional mesh model. The construction module 1010 includes:

[0168] The traversal submodule 1011 is used to traverse the vertex pairs of the edges of each facet of the three-dimensional mesh model and generate the edge code based on the vertex number of the traversed vertex pairs.

[0169] The judgment submodule 1012 is used to store the edge code of the current edge, the edge adjacent face, and the vertex information of the adjacent face in the edge topology information when the edge code of the current edge does not exist in the edge topology information.

[0170] The judgment submodule 1012 is further configured to, when the edge code of the current edge exists in the edge topology information, add the corresponding edge adjacent face and adjacent face vertex information to the edge topology information corresponding to the edge code.

[0171] In one implementation, the tree object is an octree structure, and the tree object includes a root node, child nodes, leaf nodes, and patch information included in the leaf nodes; such as Figure 10 As shown, building module 1010 may also include:

[0172] Bounding box calculation submodule 1013 is used to calculate the root bounding box based on the three-dimensional mesh model;

[0173] The setting submodule 1014 is used to set the maximum depth and maximum node capacity of the tree object, and to use the root bounding box as the root node; wherein, the maximum depth is the maximum number of layers of the nodes of the tree object, and the maximum node capacity is the maximum number of faces that can be accommodated in the node;

[0174] The sub-module 1015 is used to divide the root bounding box into eight sub-quadrants along the center of the root bounding box. Each sub-quadrant is a child node of the root node. The sub-bounding box is calculated for the child node, and the face information of the face that intersects with the sub-bounding box is stored in the child node.

[0175] The partitioning submodule 1015 is further configured to divide the sub-boundary box into eight sub-quadrants along the center of the sub-boundary box, with each sub-quadrant serving as the next-level sub-node of the sub-node, calculate the sub-boundary box for the next-level sub-node, and store the face information of the face that intersects with the sub-boundary box of the next-level sub-node into the next-level sub-node.

[0176] The clearing submodule 1016 is used to clear the face information of nodes other than leaf nodes in the tree object when the depth of the nodes of the tree object does not reach the maximum depth and / or the number of faces contained therein is higher than the maximum capacity of the node.

[0177] In one implementation, the candidate edges include boundary edges, internal feature edges, and projected contour edges; the candidate edge determination module 1020 can be used for one or more of the following:

[0178] The edge in the three-dimensional mesh model that has only one adjacent face is used as the boundary edge;

[0179] The three-dimensional mesh model has multiple adjacent faces, and these adjacent faces are distributed on opposite sides of the plane formed by the vector of the projection direction and the edge vector. The edge through which the vector of the projection direction first passes through two adjacent faces with the included angle within a limited range is taken as the internal feature edge.

[0180] The projection contour edge is defined as the edge of a plane formed by the vectors and edge vectors of the projection direction in the three-dimensional mesh model, where multiple adjacent faces are distributed on the same side.

[0181] In one implementation, such as Figure 10 As shown, the visible edge determination module 1030 may include:

[0182] A submodule 1031 is constructed to construct a ray based on the midpoint of the candidate edge and the opposite direction of the projection direction;

[0183] The recursive submodule 1032 is used to recursively process the tree object according to the ray and select the candidate edges that satisfy the visible edge condition as the visible edges.

[0184] In one implementation, the recursive submodule 1032 can also be used for:

[0185] Determine whether the root node of the tree object satisfies the visible edge condition;

[0186] If the root node satisfies the visible edge condition, then the child nodes of the root node are sequentially checked to see if they satisfy the visible edge condition.

[0187] If the child node satisfies the visible edge condition, then the next level child nodes of the child node are sequentially checked to see if they satisfy the visible edge condition.

[0188] If the node does not satisfy the visible edge condition, stop the recursion;

[0189] For all leaf nodes reached in the recursion, the candidate edges that satisfy the visible edge condition are designated as visible edges.

[0190] In one implementation, the visible edge determination condition includes at least one of the following:

[0191] The candidate edges are not edges of degenerate patches; wherein, the degenerate patches include patches with an area close to 0;

[0192] The ray does not intersect with the bounding box of the node;

[0193] The ray intersects the bounding box of the node, but does not intersect each non-degenerate patch in the node;

[0194] The ray intersects the bounding box of the node and the boundary edge of the non-degenerate patch in the node.

[0195] In one implementation, such as Figure 10 As shown, the device may further include:

[0196] The simplification module 1050 is used to simplify the topologically continuous polyline segments in the two-dimensional projection line diagram.

[0197] In one implementation, such as Figure 10 As shown, the device may further include:

[0198] The acquisition module 1060 is used to acquire vertex and face information of the three-dimensional mesh model;

[0199] The optimization module 1070 is used to optimize the three-dimensional mesh model based on the vertex and face information to obtain an optimized three-dimensional mesh model.

[0200] The optimization step based on the vertex and face information of the 3D mesh model includes at least one of the following:

[0201] Delete unused vertices from the 3D mesh model;

[0202] Remove duplicate vertices from faces that have the same position but are not topologically adjacent;

[0203] Mark the degenerate facet.

[0204] In one embodiment, the device may further include an adjustment module 1080, which can be used to:

[0205] If the projection requirements change, the projection direction and projection reference plane information are updated according to the projection requirements.

[0206] When the three-dimensional mesh model is displaced and rotated, the projection direction and the projection reference plane are transformed inversely according to the parameters of displacement and rotation, so as to keep the relative positional relationship between the projection direction and the projection reference plane and the three-dimensional mesh model unchanged.

[0207] When the 3D mesh model is scaled, the bounding boxes of all nodes in the tree object are scaled accordingly according to the scaling parameters, and the scaling ratio information is maintained in the tree object.

[0208] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0209] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0210] Figure 11 This is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Figure 11 As shown, the electronic device includes a memory 1110 and a processor 1120. The memory 1110 stores a computer program that can run on the processor 1120. The number of memories 1110 and processors 1120 can be one or more. The memory 1110 can store one or more computer programs, which, when executed by the electronic device, cause the electronic device to perform the method provided in the above-described method embodiments. The electronic device may also include a communication interface 1130 for communicating with external devices and performing data exchange and transmission.

[0211] If the memory 1110, processor 1120, and communication interface 1130 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0212] Optionally, in a specific implementation, if the memory 1110, processor 1120 and communication interface 1130 are integrated on a single chip, the memory 1110, processor 1120 and communication interface 1130 can communicate with each other through an internal interface.

[0213] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0214] Further, optionally, the aforementioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct RAMBUS RAM (DR RAM).

[0215] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line, DSL) or wireless (e.g., infrared, Bluetooth, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)). It is worth noting that the computer-readable storage media mentioned in this disclosure can be non-volatile storage media; in other words, it can be non-transient storage media.

[0216] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0217] In the description of the embodiments of this disclosure, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0218] In the description of the embodiments disclosed herein, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0219] In the description of embodiments of this disclosure, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more.

[0220] The above description is merely an exemplary embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.

Claims

1. A projection method for a three-dimensional mesh model, comprising: Construct the edge topology information and tree object of the 3D mesh model; wherein, the 3D mesh model includes multiple patches, each patch including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple patches; the tree object is obtained by partitioning the 3D mesh model according to the bounding box; the 3D mesh model is used for video, games, animation, movie special effects, virtual reality, augmented reality, industrial design, architecture and 3D printing; Candidate edges in the edge topology information are determined based on the projection direction and the projection reference plane; wherein, the candidate edges are edges that need to be filtered for visibility; the candidate edges include boundary edges, internal feature edges, and projected contour edges; Visible edges are determined based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane. Based on the projection direction and the projection reference plane, the visible edge is projected to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane; The edge topology information for constructing the three-dimensional mesh model includes: Traverse the vertex pairs of the edges of each facet of the 3D mesh model, and generate edge codes based on the vertex numbers of the traversed vertex pairs; If the edge code of the current edge is not present in the edge topology information, the edge code of the current edge, the adjacent face, and the vertex information of the adjacent face are stored in the edge topology information. If the edge code of the current edge exists in the edge topology information, add the corresponding edge adjacent face and adjacent face vertex information to the edge topology information corresponding to the edge code; The process of determining candidate edges in the edge topology information based on the projection direction and the projection reference plane includes: after inputting the projection direction and the projection reference plane, traversing the edge topology and determining the candidate edges according to the following rules: A boundary edge has only one adjacent face; There are multiple adjacent faces distributed on both sides of the plane composed of the projection vector and the edge vector. The two faces closest to the projection direction with an angle greater than or equal to the threshold are the internal feature edges. The projection contour edge is defined as a plane composed of multiple adjacent facets distributed on the same side of the plane formed by the projection vector and the edge vector. The process of determining visible edges based on the projection direction, the candidate edges, and the tree object includes: constructing a ray based on the midpoint of the candidate edges and the opposite direction of the projection direction; and recursively defining the tree object based on the ray, and selecting the candidate edges that satisfy the visible edge conditions as the visible edges. The process of recursively ... The visible edge conditions include: The candidate edge is not an edge of a degenerate patch; The ray does not intersect with the bounding box of the node; The ray intersects the bounding box of the node, but does not intersect each non-degenerate patch in the node; The ray intersects the bounding box of the node and the boundary edge of the non-degenerate patch in the node.

2. The method according to claim 1, wherein, The tree object is an octree structure, and the tree object includes a root node, child nodes, leaf nodes, and the face information included in the leaf nodes; Constructing the tree object of the 3D mesh model includes: Calculate the root bounding box based on the three-dimensional mesh model; Set the maximum depth and maximum node capacity of the tree object, and use the root bounding box as the root node; wherein, the maximum depth is the maximum number of layers of the tree object's nodes, and the maximum node capacity is the maximum number of faces that a node can hold; The root bounding box is divided into eight sub-quadrants along its center. Each sub-quadrant serves as a child node of the root node. A sub-bounding box is calculated for each child node, and the face information of the face that intersects with the sub-bounding box is stored in the child node. The center of the sub-bounding box is divided into eight sub-quadrants. Each sub-quadrant serves as the next-level child node of the child node. The sub-bounding box is calculated for the next-level child node. The face information of the face that intersects with the sub-bounding box of the next-level child node is stored in the next-level child node. If the depth of a node in the tree object does not reach the maximum depth and / or the number of faces it contains is higher than the maximum capacity of the node, clear the face information of all nodes in the tree object except for the leaf nodes.

3. The method according to claim 1, wherein, The candidate edges include boundary edges, internal feature edges, and projected contour edges; the candidate edges in the edge topology information are determined based on the projection direction and the projection reference plane, including: The edge in the three-dimensional mesh model that has only one adjacent face is used as the boundary edge; The three-dimensional mesh model has multiple adjacent faces, and these adjacent faces are distributed on opposite sides of the plane formed by the vector of the projection direction and the edge vector. The edge through which the vector of the projection direction first passes through two adjacent faces with the included angle within a limited range is taken as the internal feature edge. The projection contour edge is defined as the edge of a plane formed by the vectors and edge vectors of the projection direction in the three-dimensional mesh model, where multiple adjacent faces are distributed on the same side.

4. The method according to any one of claims 1 to 3, further comprising: The topologically continuous polyline segments in the two-dimensional projection line graph are simplified.

5. The method according to any one of claims 1 to 3, further comprising: Obtain the vertex and face information of the three-dimensional mesh model; The optimized 3D mesh model is obtained by optimizing the vertex and face information of the 3D mesh model. The optimization step based on the vertex and face information of the 3D mesh model includes at least one of the following: Delete unused vertices from the 3D mesh model; Remove duplicate vertices from faces that have the same position but are not topologically adjacent; Mark the degenerate facet.

6. The method according to any one of claims 1 to 3, further comprising one or more of the following steps: If the projection requirements change, the projection direction and projection reference plane information are updated according to the projection requirements. When the three-dimensional mesh model is displaced and rotated, the projection direction and the projection reference plane are transformed inversely according to the parameters of displacement and rotation, so as to keep the relative positional relationship between the projection direction and the projection reference plane and the three-dimensional mesh model unchanged. When the 3D mesh model is scaled, the bounding boxes of all nodes in the tree object are scaled accordingly according to the scaling parameters, and the scaling ratio information is maintained in the tree object.

7. A projection device for a three-dimensional mesh model, comprising: A construction module is used to construct the edge topology information and tree object of the 3D mesh model; wherein, the 3D mesh model includes multiple patches, each patch including multiple edges and multiple vertices; the edge topology information is generated based on the edges and vertices of the multiple patches; the tree object is obtained by partitioning the 3D mesh model according to the bounding box; the 3D mesh model is used for video, games, animation, movie special effects, virtual reality, augmented reality, industrial design, architecture and 3D printing; The candidate edge determination module is used to determine candidate edges in the edge topology information based on the projection direction and the projection reference plane; wherein, the candidate edges are edges that need to be filtered for visibility; the candidate edges include boundary edges, internal feature edges, and projected contour edges; The visible edge determination module is used to determine visible edges based on the projection direction, the candidate edges, and the tree object; the visible edges are the candidate edges that can be projected onto the projection reference plane; The projection module is used to project the visible edge according to the projection direction and the projection reference plane to obtain a two-dimensional projection line diagram of the three-dimensional mesh model on the projection reference plane. The building module includes: The traversal submodule is used to traverse the vertex pairs of the edges of each facet of the 3D mesh model and generate edge codes based on the vertex numbers of the traversed vertex pairs. The judgment submodule is used to store the edge code of the current edge, the edge adjacent face, and the vertex information of the adjacent face in the edge topology information if the edge code of the current edge does not exist in the edge topology information. The judgment submodule is also used to add the corresponding edge adjacent face and adjacent face vertex information to the edge topology information corresponding to the edge code when the edge code of the current edge exists in the edge topology information. The process of determining candidate edges in the edge topology information based on the projection direction and the projection reference plane includes: after inputting the projection direction and the projection reference plane, traversing the edge topology and determining the candidate edges according to the following rules: A boundary edge has only one adjacent face; There are multiple adjacent faces distributed on both sides of the plane composed of the projection vector and the edge vector. The two faces closest to the projection direction with an angle greater than or equal to the threshold are the internal feature edges. The projection contour edge is defined as a plane composed of multiple adjacent facets distributed on the same side of the plane formed by the projection vector and the edge vector. The visible edge determination module is further configured to construct a ray based on the midpoint of the candidate edge and the opposite direction of the projection direction; and recursively analyze the tree object based on the ray to determine the candidate edge that satisfies the visible edge condition as the visible edge. The process of recursively ... The visible edge conditions include: The candidate edge is not an edge of a degenerate patch; The ray does not intersect with the bounding box of the node; The ray intersects the bounding box of the node, but does not intersect each non-degenerate patch in the node; The ray intersects the bounding box of the node and the boundary edge of the non-degenerate patch in the node.

8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.