Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions

JP2025031730AActive Publication Date: 2025-03-07ROBLOX CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024211525
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-06-02
Filing Date
2024-12-04
Publication Date
2025-03-07
Estimated Expiration
2043-06-02

Smart Images

  • Figure 2025031730000001_ABST
    Figure 2025031730000001_ABST
Patent Text Reader

Abstract

To generate polygon meshes that approximate surfaces using root-finding and iteration for mesh vertex positions.SOLUTION: In some embodiments, a method includes receiving input data that represents a surface that distinguishes an inside and an outside of a volume. A voxel grid that includes the surface is determined, the voxel grid including a plurality of voxels. Particular voxels of the voxel grid intersecting the surface are identified. A mesh is generated that approximates the surface, the mesh including a plurality of polygons that are defined by vertices in the particular voxels. Generating the mesh includes determining some of the vertices using a root-finding technique for acquiring roots of a surface function that describes the surface.SELECTED DRAWING: Figure 1A
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to the field of computer-generated surface approximations, and in particular to methods, systems and computer-readable media for the generation of polygon meshes that are approximations of surfaces. [Background technology]

[0002] Rendering three-dimensional (3D) objects and surfaces for display on a display device is utilized in a variety of applications. Images, videos, games, simulations, virtual reality systems, medical imaging, and many other applications render three-dimensional objects and surfaces based on data describing the objects and surfaces for display on a two-dimensional (2D) screen and / or a three-dimensional virtual environment. Various techniques have been developed to enable devices to efficiently generate, store, and display approximations of surfaces as meshes of polygons, such as triangles, based on input data describing the surfaces.

[0003] In many systems, surface data is received in any of a variety of formats. For example, the surface data may be encoded as a grid of voxels, a point set, or other representations that include mathematical functions, scalar values. However, standard techniques for approximating a mesh from surface data may not provide an accurate approximation of the surface, for example, when the surface data is provided in a particular format, or in other cases has particular characteristics. For example, in some applications, the data to be rendered may not be provided as a distance function, but may include density or occupancy values ​​that indicate the amount of each voxel occupied by a volume with the surface. In other examples, the surface may vary nonlinearly along the edges of the voxels. In such cases, existing techniques for approximating meshes for surfaces may be inaccurate to render. Thus, improved techniques that can efficiently generate meshes that more accurately approximate the surface may be needed.

[0004] The background description provided herein is for the purpose of generally presenting the context of the disclosure. The work of the inventors may not be admitted, explicitly or implicitly, as prior art to the present disclosure to the extent that it is described in this background section and any aspect of the description that may not be considered prior art at the time of filing. Summary of the Invention [Means for solving the problem]

[0005] An embodiment of the present application relates to generating a polygon mesh that approximates a surface using iterations for root solving and / or mesh vertex locations. In some embodiments, the method includes receiving, by one or more processors, input data representing a surface that distinguishes between an interior and an exterior of a volume. The one or more processors determine a voxel grid that includes the surface, the voxel grid including a plurality of voxels. The one or more processors identify particular voxels of the voxel grid that are intersected by the surface. The one or more processors generate a mesh that approximates the surface, the mesh including polygons defined by vertices in the particular voxels. Generating the mesh includes determining a portion of the vertices using a root solving method that obtains roots of a surface function that describes the surface.

[0006] Various embodiments and examples of the method are described. For example, in some embodiments, the method further includes mapping each voxel of the plurality of voxels to each intersection case from a set of stored intersection cases based on the input data, each mapping intersection case indicating an intersection path of the surface through the voxel, and identifying the particular voxel includes identifying an edge or other line segment of the particular voxel where the surface intersects based on the mapping intersection case. In some embodiments, the root finder approximates the location of the vertex by iteratively evaluating the location of the vertex and adjusting the location of the vertex to the surface. In some embodiments, each vertex is constrained to a dimension of the voxel space of the associated one of the particular voxels. In various embodiments, the input data may include a scalar value in a distance field indicating the spatial distance of the data point to the surface, a scalar value indicating the density or occupancy of the voxel by volume, etc.

[0007] In some embodiments, the root finding method includes approximating a derivative of the surface function based on discrete samples of the input data using differences of the surface function, and approximating roots of the surface function using the derivative to determine positions of the vertices. In some embodiments, the root finding method includes determining, for each vertex, an approximate position of the vertex based on the root of the surface function determined based on the derivative of the surface function, determining an error between the approximate position and the surface, and determining a new approximate position of the vertex in the associated voxel to reduce the error.

[0008] In some embodiments, the method further includes repeating, with one or more processors, the steps of determining the error and determining additional approximate positions until the error meets a predetermined criterion to reduce the error. In some embodiments, the root finding method includes analytically solving a surface function describing the surface to obtain roots of the surface function, the roots being used to determine the positions of the vertices. In some embodiments, the root finding method includes, for each vertex of the plurality of vertices, performing linear interpolation on a first set of vertices to determine an approximation of the position of the vertex along an edge or other line segment of an associated voxel, determining an error between the approximation of the vertex position and the surface, and performing linear interpolation on a second set of vertices including the approximation of the vertex position to determine a new approximation of the vertex position in the associated voxel to reduce the error. In some embodiments, the method further includes repeating, with one or more processors, the steps of determining the error and performing linear interpolation on a set of vertices including the newer approximation of the vertex position to reduce the error until the error meets a predetermined criterion.

[0009] In some embodiments, the method further includes determining a curvature of the surface over one or more of the particular voxels, determining that the curvature of the surface in at least one of the one or more voxels exceeds a threshold, and in response to the curvature of the surface exceeding the threshold in the at least one voxel, subdividing the mesh by inserting an additional vertex in the mesh between two vertices of the mesh in the at least one voxel, determining a second error between the additional vertex and the surface, and adjusting the additional vertex proximate to the surface to reduce the second error. In some embodiments, the method further includes repeating, with one or more processors, the steps of determining the second error and adjusting the additional vertex until the second error meets a second predetermined criterion. In some embodiments, the method further includes generating, with the one or more processors, a feature surface based on the mesh, the feature surface being displayable by a display device.

[0010] In some embodiments, a computer-implemented method includes receiving, by one or more processors, input data representing a surface that distinguishes between an interior and an exterior of a volume. The one or more processors determine a voxel grid that includes the surface, the voxel grid including a plurality of voxels. The one or more processors identify particular voxels of the voxel grid that are intersected by the surface. The one or more processors generate a mesh that approximates the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxels. The step of generating the mesh includes the steps of determining approximate locations of vertices of the polygon within the voxel, determining a surface curvature over one or more of the particular voxels, determining that the surface curvature in a particular one of the particular voxels exceeds a threshold, and in response to determining that the surface curvature exceeds a threshold in the particular voxel, subdividing the mesh by inserting an additional vertex in the mesh between two vertices of the mesh in the particular voxel, determining an error between the additional vertex and the surface, and adjusting the additional vertex in the particular voxel to reduce the error.

[0011] Various embodiments and examples of the method are described. For example, in some embodiments, adjusting the additional vertices includes repeating, with one or more processors, determining an error and adjusting the additional vertices until the error meets a predetermined criterion. In some examples, the error meets the predetermined criterion as a predetermined number of iterations are performed, the error falls below a predetermined threshold, etc. For example, in some embodiments, the method further includes mapping, by one or more processors, each voxel of the plurality of voxels to each intersection case from a set of stored intersection cases based on the input data, each mapped intersection case indicating an intersection path of the surface through the voxel, and identifying the particular voxel includes identifying an edge or other line segment of the particular voxel that the surface intersects based on the mapped intersection case. In some embodiments, each vertex is constrained to a dimension of the voxel space of the associated one of the particular voxels.

[0012] In some embodiments, determining the curvature of the mesh includes determining tangent surfaces at vertices at one or more of the particular voxels. In some embodiments, determining the curvature of the mesh includes sampling the mesh at midpoints of edges or other line segments of certain of the particular voxels and determining the distance from the midpoints to the surface. In some embodiments, adjusting additional voxels within the particular voxel includes using a root-finding method to obtain roots of a surface function describing the surface. In some embodiments, after inserting the additional vertex, the method further includes determining that a curvature of a portion of the surface in the particular voxel at the additional vertex exceeds a threshold, and in response to determining that a curvature of the portion of the surface exceeds a threshold, further subdividing the mesh by inserting a second additional vertex in the mesh between the additional vertex and the other of the two vertices of the mesh in the particular voxel, determining an error between the second additional vertex and the surface, and adjusting the second additional vertex in the particular voxel to reduce the error. In some embodiments, the method further includes generating a feature surface based on the mesh, the feature surface being displayable by a display device.

[0013] In some embodiments, a system includes at least one processor and a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform operations including receiving input data representing a surface that distinguishes between an interior and an exterior of a volume, determining a voxel grid that includes the surface, the voxel grid including a plurality of voxels, identifying particular voxels of the voxel grid that are intersected by the surface, and generating a mesh that approximates the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxels. Generating the mesh includes determining a portion of the vertices using a root-finding method that obtains roots of a surface function that describes the surface.

[0014] Some embodiments may include a system with at least one processor coupled to a non-transitory computer-readable medium having stored thereon software instructions that, when executed by the one or more processors, cause the one or more processors to perform operations. The operations may include one or more features of any of the methods described above.

[0015] In some embodiments, a non-transitory computer-readable medium stores software instructions that, when executed by a processor of a device, cause the processor to perform operations that may include one or more features of any of the methods or systems described above.

[0016] Some embodiments of the present application relate to generating a polygon mesh that approximates a surface using iterations for mesh vertex positions. In some embodiments, the method includes receiving, by one or more processors, input data representing a surface that distinguishes between an interior and an exterior of a volume. The one or more processors determine a voxel grid that includes the surface, the voxel grid including a plurality of voxels. The one or more processors identify particular voxels of the voxel grid that are intersected by the surface. The one or more processors generate a mesh that approximates the surface, the mesh including polygons defined by vertices in the particular voxels. Generating the mesh includes determining approximate positions of a set of vertices of polygons of the mesh at the particular subset of voxels based on interpolation between positions at the particular subset of voxels where a surface intersects the particular subset of voxels; determining an error between the approximate voxel values ​​and assigned voxel values ​​at the particular voxels, where the approximate voxel values ​​are based on the approximate positions and the assigned voxel values ​​are determined from input data; and adjusting the approximate position of at least one vertex of the subset of vertices using an iterative accelerated relaxation method to reduce the error.

[0017] Various embodiments and examples of the method are described. For example, in some embodiments, adjusting the approximate position of at least one vertex includes iterating, with one or more processors, the steps of determining an error and adjusting until the error meets a predetermined criterion. In some embodiments, the error meets the predetermined criterion in response to a predetermined number of iterations being performed or the error meeting one or more predetermined thresholds. In some embodiments, the approximate positions of a subset of the vertices of the polygon are determined based on an interpolation between the placement on the edge of a particular subset of voxels where the surface intersects the edge.

[0018] In some embodiments, the method further includes mapping, by the one or more processors, each voxel of the plurality of voxels to a respective intersection case from a set of stored intersection cases based on the input data, where each mapped intersection case indicates an intersection path of the surface through the voxel, and identifying the particular voxel includes identifying an edge or other line segment of the particular voxel with which the surface intersects based on the mapped intersection case. In some embodiments, determining approximate locations of a subset of vertices of polygons of the mesh includes determining initial approximate locations of the vertices using a marching cubes technique or a surface nets technique.

[0019] In some embodiments, the iterative accelerated relaxation method is used to determine a plurality of approximate positions of a subset of the vertices of the polygon, the subset of particular voxels including a plurality of neighboring voxels of the mesh. In some embodiments, the subset of particular voxels includes a plurality of neighboring voxels of a voxel grid, and the method further includes determining a proximity position of a second subset of the vertices of the polygon of the mesh in a second subset of the neighboring voxels of the particular voxel.

[0020] In some embodiments, determining the error includes determining approximate voxel values ​​based on the approximate positions and a comparison of the approximate voxel values ​​to the assigned voxel values, and determining the approximate voxel values ​​includes, for each approximate voxel value, determining a volume of a mesh that intersects with a voxel associated with the approximate voxel value and determining the approximate voxel value based on the volume of the mesh. In some embodiments, determining the volume of a mesh that intersects with a voxel associated with the approximate voxel value includes determining a three-dimensional integral of the mesh within the voxel associated with the approximate voxel value.

[0021] In some embodiments, the method further comprises generating a feature surface based on the mesh, the feature surface being displayable by a display device. In some embodiments, each vertex is constrained to a dimension of the voxel space of an associated one of the voxels. In some embodiments, the input data comprises a scalar value indicating the density or occupancy of the voxel by volume.

[0022] In some embodiments, a system includes at least one processor and a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform operations including receiving input data representing a surface that distinguishes between an interior and an exterior of a volume, determining a voxel grid that includes the surface, the voxel grid including a plurality of voxels, identifying particular voxels of the voxel grid that are intersected by the surface, and generating a mesh that approximates the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxels. Generating the mesh includes determining approximate positions of a subset of vertices of polygons of the mesh at the particular subset of voxels based on interpolation between positions at the particular subset of voxels where a surface intersects the particular subset of voxels; determining an error between the approximate voxel values ​​and assigned voxel values ​​at the particular voxels, where the approximate voxel values ​​are based on the approximate positions and the assigned voxel values ​​are determined from input data; and adjusting the approximate position of at least one vertex of the subset of vertices using an iterative accelerated relaxation method to reduce the error.

[0023] Various embodiments and examples of the system are described. For example, in some embodiments, the operation of adjusting the approximate position of at least one vertex includes determining an error and repeating the adjusting step until the error meets a predetermined criterion. In some embodiments, the iterative accelerated relaxation method is used to determine a plurality of approximate positions of a subset of the vertices of the polygon, the subset of particular voxels including a plurality of neighboring voxels of the mesh. In some embodiments, the subset of particular voxels includes a plurality of neighboring voxels of the voxel grid, and the at least one processor performs further operations including determining a proximity position of a second subset of the vertices of the polygon of the mesh in a second subset of the neighboring voxels of the particular voxel.

[0024] In some embodiments, the operation of determining the error includes determining approximate voxel values ​​based on the approximate location and a comparison of the approximate voxel values ​​to the assigned voxel values, and determining the approximate voxel values ​​includes, for each approximate voxel value, determining a volume of a mesh that intersects with a voxel associated with the approximate voxel value and determining the approximate voxel value based on the volume of the mesh. In some embodiments, the operation of determining a volume of a mesh that intersects with a voxel associated with the approximate voxel value includes determining a three-dimensional integral of the mesh within the voxel associated with the approximate voxel value. In some embodiments, each vertex is constrained to a dimension of the voxel space of the associated one of the voxels. In some embodiments, the at least one processor performs further operations including generating a feature surface based on the mesh, the feature surface being displayable by a display device.

[0025] In some embodiments, a non-transitory computer readable medium stores software instructions that, when executed by a processor of the device, cause the processor to perform operations including receiving input data representing a surface that distinguishes between an interior and an exterior of a volume, determining a voxel grid that includes the surface, the voxel grid including a plurality of voxels, identifying particular voxels of the voxel grid that are intersected by the surface, and generating a mesh that approximates the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxels. Generating the mesh includes determining approximate positions of a subset of vertices of polygons of the mesh at the particular subset of voxels based on interpolation between positions at the particular subset of voxels where a surface intersects the particular subset of voxels; determining an error between the approximate voxel values ​​and assigned voxel values ​​at the particular voxels, where the approximate voxel values ​​are based on the approximate positions and the assigned voxel values ​​are determined from input data; and adjusting the approximate position of at least one vertex of the subset of vertices using an iterative accelerated relaxation method to reduce the error. [Brief description of the drawings]

[0026] [Figure 1A] FIG. 2 is an illustration showing a surface onto which a voxel grid is fitted. [Figure 1B] FIG. 1B is an illustration showing an example mesh approximating the surface of FIG. 1A, according to some embodiments. [Diagram 2] 1 is a flowchart of an exemplary method for generating a polygon mesh that approximates a surface represented in input data, according to some embodiments. [Diagram 3] 4 is a flowchart of an example method for determining positions of vertices of a mesh that approximates a surface, according to some embodiments. [Figure 4]4 is a flowchart of an example method for determining locations of vertices of a mesh that approximates a surface based on derivatives of a surface function and using a numerical root-finding method, in accordance with some embodiments. [Diagram 5] 1 is a graphical illustration showing an example of obtaining the positions of vertices of a mesh using a root-finding method with a differentiable surface function, according to some embodiments. [Figure 6] 4 is a flowchart of an example method for determining locations of vertices of a mesh that approximates a surface using a numerical root-finding method in iterative refinement, according to some embodiments. [Figure 7] 1 is a graphical illustration showing an example of obtaining the positions of vertices of a mesh using a root-finding method in iterative refinement, according to some embodiments. [Figure 8] 4 is a flowchart of an example method for determining locations of vertices of a mesh that approximates a surface using an iterative accelerated relaxation method, in accordance with some embodiments. [Figure 9] 1 is a flowchart of an example method for determining locations of vertices of a mesh that approximates a surface by subdividing one or more portions of the mesh, according to some embodiments. [Figure 10] 1 is a graph illustrating an example of subdividing a portion of a mesh, adding vertices to the mesh, and refining the positions of the added vertices, according to some embodiments. [Figure 11] 1 is a graph illustrating an example of subdividing a portion of a mesh, adding vertices to the mesh, and refining the positions of the added vertices, according to some embodiments. [Figure 12] FIG. 1 is a block diagram illustrating an example system that may be used to implement one or more features described herein, according to some embodiments. [Figure 13] FIG. 1 is a block diagram illustrating an example computing device that may be used to implement one or more features described herein, according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] One or more embodiments described herein relate to generating a polygonal mesh that approximates a surface represented in input data. Features described include using one or more root-finding techniques and / or iterations to determine the vertices of the polygons that make up the mesh.

[0028] In some example applications, input data is received that represents a surface or a feature having such a surface (e.g., an object, a terrain feature, etc.). The input data may be provided or transmitted, for example, from a terrain editing program, a constructive solid geometry application, a three-dimensional (3D) modeling program, a magnetic resonance imaging (MRI), X-ray or other volumetric scanner, an image capture device, a virtual reality (VR) or augmented reality (AR) program or device, or other source. In some cases, a mesh of polygons that approximates the surface or object will be generated. The mesh may be defined with sufficiently reduced complexity so that it can be processed, transmitted, and / or rendered for display quickly and stored in reduced storage space compared to other representations of surfaces and objects. For example, such meshes are commonly used in applications such as terrain, medical imaging, or efficient rendering of clay-modeled objects.

[0029] The input data may be encoded in various forms and formats, for example as a mathematical function, a grid of discrete voxels containing scalar values, a point set, or other representation suitable for mapping a 3D configuration to a value. In some examples, the input data may define a 3D field f(x,y,z) that associates a scalar value with the entire (x,y,z) configuration. In some applications, the scalar value of this field may represent a distance from some desired surface, creating a "signed distance field." In other applications, the scalar value may represent a density or occupancy, creating an "occupancy field," or may represent any continuous non-distance value. The occupancy is considered here as a ratio of the occupied volume (e.g., occupied by solid material) in one voxel, and is not a continuous field in three dimensions, since it cannot be evaluated at any configuration in space. The occupancy value is known in discrete voxels, because the occupancy value in a voxel is the integral of the infinitesimal occupancy over each voxel. Mesh generation methods can be applied to the occupancy field as if it were a distance function, but this can limit the quality of the results.

[0030] An isosurface (e.g., a level set) (herein referred to as a "surface") is a surface where the field has a constant value. Typically, an isosurface threshold f is used, where f=0 (for distance and arbitrary data) and f=0.5 (for occupancy data) are the most interesting isosurfaces for discrimination. Surfaces are continuous, potentially smooth shapes in volume. Surfaces distinguish between the inside and outside of a volume.

[0031] In some cases, the input data may be encoded in voxels, and the interpolation and generated voxels may define the field. In some examples, the field can be interpolated by tri-linear interpolation, nearest neighbor (e.g., point sampling), or higher order methods. Tri-linear interpolation produces cubic (third order) variations along the lines, which means that the field varies non-linearly. Any form of input data may be volumetrically rasterized into voxels as a pre-processing step.

[0032] The described techniques determine and generate polygon meshes (e.g., triangular meshes, or meshes of various types of polygons) that approximate surfaces defined in the input data. In some cases, line meshes may be determined and generated for two-dimensional (2D) fields defined in the input data. The described techniques can convert input data represented in various formats into meshes that allow efficient physics simulation, rendering, and storage, as well as further editing.

[0033] One or more techniques described herein can achieve higher quality than conventional techniques even when the input data contains discrete occupancy values. The described techniques are also applicable to true distance fields as inferred from occupancy fields.

[0034] For example, the known mesh generation technique marching cubes (including the related methods marching tetrahedra and its 2D equivalents marching squares and marching triangles) fits a voxel grid and classifies each vertex of the mesh as inside or outside the volume (e.g., there could be one bit per vertex / corner of the voxel cage). A triangular template is generated to identify the edges through which the surface passes, but not the location along these edges. The marching cubes algorithm uses linear interpolation to estimate the location where the actual surface intersects a voxel, based on the values ​​of a signed distance function at the corners of the voxel. In some cases, for example, if the field f is a linear gradient, linear interpolation along the edges of the location (x,y,z) proportional to the value f will accurately identify the interpolated location of the actual surface. However, now the f value varies non-linearly along the edge, which places the vertices of the generated mesh off-center from the actual surface, producing an inaccurate mesh representation of the surface.

[0035] An extension of the marching cubes method uses quadratic interpolation to better match the nonlinear density functions of human bones and tissues when detecting surfaces in computed tomography and x-ray scans. However, the marching cubes method has another limitation: it only gives a good approximation when applied to true, metric distance functions. If the input f is non-metric (e.g., monotonic with distance to the surface but not directly proportional) or contains occupancy / density information instead of distance, the marching cubes method will create inconsistent slopes for the generated triangles and will determine vertex positions that are far from the surface.

[0036] A related technique known as "surface nets" is designed to work more robustly for non-distance functions: it centers mesh vertices on voxels that lie on the boundary, connects adjacent vertices, and constrains vertices to stay within their original voxel cage, while relaxing the entire plane for smoothing.

[0037] Some extensions of the Surface Nets method place a vertex at each corner between eight voxels where at least one voxel is below the threshold and at least one voxel is above the threshold surface. The vertices are then moved to positions calculated by interpolating between the centers of the voxels based on their values. One method uses the same linear interpolation as the Marching Cubes method to interpolate between each pair of voxels where one voxel is above the threshold and the other is below the threshold, averaging the positions. However, because Surface Nets uses data from the function values ​​outside each cell, it is not local and cannot be parallelized. It is not memory efficient on digital processors because it exploits data dependencies that require communication between individual processor threads working on separate voxel cells.

[0038] The techniques and features described herein have several advantages. This disclosure details techniques that can be used to generate meshes of polygons that approximate surfaces. Each technique described is independent and can be used individually or in combination. Each technique improves the accuracy of surface exploration and generation where conventional techniques such as marching cubes yield poor results due to non-linear variations in the field along edges and non-descriptive nature of the field distance function. The features are described for the case of a 3D cube, but the same features are also applicable to 3D tetrahedrons, 2D squares, and 2D triangles.

[0039] Unlike SurfaceNets and other machine learning methods, the techniques described above offer efficiency while being local and fully parallelizable. Thus, only data from the function values ​​in each cell's neighborhood is used. This ensures that there are no data dependencies that would require communication between individual processor threads working on separate voxel cells, making them memory efficient on digital processors. The results using these techniques are also deterministic, avoiding cracks or discontinuities in the generated surface between voxels. For example, for each of the described techniques, the vertices of the mesh can be computed independently for two adjacent voxels along each face of the generated surface, and each technique independently yields the same vertex value. This results in a mesh that more accurately approximates the surface without increasing the processing requirements to deal with discontinuities between voxels.

[0040] A technical effect of one or more of the described embodiments may be that the apparatus scales less computational resources to obtain more accurate results. For example, a technical effect of the described embodiments may be that the apparatus consumes less system processing and power resources compared to conventional systems that do not provide one or more of the above-described techniques or features. For example, conventional systems using conventional techniques such as surface nets may require more memory capacity due to data dependencies that require communication between individual processor threads that handle separate voxel cells. The techniques described herein may be implemented locally to a processor or processor thread and do not require such communication. Conventional systems or techniques that do not provide deterministic results may require additional processing to remove or address discontinuities that arise between independently processed voxels. The techniques described herein provide deterministic results, providing greater accuracy and avoiding such additional processing. Some conventional systems produce inaccurate results because surfaces vary nonlinearly along voxel edges or because surfaces are not described by distance functions. The techniques described herein can provide meshes that more accurately approximate surfaces that may vary non-linearly or that are not described by a distance function (eg, those described by occupancy or density values).

[0041] Example Voxel Grids and Surfaces 1A is an illustration 100 of an example surface 102 described in input data, according to some embodiments. The surface 102 may be a feature such as a terrain or landscape, a portion of a virtual object, etc. A voxel grid 104 is fitted across the surface 102. In this example, the voxel grid 104 is made up of a number of cubic voxels 106, all of the same size. For ease of illustration, a subset of the voxels 106 is shown in detail. The voxels 106 include vertices 108, which in this example are corners of the voxels. The surface 102 has intersecting paths through the voxels 106 of the voxel grid 104, e.g., the surface 102 intersects with faces and edges in some of the voxels 106 of the grid. Here, a "face" of a voxel is considered to be a two-dimensional side of the voxel, and an "edge" of a voxel is considered to be a one-dimensional edge of the face. A "line segment" may be an edge of a voxel, or it may be any other kind of straight line segment on or within a voxel (e.g., a straight line defined by the vertices of a voxel, such as the two central vertices, or a line connecting other vertices of adjacent voxels, as used in surface nets methods).

[0042] FIG. 1B is an illustration of an example mesh 120 approximating the surface 102 shown in FIG. 1A, according to some embodiments. The mesh 120 is made up of polygons, in this example, triangles 122 defined by mesh vertices 124. The triangles 122 are adapted to approximate the contour of the surface 102. The mesh 102 is generated by obtaining the locations of the mesh vertices 124 within the voxels 106 of the voxel grid 104 shown in FIG. 1A. The locations of the mesh vertices 124 are determined within the set of voxels intersected by the surface 102. The locations of the mesh vertices 124 relative to the voxels 106 may be determined using one or more techniques described herein. The techniques can generate meshes similar to the mesh 102 and / or other meshes, e.g., meshes made up of various numbers and / or types of polygons (e.g., quadrangles, additional triangles, etc.).

[0043] Mesh Generation Method FIG. 2 is a flowchart of an example method 200 of generating a polygon mesh approximating a surface represented in input data, according to some embodiments. In some embodiments, the method 200 can be executed, for example, on a server system, such as, for example, the online platform 1202 as shown in FIG. 12, or the computing device 1300 as shown in FIG. 13. In some embodiments, some or all of the method 200 can be implemented on a system, such as one or more client devices 1210 and devices 1216, and / or both the server system and one or more client systems, as shown in FIG. 12 and / or FIG. 13. In the described example, the implementation system includes one or more processors or processing circuits and one or more processor storage devices, such as a database or other accessible storage. In some embodiments, various components of one or more servers and / or client devices can execute various blocks or other portions of the method 200.

[0044] Method 200 may begin at block 202. In block 202, input data is received by a device or system performing method 200. In some embodiments, the input data includes a representation of one or more surfaces (e.g., isosurfaces) within a 3D field. The surfaces may be continuous and potentially smooth in shape as a solid. For example, the surfaces may be surfaces of solid objects represented within a video game, a virtual reality environment, or other virtual environment. In some examples, the surfaces may be representations of surfaces of physical objects or other features within a scanned or sensed volume or region, such as organs within a human body, objects within a particular environment (e.g., materials or elements, inside, underground, in space, underwater, etc.), a geographical landscape, or other environment.

[0045] In some embodiments, a surface distinguishes between the inside and outside of a volume. For example, a represented object may have a volume, the inside of the volume including one or more materials of the object, and the outside of the volume is the environment in which the object is placed. In some examples, a surface can define where the interior of the object is located (e.g., walls that represent the interior volume of a car object) and where the exterior to the object is located (e.g., walls and other exterior surfaces that represent the space around the car, placement surfaces, etc.).

[0046] In some embodiments or cases, the input data describes a 3D field with scalar values ​​at each (x,y,z) location of the field. In some embodiments or cases, each scalar value can represent a distance from a surface, thereby forming a signed distance field (e.g., positive or negative outside or above the surface, and opposite sign (negative or positive) inside or below the surface). In some embodiments or cases, each scalar value can represent a ratio of a voxel volume (e.g., a solid body of a volume) occupied by a volume defined by the surface, thereby representing a quantity of density or occupancy of the voxel, forming an occupancy field. In some embodiments, this occupancy is not a continuous field in 3D, since it cannot be evaluated at any location in space. The occupancy value may only be known in discrete voxels. The occupancy value in a voxel may be the integral of the infinitesimal occupancy over each voxel. In some embodiments or cases, each scalar value can represent a continuous and non-distance value, or other value.

[0047] In some embodiments, the surface is an isosurface (e.g., a level set), a surface where the field has a constant value. In some embodiments, an isosurface threshold may be used. In some examples, thresholds of 0 (for distance and arbitrary data) and 0.5 (for occupancy data) can be used to identify isosurfaces.

[0048] In various examples, the input data may be encoded as a mathematical function, a grid of discrete voxels containing scalar values, a point set, or other representations, e.g., suitable for mapping 2D or 3D locations on a surface to values. In some examples, if the input data is encoded in voxels, the interpolation method used to encode the voxels defines the surface field. The surface field may be interpolated using any of a variety of methods, e.g., trilinear interpolation, nearest neighbor (e.g., point sampling), or higher order methods. Trilinear interpolation produces a cubic (third order) change along the line, causing the surface field to vary nonlinearly. In yet another example, any form of input data is volumetrically rasterized into voxels as a pre-processing step prior to method 200. In some embodiments, if the input data is encoded in a voxel grid, the voxel grid used for method 200 (or any of the other methods described herein) may be a different grid (e.g., a grid having a different resolution or voxel dimensions) than the grid of the input data. In some embodiments, a voxel grid of input data, or its dual (eg, where values ​​are considered to be at the corners of the voxels rather than in the center) can be used for the methods described herein.

[0049] In various examples, the input data may be provided by an application program, device, or other source. For example, a terrain editing program, a structural solid geometry application, a 3D modeling program, an MRI, X-ray, or other volumetric scanner can generate the input data received at block 202. In some embodiments, data output by such sources is pre-processed before being received at block 202. For example, it may be encoded as one of the representations described above (e.g., mathematical functions, voxels, etc.).

[0050] In some embodiments, a 2D equivalent of a surface, such as a line (e.g., an isoline or contour line), can be represented in the input data. The line represented in place of a surface can be approximated using techniques similar to those described herein, including method 200. For example, the line can be approximated by providing multiple different line segments (e.g., polylines) and / or approximated curvatures. Block 202 can be followed by block 204.

[0051] At block 204, a voxel grid is determined, where the voxel grid includes a surface represented in the input data that includes a plurality of voxels. In some embodiments, the voxels may be cubic in shape. For example, the voxel grid may be fitted to the input data such that each corner of each voxel may be classified as inside or outside a volume defined by the surface in the input data. In some examples, each corner of each voxel in the voxel grid may be assigned one bit. The size of the voxels in the grid may be determined based on a desired resolution, available storage, and / or other considerations.

[0052] In some embodiments, the input data received at block 202 may have voxels and a voxel grid pre-encoded in the input data, and these same voxels may be used in method 200, rather than block 204 defining the various voxels on the input data and surface. In some embodiments, a grid similar to such an existing voxel grid may be determined at block 204, e.g., a dual of the existing grid where the voxel values ​​are at the corners of the voxels rather than at the centers of the voxels. In some embodiments, a new voxel grid may be determined at block 204 defining new voxels for the input data, which may differ from the existing encoded voxel grid where the new voxels are used in method 200. Block 204 may be followed by block 206.

[0053] At block 206, particular voxels that the surface intersects are identified. For example, this may include identifying line segments, such as edges of specific voxels (e.g., intersection paths of the surface) through which the surface passes. In some embodiments, this is done by mapping one or more voxels of the voxel grid to respective intersection cases from a set of stored intersection cases. For example, each voxel of the voxel grid may be assigned to an associated intersection case. In some embodiments, marching tetrahedron or marching cube intersection cases may be used, or intersections used in other techniques may be used (e.g., intersection of lines with some surface nets or other techniques). In some embodiments, a number of unique intersection cases may be provided (e.g., stored and accessed in a lookup table of the system), each intersection case describing a respective path of the surface (or volume) through the voxel, e.g., indicating a respective set of voxel edges (or other voxel line segments) that intersect at the surface (or volume). The intersection cases may be based on various rotations and / or reflections of possible pathways through a voxel at the surface. For example, in the marching cubes method, a set of 14 unique intersection cases describes all of the possible edge intersections at the surface through the 12 edges of a voxel. In some embodiments, a set of 8 bits may be associated with the collection of 8 corners at each voxel, with each of the various sets of bitmaps mapping to a separate one of the intersection cases. For example, the set of bits may be a vector that acts as an index into a table of intersection cases.

[0054] In some examples, for the trivial case where a voxel is completely outside the volume and there are no surfaces intersecting the voxel, the voxel may be assigned an intersection case where all of the set of bits are labeled with a value of zero. In other examples, for the trivial case where a voxel is completely inside the volume and there are no surfaces intersecting the voxel, the voxel may be assigned an intersection case where all of the set of bits are labeled with a value of one. In other intersection cases, a surface passes through one or more faces of the voxel, and the appropriate intersection case is assigned to the voxel based on the corners of the voxel inside the volume and the corners outside the volume. In other examples, the marching tetrahedron technique may be used. This technique is similar to the marching cubes technique, except that each voxel cube is divided into six tetrahedrons, and instead of the 12 edges of the voxel, 19 edges are specified. For each tetrahedron, there are eight possible intersection cases. Other embodiments may assign intersection cases or labels / bits in other ways. Other techniques may be used instead or in addition to determine voxel segments that intersect with a surface. Block 206 may be followed by block 208.

[0055] At block 208, a polygonal template is generated based on the particular voxel identified. For example, the template may be generated based on the identified line segments (e.g., edges) of the particular voxel identified. For example, in some embodiments, the polygon may be a triangle, while in other embodiments, the polygon may be of other types (such as a tetrahedron). The template identifies the edge (or other line segment) where the surface intersects, but not a particular location along the edge. In some embodiments, the vertices of the template's polygon may be assigned an initial location along the identified edge of the particular voxel. For example, the initial location may be a corner, or a midpoint of the identified edge. Other initial locations may be used in other embodiments (e.g., a particular fraction of the edge distance, etc.). Block 208 may be followed by block 210.

[0056] In block 210, a mesh is generated based on the template of block 208, where the mesh approximates the surface. For example, the mesh can be a polygon mesh for 3D fields and surfaces, or a line mesh for 2D fields and lines. The mesh generation includes determining the positions of the polygon vertices of the mesh using one or more root-finding and / or iterative methods, according to the features described herein. This block estimates the positions where the surface is located based on values ​​in the input data, which may be values ​​of signed distance functions or occupancy or density values ​​that describe the surface at the vertices (e.g., corners) of the intersected voxels. Using the described technique, the positions of the mesh vertices are determined more accurately than in conventional techniques. Various embodiments for determining the positions of the vertices for block 210 are described below with reference to Figures 3 to 11.

[0057] The mesh resulting from block 210 can be used as an approximation of the surfaces represented in the input data. After the vertices are located using one or more of the described techniques, the mesh is defined and completed. In some embodiments, the mesh can be further processed in various ways, for example, assigned features (e.g., color or texture to fill polygons), modified to fit a particular object, stored in a particular memory, displayed by a display device, etc. Mesh generation provides for converting the input data of the field represented in various formats into a polygon mesh that can be used, for example, for efficient physics simulation, rendering, storage, and / or further data editing. Common applications include efficient rendering of terrain, medical images, or clay-modeled objects. For example, the mesh can be used to generate feature surfaces of features, such as the surfaces of terrain features (landscapes, mountains, etc.), organs or other body parts, digital objects, etc.

[0058] Selecting the mesh determination method FIG. 3 is a flow chart of an example method 300 for determining vertex positions of a mesh approximating a surface, according to some embodiments. For example, method 300 may be an example embodiment of vertex position determination in block 210 of method 200 of FIG. 2 described above. In some embodiments, method 300 may be executed, for example, on a server system and / or a client system, similar to that described for method 200. In various embodiments, only portions of method 300 are used, e.g., only certain forms of input data and / or only some of the mesh generation techniques described are utilized. For example, some embodiments may utilize only block 304, some embodiments may utilize only blocks 302, 304, and 314, some embodiments may utilize only blocks 302 through 308, and some embodiments may utilize only blocks 302, 304, and 310 through 314.

[0059] Some of the techniques described herein are root finders. In the examples described, the root finders may use the convention of representing a surface or line as an equation with one side of the equation being zero. For example, x 2 +y 2 =r 2 defines a circle, and in the described embodiment, the equation is x 2 +y 2 -r 2 =0. This results in one equation instead of two equations, and allows the surface function to be defined such that a zero result of the function is a point on the surface defined by the function. The techniques described herein can find the zero, for example, determine the x and y values ​​that satisfy the function and result in zero. The set of values ​​that obtains the zero result are the roots of the equation.

[0060] The described root-finding method or methods determine the neighborhood where the zero surface function should be located. More specifically, if f(x1,y1)<0 (e.g., the point is outside the volume) and f(x2,y2)>0 (e.g., the point is inside the volume) and f() is continuous, then somewhere between these points f(x,y)=0. The surface is where the sign is changed to a positive sign. It is an arbitrary convention whether a result less than zero is inside and greater than zero is outside, or vice versa, and either convention can be used in the described technique. In some embodiments, if a vertex (corner) at a voxel edge (or other voxel line segment) is inside the volume and another corner is outside the volume, then a search along the edge is guaranteed to find a point on the surface, e.g., a zero point. There are multiple zero points, but this particular zero is the intersection of the surface and the edge.

[0061] Method 300 may begin at block 302, where it is determined whether the surface is described by a known surface function. Method 300 may be used in some embodiments to process input data that includes a representation of a surface described by a surface function. In some examples, the surface function may be a signed distance function in which the input data values ​​represent the distance of a voxel corner (or other voxel reference point) to the surface. In some embodiments, the surface function describing the surface is defined and included within the input data received by the system-implemented method 300, or the function may otherwise be known by the system (e.g., stored by the system, associated with the input data, specified by user command, etc.). In some examples, it may be useful to convert a particular function into a mesh to describe the function.

[0062] In yet another example, values ​​may be pre-specified at the corners of the voxels and the surface function may be created based on a priori linear interpolation that describes how the surface varies through space. In an additional example, the commands may specify that an existing voxel grid in the input data is to be changed to another voxel grid (e.g., a grid of a different resolution) for mesh generation, and the surface function is specified to enable such conversion to another grid.

[0063] In some embodiments, any of a variety of methods may be used to enable a system performing method 300 to determine whether there is a surface function that describes (or is associated with) the input data, such as providing a field or flag in the input data indicating that there is a surface function, receiving a command from a user, etc. In some embodiments, the surface function may be determined in other ways, for example, a particular type of input data, or input data from a particular source, may be associated with a particular surface function.

[0064] If the surface represented in the input data is described by a known surface function, one or more root-finding methods can be used and the method continues to block 306, described below. If the surface described in the input data is not described by a known surface function, for example if the input data is in the form of percentage or density values, the method may continue to block 304, where one or more techniques other than root-finding can be used. For example, method 800 of FIG. 8, described below, can be used for input data in the form of percentage or density values. In some embodiments, method 900 of FIG. 9 can be used. In some embodiments, even if the surface is described by a known surface function, other techniques (such as method 800 and / or method 900) can be used by block 304 instead of or in addition to one or more root-finding methods. In some embodiments, other techniques, such as, for example, linear interpolation, can be used to obtain the vertices of the mesh, which are used in addition to the other techniques described. A mesh is generated using one or more techniques of block 304, including estimating the vertex positions of the mesh.

[0065] Block 306 is performed if the input data is described by a known surface function determined in block 302. In block 306, it is determined whether the surface function has a (practical) analytical solution (e.g., an analytic function). Examples of such functions are field functions, where the surface function can be analytically expressed and admits of a closed-form solution. Because the surface function is known and analytical, it can be directly solved for values ​​at any location, e.g., to obtain the exact roots of the surface function. Examples of analytic functions include first order polynomials, second order polynomials, third order polynomials, fourth order polynomials, or other functions.

[0066] In some examples, trilinear interpolation of discrete voxels is third order and may be considered a function that has an analytical solution. Other functions may be analytically solvable. For example, the input data may be based on a particular function that is analytically solvable (e.g., an equation describing the airflow over a wing, etc.) to provide a visualization of the data as a mesh. In some embodiments, any of a variety of methods may be used to enable the system performing method 300 to determine whether a function is analytically solvable, such as a field or flag in the input data, a command from a user, stored features that the system accesses and compares to the received surface function, a machine learning model trained on example analytical functions and used to detect whether the surface function is an analytical function, etc.

[0067] If the surface is not described by a surface function that has an analytical solution, the method continues to block 310, described below. If the surface is described by a surface function that has an analytical solution, the method continues to block 308, where the locations of the vertices of the mesh are determined by using an analytical root-finding method, which involves solving the analytical surface function for roots. For example, on each edge (or other line segment) of a voxel that is detected as having an intersected surface, the exact location of the intersection across the edge (and the location of the vertices of the mesh) is determined by solving the surface function for roots. In some embodiments, values ​​of voxels specified in the input data, or values ​​otherwise extracted from the input data, may be used to solve for the roots (e.g., depending on how the surface is represented in the input data). A mesh is generated based on the locations of the vertices of the mesh determined based on solving for roots. By directly solving the surface function for the locations of the vertices of the mesh, the vertices of the mesh can be precisely located at the intersection locations with the intersecting voxels on the surface.

[0068] Block 310 is executed if it is determined in block 306 that the surface is not described by a surface function that has an analytical solution. In block 310, it is determined whether the surface function is differentiable, e.g., a derivative can be derived from the surface function. In some embodiments, any of a variety of methods may be used to enable a system performing method 300 to determine whether a surface function has a derivative, such as a field or flag in the input data, a command from a user, stored features of differentiable functions that the system accesses and compares to the received surface function, a machine learning model trained on examples of differentiable functions and used to detect whether the surface function is a differentiable function, etc.

[0069] If the surface function is differentiable, as determined in block 310, the method proceeds to block 314, described below. If the surface function is differentiable, as determined in block 310, the method continues to block 312, where the positions of the vertices of the mesh are determined based on the derivatives of the surface function using a root-finding method. For example, this block may obtain the numeric root(s) of the surface function and iterate to locate the vertices closer to the surface. The numerical root-finding method may determine the roots by evaluating the derivatives of the surface function and obtain the positions of the vertices of the mesh closer to the surface by iterative root-finding. An example of block 308 is described in more detail below with reference to FIG. 4. Using a numerical root-finding method with derivatives, a mesh may be generated with estimates of the mesh vertex positions that are close to the actual positions of the surface intersections with the voxels.

[0070] Block 314 is performed if the surface function is not differentiable at block 310. In some embodiments or cases, block 314 may also be performed even if the surface function is differentiable, such as when one or more other root-finding methods that do not use derivatives of the function are used to obtain the vertices of the mesh in addition to or instead of the root-finding method of block 312.

[0071] In block 314, the locations of the mesh vertices are determined using a numerical root-finding method with iterative refinement. For example, this block can be used to obtain the roots of the surface function using any of a number of different techniques, where such techniques do not require derivatives of the surface function. Multiple techniques can be used in some embodiments. Iterative refinement of the described techniques provides more accurate locations of the vertices (e.g., closer to the surface) than would be the case if the root-finding method were used without iterations. An example of block 314 is described in more detail below with reference to FIG. 6. Using a root-finding method with iterative refinement, a mesh can be generated with estimates of the vertex locations that are close to the actual locations of the surface intersections with the voxels.

[0072] In some embodiments, after determining the positions of the mesh vertices (e.g., at block 304, block 308, block 312, or block 314), additional processing may be performed by performing one or more additional techniques to more precisely position one or more of the vertices (e.g., closer to the actual surface). For example, method 900 of FIG. 9 may subdivide the mesh into additional mesh segments, and may be performed in addition to (e.g., before or after) one or more other techniques described herein.

[0073] Mesh determination using derivatives of surface functions 4 is a flowchart of an example method 400 for determining positions of vertices of a mesh approximating a surface using a numerical root-finding method based on derivatives of a surface function, according to some embodiments. For example, method 400 may be an example embodiment of block 312 of method 300 of FIG. 3, or may be performed independently, i.e., separate from method 300. In some embodiments, method 400 may be performed, for example, on a server system and / or a client system, in a manner similar to that described for methods 200 and 300.

[0074] It should be noted that the terms "edge" or "edge of a voxel" are used for descriptive purposes in describing method 400. An edge of a voxel may be more generally described as a line segment of a voxel. For example, in some embodiments, the line segment may be an actual edge of a face of a cubic voxel. In some embodiments, in some mesh generation techniques, such as, for example, some surface nets or similar techniques usable in method 400, the line segment may be a line connecting the centers of adjacent voxels (or connecting other points of two adjacent voxels). In these latter embodiments, such a line segment may be used in place of an edge of a voxel. For example, vertices in method 400 may be determined or selected along such a line segment of a voxel, rather than along an actual edge of the voxel.

[0075] The method 400 may begin at block 402. In block 402, a voxel is selected from a grid of voxels to be processed. The voxel is one of the voxels of the grid that is determined to intersect with a surface, for example, block 206 of Figure 2. The method continues to block 404.

[0076] At block 404, a vertex within the selected voxel is selected. In some embodiments, a vertex of an edge of the selected voxel is selected, where the edge intersects with the surface. The selected vertex has a current position. In some embodiments, the selected vertex may be a corner of the selected voxel whose voxel value is represented in the input data (the voxel value of the input data may represent another reference point (portion) of the voxel in other embodiments, e.g., the center of the voxel). In some embodiments, the selected vertex may be determined using other techniques, e.g., the midpoint of the intersected edge of the selected voxel, or a position estimated by another technique. The vertex selected in an iteration of method 400 may be constrained to the dimensions of the voxel space of the selected voxel.

[0077] In some embodiments, after the edges (lines) that traverse the vertices of the mesh are determined, the surface function is transformed from a 2D or 3D function to a linear function on the edges. This transformation may involve fitting an equation of a line to the surface function. For example, if the surface function is a sphere (e.g., x 2 +y 2 = 100), if the edge being searched for is y = 3 (e.g., a horizontal edge with a constant y-axis value), then the equation on that edge is x 2 +3 2 = 100, that is, x 2 +9=100, or x 2 = 91. In this simple example, the solution is exactly determinable, but for more complex surface functions the results may remain difficult to solve. The method continues at block 406.

[0078] In block 406, the new positions of the selected vertices are determined as roots of the surface function using a root-finding method that uses the derivative of the surface function (e.g., the transformed function described above). The surface function is defined such that it is equal to zero at the surface and a root-finding corresponds to obtaining a point on the surface. In method 400, the surface function does not have an analytical solution and is differentiable.

[0079] For example, a root finder can obtain the roots of an equation that includes the derivative of a surface function. The new position of the selected vertex can be one where the derivative tangent at the selected vertex intersects the surface. The zero of the tangent to the surface function at the current position can be used as an approximation to the zero of the surface function. In some examples, a Newton-Raphson root finder can be used. In some embodiments, the difference of the surface function can be used to approximate the derivative of the surface function from the values ​​in the discrete samples or input data. In some examples, the Newton-Raphson method is solved for the zero derivative using the following equation:

[0080]

number

[0081] Here, (x n , f(x n )) is the vertex selected (in 2D) at the nth iteration, and x n is the current position of the selected vertex on the edge of the voxel, and f(x n ) is the surface function evaluated at the selected vertex location. (x n+1 , f(x n+1 )) is the resulting vertex, and f'(x n ) is the derivative of the surface function evaluated at the current position of the selected vertex. This equation divides the surface function at the selected vertex by the derivative of the surface function at the selected vertex and subtracts the result from the current position of the selected vertex. The result is the vertex (x n+1 , f(x n+1 )) and x n+1 The method continues at block 408.

[0082] At block 408, the error between the surface and the new location of the selected vertex determined at block 406 is determined. For example, this error can be determined by evaluating a surface function at the new location value determined at block 406 and determining the difference between the function result and zero. A result of zero from the evaluation of the surface function indicates that the new location of the selected vertex is exactly on the surface, and therefore accurately provides the intersection location of the surface and the edge of the voxel. The method continues at block 410.

[0083] At block 410, it is determined whether the error determined at block 408 meets one or more predetermined criteria (and / or the predetermined criteria are otherwise met). For example, if a threshold amount of error was pre-determined for use at block 410, the error is checked to see if it is below the threshold (or, in other embodiments, exceeds the threshold). Other or additional criteria may be used in various embodiments. In some embodiments, the number of iterations of blocks 406 through 410 performed may be an alternative or additional criterion for the determination at block 410. For example, if the number of iterations performed exceeds an iteration threshold (e.g., three iterations), the predetermined criteria is met. If the predetermined criteria is met, the method continues to block 412, described below.

[0084] If the predetermined criterion in block 410 is not met, the new position of the selected vertex in the current iteration is set as the current position of the selected vertex and another iteration of the root finder is started by continuing to block 406 to determine the new position of the selected vertex. Thus, the selected vertex is adjusted (e.g., moved) along the edge of the voxel to a (new) current position that is closer to the actual position of the intersection. In the next iteration, a new position of the selected vertex is determined in block 406 using the root finder at the (new) current position as described above. This new position is closer to the actual intersection placement for the surface voxel than the previous position. The new position is evaluated for error in block 408, also as described above, until the predetermined criterion is met in block 410.

[0085] In some embodiments, the current position of the selected vertex can be adjusted (e.g., moved) an additional amount or magnitude closer to the actual intersection. For example, the additional amount can be based on the determined error or can be a predetermined amount. For example, the magnitude of the error determined in block 408 can indicate how close the approximate position is to the actual position, and the vertex can be moved additionally based on (e.g., proportional to) the error for the estimated position that is closer to the actual position.

[0086] At block 412, if the predetermined criteria of block 410 are met, the determined positions of the selected vertices are assigned to the generated mesh. The method continues at block 414.

[0087] At block 414, it is determined whether there is another mesh vertex of the selected voxel to process. For example, one or more mesh vertex positions on other edges of the selected voxel may not have been determined through method 400. If there is another mesh vertex of the selected voxel to process, the method continues to block 404 to select another vertex to process. If there are no more vertices of the selected voxel to process, the method continues to block 416.

[0088] At block 416, it is determined whether there are other voxels of the voxel grid to process. If there are other voxels to process, the method continues to block 402 to select another voxel to process. In various embodiments, a voxel adjacent to the voxel just processed can be selected, or another voxel can be selected. In some embodiments, not all of the voxels intersected by the surface are processed by method 400, e.g., based on a predetermined threshold or other criteria. If there are no more voxels of the voxel grid to process, the method continues to block 418 to complete the mesh. For example, additional processing of the mesh can be optionally performed, such as further adjusting the vertices of the mesh using one or more additional techniques (e.g., method 900 of FIG. 9), storing the mesh, displaying the mesh, etc.

[0089] 4 illustrates voxel-by-voxel determination of the mesh, it will be appreciated that one or more blocks of method 400 can be performed substantially in parallel. For example, block 402 may select multiple voxels and execute, and blocks 404 through 414 may execute substantially in parallel for each selected voxel. In another example, in block 404, one or more vertices may be selected and for each selected voxel, blocks 406 through 412 may execute substantially in parallel. Parallel execution may improve mesh determination speed (because multiple voxels / vertices can be computed simultaneously). Additionally, parallel execution may better utilize processor resources. This is the case, for example, when the processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of running multiple threads in parallel.

[0090] Graph showing root finding using differentiable surface functions 5 is an illustration of a graph 500 showing an example of obtaining the positions of vertices of a mesh using a root-finding method with a differentiable surface function, according to some embodiments. In some embodiments, the example of FIG. 5 is based on the method 400 of FIG.

[0091] Graph 500 shows a 2D example for simplicity. Graph 500 shows a curve 502 that represents a surface function for a position on the edge between two original vertices (e.g., corners) of a voxel. The surface function has been transformed from a 2D or 3D function to a linear function on the (edge) line as described above for block 404 of FIG. 4. The x-axis represents the position across the edge of the voxel between the two original vertices V0 and V1 (e.g., corners of the voxel). The y-axis represents the value of the surface function at that position. Vertices V0 and V1 have y values ​​(in xy coordinates) contained in the input data as voxel values ​​that indicate the value of the surface function at their respective positions. The y value at V0 is positive and the y value at V1 is negative, indicating that the surface intersects the voxel edge at a point between the x values ​​of vertices V0 and V1. The y-axis represents the position across the edge of the voxel between the two original vertices V0 and V1 (e.g., corners of the voxel). The y-axis represents the value of the surface function at that position. The y-value at V0 is positive and the y-value at V1 is negative, indicating that the surface intersects the voxel edge at a point between the x-values ​​of vertices V0 and V1. A is the actual position of the intersection between the surface and the edge of the voxel (where V A is unknown). The surface and the edge intersect at y=0, where the surface function is zero (the root of the surface function). This location is neither above the surface (positive values ​​on the y-axis) nor below the surface (negative values ​​on the y-axis).

[0092] In some cases, as described above with reference to blocks 306 and 308 of FIG. 3, if the surface function has an analytical solution, the vertices V A The location of V can be determined directly by evaluating the surface function and obtaining the location that results in the surface function being equal to zero (a root). If the surface function does not have an analytical solution, then the location V A Another root-finding method can be used to obtain vertex positions close to . In this example, the surface function is differentiable, so a root-finding method that uses the derivative of the surface function, such as the Newton-Raphson root-finding method, can be used.

[0093] A tangent line 504 is determined in the first iteration using a root-finding method, where the line 504 represents the tangent line at point V0 based on the derivative of the surface function. The tangent line 504 is determined at the location V0 where the line 504 intersects the horizontal axis. R1 It has a root at position V R1 is the actual position of the intersection V A Since the surface function is not R1 When the surface function is evaluated at , the surface function is located at point V of curve 502 above the x-axis as shown. N1 Position V R1 has an error and in some embodiments is shown as line segment 506 R1 and V N1 can be expressed as the error in position (along the y-axis) between

[0094] V N1 and zero (V A The error between point V and point V (y value of point V) is determined to not meet the criteria (e.g., the error exceeds a threshold). N1 Another iteration of the root-finding method is performed with V as the location of the mesh vertex instead of V0 from the previous iteration. Effectively, the vertex location is calculated by dividing V by V N1 Point V N1 A tangent 508 to the line 508 is determined based on the derivative of the surface function. The tangent 508 is determined at the location V R2 It has a root at position V R2 is the actual position of the intersection V A Unlike the surface function, R2 When the surface function is evaluated at , the surface function is located at point V of curve 502 above the x-axis as shown. N2 Provide point V N2 is point V N1 V than A Close to position V R2 V has an error and is shown as line segment 510 R2 and V N2 can be expressed as the error in position (along the y-axis) between

[0095] V R2 and zero (V AIf the error between the y value of point V and the y value of point V still does not meet the criteria, N2 , V N1 Alternatively, another iteration may be performed using the determined zero position as a starting point instead of V, and so on for as many additional iterations as necessary. A If the error with satisfies a criterion, the iterations do not continue and the zero position is taken as the position of the mesh vertex.

[0096] Mesh determination using iterative refinement of root finding 6 is a flow chart of an example method 600 for determining the locations of vertices of a mesh approximating a surface using numerical root finding in an iterative refinement manner, according to some embodiments. For example, method 600 may be an example embodiment of block 314 of method 300 of FIG. 3, or may be performed independently, i.e., separate from method 300. For method 600, the surface function to which the mesh is approximated may be a non-differentiable function or may be a differentiable function. In some embodiments, method 600 may be performed, for example, on a server system and / or a client system, similar to that described for methods 200 and 300.

[0097] It should be noted that the terms "edge" or "edge of a voxel" are used for descriptive purposes in describing method 600. As similarly described for method 400, in some embodiments the line segments may be actual edges of faces of cubic voxels, and in some embodiments, in some mesh generation techniques, e.g., in some surface nets or similar techniques usable in method 600, the line segments may be lines connecting centers of adjacent voxels (or connecting other points of two adjacent voxels). In these latter embodiments, such line segments may be used in place of voxel edges. For example, vertices in method 600 may be determined or selected along such line segments of voxels, rather than along actual edges of voxels.

[0098] The method 600 may begin at block 602. In block 602, a voxel is selected from a grid of voxels to be processed. The voxel is one of the voxels of the grid that is determined to intersect with a surface, for example, block 206 of FIG. 2. The method continues to block 604.

[0099] At block 604, a vertex within the selected voxel is selected for the mesh. In some embodiments, a vertex of an edge of the selected voxel is selected, the edge intersecting with the surface. The selected vertex has a current location. In some embodiments, the selected vertex may be a corner of the selected voxel whose value is known from the input data. In some embodiments, two vertices are selected at block 604, where the selected vertex is one of two known vertices, e.g., the two vertices are two vertices within a voxel whose roots are known and whose line intersecting the vertices intersects the surface. In some embodiments, the selected vertex may be determined using other techniques, e.g., the midpoint of the intersected edge of the selected voxel, or a location estimated by another technique. The vertex selected in the iterations of method 600 may be constrained to the dimensions of the voxel space of the selected voxel.

[0100] In some embodiments, after the edges along which the vertices of the mesh are sought are determined, the surface function is transformed on the edges from a 2D or 3D function to a linear function, such as that described above with reference to block 404 of Figure 4. The method continues to block 606.

[0101] In block 606, a new location for the selected vertex (or one of the selected vertices) is determined as a root of the surface function (e.g., the transformed function described above) using a numerical root finder. The root finder can search for a root of the surface function, e.g., a location where the surface function results in zero and the surface intersects the edge of a voxel.

[0102] One or more of a variety of numerical root-finding techniques may be used. In some examples, the root-finding techniques may include a bisection technique (e.g., find the midpoint of a line between two known voxel edge vertices that bracket the root and evaluate the surface function at the midpoint), a secant technique (e.g., linear interpolation with the two most recent points or the two end points), a Bezier clipping technique (e.g., convert the function into a Bezier curve and clip ends), a false position technique (e.g., interpolation with bracketing with the two most recent points), a Ridders' technique (e.g., fit an exponential function to the function at the positive, negative and midpoints), a Van Wijngaarden-Dekker-Brent technique (e.g., fit an inverse quadratic function to the three most recent points), and / or other root-finding techniques. The zero result of the root finder can be used as an approximation of the zero of the surface function. This result is a vertex that is closer to the actual intersection with the edge of the voxel in the surface.

[0103] In one example using bisection linear interpolation, two vertices that are known and bracket a root of the surface function are selected at block 604. For example, one of the vertices has a positive value and the other vertex has a negative value. A line is drawn between the vertices and the midpoint of this line is determined as the approximate root. The midpoint creates an interpolated vertex between the two vertices that is proportional to the positions of the two vertices. This is the case, for example, when the underlying surface function is linear (e.g., in some embodiments the function is nonlinear, e.g., bilinear or bicubic). The method continues to block 608.

[0104] At block 608, the error between the surface and the new position of the selected vertex determined at block 606 is determined. In some examples, this error can be determined by evaluating a surface function at the new position values ​​determined at block 606 and determining the difference between the result of the function and zero. A result of zero from the evaluation of the surface function indicates that the new position of the selected vertex is exactly on the surface. The method continues to block 610.

[0105] At block 610, it is determined whether the error determined at block 608 meets one or more predetermined criteria (and / or the predetermined criteria are otherwise met). For example, if a threshold amount of error was pre-determined for use at block 610, it is determined whether the error is below the threshold (or, in other embodiments, exceeds the threshold). Other or additional criteria may be used in various embodiments. In some embodiments, the number of iterations of blocks 606 through 610 performed may be an alternative or additional criterion for the determination at block 610. For example, if the number of iterations performed exceeds an iteration threshold (e.g., three iterations), then the predetermined criteria is met. If the predetermined criteria is met, the method continues to block 612, described below.

[0106] If the predetermined criteria of block 610 are not met, the new position of the selected vertex in the current iteration becomes (is assigned to) the current position of the selected vertex (or one of the selected vertices if two vertices are selected) and the method begins another iteration of the root-finding method by continuing to block 606, where a new position of the selected vertex is determined. Thus, the selected vertex is adjusted (e.g., moved) along the edge of the voxel to a (new) current position that is closer to the actual position of the intersection.

[0107] For example, in some embodiments of the above example with bisection and two selected vertices, the new position can replace one of the selected vertices. For example, if the evaluation of the surface function at the new position has a positive result, the new position is assigned to replace the first of the two selected vertices that is positive. If the evaluation of the surface function at the new position has a negative result, the new position is assigned to replace the second of the two selected vertices that is negative. In this way, the two vertices, in succession, sandwich a zero point.

[0108] At the next iteration, a newer position of the selected vertex is determined at block 606 at the (new) current position, also as described above. This newer position is closer to the actual intersection with the surface voxels than the previous position. The newer position is evaluated for error at block 608, also as described above, until a predetermined criterion is met at block 610. In this manner, the method can repeat the subdivision of the error interval over multiple iterations.

[0109] In some embodiments, the current position of the selected vertex can be adjusted (e.g., moved) an additional amount or magnitude closer to the actual intersection. For example, the additional amount can be based on the determined error or can be a predetermined amount. For example, the magnitude of the error determined in block 608 can indicate how close the approximate position is to the actual position, and the vertex can be moved additionally based on (e.g., proportional to) the error for the estimated position that is closer to the actual position. In some embodiments, the parameters used in the incremental acceleration relaxation of method 600 can be adjusted for different types of input data.

[0110] At block 612, if the predetermined criteria of block 610 are met, the determined positions of the selected vertices are assigned to the generated mesh. The method continues at block 614.

[0111] At block 614, it is determined whether there is another mesh vertex of the selected voxel to process. For example, one or more mesh vertex positions on other edges of the selected voxel may not have been determined through method 600. If there is another mesh vertex of the selected voxel to process, the method returns to block 604 to select another vertex to process. If there are no more vertices of the selected voxel to process, the method continues to block 616.

[0112] At block 616, it is determined whether there are other voxels of the voxel grid to process. If there are other voxels to process, the method returns to block 602 to select another voxel to process. In some embodiments, a voxel adjacent to the voxel just processed can be selected, or another voxel can be selected. In some embodiments, not all of the voxels intersected by the surface are processed by method 600, e.g., based on a predetermined threshold or other criteria. If there are no more voxels of the voxel grid to process, the method continues to block 618 to complete the mesh. For example, additional processing of the mesh can optionally be performed, such as further adjusting the vertices of the mesh using one or more additional techniques (e.g., method 900 of FIG. 9), storing the mesh, displaying the mesh, etc.

[0113] 6 illustrates voxel-by-voxel determination of the mesh, it will be appreciated that one or more blocks of method 600 can be performed substantially in parallel. For example, block 602 may select multiple voxels and perform blocks 604 through 614 substantially in parallel for each selected voxel. In another example, in block 604, one or more vertices may be selected and for each selected voxel, blocks 606 through 612 may be performed substantially in parallel. Parallel execution may improve mesh determination speed (because multiple voxels / vertices may be computed simultaneously). Additionally, parallel execution may better utilize processor resources, for example, when the processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of running multiple threads in parallel.

[0114] An example embodiment of method 600 is shown below as pseudocode for the Marching Triangles method, using linear interpolation and a bisection root-finding method that halves the error interval at each iteration. Other embodiments may use other mesh generation methods, such as, for example, surface nets, a root-finding method similar to method 600. / * The result is an array of {x:, y:} vertices for the polygon in pixel coordinates, or zero if there is no polygon. Polygons have 3 or 4 vertices, as the case may be. A, B, C are pixel coordinates. function getIsoPoly(density, A, B, C) { const vertex = [{point:A}, {point:B}, {point:C}]; let numInside = 0; for (let V of vertex) { V.density = density(V.point); V.inside = (V.density >= THRESHOLD) ?1 :0; if (V.inside) { ++numInside;} } / / Switch based on which of the 8 cases we're in, which reduce to / / 2 trivial cases plus 2 cases with 3-way rotational symmetry. switch (numInside) { case 0: / / All outside (case 000) return null; case 1: / / One inside -> tri (cases 100, 010, 001) / / Cyclic shift until vertex[0] is the one inside while (! vertex[0].inside) { vertex.unshift(vertex.pop());} / / Produce the triangle with tip at 0 return [cloneXY(vertex[0].point), rootFindVertex(vertex[1], vertex[0], density), rootFindVertex(vertex[2], vertex[0], density)]; case 2: / / Two inside -> quad (cases 101, 110, 011) / / Cyclic shift until vertex[0] is the one outside while (vertex[0].inside) { vertex.unshift(vertex.pop());} / / Produce the quad cutting off point 0 return [cloneXY(vertex[1].point), rootFindVertex(vertex[0], vertex[1], density), rootFindVertex(vertex[0], vertex[2], density), cloneXY(vertex[2].point)]; return; case 3: / / All inside (case 111) return [cloneXY(A), cloneXY(B), cloneXY(C)]; } / / switch } / * Two vertices {point: {x:, y:}, value:} are Interpolate between these to generate vertices proportional to each position, as in interpolating against THRESHOLD(surface).... This assumes that the underlying density is linear (usually bilinear or bicubic, so a single iteration root find). A. density<THRESHOLDかつB.density> Assume =THRESHOLD. * / function rootFindVertex(A, B, density) { console.assert(A.density < THRESHOLD); console.assert(B.density >= THRESHOLD); if (ROOT_ITERATIONS === 0) { / / 0 iterations; just move halfway return {x:(A.point.x + B.point.x) * 0.5, y:(A.point.y + B.point.y) * 0.5}; } else { / / General case.Binary search for (let i = 0; i < ROOT_ITERATIONS - 1; ++i) { / / Slide C between A and B const C = {point: lerpXY(A.point, B.point, (THRESHOLD - A.density) / (B.density - A.density))}; / / Prepare for the next iteration C.density = density(C.point); if (C.density >= THRESHOLD) { / / Isosurface is between A and Cs B = C; } else { / / Isosurface is between C and B A = C; } / / binary search } / / for i / / Final iteration return lerpXY(A.point, B.point, (THRESHOLD - A.density) / (B.density - A.density)); } }

[0115] Graph showing root finding using the root-finding method with iterative refinement Figure 7 is an illustration of a graph 700 showing an example of obtaining the positions of vertices of a mesh using a root-finding method with iterative refinement, according to some embodiments. In some embodiments, the example of Figure 7 is based on the method 600 of Figure 6. For example, the surface function used in the example of Figure 7 can be a differentiable function or a non-differentiable function.

[0116] Graph 700 shows a 2D example for simplicity. Graph 700 shows a curve 702, similar to curve 502 of FIG. 5, that represents a surface function over a position on the edge between two original vertices (e.g., corners) of a voxel. The surface function has been transformed from a 2D or 3D function to a linear function on the (edge) line as described above for block 604 of FIG. 6. The x-axis represents the position over the edge of the voxel between the two original vertices V0 and V1 of the voxel (e.g., corners of the voxel). The y-axis represents the value of the surface function at that position. The y-value at V0 is positive and the y-value at V1 is negative, which indicates that the point V between the x-values ​​of vertices V0 and V1 is a point on the edge. A indicates that the surface intersects a voxel edge at A is unknown).

[0117] If the surface function is continuous and does not have an analytical solution, the position V A A root-finding technique can be used to obtain the vertex positions close to . In this example, the surface functions are either differentiable or non-differentiable. The root-finding technique can obtain the roots for any continuous function.

[0118] A line 704 is determined in the first iteration using a root finder for vertex V. For example, linear interpolation with a secant root finder can be used, where point V S1 is being interpolated. For example, point V S1 can be determined using the secant method equation:

[0119]

number

[0120] In this example, the line 704 is a straight line extending between points V0 and V1, and approximates the surface function curve 702. S1 crosses the horizontal axis, where the y value of line 704 is zero. S1 is the actual root position V of the surface function curve 702. AUnlike the surface function f, the surface function S1 , a point V on the curve 702 that lies below the x-axis as shown. N1 Position V S1 has an error and in some embodiments is shown as line segment 706 S1 and V N1 (V S1 It can be expressed as the difference in position (along the y-axis) between

[0121] In this case, V N1 and zero (V A The error between point V and point V (y value of point V) is determined to not meet the desired criteria (e.g., the error exceeds a threshold value), and point V N1 Another iteration of the root finder is performed, substituting point V1 from the previous iteration. Effectively, the location of the vertex is moved from V1 to V N1 has been adjusted (moved) to.

[0122] Line 708 represents the relationship between V0 and V N1 The line 708 is a straight line extending between the position V S2 It has a root at position V S2 is the actual position of the intersection V A Unlike the surface function, S2 , the surface function is evaluated at point V of curve 702 below the x-axis as shown. N2 Provide point V N2 is point V N1 V than A Close to position V S2 V has an error and is shown as line segment 710 S2 and V N2 It can be expressed as the difference in position (along the y-axis) between

[0123] V S2 and zero (V A If the error between the y value of point V and the N2 At point V N1Another iteration can be performed by replacing V with V, and additional iterations can be performed as necessary. A If the error with satisfies a criterion, the iterations do not continue and the zero position may be considered as the position of the mesh vertex.

[0124] Uses the iterative accelerated relaxation method to determine the mesh 8 is a flow chart illustrating an example method 800 for determining the locations of vertices of a mesh approximating a surface using a successive accelerated relaxation method, according to some embodiments. For example, method 800 may be an example embodiment of the vertex location determination in block 210 of method 200 of FIG. 2 described above. In some embodiments, method 800 may be a technique used in block 304 of method 300 of FIG. 3, or may be used independently, i.e., separate from method 300 of FIG. 3, to determine the locations of vertices in a mesh. In some embodiments, method 800 may be performed, for example, on a server system and / or a client system, in a manner similar to that described for methods 200 and 300.

[0125] It should be noted that the terms "edge" or "edge of a voxel" are used for descriptive purposes in describing method 800. As with methods 400 and 600, in some embodiments the line segments may be actual edges of faces of cubic voxels, and in some embodiments in some mesh generation techniques, e.g., some surface nets or similar techniques usable in method 800, the line segments may be lines connecting the centers of two adjacent voxels (or connecting other points of two adjacent voxels). In the latter embodiments, such line segments may be used in place of voxel edges. For example, vertices in method 800 may be determined or selected along such line segments of voxels, rather than along actual edges of voxels.

[0126] Method 800 may be used in some embodiments where input data is provided in the form of occupancy or density values ​​(both of which are referred to in the method as "occupancy values"). Such values ​​may indicate the amount of each defined voxel that is occupied by a volume that contains the surface. In some embodiments, any of a variety of forms of input data may be used in method 800, such as input data that represents a surface that is described by a function, input data that represents a surface that is not described by a function, etc.

[0127] Method 800 may begin at block 802. In block 802, a set of voxels in the input data is selected from a grid of voxels to be processed. In some embodiments, the set of voxels is a subset of the complete set of voxels intersected by the surface. In some embodiments, the set of voxels is a set of adjacent voxels of the voxel grid. For example, the set of adjacent voxels may be a set of 3x3 adjacent voxels, a set of 5x5 adjacent voxels, etc. By selecting a set of voxels smaller than the entire set, memory and / or processing power requirements can be reduced for a computing system used for mesh generation. In some embodiments, only the selected set of voxels is processed by method 800, and other voxels are ignored by method 800. In other embodiments, multiple different sets of voxels can be selected for processing, e.g., at different iterations, for different processors or processor cores, partially or completely in sequence, etc. In some embodiments, all of the voxels of the grid intersected by the surface may be selected in block 802. This may not be practical in some embodiments due to the memory and processing power requirements of processing a large number of voxels. The method continues to block 804.

[0128] At block 804, initial approximate locations of the vertices of the mesh are determined at the selected set of voxels. In some embodiments, initial approximate locations of the vertices of the mesh are determined on the edges of the selected set of voxels. The approximate locations are determined based on voxel values ​​of the input data that apply to voxels in the selected set. For example, the approximate locations can be determined using linear interpolation. In some examples, values ​​of nearby voxels known from the input data can be taken and linearly interpolated between these nearby values ​​to find an approximate initial location of the vertex of the mesh. In some embodiments, the initial approximate location of the vertex can be determined using other techniques. In some embodiments, the vertices selected in the iterations of method 800 can be constrained to the dimensions of the voxel space of the associated selected voxels in the voxel set. The method continues to block 806.

[0129] At block 806, an approximate volume occupying each voxel in the selected set of voxels is determined based on the approximate positions of the vertices determined at block 804. In some embodiments, the approximate occupied volume determined for each voxel is an approximate occupancy value that may be compared to input data if the input data is in the form of an occupancy value. The input data may specify a voxel value for each voxel that represents the occupied volume within the voxel. In some embodiments, a 3D integral may be determined at each voxel for which an approximate volume is determined at block 804. The result of this integral is the volume of the mesh occupying the voxel (e.g., the interior), and thus a current approximation of the volume occupying that voxel. The method continues at block 808.

[0130] At block 808, an error between the approximation volume of the selected set of voxels and the corresponding voxel values ​​of the voxels in the input data is determined. For example, each determined approximation volume can be compared to the corresponding voxel value in the input data, and the difference between these values ​​is determined to indicate the error for that voxel. An associated error can be determined for each voxel of the selected set of voxels. In some embodiments, the input data can include an occupancy value that is directly comparable to the determined approximation. In some embodiments, the input data can be converted to a format that conforms to the determined approximation or to another format to allow comparison, for example, based on a new voxel grid that is fitted to the input data in method 200. The method continues to block 810.

[0131] At block 810, it is determined whether the error determined at block 808 for the selected set of voxels meets one or more predetermined criteria. For example, if a threshold amount of error was pre-determined for use at block 810, it is determined whether the error for each voxel in the set is below the threshold (or, in other embodiments, exceeds the threshold). Other or additional criteria may be used in various embodiments. In some embodiments, the number of iterations of blocks 806 through 812 performed may be an alternative or additional criterion for the determination at block 810. For example, if the number of iterations exceeds an iteration threshold (e.g., three iterations), the predetermined criterion is met. If the predetermined criterion is met, the method continues to block 814, described below.

[0132] If the predetermined criteria of block 810 are not met for a voxel in the set, processing continues to block 812, where one or more approximate positions of vertices of one or more selected voxels are adjusted (e.g., moved) to reduce errors from the iterative accelerated relaxation method. In some examples, one vertex can be selected to move, or multiple vertices can be selected to move. For example, if the approximation volume is larger than the corresponding voxel value, one or more of the approximate vertices are moved inward toward the volume, and if the approximation volume is less than the corresponding voxel value, one or more of the approximate vertices are moved outward from the volume. In some embodiments, the iterative accelerated relaxation method determines voxels for which the moved vertices are selectable based on a particular method for moving the vertices, e.g., moving one of the vertices, moving all of the vertices, etc. In some embodiments, the amount by which these vertices are moved can be determined based on a tunable heuristic (e.g., based on desired characteristics of the mesh). For example, the selected vertices can be moved the same amount, or selected vertices that were moved in the previous iteration can be moved a lesser amount than selected vertices that were not moved.

[0133] The Successive Accelerated Relaxation method is an iterative method that takes the form of a weighted average between the previous iteration and successively calculated Gauss-Seidel iterates (using the Gauss-Seidel method) for each component, e.g.

[0134]

number

[0135] Where:

[0136]

number

[0137] denotes the Gauss-Seidel iteration, and ω is the relaxation factor. A value can be chosen as the relaxation factor to accelerate the rate at which the iterations converge to a solution (the actual location of the surface intersection).

[0138] In some embodiments, the Gauss-Seidel method, which may be considered as a sequentially accelerated relaxation method with a relaxation factor of 1, may be used.

[0139] After moving one or more vertices, the method continues at the next iteration to block 806 to determine an approximate volume of the selected voxels based on the new approximate positions of the vertices determined at block 812, determine an error for the new approximate volume at block 808, and determine whether the error meets a predetermined criterion at block 810. These iterations are repeated with the newly determined vertex positions at block 812 for each successive iteration until the error meets the predetermined criterion at block 810. At block 810, the method continues to block 814. In this manner, the method iteratively converges to a vertex position within the threshold error.

[0140] In some embodiments, in successive iterations, one or more different vertices of the selected set of voxels can be moved in place of one or more vertices that have been moved in a previous iteration, and / or one or more identical vertices of the selected set of voxels can be moved in subsequent iterations. In some examples, one vertex is moved in one iteration of block 812, and another vertex that is close to the moved vertex is moved in the next iteration of block 812, etc. In other examples, multiple vertices are moved in one iteration, multiple other vertices are moved in the next iteration, etc. In other examples, multiple vertices are moved in one iteration, and one or more identical vertices are moved in the next iteration. For example, the other vertices can be moved randomly or regularly in each iteration. In other examples, all vertices of the selected set are moved in each iteration. The technique used to move the vertices may depend, for example, on the format and / or content of the input data, and the technique results in better (e.g., faster) convergence to the actual intersection point.

[0141] In block 814, if the predetermined criteria of block 810 are met, the determined approximate locations of the vertices of the selected set of voxels are assigned to the generated mesh. The method continues to block 816.

[0142] At block 816, it is determined whether there are one or more other voxels of the voxel grid (outside the selected set of voxels) from which to obtain vertices of the mesh. For example, one or more vertex locations on other edges of the voxel intersected by the surface may not be determined by method 800. In some embodiments, one or more voxels adjacent to the voxel just processed may be selected, or another voxel from the voxel grid may be selected. In some embodiments, not all of the voxels intersected by the surface are processed by method 800, for example based on a predefined threshold or other criteria. If there are one or more other voxels to process, the method returns to block 802 to select another set of voxels to process. If there are no voxels of the voxel grid to process, the method continues to block 818.

[0143] At block 818, the method completes the mesh. Additional processing of the mesh may optionally be performed, such as further adjusting the vertices of the mesh using one or more additional techniques (e.g., method 900 of FIG. 9), storing the mesh, displaying the mesh, etc.

[0144] In some embodiments, parallel processing of vertices and / or voxels of the mesh may be performed. For example, parallel processing of vertices and / or voxels in one or more blocks of method 800 for each voxel in the voxel set being processed. In various embodiments, one or more blocks of method 800 may perform vertices and / or voxels sequentially or substantially in parallel. For example, block 802 may select and perform multiple voxel sets, and blocks 804 through 816 may be performed substantially in parallel with each selected voxel set. Parallel execution may improve the speed of mesh determination (because multiple voxels / vertices may be computed simultaneously). Additionally, parallel execution may better utilize processor resources. This is the case, for example, when the processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of running multiple threads in parallel.

[0145] Surface approximation by mesh refinement FIG. 9 is a flow chart illustrating an example method 900 for determining positions of vertices of a mesh that approximates a surface by subdividing one or more portions (e.g., lines) of the mesh, according to some embodiments. For example, method 900 can iteratively adjust (e.g., move) added vertices to be on or approximately on the surface. For example, method 900 can be an example embodiment of vertex position determination in block 210 of method 200 of FIG. 2 described above. In some embodiments, method 900 can be a technique used in block 304 of method 300 of FIG. 3, or can be used independently, i.e., separate from method 300 of FIG. 3, to determine positions of vertices in a mesh. In some embodiments, method 900 can be performed before, after, or in conjunction with one or more other techniques, such as methods 400, 600, or 800 described herein, or other known techniques (e.g., marching cubes, surface nets, or related techniques). In some embodiments, method 900 can be implemented, for example, on a server system and / or a client system, similar to those described for methods 200 and 300.

[0146] It should be noted that the terms "edge" or "edge of a voxel" are used for descriptive purposes in describing method 900. As with the methods described above, in some embodiments, the line segment may be an actual edge of a face of a cubic voxel, or in some embodiments, in some mesh generation techniques, such as, for example, some surface nets or similar techniques usable in method 900, the line segment may be a line connecting the centers of two adjacent voxels (or connecting other points of two adjacent voxels). In the latter embodiment, such a line segment may be used in place of an edge of a voxel. For example, vertices in method 900 may be determined or selected along such a line segment of a voxel, rather than along the actual edge of the voxel.

[0147] Method 900 can be used in some embodiments where the input data is provided as a distance field and / or represents a surface described by a surface function, hi some embodiments, the input data may be provided as occupancy or density values.

[0148] The method 900 may begin at block 902. In block 902, a voxel is selected from a grid of voxels to be processed. The voxel is one of the voxels of the grid that intersects with the surface, e.g., block 206. The method continues to block 904.

[0149] At block 904, a vertex is selected at the selected voxel. In some embodiments, a vertex on a face (or edge) of the selected voxel is selected, where the face (or edge) intersects with the surface. In some embodiments, method 900 may be performed after a method of generating a mesh has been performed, such as methods 400, 600, or 800 described herein, or other known techniques, and an approximate vertex of the mesh on the face of the voxel, determined by such a prior method, may be selected at block 904. In such an embodiment, the vertex may have an approximate location determined by the prior method. In some embodiments, the surface function can be converted, for example, from a 2D or 3D function to a linear function on the edge, similar to that described above for block 404 of FIG. 4. The method continues to block 906.

[0150] At block 906, the curvature of the surface is determined (e.g., estimated) across the selected voxels, e.g., across the edges of the selected voxels. In some embodiments, if the surface functions defining the surface are known and differentiable, the curvature can be estimated by determining the tangents or normals at the selected vertices by such a method of difference. The characteristics of the tangents can be compared to determine an estimated curvature of the surface provided between these vertices. For example, if two tangents at a vertex are at approximately the same angle, the surface between the vertices will not tend to curve significantly, but if the two tangents have significantly different angles, the surface between them will tend to curve significantly.

[0151] In some embodiments, the curvature of the surface can be determined by evaluating a surface function (if the surface function is known). For example, the surface function can be sampled or evaluated at the midpoints of the edges of the intersecting voxel faces (or at the midpoints of the lines connecting the selected vertices). The distance between the result of the function and the surface can be determined, which may indicate the curvature of the surface (e.g., the greater the distance to the surface at the midpoint, the greater the curvature). In other embodiments, other methods of determining the curvature of the approximate surface locally, e.g., at the selected vertices or otherwise across the intersecting faces of the selected voxels, can be used. The method continues at block 908.

[0152] At block 908, it is determined whether the curvature determined at block 906 exceeds a threshold. The curvature threshold may be selected, for example, to specify a curvature large enough to not be approximated by a line within an acceptable accuracy range. In some examples, if two tangents are used as described above to determine the curvature, the curvature threshold may be provided as a threshold difference in the angle of the two tangents. That is, if the angle of the tangents is greater than the threshold angle difference, the curvature of the surface is greater than the curvature threshold. Similarly, the curvature threshold may be provided as a threshold for the amount of distance between the evaluated midpoint and the surface. The midpoint is located between the vertices selected as described above. If the curvature is less than the threshold (or otherwise does not meet the threshold), the method continues to block 918, described below. If the curvature exceeds the threshold (or otherwise meets the threshold), the method continues to block 910.

[0153] At block 910, an additional vertex is inserted between the two existing vertices in the selected voxel to subdivide the line between the two existing vertices into a polyline. In some embodiments, the two existing vertices may be the vertices selected at block 904. In some examples, the two existing vertices are provided on an edge of the selected voxel, and the additional vertex may be inserted at the midpoint between the two existing vertices or at a different point with respect to the two vertices (e.g., closer to one of the existing vertices than the other of the existing vertices). Some embodiments may place the additional vertex at a location between the two existing vertices based on the curvature determined at block 906. For example, if the curvature is determined to be skewed, i.e., biased toward one of the two existing vertices, the additional vertex may be placed closer to that existing vertex.

[0154] In some embodiments, the additional vertex is inserted between two existing vertices in a line of an existing mesh (e.g., a side of a mesh polygon), which may have been generated in a previous iteration of method 900 or a previous method, such as methods 400, 600, 800, or other mesh generation techniques. In some embodiments, the additional vertex may be inserted between two existing vertices of one or more polygons in a template of a polygon, for example, determined in block 208 of FIG. 2; such a template may be referred to as a "mesh" for purposes of method 900. The method continues at block 912.

[0155] At block 912, an error between the surface and the location of the additional vertex determined at block 910 is determined. For example, this error can be determined by evaluating a surface function at the value of the location of the additional vertex and determining the difference between the result of the function and zero. A result of zero from such an evaluation of the surface function indicates that the location of the additional vertex is exactly on the surface. The method continues at block 914.

[0156] At block 914, it is determined whether the error meets one or more predetermined criteria. For example, if a threshold amount of error was pre-determined for use at block 914, the error is determined to be below the threshold (or, in other embodiments, exceeds the threshold). Other or additional criteria may be used in various embodiments. In some embodiments, the number of iterations of blocks 912 through 916 performed may be an alternative or additional criterion for the determination at block 914. For example, if the number of iterations exceeds the iteration threshold (e.g., three iterations), the predetermined criterion is met. If the predetermined criterion is met, the method continues to block 918, described below.

[0157] If the predetermined criteria is not met at block 914, the method continues to block 916, where the position of the additional vertex is adjusted (e.g., moved) such that the error determined at block 912 is reduced, e.g., moved by an amount that positions the additional vertex closer to the actual surface. In some embodiments, the new (moved) position of the additional vertex is determined using a similar root-finding method, e.g., root-finding using a differentiable function, bisection method, etc., as described above with reference to method 400 or method 600. In some embodiments, the additional vertex can be moved an amount based on the determined error or a predetermined amount. In some embodiments, the magnitude of the error can be indicative of how close the position of the additional vertex is to the actual position, and the additional vertex can be moved based on (e.g., proportional to) the error relative to the estimated position that is closer to the actual position.

[0158] The method then continues to block 912 and begins another iteration of adjusting the additional vertex, where the moved position from the previous iteration becomes the current position of the additional vertex. In the next iteration, the method determines and evaluates the error in the position after the movement of the additional vertex and moves the additional vertex as indicated by the predetermined criterion, if necessary for multiple iterations, as also described above, until the error meets the predetermined criterion at block 914.

[0159] At block 918, the predetermined criteria of block 914 are met and it is determined whether there are other voxels of the voxel grid to process in method 900. If there are other voxels to process, the method returns to block 902 to select another voxel to process. In some embodiments, a voxel adjacent to the voxel just processed can be selected, or another voxel from the voxel grid can be selected. In some embodiments, not all voxels intersected by the surface are processed by method 900, for example based on a predetermined threshold or other criteria.

[0160] In some embodiments, the mesh can be further subdivided by adding one or more additional vertices to the mesh on one or more polylines that were previously subdivided by the aforementioned additional vertices. The vertices selected and added in each iteration of method 900 can be constrained to the dimensions of the voxel space of the associated selected voxel. For example, as in block 906, the curvature of the surface can be determined between the original vertex of the voxel and the first additional vertex, and if this curvature exceeds a curvature threshold (or in some embodiments, if it exceeds another threshold used for additional vertices after the first additional vertex), the mesh line between the original vertex and the first additional vertex can be further subdivided by adding a second additional vertex to the mesh line, as in block 908. In some embodiments, the position of the second additional vertex can be iteratively refined by moving it closer to the surface, as described above in block 916 for the first additional vertex. For example, if the error between the second additional vertex and the surface exceeds an error threshold. In some embodiments, third, fourth and / or further additional vertices can be similarly added to the same mesh line, with the location being iteratively refined. In some cases or embodiments, such second (and subsequent) additional vertices can be added to the mesh at locations of the voxel that are not on a face or edge of the voxel, e.g., within the interior of the voxel or at other locations.

[0161] If there are no voxels of the voxel grid to process as determined at block 918, the method continues to block 920 to generate or modify a mesh. In some embodiments, additional vertex positions are assigned to the mesh, e.g., triangles or other polygons of the mesh are created or adjusted to incorporate the additional vertices added by method 900. For example, mesh lines may be drawn to the additional vertices. In some embodiments, additional processing of the mesh may optionally be performed, e.g., further adjusting the mesh vertex positions using one or more techniques, storing the mesh, displaying the mesh, etc.

[0162] 9 illustrates a voxel-by-voxel determination of the mesh, it will be appreciated that one or more blocks of method 900 can be performed substantially in parallel. For example, block 902 can select multiple voxels to perform, and blocks 904 through 918 can be performed substantially in parallel for each selected voxel. Parallel execution can improve mesh determination speed (because multiple voxels / vertices can be computed simultaneously). Additionally, parallel execution can better utilize processor resources, for example, when the processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of running multiple threads in parallel.

[0163] A graph showing subdividing a portion of a mesh, adding vertices, and refining the positions of the added vertices. According to some embodiments, Figure 10 is a graphical illustration of an example of subdividing a portion of a mesh and adding vertices, and Figure 11 is a graphical illustration of an example of refining the positions of the added vertices. In some embodiments, the example of Figure 10 is based on the method 900 of Figure 9.

[0164] Graph 1000 shows a 2D example for simplicity. Graph 1000 shows a curve 1002 that, in some embodiments, represents a surface function over a position on the edge (and / or across a face) of a voxel between two vertices V0 and V1 on separate (e.g., opposing) edges of the voxel. The surface function has been transformed from a 2D or 3D function to a linear function on the edge similar to that described above with reference to blocks 904 or 404. The x-axis represents the position over the edge (or face) of the voxel. The y-axis represents the value of the surface function at that position. Position V A is the actual location of the intersection between the surface and the edge of the voxel, where the surface function is zero.

[0165] A line 1004 is provided between vertices V0 and V1 as an approximation of the surface path between these vertices. In some embodiments, the line 1004 may be part of a mesh generated prior to the method performed in the example of Figure 10, or may be generated as part of the method of Figure 10.

[0166] The curvature of the surface is determined at vertices V0 and V1. For example, a tangent 1006 can be determined at vertex V0 and a tangent 1008 can be determined at vertex V1. The angles of these tangents can be compared to determine the curvature. In this example, the difference in the angles of tangents 1006 and 1008 is greater than a threshold angle, indicating a large angle of surface curvature between vertices V0 and V1.

[0167] Depending on the detection of curvature exceeding the curvature threshold, additional vertices V R1 is added to the line 1004 connecting the vertex V0 and the vertex V1. R1 is added at the midpoint between V0 and V1. V R1 may be added at other locations on line 1008 in other embodiments.

[0168] Figure 11 shows the additional vertex V R1 10, where V has been moved closer to the surface. N1 is an additional vertex V R1 is the actual function value (y value) of V N1 is not at zero (y=0) and therefore is not on the surface. N1 is moved closer to the surface and is now almost on the surface. In this example, a root-finding method such as the Newton-Raphson root-finding method (surface functions are differentiable) is used. The roots obtained by the root-finding method are N1 vertex V based on where the tangent 1102 at N2 It is in. N2 V N1 More than V A Close to the surface position at

[0169] V N2 But, VA If it is within the threshold distance of V, no further iterations are performed in the root finder, and V N2 are assigned as vertices of the mesh. This results in two mesh lines 1104 and 1106 being used in place of line 1004, and which approximate the surface curve 1002 more closely than line 1004 does.

[0170] In some embodiments, additional iterations may be performed. For example, N2 The curvature at is evaluated, and if the curvature exceeds a curvature threshold, the mesh line 1104 may subdivide the second additional vertex into a polyline with two rays. The second additional vertex need not be on an edge or face of the voxel (e.g., it may be located within the voxel). In some embodiments, the second additional vertex may be moved, for example, using another technique other than root-finding.

[0171] The blocks in methods 400, 600, 800, or 900 may be performed (or repeated) in a different order than described above and / or one or more blocks may be omitted. The methods may be performed on a server (e.g., 102 in FIG. 12) and / or on a client device (e.g., 1210 or 1216 in FIG. 12).

[0172] Exemplary System Architecture 12 illustrates an example system architecture 1200 according to some embodiments of the present disclosure. The system architecture 1200 (also referred to herein as the "system") includes an online platform 1202, a first client device 1210 (generally referred to herein as the "client device 1210 / 1216"), a network 1222, and a second client device 1216. The online platform 1202 may include, among other things, an application engine 1204, one or more applications 1205, a search engine 1206, and a data store 1208. The client device 1210 may include an application 1212. The client device 1216 may include an application 1218. Users 1214 and 1220 can interact with the online platform 1202 utilizing the client devices 1210 and 1216, respectively.

[0173] System architecture 1200 is provided for illustrative purposes. In some embodiments, system architecture 1200 may include the same, fewer, more, or different elements arranged in the same or different manner as shown in FIG.

[0174] In one embodiment, the network 1222 may include a public network (e.g., the Internet), a private network (e.g., a local area network (LAN) or a wide area network (WAN)), a wired network (e.g., an Ethernet network), a wireless network (e.g., an 802.11 network, a Wi-Fi network, or a wireless LAN (WLAN)), a cellular network (e.g., a Long Term Evolution (LTE) network), a router, a hub, a switch, a server computer, or a combination thereof.

[0175] In one embodiment, data store 1208 may be a non-transitory computer-readable memory (e.g., random access memory), a cache, a drive (e.g., a hard drive), a flash drive, a database system, or any other type of component or device capable of storing data. Data store 1208 may further include multiple storage elements (e.g., multiple drives or multiple databases), which may span multiple computing devices (e.g., multiple server computers).

[0176] In some embodiments, the online platform 1202 may comprise a server having one or more computing devices (e.g., a cloud computing system, a rack mount server, a server computer, a cluster of physical servers, a virtual server, etc.) In some embodiments, the server may be included within the online platform 1202, may be a separate system, or may be part of another system or platform.

[0177] In some embodiments, the online platform 1202 may comprise one or more computing devices (such as a rack mount server, a router computer, a server computer, a personal computer, a mainframe computer, a laptop computer, a tablet computer, a desktop computer, etc.), data storage (e.g., hard disk, memory, databases), networks, software components, and / or hardware components that may be used to execute operations on the online platform 1202 and provide users with access to the online platform 1202. The online platform 1202 may comprise websites (e.g., one or more web pages) or application backend software that may be used to provide users with access to content provided by the online platform 1202. For example, users may access the online platform 1202 using respective applications 1212 / 1218 on client devices 1210 / 1216.

[0178] In some embodiments, the online platform 1202 may be a type of social network that provides connectivity between users or a type of user-generated content system that allows users (e.g., end users or consumers) to communicate with other users via the online platform 1202, which may include voice chat, video chat, or text chat. In some embodiments of the present disclosure, a "user" may be represented as a single individual. However, other embodiments of the present disclosure also include a "user" (e.g., a creating user) that is a group of users or an entity controlled by an automated source.

[0179] In some embodiments, the online platform 1202 can generate the mesh based on the input data and using one or more of the methods and features described herein. In some embodiments, one or more client devices can generate the mesh based on the input data and using one or more of the methods and features described herein.

[0180] In some embodiments, the online platform 1202 may be a virtual gaming platform. For example, the gaming platform may provide single player or multi-player games to a community of users who may access or interact with the games (e.g., user-generated games, or other games) using client devices 1210 / 1216 over the network 1222. In some embodiments, the games may be, for example, two-dimensional (2D) games, three-dimensional (3D) games (e.g., 3D user-generated games), virtual reality (VR) games, or augmented reality (AR) games. Objects depicted in the games may include objects defined by meshes generated from data described herein. In some embodiments, users may search for games and participate in gameplay with other users in one or more games selected from the search results. In some embodiments, a game selected from the search results may be played in real time with other users of the game. In some embodiments, gameplay may refer to the interaction of one or more players with client devices (e.g., 1210 and / or 1216) in a game (e.g., 1205) and the presentation of the interactions on a display or other output device of client device 1210 or 1216.

[0181] In some embodiments, the online platform 1202 may be a social networking platform, a purchasing platform, a messaging platform, a creation platform, a platform that provides digital content for viewing and manipulation by users (e.g., medical scanning, topographical maps, etc.), etc. Other collaborative platforms can be used in place of or in addition to the online platform 1202 with the features described herein (e.g., using 3D or 2D digital objects defined by meshes about their surfaces or other features).

[0182] One or more applications 1205 are provided by the online platform. In some embodiments, the application 1205 may include electronic files executable or readable by software, firmware, or hardware configured to present the application's content (e.g., digital media items) to an entity. For example, the application 1205 may be a game that presents the application content. In some embodiments, the application 1212 / 1218 may be executed and the application 1205 may be rendered in association with the application engine 1204.

[0183] It should be noted that a 3D environment or world uses graphics using a three-dimensional representation of the geometric data that is a representation of the application content (or at least presents the content so that it appears as 3D content, whether or not a 3D representation of the geometric data is used), and a 2D environment or world uses graphics using a two-dimensional representation of the geometric data that is a representation of the application content.

[0184] In some embodiments, the online platform 1202 can host one or more applications 1205 and enable users to interact with the applications 1205 (e.g., search for applications, application content, or other content) using the applications 1212 / 1218 on the client devices 1210 / 1216. In some embodiments, users of the online platform 1202 (e.g., 1214 and / or 1220) may play, create, search, interact, or build applications and application content, such as, for example, games, videos, images, audio data, documents, etc., interact with other users, create and build application objects (e.g., also referred to herein as "items" or "visual items") for the application 1205, and / or search for objects. For example, in creating user-created virtual game items, a user may create characters, decorations for the characters, one or more virtual environments for an interactive game, build structures used within the game application 1205, among other things. In some embodiments, the online platform 1202 may send application content to an application (e.g., 1212). In some embodiments, an application object may refer to an object used, created, shared, or otherwise depicted within an application 1205 of the online platform 1202 or an application 1212 or 1218 of a client device 1210 / 1216. For example, game objects may include parts, models, characters, tools, weapons, clothing, buildings, vehicles, currency, plants, animals, components of the above (e.g., windows of a building), etc.

[0185] Additionally, the online platform 1202 may host one or more media items, which may include communication messages from one user to one or more other users. Media items may include, but are not limited to, digital videos, digital pictures, digital photos, digital music, audio content, melodies, website content, social media updates, e-books, e-magazines, digital newspapers, digital audiobooks, e-journals, web blogs, RSS feeds, e-comics, software applications, etc. In some embodiments, a media item may be an electronic file that is executable or readable by software, firmware, or hardware configured to present the digital media item to an entity.

[0186] In some embodiments, the application 1205 may be associated with a particular user or group of users (e.g., a private game) or may be broadly available to users of the online platform 1202 (e.g., a public game).

[0187] In some embodiments, the online platform 1202 or the client devices 1210 / 1216 may include an application engine 1204 or an application 1212 / 1218. The engine 1204 may include applications similar to the applications 1212 / 1218. In some embodiments, the engine 1204 may be used for developing or running the applications 1205. For example, the game engine 1204 may include a drawing engine ("renderer") for 2D, 3D, VR or AR graphics, a physics engine, a collision detection engine (and collision response), a sound engine, scripting capabilities, an animation engine, an artificial intelligence engine, networking capabilities, streaming capabilities, memory management capabilities, threading capabilities, scene graph capabilities, or video support for movie production, among other features. Components of the engine 1204 may generate commands (e.g., drawing commands, collision commands, physics commands, etc.) that help compute and render the application. In some embodiments, the respective applications 1212 / 1218 of the client devices 1210 / 1216 may operate independently, in conjunction with the engine 1204 of the online platform 1202, or a combination of both.

[0188] In some embodiments, both the online platform 1202 and the client devices 1210 / 1216 run the engines (1204, 1212, and 1218, respectively). In various embodiments, each application 1205 may have a different ratio of engine functions that run on the online platform 1202 and on the client devices 1210 and 1216.

[0189] In some embodiments, a component of a digital object, such as a body part, may be a basic geometric shape, such as a block, cylinder, sphere, or other basic shape, such as a wedge, torus, tube, channel, etc. In some embodiments, a creator module may publish an object (e.g., a game character) for viewing or use by other users of the online platform 1202. In some embodiments, the creation, modification, or customization of an object, application 1205, or application environment may be done by a user utilizing a user interface (e.g., a developer interface), with or without scripting (or with or without an application programming interface (API)).

[0190] In some embodiments, the online platform 1202 may store digital objects and content created by users in the data store 1208.

[0191] In some embodiments, client device 1210 or 1216 may each comprise a computing device such as a personal computer (PC), a mobile device (e.g., a laptop, a mobile phone, a smart phone, a tablet computer, or a notebook computer), a network-connected television, a game console, etc. Also, in some embodiments, client device 1210 or 1216 may be referred to as a "user device." The number of client devices 1210 or 1216 is provided for purposes of illustration and not limitation. In some embodiments, any number of client devices 1210 or 1216 may be used.

[0192] In some embodiments, each client device 1210 or 1216 may include an instance of an application 1212 or 1218, respectively. In one embodiment, the application 1212 or 1218 may allow a user to interact with the online platform 1202, such as searching for applications or application content, control objects in virtual games hosted by the online platform 1202, or view uploaded content, such as games, images, video items, web pages, documents, etc. In one example, the application may be a web application (e.g., an application that works with a web browser) that can access, search, present, or navigate content provided by a web server. In another example, the application may be a native application (e.g., a mobile application, app, or game program) that is installed on the client device 1210 or 1216 and runs locally to enable a user to interact with the online platform 1202. The application may render, display, or present content (e.g., a web page, media viewer) to a user. In embodiments, the application may include an embedded media player (eg, a Flash player) that is embedded within a web page.

[0193] In general, functions described in one embodiment as being performed by the online platform 1202 may in other embodiments be performed by a client device 1210 or 1216 or a server, as appropriate. Moreover, functions performed by a particular component may be performed by multiple components separately or in cooperation. Additionally, the online platform 1202 is not limited to use within a website, as it may also be accessible as a service provided to other systems or devices via appropriate application programming interfaces (APIs).

[0194] Exemplary Computing Device 13 is a block diagram of an example computing device 1300 that may be used to implement one or more features described herein, according to some embodiments. In one example, the device 1300 may be used to implement a computing device (e.g., 1202, 1210, and / or 1216 of FIG. 12) to execute embodiments of the methods described herein. The computing device 1300 may be any suitable computer system, server, or other electronic or hardware device. For example, the computing device 1300 may be a mainframe computer, a desktop computer, a workstation, a portable computer, or an electronic device (portable device, mobile device, mobile phone, smartphone, tablet computer, television, TV set-top box, personal digital assistant (PDA), media player, gaming device, wearable device, etc.). In some embodiments, the device 1300 includes a processor 1302, a memory 1304, an input / output (I / O) interface 1306, and an audio-visual input / output device 1314 (e.g., a display screen, a touch screen, display goggles or glasses, audio speakers, a microphone, etc.).

[0195] The processor 1302 may be one or more processors and / or processing circuits that execute program code to control the basic operations of the device 1300. A "processor" includes any suitable hardware and / or software system, mechanism, or component that processes data, signals, or other information. A processor may comprise a general-purpose central processing unit (CPU), multiple processing units, a system with dedicated circuits to implement functions, or other systems. Processing need not be limited to a particular geographic location or temporally. For example, a processor may perform its functions in "real-time," "offline," "batch mode," etc. Portions of processing may be performed at different times, in different locations, in different (or the same) processing systems. A computer may be any processor in communication with a memory.

[0196] Typically, memory 1304 is provided within device 1300 for access by processor 1302 and may be any suitable processor-readable storage medium, such as random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory, etc., located separately from and / or integrated with processor 1302, suitable for storing instructions for execution by the processor. Memory 1304 may store software that is run on server device 1300 by processor 1302, including operating system 1308, mesh generation engine application 1310, and associated data 1312. In some embodiments, mesh generation engine application 1310 may include instructions that enable processor 1302 to perform functions described herein, such as some or all of the methods of FIGS. 2-4, 6, 8, and 9. In various embodiments, some or all of the methods of Figures 2-4, 6, 8 and 9 can be implemented on one or more devices 1300, e.g., on one or more processors of each of the one or more devices 1300.

[0197] For example, memory 1304 may include software instructions for a mesh generation engine 1310 that can generate a mesh from input data and provide the mesh for use by the apparatus 1300 and / or the online platform (e.g., 1202). For example, storing, modifying, and / or rendering the mesh for display by a display device of the I / O device 1314. Any of the software in memory 1304 may alternatively be stored in other suitable memory locations or on computer readable media. Additionally, memory 1304 (and / or other connected storage devices) may store instructions and data used in the features described herein. Memory 1304 and other types of storage devices (such as magnetic disks, optical disks, magnetic tape, or other tangible media) may be considered "storage devices" or "storage devices."

[0198] The I / O interface 1306 can provide the server device 1300 with the functionality to interface with other systems and devices. For example, network communication devices, storage devices (e.g., memory and / or data storage 1208), and input / output devices can communicate via the interface 1306. In some embodiments, the I / O interface can connect to interface devices including input devices (keyboards, pointing devices, touch screens, microphones, cameras, scanners, etc.) and / or output devices (display devices, speaker devices, printers, motors, etc.). For example, meshes (and / or digital objects and digital features extracted therefrom) generated by the online platform 1202 can be stored at the platform 1202 and transmitted over a network to one or more client devices for storage and display on the client devices.

[0199] For simplicity of illustration, FIG. 13 illustrates one block for each of the processor 1302, memory 1304, I / O interface 1306, software blocks 1308 and 1310, and database 1312. These blocks represent one or more processors or processing circuits, operating systems, memory, I / O interfaces, applications, and / or software modules. In other embodiments, the device 1300 may not have all of the components illustrated and / or may have other elements, including other types of elements other than or in addition to those illustrated herein. Although the online platform 1202 is described as performing operations as described in some embodiments herein, any suitable component or combination of components of the online gaming platform 1202 or a similar system, or any suitable processor or processors associated with such a system, may perform the described operations.

[0200] Also, a user device may implement and / or be used with the features described herein. An exemplary user device may be a computing device including several similar components as device 1300, such as processor 1302, memory 1304, I / O interface 1306, etc. An operating system, software, and applications suitable for the client device may be provided in the memory and used by the processor. The I / O interface for the client device may be connectable to a network communication device and connectable to an input / output device. The input / output device may be, for example, a microphone for capturing audio, a camera for capturing images or video, an audio speaker device for outputting audio, a display device for outputting images or video, or other output device. A display device in audio-visual input / output device 1314 may be connectable to (or included in) device 1300, for example, and may display pre- and post-processing of images as described herein. Such a display device may comprise any suitable display device, such as an LCD, LED or plasma display screen, a CRT, a TV, a monitor, a touch screen, a 3D display screen, an AR / VR display, a projector, or other visual display device. Some embodiments may provide audio output devices, such as speech output or synthesis of text to speech. For example, such display or output devices may display objects (including one or more surfaces or other properties / features) within a virtual environment based on a mesh generated by mesh generation engine 1310.

[0201] Methods, blocks, and / or operations described herein may be performed in an order different from that illustrated or described, and / or may be performed concurrently (partially or fully) with other blocks or operations, as appropriate. Some blocks or operations may be performed on a portion of the data, and then performed again at a later time on other portions of the data, for example. Not all of the blocks and operations described need be performed in various embodiments. In some embodiments, blocks and operations may be performed multiple times, in a different order, and / or at different points in the method.

[0202] In some embodiments, some or all of the methods can be implemented on a system, such as one or more client devices. In some embodiments, one or more methods described herein can be implemented, for example, on a server system and / or on both a server system and a client system. In some embodiments, various components of one or more servers and / or clients can perform various blocks or other portions of the methods.

[0203] One or more of the methods described herein (e.g., methods 200, 300, 400, 600, 800, and / or 900) can be implemented by computer program instructions or code executable on a computer. For example, the code can be implemented by one or more digital processors (e.g., microprocessors or other processing circuits) and stored on a computer program product including a non-transitory computer-readable medium (e.g., storage medium), such as a magnetic, optical, electromagnetic, or semiconductor storage medium, including semiconductor or solid-state memory, magnetic tape, removable computer disks, random access memory (RAM), read-only memory (ROM), flash memory, rigid magnetic disks, optical disks, solid-state storage disks, and the like. Also, the program instructions can be stored in and provided as electronic signals. The electronic signals are in the form of software, for example, as a service extracted from a server (e.g., distributed systems and / or cloud computer systems). Alternatively, one or more of the methods can be implemented in hardware (e.g., logic gates) or a combination of hardware and software. Exemplary hardware may be a programmable processor (e.g., a Field Programmable Gate Array (FPGA), Complex Programmable Logic Device), a general-purpose processor, a graphics processor, an application specific integrated circuit (ASIC), etc. One or more methods may be implemented as part of a component of an application running on the system, or as an application or software running in combination with other applications and the operating system.

[0204] One or more methods described herein can be implemented as a stand-alone program executable on any type of computing device, a program running on a web browser, or within a mobile application ("app") running on a mobile computing device (e.g., a mobile phone, a smart phone, a tablet computer, a wearable device (watch, armband, jewelry, headwear, goggles, glasses, etc.), a laptop computer, etc.). In one example, a client / server architecture can be used, e.g., a mobile computing device (as a client device) sends user input data to a server device and receives final output data for output (e.g., for display) from the server. In other examples, all computations can be implemented within the mobile app (and / or other apps) on the mobile computing device. In other examples, computations can be split between the mobile computing device and one or more server devices.

[0205] Although specific embodiments have been described, each specific embodiment is illustrative only and is not intended to be limiting, and concepts described in each example may be applied to other examples and embodiments.

[0206] It should be noted that the functional blocks, operations, features, methods, devices, and systems described in this disclosure may be combined or divided into other combinations of systems, devices, and functional blocks as would be understood by one of ordinary skill in the art. Any suitable combination of programming languages ​​and techniques may be used to implement the routines of each particular embodiment. For example, other programming techniques, such as procedural or object-oriented, may be employed. The routines may be executed on a single processing device or multiple processors. While steps, operations, or computations may be presented in a particular order, in other specific embodiments, the order may be changed. In some embodiments, multiple steps or operations shown in a sequence in this example may be executed simultaneously. [Explanation of symbols]

[0207] 102 Surface 104 Voxel Grid 106 Voxels 120 mesh 122 triangle 124 Vertices 500 graphs 502 curve 504 line 504 Tangent line 506 Line Segments 508 Tangent 510 Line Segments 700 graphs 702 curve 704 line 706 Line Segments 708 line 710 Line Segments 1000 Graphs 1002 curve 1004 line 1006 Tangent line 1008 Tangent line 1102 Tangent line 1200 System Architecture 1202 Online Platform 1204 Application Engine 1205 Application 1208 Data storage unit 1210 Client device 1212 Applications 1214 User A 1216 Client Device 1218 Applications 1220 User n 1222 Network 1300 Arithmetic equipment 1302 Processor 1304 Memory 1306 I / O Interface 1308 Operating Systems 1310 Mesh Generation Engine 1312 Database 1314 I / O Devices V0 vertex V1 Vertex

Claims

1. receiving, by one or more processors, input data representing a surface that distinguishes between an interior and an exterior of a volume; determining, by the one or more processors, a voxel grid that includes the surface, the voxel grid including a plurality of voxels; identifying, by the one or more processors, particular voxels of the voxel grid that are intersected by the surface; generating, by the one or more processors, a mesh approximating the surface, the mesh including a number of polygons defined by vertices of the mesh within the particular voxel, and generating the mesh includes determining positions of the vertices using a root-finding method to obtain roots of a surface function describing the surface.

2. 2. The computer-implemented method of claim 1, further comprising: mapping, by the one or more processors, each voxel of the plurality of voxels to a respective intersection case from a set of stored intersection cases based on the input data, each mapped intersection case indicating an intersection path of the surface through the voxel, and identifying the particular voxel comprises identifying an edge or other line segment of the particular voxel that is intersected by the surface based on the mapped intersection case.

3. 2. The computer-implemented method of claim 1, wherein the root-finding method approximates the positions of the vertices by iteratively evaluating the positions of the vertices and adjusting the positions of the vertices towards the surface.

4. The root finding method is approximating a derivative of the surface function based on discrete samples of the input data using differences of the surface function; and using the derivatives to approximate the roots of the surface function to determine locations of the vertices.

5. The root finding method includes, for each vertex of the plurality of vertices, determining an approximate location of the vertex based on roots of the surface function determined based on derivatives of the surface function; determining an error between the approximate position and the surface; determining a new approximate position of the vertex within an associated voxel to reduce the error.

6. 6. The computer-implemented method of claim 5, further comprising: using the one or more processors to reduce the error by iterating the steps of determining the error and determining additional approximate positions until the error meets a predetermined criterion.

7. The root finding method is 2. The computer-implemented method of claim 1, further comprising: analytically solving the surface function describing the surface to obtain the roots of the surface function, the roots being used to determine positions of the vertices.

8. The root finding method includes, for each vertex of the plurality of vertices, performing linear interpolation on the first set of vertices to determine approximations of the positions of the vertices along edges or other line segments of associated voxels; determining an error between the approximation of the vertex positions and the surface; and performing linear interpolation on a second set of vertices that includes the approximation of the vertex's position to determine a new approximation of the vertex's position in the associated voxel to reduce the error.

9. 9. The computer-implemented method of claim 8, further comprising: using the one or more processors to iterate the steps of determining the error and performing linear interpolation on a set of vertices including newer approximations of the vertex positions to reduce the error until the error meets a predetermined criterion.

10. determining a curvature of the surface over one or more of the particular voxels; determining that the curvature of the surface in at least one of the one or more voxels exceeds a threshold; subdividing the mesh by inserting an additional vertex in the mesh between two vertices of the mesh in the at least one voxel in response to the curvature of the surface exceeding the threshold in the at least one voxel; determining a second error between the additional vertex and the surface; and adjusting the additional vertices proximate the surface to reduce the second error.

11. 8. The computer-implemented method of claim 1, further comprising: generating, by the one or more processors, a feature surface based on the mesh, the feature surface being displayable by a display device.

12. receiving, by one or more processors, input data representing a surface that distinguishes between an interior and an exterior of a volume; determining, by the one or more processors, a voxel grid that includes the surface, the voxel grid including a plurality of voxels; identifying, by the one or more processors, particular voxels of the plurality of voxels that are intersected by the surface; and generating, by the one or more processors, a mesh approximating the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxel, the generating of the mesh comprising: determining approximate locations of the vertices of the polygon within the voxels; determining a curvature of the surface over one or more of the particular voxels; determining that the curvature of the surface in a particular one of the particular voxels exceeds a threshold; in response to determining that in the particular voxel the curvature of the surface exceeds the threshold, subdividing the mesh by inserting an additional vertex in the mesh between two vertices of the mesh in the particular voxel; determining an error between the additional vertex and the surface; and adjusting the additional vertices in the particular voxel to reduce the error.

13. 13. The computer-implemented method of claim 12, wherein adjusting the additional vertices comprises iterating, with the one or more processors, determining the error and adjusting the additional vertices until the error meets a predetermined criterion.

14. 13. The computer-implemented method of claim 12, further comprising: mapping, by the one or more processors, each voxel of the plurality of voxels to a respective intersection case from a set of stored intersection cases based on the input data, each mapped intersection case indicating an intersection path of the surface through the voxel, and identifying the particular voxel comprises identifying an edge or other line segment of the particular voxel that is intersected by the surface based on the mapped intersection case.

15. 13. The computer-implemented method of claim 12, wherein determining the curvature of the mesh comprises determining tangent surfaces at vertices at the one or more of the particular voxels.

16. 13. The computer-implemented method of claim 12, wherein determining the curvature of the mesh comprises sampling the mesh at midpoints of edges or other line segments of certain ones of the voxels and determining a distance from the midpoints to the surface.

17. 17. The computer-implemented method of claim 12, wherein adjusting the additional vertices in the particular voxel comprises using a root-finding technique to obtain a root of a surface function describing the surface.

18. After inserting the additional vertex, determining whether the curvature of a portion of the surface in the particular voxel at the additional vertex exceeds the threshold; in response to determining that the curvature of the portion of the surface exceeds the threshold, further subdividing the mesh by inserting a second additional vertex in the mesh between the additional vertex and the other of the two vertices of the mesh in the particular voxel; determining an error between the second additional vertex and the surface; and adjusting the second additional vertex in the particular voxel to reduce the error.

19. 17. The computer-implemented method of claim 12, further comprising the step of generating a feature surface based on the mesh, the feature surface being displayable by a display device.

20. At least one processor; and a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform operations, the operations including: Receiving input data representing a surface that distinguishes between an interior and an exterior of a volume; determining a voxel grid that includes the surface, the voxel grid including a plurality of voxels; identifying particular voxels of the voxel grid that are intersected by the surface; generating a mesh that approximates the surface, the mesh including a plurality of polygons defined by vertices of the mesh within the particular voxel, the generating of the mesh including determining positions of the vertices using a root-finding method to obtain roots of a surface function that describes the surface.

Citation Information

Patent Citations

  • Systems and methods for generating a proxy mesh for an artist-authored mesh using conformed smoothing

    US11217016B1

  • Three-dimensional shape data processing apparatus and non-transitory computer readable medium

    US20210295597A1