Three-dimensional equivalent surface extraction algorithm (Dual contouring)

Source: Internet
Author: User

The previous article introduced the Marching Cubes algorithm, the Marching cubes algorithm is a three-dimensional reconstruction algorithm in the classical algorithm, the main idea of the algorithm is to detect and the equivalent plane intersection of the voxel unit and calculate the intersection point coordinates, Then we use the lookup table to construct the corresponding grid topological relation in the Voxel unit for different intersection situations. Marching cubes algorithm is simple, but there are some defects: 1. Model ambiguity problem; 2. Model feature problem.

For the question of ambiguity, in the case of the 2D case, there is a different connection method (as shown) for the same vertex state in a cell.

Figure: Two semantic problems of marching cubes algorithm in 2D

Then for the different choices of the two connection modes, which may result in a completely different result on the same image (as shown), the direct consequence of ambiguity in 3D is to produce "holes". This ambiguity usually occurs if the two-point value of one diagonal is greater than the contour threshold in one cell, and the point value of the other diagonal is less than the contour threshold.

Fig: Two different results of the semantic question

For the characteristic problem, because the marching cubes algorithm only calculates the intersection coordinate information of the Voxel unit, and constructs the geometrical model in the Voxel unit according to the triangular patches connected by these intersections, so that if there is the characteristic information of the geometrical model in the voxel element (edges, edges and corners), but marching The geometry model that the cubes algorithm eventually constructs will lack these feature information (as shown).

Graph: Upper left-intersection coordinates and normal direction, upper right-marching cubes algorithm, lower left-extended marching cubes algorithm, lower right-dual contouring algorithm

The Dual contouring algorithm [Ju et al. 2002] is also a classic contour extraction algorithm, compared to the Marching cubes algorithm, Dual contouring algorithm uses Hermite data (the location of the intersection point and the normal direction) to build the equivalent plane, It overcomes the shortcomings of the marching cubes algorithm. The specific algorithm is divided into two steps:

First step: generating vertex coordinates using two-time error functions

For each voxel element that intersects the contour, a vertex coordinate is generated by minimizing the two error function:

Where Pi is the position of the intersection, NI is the normal direction of the intersection.

The error function can be written in matrix form:

Where the line vector of matrix A is the normal ni of intersection, and each element of vector b is ni pi.

The extremum points can be obtained by solving the regular equation:

However, the article points out that there is a numerical instability in this way and a solution is proposed. The orthogonal matrix Q is computed based on the QR matrix decomposition, so that the Q and [A B] are multiplied by the following triangular matrix form:

Where a ' is the upper triangular matrix of 3*3, B ' is a vector of length 3, and R is a scalar.

Then the error function can change to:

The extremum point x is then computed based on the above formula.

Step two: generate mesh patches

For each of the voxel edges that intersect the contour, there must be vertices within the 4 adjacent voxel cells that contain the voxel edge, and the 4 vertex connections generate 1 quadrilateral patches.

The article [Schaefer et al. 2002] describes in detail the implementation details of the dual contouring algorithm, which can be obtained by summarizing the dual contouring algorithm process as follows:

For each voxel unit that intersects the contour plane:

1. Create 1 4*4 0 matrices for storing the results of the QR matrix decomposition;

2. For each intersecting edge of the voxel unit, calculate the position of the intersection pi and the corresponding normal NI;

3. Add the vector [ni.x, NI.Y, ni.z, Dot (pi,ni)] to the bottom of the 4*4 0 matrix;

4. The upper triangular matrix A ' and B ' of 3*3 are obtained by the QR matrix decomposition;

5. Solve the linear equation Group A ' tax = (a ' TB '-a ' TB ' C), where C is the centroid position of all intersections in the voxel unit;

6. The calculated offset X plus the centroid position C is the vertex coordinate in the voxel unit;

7. If the computed vertex coordinates are located outside the Voxel unit, the vertex coordinates are replaced by centroid position C;

8. For each intersecting voxel edge, the vertex connections within the 4 voxel cells around it are generated with 1 quadrilateral patches.

Graph: Left-marching cubes algorithm, right-dual contouring algorithm

Graph: Left-marching cubes algorithm, right-dual contouring algorithm

This article is original, reprint please indicate source: Http://www.cnblogs.com/shushen.

Related:

Blister animation Simulation (Marching Cubes): http://www.cnblogs.com/shushen/p/5542131.html

Reference documents:

[1] Tao Ju, Frank LoSasso, Scott Schaefer, and Joe Warren. 2002. Dual contouring of Hermite data. ACM Trans. Graph. 3 (July 2002), 339-346.

[2] Scott Schaefer and Joe Warren. Dual contouring:the secret sauce. Technical report 02-408, Department of the computer science, Rice University, 2002.

[3] Http://users.csc.calpoly.edu/~zwood/teaching/csc572/final15/kpidding/index.html

Three-dimensional equivalent surface extraction algorithm (Dual contouring)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.