Method and system for generating polygon meshes that approximate surfaces using root finding and iteration on mesh vertex positions - Patents.com
By employing root-finding and iterative techniques to adjust vertex positions, the method addresses inaccuracies in existing mesh generation methods, resulting in more efficient and accurate polygon mesh approximations with reduced resource consumption.
Patent Information
- Application Number
- JP2024211525
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-06-02
- Filing Date
- 2024-12-04
- Publication Date
- 2025-09-08
- Estimated Expiration
- 2043-06-02
AI Technical Summary
Existing techniques for generating polygon meshes from surface data, particularly when the data is provided in formats like density or occupancy values, often result in inaccurate approximations due to nonlinear variations along voxel edges or non-distance function descriptions, leading to inefficiencies and resource consumption.
The method employs root-finding and iterative techniques to determine vertex positions of polygons within a voxel grid, using methods like root solving and iterative accelerated relaxation to adjust vertex positions until errors meet predetermined criteria, ensuring accurate mesh generation.
This approach achieves more accurate and efficient mesh generation with reduced computational resources, providing deterministic results that avoid discontinuities and resource inefficiencies common in conventional methods.
Smart Images

Figure 0007735518000005 
Figure 0007735518000006 
Figure 0007735518000007
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to the field of computer-generated surface approximations, and more particularly to methods, systems and computer-readable media for generating polygonal 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 two-dimensional (2D) screens and / or in three-dimensional virtual environments. 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 containing mathematical functions, scalar values, a point set, or other representation. However, standard techniques for approximating a mesh from surface data may not provide an accurate approximation of the surface, for example, if the surface data is provided in a particular format or 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 indicating the amount of each voxel occupied by a volume with the surface. In other examples, the surface may vary nonlinearly along the edges of voxels. In such cases, existing techniques for approximating meshes for surfaces may be inaccurate. Therefore, improved techniques that can efficiently generate meshes that more accurately approximate surfaces may be needed.
[0004] The background description provided herein is for the purpose of generally presenting the context of the disclosure. The inventor's work may not be admitted, expressly or implicitly, as prior art to the present disclosure to the extent that it is described in this background section and in 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] Embodiments of this application relate to generating a polygon mesh that approximates a surface using iteration for root solving and / or mesh vertex locations. In some embodiments, a method includes receiving, by one or more processors, input data representing a surface that distinguishes between the interior and 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 within 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 stored set of 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 that the surface intersects based on the mapped intersection case. In some embodiments, the root-finding method approximates the position of the vertex by iteratively evaluating the position of the vertex and adjusting the position of the vertex to the surface. In some embodiments, each vertex is constrained to the 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 a data point to the surface, a scalar value indicating the density or occupancy of a voxel by volume, etc.
[0007] In some embodiments, the root-finding method includes using differences of the surface function to approximate a derivative of the surface function based on discrete samples of the input data, and using the derivative to approximate roots of the surface function to determine positions of the vertices. In some embodiments, the root-finding method includes, for each vertex, determining an approximate position of the vertex based on the roots 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 using one or more processors to iterate between determining the error and determining additional approximate positions until the error meets a predetermined criterion, thereby reducing 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, where the roots are used to determine the position of the vertex. 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 vertex's position along an edge or other line segment of an associated voxel, determining an error between the approximation of the vertex's position and the surface, and performing linear interpolation on a second set of vertices including the approximation of the vertex's position to determine a new approximation of the vertex's position in the associated voxel, thereby reducing the error. In some embodiments, the method further includes using one or more processors to iterate between determining the error and performing linear interpolation on a set of vertices including the newer approximation of the vertex's position until the error meets a predetermined criterion, thereby reducing the error.
[0009] In some embodiments, the method further includes determining a surface curvature over one or more of the particular voxels; determining that the surface curvature 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 surface curvature exceeding the threshold 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 iterating, using one or more processors, the steps of determining the second error and adjusting the additional vertex until the second error meets a predetermined second criterion. In some embodiments, the method further includes generating, by the one or more processors, a feature surface based on the mesh, wherein the feature surface is 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 mesh vertices within the particular voxels. The step of generating the mesh includes the steps of determining approximate locations of vertices of the polygon within the voxels, determining the curvature of the surface over one or more of the particular voxels, determining that the curvature of the surface within a particular one of the particular voxels exceeds a threshold, and in response to the step of determining that the curvature of the surface within the particular voxels exceeds the threshold, subdividing the mesh by inserting additional vertices within the mesh between two vertices of the mesh within the particular voxels, determining an error between the additional vertices and the surface, and adjusting the additional vertices within the particular voxels to reduce the error.
[0011] Various embodiments and examples of the method are described. For example, in some embodiments, adjusting the additional vertices includes, using one or more processors, determining an error and repeating the adjusting the additional vertices until the error meets a predetermined criterion. In some examples, the error meets the predetermined criterion after a predetermined number of iterations, when the error falls below a predetermined threshold, or the like. 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 stored set of intersection cases based on the input data, where each mapped intersection case indicates an intersection path of a 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 that describes 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 the 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, wherein the feature surface is 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 comprising 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 this application relate to generating a polygon mesh that approximates a surface using iteration for mesh vertex positions. In some embodiments, a 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 within the particular voxels. Generating the mesh includes determining approximate positions of a set of vertices of polygons of the mesh at a 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, using one or more processors, determining an error and repeating the adjusting step until the error meets a predetermined criterion. In some embodiments, the error meets the predetermined criterion in response to a predetermined number of iterations 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 interpolation between the locations 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 stored set of intersection cases based on the input data, wherein 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 that 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 multiple approximate locations of a subset of vertices of the polygon, the particular subset of voxels including multiple neighboring voxels of the mesh. In some embodiments, the particular subset of voxels includes multiple neighboring voxels of the voxel grid, and the method further includes determining the approximate locations of a second subset of vertices of the polygon of the mesh at a second subset of neighboring voxels of the particular voxel.
[0020] In some embodiments, determining the error includes determining approximate voxel values based on the approximate locations 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 the 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 the mesh that intersects with the 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 an interior from 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 a 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, 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, an iterative accelerated relaxation method is used to determine multiple approximate positions of a subset of the vertices of the polygon, the specific subset of voxels including multiple neighboring voxels of the mesh. In some embodiments, the specific subset of voxels includes multiple neighboring voxels of a voxel grid, and the at least one processor performs a further operation including determining the neighboring positions of a second subset of the vertices of the polygon of the mesh at a second subset of the neighboring voxels of the specific 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, wherein determining the approximate voxel values includes, for each approximate voxel value, determining a volume of a mesh that intersects with the 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 the volume of the mesh that intersects with the 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 a 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 the 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 a 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 explanation of the drawings]
[0026] [Figure 1A] FIG. 1 is an illustration showing a surface onto which a voxel grid has been fitted. [Figure 1B] FIG. 1B is an illustration showing an example mesh approximating the surface of FIG. 1A, according to some embodiments. [Figure 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. [Figure 3] 1 is a flowchart of an exemplary method for determining the positions of vertices of a mesh that approximates a surface, according to some embodiments. [Figure 4]1 is a flowchart of an exemplary method for determining the locations of vertices of a mesh that approximates a surface based on derivatives of a surface function and using a numerical root-finding method, according to some embodiments. [Figure 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] 1 is a flowchart of an exemplary method for determining the locations of vertices of a mesh that approximates a surface using numerical root-finding 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] 1 is a flowchart of an exemplary method for determining the locations of vertices of a mesh approximating a surface using an iterative accelerated relaxation method, according to some embodiments. [Figure 9] 1 is a flowchart of an exemplary method for determining the 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] FIG. 1 is an illustration of a graph showing 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] FIG. 1 is an illustration of a graph showing 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 INVENTION
[0027] One or more embodiments described herein relate to generating a polygonal mesh that approximates a surface represented in input data. Described features 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 representing surfaces or features having such surfaces (e.g., objects, terrain features, etc.) is received. 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 approximating 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 distance from some desired surface, creating a "signed distance field." In other applications, the scalar value may represent density or occupancy, creating an "occupancy field," or any continuous, non-distance value. Occupancy is considered here as the ratio of occupied volume (e.g., occupied by solid material) within a voxel and is not a continuous field in three dimensions because it cannot be evaluated at an arbitrary location in space. Occupancy values are known within discrete voxels because they are 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 of volumetric shapes. Surfaces distinguish between the inside and outside of a volume.
[0031] In some cases, input data may be encoded in voxels, and interpolation and generated voxels may define the field. In some examples, the field can be interpolated using tri-linear interpolation, nearest neighbor (e.g., point sampling), or higher-order methods. Tri-linear interpolation produces cubic (third-order) variation along the line, which means the field varies nonlinearly. Any form of input data may be cubically rasterized into voxels as a preprocessing 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 value 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 at location (x,y,z) proportional to the value f accurately identifies 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 at positions that deviate 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 bone and tissue when detecting surfaces in computed tomography and X-ray scans. However, the marching cubes method has another limitation: it only provides a good approximation when applied to true, metric distance functions. When 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 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 boundary voxels, 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 interpolation based on their values between voxel centers. 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, and averages the positions. However, because Surface Nets uses data from function values outside each cell, it is non-local and cannot be parallelized. It is not memory-efficient on digital processors because it exploits data dependencies, which require communication between individual processor threads working on different voxel cells.
[0038] The techniques and features described herein have several advantages. This disclosure details techniques that can be used to generate a mesh of polygons that approximates a surface. Each of the described techniques is independent and can be used individually or in combination. Each technique improves the accuracy of surface search and generation when conventional techniques, such as the Marching Cubes method, produce poor results due to nonlinear field variations along edges and non-descriptive properties of the field distance function. While the features are described for the case of a 3D cube, the same features are applicable to 3D tetrahedrons, 2D squares, and 2D triangles.
[0039] Unlike surface nets and other machine learning methods, the techniques described above are local and fully parallelizable, offering efficiency. Thus, only data from the function's values in each cell's neighborhood is used. This ensures memory efficiency on digital processors and eliminates data dependencies that would require communication between individual processor threads working on different voxel cells. Results using these techniques are also deterministic, avoiding gaps 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 handle discontinuities between voxels.
[0040] A technical effect of one or more described embodiments may be that an apparatus requires fewer computational resources to achieve more accurate results. For example, a technical effect of the described embodiments may be reduced consumption of 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 different voxel cells. The techniques described herein can 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 occur between independently processed voxels. The techniques described herein provide deterministic results, improving accuracy and avoiding such additional processing. Some conventional systems produce inaccurate results due to surfaces that 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 nonlinearly or that are not described by a distance function (e.g., those described by occupancy or density values).
[0041] Example Voxel Grids and Surfaces FIG. 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 consists 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 of some of the voxels 106 of the grid. Here, a "face" of a voxel is considered a two-dimensional side of the voxel, and an "edge" of a voxel is considered a one-dimensional edge of the face. A "line segment" can be an edge of a voxel, or it can be any other kind of straight line segment on or within a voxel (e.g., a 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 showing an example mesh 120 approximating the surface 102 shown in FIG. 1A, according to some embodiments. The mesh 120 is composed 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, for example, meshes composed of various numbers and / or types of polygons (e.g., quadrilaterals, additional triangles, etc.).
[0043] Mesh Generation Method 2 is a flowchart of an example method 200 for generating a polygon mesh approximating a surface represented in input data, according to some embodiments. In some embodiments, method 200 can be performed, for example, on a server system, such as, for example, online platform 1202 as shown in FIG. 12 or computing device 1300 as shown in FIG. 13. In some embodiments, some or all of method 200 can be implemented on a system, such as one or more client devices 1210 and 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 implementing system includes one or more processors or processing circuitry and one or more processor storage devices, such as a database or other accessible storage. In some embodiments, various components of one or more server and / or client devices can perform various blocks or other portions of 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 the surfaces of solid objects represented in a video game, a virtual reality environment, or other virtual environment. In some examples, the surfaces may be representations of the surfaces of physical objects or other features within a scanned or sensed volume or region, such as organs within the human body, objects within a particular environment (e.g., the interior of materials or elements, 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 which includes one or more materials of the object, and the outside of which is the environment in which the object is located. In some examples, a surface can define where the interior of an object is located (e.g., walls that define the interior volume of a car object) and where the exterior to the object is located (e.g., walls and other exterior surfaces that define the space around the car, placement surfaces, etc.).
[0046] In some embodiments or cases, the input data describes a 3D field having scalar values at each (x, y, z) location in 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 the ratio of a voxel's volume (e.g., a volumetric solid) occupied by the 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 because it cannot be evaluated at any location in space. Occupancy values may only be known within discrete voxels. The occupancy value within 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, 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 representation, e.g., a representation 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) variation along the line, resulting in a nonlinear variation of the surface field. In yet another example, any form of input data may be volumetrically rasterized into voxels as a preprocessing 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 with a different resolution or voxel dimensions) from the grid of the input data. In some embodiments, a voxel grid of input data, or its dual (e.g., 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, the 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, 2D equivalents to surfaces, such as straight lines (e.g., isolines or contours), can be represented in the input data. The straight lines represented in place of surfaces can be approximated using techniques similar to those described herein, including method 200. For example, the straight lines can be approximated by providing multiple different straight line segments (e.g., polylines) and / or approximated curvatures. Block 202 can be followed by block 204.
[0051] In 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 is fitted to the input data, and each corner of each voxel may be classified as inside or outside the volume defined by the surface in the input data. In some examples, one bit may be assigned to each corner of each voxel in the voxel grid. The size of the voxels in the grid can be determined based on the desired resolution, available storage, and / or other considerations.
[0052] In some embodiments, the input data received in 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 various voxels in the input data and on the surface. In some embodiments, a grid similar to such an existing voxel grid may be determined in block 204, e.g., a dual of the existing grid where voxel values are at the corners of the voxels rather than at the centers of the voxels. In some embodiments, a new voxel grid defining new voxels may be determined in block 204 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] In block 206, particular voxels that the surface intersects are identified. For example, this may include identifying line segments, such as particular voxel edges (e.g., surface intersection paths), 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 stored set of intersection cases. For example, each voxel of the voxel grid may be assigned an associated intersection case. In some embodiments, marching tetrahedron or marching cube intersection cases may be used, or intersections used in another technique may be used (e.g., the intersection of line segments with several 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 in the system), each 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 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 each of the 8 corner sets at each voxel, with each different set of bitmaps mapping to a different 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 no surfaces intersect 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 another example, for the trivial case where a voxel is completely inside the volume and no surfaces intersect 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 another example, the marching tetrahedron method may be used. This technique is similar to the marching cubes method, except that each voxel cube is divided into six tetrahedrons and 19 edges of the voxel are specified instead of 12 edges. For each tetrahedron, eight intersection cases are possible. Other embodiments may assign intersection cases or labels / bits in other ways. Other techniques may alternatively or additionally be used to determine voxel line segments that intersect with a surface. Block 206 may be followed by block 208.
[0055] In block 208, a polygonal template is generated based on the identified particular voxel. For example, the template may be generated based on the identified line segments (e.g., edges) of the identified particular voxel. For example, in some embodiments, the polygon may be a triangle, while in other embodiments, the polygon may be of another type (such as a tetrahedron). The template identifies the edges (or other line segments) where the surface intersects, but not specific locations along the edges. In some embodiments, the vertices of the template's polygon may be assigned initial locations along the identified edges of the particular voxel. For example, the initial locations may be corners or midpoints of the identified edges. Other initial locations may be used in other embodiments (e.g., specific fractions 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 line segments. 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 where the surface will be located based on values in the input data, which may be values of a signed distance function or occupancy or density values that describe the surface in terms of the vertices (e.g., corners) of intersected voxels. Using the described techniques, the positions of the mesh vertices are determined more accurately than conventional techniques. Various embodiments for determining the positions of the vertices for block 210 are described below with reference to FIGS. 3 through 11.
[0057] The mesh resulting from block 210 can be used as an approximation of the surface represented in the input data. After vertex locations are determined 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, such as being assigned features (e.g., color or texture to fill polygons), modified to fit a particular object, stored in a particular memory, displayed on a display device, etc. Mesh generation provides for converting input field data 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 the efficient rendering of terrain, medical images, or clay-modeled objects. For example, meshes can be used to generate feature surfaces for features such as terrain features (landscapes, mountains, etc.), surfaces of organs or other body parts, digital objects, etc.
[0058] Selecting the mesh determination method FIG. 3 is a flowchart 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 the vertex position determination in block 210 of method 200 of FIG. 2 described above. In some embodiments, method 300 may be implemented, for example, on a server system and / or a client system, similar to the manner described for method 200. In various embodiments, only portions of method 300 are used, e.g., using only particular forms of input data and / or only some of the mesh generation techniques described. For example, some embodiments may use only block 304; some embodiments may use only blocks 302, 304, and 314; some embodiments may use only blocks 302 through 308; and some embodiments may use only blocks 302, 304, and 310 through 314.
[0059] Some of the techniques described herein are root finders. In the examples described, root finders may use the convention of representing a surface or line as an equation with one side of the equation 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, 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 a zero result are the roots of the equation.
[0060] One or more of the described root-finding methods determine the neighborhood where the zero surface function should be located. More specifically, if f(x1,y1)<0 (e.g., this point is outside the volume) and f(x2,y2)>0 (e.g., this point is inside the volume), and f() is continuous, then somewhere between these points, f(x,y)=0. The surface is where the sign changes to a positive sign. Whether a result less than zero is inside and greater than zero is outside, or vice versa, is an arbitrary convention, and either convention can be used with the described techniques. In some embodiments, if one vertex (corner) at a voxel edge (or other voxel segment) is inside the volume and another corner is outside the volume, then searching along that 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 a 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 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 may be 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 be changed to a different voxel grid (e.g., a grid of a different resolution) for mesh generation, and the surface function is specified to enable such conversion to the different 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 that indicates the presence of a surface function, receiving a command from a user, etc. In some embodiments, the surface function may be determined in other ways, such as, for example, that 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 can be 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). An example of such a function is a field function, where the surface function can be analytically expressed and admits a closed-form solution. Because the surface function is known and analytic, 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 with an analytical solution. Other functions may be analytically solvable. For example, the input data may be based on a particular analytically solvable function (e.g., an equation describing the airflow over an airfoil, 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 a 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 with the received surface function, a machine learning model trained on example analytical functions and used to detect whether the surface function is analytical, etc.
[0067] If the surface is not described by a surface function with an analytical solution, the method continues to block 310, described below. If the surface is described by a surface function with an analytical solution, the method continues to block 308, where the locations of the vertices of the mesh are determined 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 detected as intersected by the surface, the exact location of the intersection across the edge (and the locations 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 accurately placed 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. For example, 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 characteristics of differentiable functions that the system accesses and compares with the received surface function, a machine learning model trained on examples of differentiable functions and used to detect whether the surface function is differentiable, 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 root by evaluating the derivative of the surface function, and the positions of the vertices of the mesh closer to the surface may be obtained through the root-finding iteration. 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 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 positions of the mesh vertices are determined using a numerical root-solver with iterative refinement. For example, this block can be used to obtain roots of the surface function using any of a number of different techniques, and 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 positions of the vertices (e.g., closer to the surface) than using the root-solver without iterations. An example of block 314 is described in more detail below with reference to FIG. 6. Using a root-solver with iterative refinement, a mesh can be generated with estimates of vertex positions that are close to the actual positions of the surface intersections with 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 the locations of vertices of a mesh approximating a surface based on derivatives of a surface function and using numerical root-finding, 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, similar to those described for methods 200 and 300.
[0074] It should be noted that the terms "edge" or "voxel edge" are used for descriptive purposes in describing method 400. A voxel edge 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 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 a voxel edge. For example, vertices in method 400 may be determined or selected along such a line segment of a voxel rather than along the actual edge of the voxel.
[0075] Method 400 may begin at block 402, where a voxel is selected from a grid of voxels to be processed. The voxel is one of the voxels in the grid that is determined to intersect with a surface, for example, block 206 of Figure 2. The method continues to block 404.
[0076] In 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 location. 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, such as the center of the voxel). In some embodiments, the selected vertex may be determined using other techniques, such as the midpoint of the intersected edge of the selected voxel, or a location estimated by another technique. The vertex selected in each 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 on the edges from a 2D or 3D function to a linear function. This transformation may involve fitting the 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 (for example, a horizontal edge with a constant y-axis value), then by fitting a straight line to the surface function, the equation on that edge is x 2 +3 2 = 100, that is, x 2 +9=100, i.e. x 2 = 91. In this simple example, the solution is exactly determinable, but for more complex surface functions, the result may remain difficult to solve. The method continues at block 406.
[0078] In block 406, the new position of the selected vertex is determined as the root of the surface function (e.g., the transformed function described above) using a root-solving method that uses the derivative of the surface function. The surface function is defined such that it is equal to zero at the surface and root-solving 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 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] where (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 is the new position of the selected vertex. The method continues at block 408.
[0082] At block 408, the error between the surface and the new position 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 position 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 position 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] In block 410, it is determined whether the error determined in 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 predetermined for use in block 410, 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 406 through 410 performed may be an alternative or additional criterion for the determination in block 410. For example, if the number of iterations performed exceeds an iteration threshold (e.g., three iterations), the predetermined criteria are met. If the predetermined criteria are 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 solver is initiated by continuing to block 406 to determine a 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 location of the intersection. In the next iteration, a new position of the selected vertex is determined in block 406 using the root solver 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 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 are other mesh vertices of the selected voxel to process. For example, one or more mesh vertex locations on other edges of the selected voxel may not have been determined through method 400. If there are other mesh vertices 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, for example, 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 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.
[0089] While FIG. 4 illustrates voxel-by-voxel determination of a 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, with blocks 404 through 414 executed substantially in parallel for each selected voxel. In another example, block 404 may select one or more vertices and, for each selected voxel, blocks 406 through 412 may be executed 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, such as when a processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of executing 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 representing 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 voxel's edge between the voxel's 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 (x, y coordinates) contained in the input data as voxel values indicating 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. 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 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 vertex 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-solving method can be used to obtain a vertex position close to . In this example, the surface function is differentiable, so a root-solving method using the derivative of the surface function, such as the Newton-Raphson root-solving method, can be used.
[0093] A tangent line 504 is determined in the first iteration using a root finder, 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 point 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 , the surface function is evaluated at point V on 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 the point V and the y-value of the point V is determined to be unsatisfactory (e.g., the error exceeds a threshold value), and the point V N1 Another iteration of the root-finding method is performed with V as the location of a mesh vertex instead of V from the previous iteration. In effect, the vertex location is calculated by N1 Point V N1 A tangent line 508 to the line 508 is determined based on the derivative of the surface function. The tangent line 508 is located at the point V where the line 508 intersects the horizontal axis. R2 It has a root at position V R2 is the actual position of the intersection V A Unlike the surface function, R2 , the surface function is evaluated at point V on curve 502 above the x-axis as shown. N2 Provide point V N2 is the point V N1 than V 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 N2 ,V N1 Instead of V as the starting point, another iteration can be performed, and so on, as many additional iterations as necessary. A If the error between satisfies the criteria, the iteration does not continue and the zero position is taken as the position of the mesh vertex.
[0096] Mesh determination using root-finding iterative refinement 6 is a flowchart of an example method 600 for determining the locations of vertices of a mesh approximating a surface using numerical root-finding with iterative refinement, 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 a differentiable function. In some embodiments, method 600 may be performed, for example, on a server system and / or a client system, similar to those 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, a line segment may be an actual edge of a face of a cubic voxel, and in some embodiments, in some mesh generation techniques, e.g., some surface nets or similar techniques usable in method 600, a 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 a voxel edge. For example, vertices in method 600 may be determined or selected along such a line segment of a voxel rather than along the voxel's actual edge.
[0098] Method 600 may begin at block 602, where a voxel is selected from a grid of voxels to be processed. The voxel is one of the voxels in the grid that is determined to intersect with a surface, for example, block 206 of Figure 2. The method continues to block 604.
[0099] At block 604, vertices within the selected voxel are selected for the mesh. 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 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., two vertices within a voxel whose roots converge, such that a line intersecting these 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 each iteration 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 mesh vertices are traversed are determined, the surface function is transformed on the edges from a 2D or 3D function to a linear function, for example, similar to that described above with reference to block 404 of Figure 4. The method continues at block 606.
[0101] In block 606, a new position 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-finding method. The root-finding method can search for a root of the surface function, for example, a location where the surface function results in zero and the surface intersects the edge of the voxel.
[0102] One or more of a variety of numerical root-finding techniques may be used. In some examples, the root-finding technique may include a bisection technique (e.g., finding the midpoint of a line between two known voxel edge vertices that bracket the root and evaluating 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., converting the function into a Bezier curve and clip ends), a false position technique (e.g., interpolation with bracketing with the two most recent points), Ridders' technique (e.g., fitting an exponential function to the function at the positive, negative, and midpoints), a Van Wijngaarden-Dekker-Brent technique (e.g., fitting an inverse quadratic function to the three most recent points), and / or other root-finding techniques. The resulting zero of the root solver 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, at block 604, two vertices that are known and that bracket a root of the surface function are selected. For example, one of the vertices has a positive value and the other vertex has a negative value. A line is extended 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 at 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 value determined at block 606 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 position of the selected vertex is exactly on the surface. The method continues at block 610.
[0105] In block 610, it is determined whether the error determined in 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 predetermined for use in block 610, the error is determined to be less than 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 in block 610. For example, if the number of iterations performed exceeds an iteration threshold (e.g., three iterations), the predetermined criteria are met. If the predetermined criteria are 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. In this way, 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 using bisection and two selected vertices, the new position can replace one of the selected vertices. For example, if evaluation of the surface function at the new position has a positive result, a new position is assigned to replace the first of the two selected vertices that is positive. If evaluation of the surface function at the new position has a negative result, a 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] In 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 voxel 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 refinement 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 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 are other mesh vertices of the selected voxel to process. For example, one or more mesh vertex locations on other edges of the selected voxel may not have been determined through method 600. If there are other mesh vertices 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, for example, 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] While FIG. 6 illustrates voxel-by-voxel determination of a 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 execute, and blocks 604 through 614 may execute substantially in parallel for each selected voxel. In another example, block 604 may select one or more vertices and, for each selected voxel, blocks 606 through 612 may execute substantially in parallel. Parallel execution may improve mesh determination speed (because multiple voxels / vertices may be computed simultaneously). Furthermore, 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 executing 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 Interpolating between these generates vertices proportional to each position, as if interpolating against THRESHOLD(surface)... This assumes the underlying density is linear (usually bilinear or bicubic, so a single iteration is the 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 solving using the root solving 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 representing a surface function across a position on the edge between two original vertices (e.g., corners) of a voxel, similar to curve 502 in FIG. 5. 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 in FIG. 6. The x-axis represents the position across 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 means that the point V between the x-values of vertices V0 and V1 is A indicates that the surface intersects the voxel edge at A is unknown).
[0117] If the surface function is continuous and does not have an analytical solution, then the position V A Root solving can be used to obtain vertex positions close to . In this example, the surface function may be differentiable or non-differentiable. Root solving can obtain the roots of 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 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. The root position V on the line 704 S1 intersects the horizontal axis, where the y value of the 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 is S1 , the point V on the curve 702 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 can be expressed as the difference in position (along the y-axis) between the surface function result at
[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 not to 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 for point V1 in the previous iteration. In effect, the vertex location is N1 has been adjusted (moved) to.
[0122] Line 708 shows the relationship between V and V in the second iteration. N1 The line 708 is a straight line extending between the horizontal axis and the point 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 the point V N1 than V 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 , and additional iterations can be performed as needed. A If the error between satisfies the criteria, 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 flowchart illustrating an example method 800 for determining the positions of vertices of a mesh approximating a surface using an iterative accelerated relaxation method, according to some embodiments. For example, method 800 may be an example embodiment of the vertex position 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 positions of vertices in a mesh. In some embodiments, method 800 may be implemented, 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, a line segment may be an actual edge of a face of a cubic voxel; in some embodiments, in some mesh generation techniques, e.g., some surface nets or similar techniques usable in method 800, a 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 a voxel edge. For example, vertices in method 800 may be determined or selected along such a line segment of a voxel rather than along the voxel's actual edge.
[0126] Method 800 may be used in some embodiments where input data is provided in the form of occupancy or density values (both referred to in this method as "occupancy values"). Such values may indicate the amount of each defined voxel occupied by a volume containing the surface. In some embodiments, any of a variety of forms of input data may be used in method 800, such as input data representing a surface described by a function or input data representing a surface not described by a function.
[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 neighboring voxels of the voxel grid. For example, the set of neighboring voxels may be a set of 3x3 neighboring voxels, a set of 5x5 neighboring 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, on different processors or processor cores, partially or completely sequentially, etc. In some embodiments, all of the voxels in 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 at 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, the 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 neighboring voxels known from the input data can be obtained, and linear interpolation can be performed between these neighboring values to find an approximate initial location for the vertex of the mesh. In some embodiments, the initial approximate locations of the vertices can be determined using other techniques. In some embodiments, the vertices selected in each iteration of method 800 can be constrained to the voxel space dimensions of each of the associated selected voxels in the voxel set. The method continues at 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 can 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 can 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 therefore a current approximation of the volume occupying that voxel. The method continues at block 808.
[0130] At block 808, an error between the approximate 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 approximate volume can be compared to the corresponding voxel value in the input data, and the difference between these values can be determined to indicate the error for that voxel. An associated error can be determined for each voxel in the selected set of voxels. In some embodiments, the input data can include occupancy values that are directly comparable to the determined approximate values. In some embodiments, the input data can be converted to a format that is compatible with the determined approximate values or to another format to enable comparison, for example, based on a new voxel grid fitted to the input data in method 200. The method continues at block 810.
[0131] In block 810, it is determined whether the error determined in block 808 for the selected set of voxels satisfies one or more predetermined criteria. For example, if a threshold amount of error was predetermined for use in block 810, the error for each voxel in the set is determined to be below the threshold (or, in other embodiments, above 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 in 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 in the iterative accelerated relaxation method. In some examples, a single vertex can be selectively moved, or multiple vertices can be selectively moved. For example, if the approximate volume is larger than the corresponding voxel value, one or more of the approximate vertices are moved inward toward the volume; if the approximate volume is smaller 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 at which the moved vertices become selectable based on a particular method for moving the vertices, e.g., moving one vertex, moving all 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, selected vertices can be moved by the same amount, or selected vertices that moved in the previous iteration can be moved by a smaller amount than selected vertices that did not move.
[0133] The SRA is an iterative method that takes the form of a weighted average between the previous iteration and successive Gauss-Seidel iterates (using the Gauss-Seidel method) calculated 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 iteration converges to a solution (the actual location of the surface intersection).
[0138] In some embodiments, the Gauss-Seidel method, which can be thought of as a sequentially accelerated relaxation method with a relaxation factor of 1, can be used.
[0139] After moving one or more vertices, the method continues in 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 in block 812, determine an error for the new approximate volume in block 808, and determine whether the error meets a predetermined criterion in block 810. These iterations are repeated for each successive iteration, using the newly determined vertex positions in block 812, until the error meets the predetermined criterion in 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 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 proximate to the moved vertex is moved in the next iteration of block 812, etc. In other examples, multiple vertices are moved in one iteration, and 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, other vertices can be moved randomly or systematically in each iteration. In other examples, all vertices of the selected set are moved in each iteration. The technique used to move vertices may depend, for example, on the format and / or content of the input data, and the technique may result 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 voxels intersected by the surface are processed by method 800, for example, based on a predetermined 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 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.
[0144] In some embodiments, parallel processing of vertices and / or voxels of a 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 a set of voxels being processed. In various embodiments, one or more blocks of method 800 can execute vertices and / or voxels sequentially or substantially in parallel. For example, block 802 may select and execute multiple sets of voxels, and blocks 804 through 816 may execute substantially in parallel for each selected set of voxels. Parallel execution may improve the speed of mesh determination (because multiple voxels / vertices may be computed simultaneously). Furthermore, parallel execution may better utilize processor resources. This is the case, for example, when a processor includes multiple processing cores (e.g., a GPU or multi-core processor) and / or is capable of executing multiple threads in parallel.
[0145] Surface approximation by mesh refinement FIG. 9 is a flowchart illustrating an example method 900 for determining the 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 the 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 the 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 performed, for example, on a server system and / or a client system, similar to that 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 a voxel edge. For example, vertices in method 900 may be determined or selected along such a line segment of a voxel rather than along the voxel's actual edge.
[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. In some embodiments, the input data may be provided as occupancy or density values.
[0148] 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, for example, 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 the surface. In some embodiments, method 900 may be performed after a method for generating a mesh has been performed, such as methods 400, 600, or 800 described herein or other known techniques, and approximate vertices of the mesh on the face of the voxel, determined by such a prior method, may be selected at block 904. In such embodiments, 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 at block 906.
[0150] In 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 function defining the surface is 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 those 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, and this distance can 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 can be used to determine the curvature of the approximate surface locally, e.g., at the selected vertices or otherwise across the intersecting faces of the selected voxels. 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 prevent the surface from being approximated by a line within an acceptable accuracy range. In some examples, if two tangents are used to determine curvature as described above, the curvature threshold may be provided as a threshold difference in the angles 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] In block 910, an additional vertex is inserted between two existing vertices in the selected voxel, thereby subdividing the line between the two existing vertices into a polyline. In some embodiments, the two existing vertices may be the vertices selected in block 904. In some examples, the two existing vertices are provided on the edges of the selected voxel, and the additional vertex may be inserted at the midpoint between the two existing vertices or at a different point relative to the two vertices (e.g., closer to one of the existing vertices than the other). Some embodiments may place the additional vertex at a location between the two existing vertices based on the curvature determined in 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 by a previous method, such as methods 400, 600, 800, or other mesh generation techniques. In some embodiments, the additional vertex can be inserted between two existing vertices of one or more polygons in a template of polygons, 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, the 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 predetermined for use at block 914, the error is determined to be below the threshold (or, in other embodiments, exceeding 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 an 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 are not met at block 914, the method continues to block 916, where the position of the additional vertex is adjusted (e.g., moved) to reduce the error determined at block 912, 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, 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 indicate 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 moved position of the additional vertex and moves the additional vertex as indicated by the predetermined criteria, if necessary for multiple iterations, as also described above, until the error meets the predetermined criteria at block 914.
[0159] In 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 a voxel other than 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 refined by adding one or more additional vertices to the mesh on one or more polylines that were previously refined by the 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 refined 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 the face or edge of the voxel, for example, 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 a mesh, it will be appreciated that one or more blocks of method 900 can be performed substantially in parallel. For example, block 902 may select multiple voxels for execution, and blocks 904 through 918 may be performed substantially in parallel for each selected voxel. 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 executing 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, in some embodiments, shows a curve 1002 that 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 block 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 position 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, 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 curvature of the surface between vertices V0 and V1.
[0167] Upon detecting 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. R1 may be added at other locations on line 1008 in other embodiments.
[0168] Figure 11 shows the additional vertex V R1 10 is moved closer to the surface. In this example, V 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 nearly 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 Located in. V N2 is V N1 Rather 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-finding method, 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 mesh lines 1104 and 1106 approximating surface curve 1002 more closely than line 1004.
[0170] In some embodiments, additional iterations may be performed. For example, if vertices V and V 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 a voxel (e.g., it may be located within the voxel). In some embodiments, the second additional vertex can be moved, for example, using another technique other than root solving.
[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 shows 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 “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 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, online platform 1202 may comprise a server having one or more computing devices (e.g., a cloud computing system, a rack-mounted server, a server computer, a cluster of physical servers, a virtual server, etc.) In some embodiments, the server may be included within online platform 1202, may be a separate system, or may be part of another system or platform.
[0177] In some embodiments, online platform 1202 may include one or more computing devices (such as a rack-mounted 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 online platform 1202 and provide users with access to online platform 1202. Online platform 1202 may also include website (e.g., one or more web pages) or application backend software that may be used to provide users with access to content provided by online platform 1202. For example, users may access online platform 1202 using respective applications 1212 / 1218 on client devices 1210 / 1216.
[0178] In some embodiments, 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 online platform 1202, which may include voice chat, video chat, or text chat. In some embodiments of the present disclosure, a "user" may be referred to 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 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 using one or more of the methods and features described herein.
[0180] In some embodiments, online platform 1202 may be a virtual gaming platform. For example, the gaming platform may offer 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 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 using a client device (e.g., 1210 and / or 1216) in a game (e.g., 1205) and the presentation of the interaction on a display or other output device of client device 1210 or 1216.
[0181] In some embodiments, 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 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 execute, and the application 1205 may be rendered in association with the application engine 1204.
[0183] Note that a 3D environment or world uses graphics that use three-dimensional representations of geometric data that are a representation of application content (or at least presents the content so that it appears as 3D content, whether or not a 3D representation of geometric data is used), and a 2D environment or world uses graphics that use two-dimensional representations of geometric data that are a representation of application content.
[0184] In some embodiments, online platform 1202 can host one or more applications 1205 and enable users to interact with applications 1205 (e.g., search for applications, application content, or other content) using applications 1212 / 1218 on client devices 1210 / 1216. In some embodiments, users of online platform 1202 (e.g., 1214 and / or 1220) may play, create, search, interact with, 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 application 1205; and / or search for objects. For example, in creating user-created virtual game items, users may create characters, decorations for characters, one or more virtual environments for interactive games, build structures used within game application 1205, among other things. In some embodiments, online platform 1202 may transmit application content to an application (e.g., 1212). In some embodiments, application objects may refer to objects used, created, shared, or otherwise depicted within an application 1205 of 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 on a building), etc.
[0185] Additionally, online platform 1202 may host one or more media items, which may include communications from one user to one or more other users. Media items may include, but are not limited to, digital videos, digital images, digital photos, digital music, audio content, melodies, website content, social media updates, e-books, e-magazines, digital newspapers, digital audiobooks, e-journals, weblogs, RSS feeds, e-comics, software applications, etc. In some embodiments, a media item may be an electronic file 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 a particular group of users (e.g., a private game) or may be generally available to users of the online platform 1202 (e.g., a public game).
[0187] In some embodiments, online platform 1202 or client device 1210 / 1216 may include application engine 1204 or application 1212 / 1218. Engine 1204 may include applications similar to application 1212 / 1218. In some embodiments, engine 1204 may be used for developing or running application 1205. For example, game engine 1204 may include, among other features, 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, a scene graph capability, or video support for filmmaking. Components of 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 on 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 engines (1204, 1212, and 1218, respectively). In various embodiments, each application 1205 may have a different ratio of engine functions running on the online platform 1202 to those running 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, online platform 1202 may store digital objects and content created by users in 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 smartphone, 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, controlling objects in virtual games hosted by the online platform 1202, or viewing 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, allowing the user to interact with the online platform 1202. The application may render, display, or present content (e.g., a web page, media viewer) to the user. In embodiments, the application may include an embedded media player (eg, a Flash player) embedded within a web page.
[0193] In general, functionality described in one embodiment as being performed by online platform 1202 may in other embodiments be performed by client device 1210 or 1216 or a server, as appropriate. Furthermore, functionality of a particular component may be performed by multiple components, either separately or in cooperation. Additionally, 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 exemplary computing device 1300 that may be used to implement one or more features described herein, according to some embodiments. In one example, device 1300 may be used to implement a computer device (e.g., 1202, 1210, and / or 1216 of FIG. 12) to perform method embodiments described herein. Computing device 1300 may be any suitable computer system, server, or other electronic or hardware device. For example, computing device 1300 may be a mainframe computer, a desktop computer, a workstation, a portable computer, or an electronic device (such as a portable device, a mobile device, a mobile phone, a smartphone, a tablet computer, a television, a TV set-top box, a personal digital assistant (PDA), a media player, a gaming device, a 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, an audio speaker, a microphone, etc.).
[0195] Processor 1302 may be one or more processors and / or processing circuits that execute program code and control the basic operations of 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 that 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, or 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 executed 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 apparatus 1300 and / or the online platform (e.g., 1202). For example, storing, modifying, and / or rendering a mesh for display by a display device of I / O device 1314. Any software in memory 1304 can alternatively be stored in other suitable memory locations or on computer-readable media. Additionally, memory 1304 (and / or other connected storage devices) can 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 functionality that allows it 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 be connected to interface devices, including input devices (keyboards, pointing devices, touchscreens, 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 explanation, FIG. 13 shows one block for each of 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, device 1300 may have less than all of the components shown and / or may have other elements, including other types of elements, other than or in addition to those shown. Although online platform 1202 is described as performing the operations described in some embodiments herein, any suitable component or combination of components of 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, user devices 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, and I / O interface 1306. 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 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 within audio / video input / output device 1314 may be connectable to (or included within) device 1300, for example, and may display pre- and post-processing images as described herein. Such a display device may comprise any suitable display device, for example, an LCD, LED, or plasma display screen, a CRT, a TV, a monitor, a touchscreen, a 3D display screen, an AR / VR display, a projector, or other visual display device. Some embodiments may provide an audio output device, such as text-to-speech output or synthesis. For example, such a display or output device may display an object (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, for example, may be performed again later on other portions of the data. Not all of the described blocks and operations 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 that includes 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 diskettes, random access memory (RAM), read-only memory (ROM), flash memory, rigid magnetic disks, optical disks, solid-state storage disks, etc. The program instructions can also be stored in or provided as an electronic signal, e.g., in the form of software as a service (SaaS) from a server (e.g., a distributed system and / or a cloud computer system). 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), a 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 on any type of computing device, as a stand-alone program, 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 smartphone, a tablet computer, a wearable device (such as a watch, an 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 computing can be performed within the mobile app (and / or other apps) on the mobile computing device. In other examples, computing 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 will be understood by those skilled 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 unit 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 performed 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 Applications 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 System 1310 Mesh Generation Engine 1312 Database 1314 I / O Devices V0 vertex V1 vertex
Claims
1. A computer-implemented method comprising: 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 comprising the surface, the voxel grid comprising a plurality of voxels; identifying, by the one or more processors, particular voxels of the plurality of voxels that are intersected by the surface; 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 in the particular voxel, the generating of the mesh comprising: determining approximate locations of a subset of the vertices of the polygons of the mesh at the particular subset of voxels based on interpolation between locations at the particular subset of voxels where the surface intersects the particular subset of voxels; determining an error between an approximate voxel value and an assigned voxel value at a particular voxel, the approximate voxel value being based on an approximate location and the assigned voxel value being determined from input data; adjusting the approximate position of at least one vertex of the subset of vertices using an iterative accelerated relaxation method to reduce the error; generating a A computer-implemented method comprising:
2. A computer-implemented method as described in claim 1, wherein the step of adjusting the approximate position of at least one vertex includes using the one or more processors to repeat the steps of determining the error and adjusting until the error meets a predetermined criterion.
3. A computer-implemented method as described in claim 2, wherein the error satisfies a predetermined criterion in response to a predetermined number of iterations being performed or in response to the error satisfying one or more predetermined thresholds.
4. A computer-implemented method as described in claim 1, wherein the approximate positions of the subset of vertices of the polygon are determined based on interpolation between the positions on the edge of the subset of the particular voxels where the surface intersects the edge.
5. A computer-implemented method as described in claim 1, further comprising the step of 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 wherein identifying the particular voxel comprises identifying an edge or other line segment of the particular voxel that the surface intersects based on the mapped intersection case.
6. A computer-implemented method as described in claim 1, wherein the step of determining the approximate positions of the subset of vertices of the polygons of the mesh includes a step of determining initial approximate positions of the vertices using the marching cubes technique or the surface nets technique.
7. A computer-implemented method as described in claim 1, wherein the iterative accelerated relaxation method is used to determine approximate positions of the subset of vertices of multiple polygons, and the subset of the particular voxel includes adjacent voxels of multiple meshes.
8. The computer-implemented method of claim 1, wherein the subset of the particular voxel includes a plurality of adjacent voxels of the voxel grid, and further comprising a step of determining approximate positions of a second subset of vertices of the polygon of the mesh within a second subset of adjacent voxels of the particular voxel.
9. The step of determining the error comprising: determining the approximate voxel value based on the approximate location; comparing the approximated voxel value with the assigned voxel value; Including, The step of determining the approximate voxel values comprises, for each approximate voxel value: determining a volume of the mesh that intersects with the voxel associated with the approximate voxel value; determining the approximate voxel values based on the volume of the mesh; Including, 10. The computer-implemented method of claim 1.
10. The method of claim 1, wherein determining the volume of the mesh that intersects with the voxel associated with the approximating voxel value comprises determining a three-dimensional integral of the mesh within the voxel associated with the approximating voxel value.
10. The computer-implemented method of claim 9.
11. A computer-implemented method as described in claim 1, further comprising a step of generating a feature surface based on the mesh, the feature surface being displayable by a display device.
12. The computer-implemented method of claim 1, wherein the input data includes a scalar value indicating the density or occupancy of voxels by the volume.
13. The computer-implemented method of claim 1, wherein the step of generating the mesh is performed according to the surface not being described by a known surface function.
14. A program that causes one or more processors to execute a method according to any one of claims 1 to 13.
15. A memory that stores the program according to claim 14; one or more processors for executing said programs; A system comprising:
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