<p>The paper doesn't say to compute the normals for the 8 "cubes" around the cube in question. It is saying to compute the normals for all the vertices of the cube you are testing. To create those normals the algorithm would need density values from the surrounding cubes but not the normals of the surrounding cubes.</p>

<p>The paper labels those vertices v1 to v8. So if v1 is the only vertex whose density value is 1 and the density value for all 7 other vertices is zero then v3,v6,v7 and v8 would have normals of zero (assuming the adjacent cubes were empty). But v1,v2,v4 and v5 would have non-zero normals since v1 is guaranteed to have a non-zero density and at least 1 of x,y or z would be non-zero. Interpolating those normals to the triangle with vertices at e1,e4 and e9 should give a normal pointing roughly at v7. </p>

<p>When reading a paper like this one (ie one that has been used around the world to visualize life saving data, and help countless people) if I think I have found an error I stop and take a long hard look for my mistake instead of looking for the mistake of the authors. Just saying.</p>

CC BY-SA 4.0
2018-06-21T09:29:46.780Z
You compute the normal "for each vertex of a cube" not "for a cube", my example case was to compute the normal for a vertex shared by 8 cubes, where such vertex is for example "on" and all the others "off". If you read the paper and use their formula you would get $(0,0,0)^T$ which doesn't make sense as normal.
user8469759
CC BY-SA 4.0
2018-06-21T14:37:19.810Z
The paper specifically says that normals are only calculated for vertices that are "off", but which have a least 1 vertice in the cube that is "on". Calculating a normal for a vertice that is inside the volume doesn't make any sense. Put another way, if you follow the edges of every cube to all the connecting vertices and compute the normal that normal will be non-zero.
pmw1234
CC BY-SA 4.0
2018-06-21T14:47:26.553Z
excuse me -- vertex (not vertice)
pmw1234
CC BY-SA 4.0
2018-06-21T14:49:09.880Z
Say you have a point cloud consisting of only 1 point, and you want to estimate the normals that are on the mesh that surrounds that point, what would you do? (this is only applying case 1 given by the paper).
user8469759
CC BY-SA 4.0
2018-06-21T15:30:33.103Z
Using case 1 from the paper:Compute the normal at v2 results in (1,0,0) compute the normal at v4 results in (0,1,0) ...interpolate the normal between v2,v4 the normal would start at (1,0,0) pass through (0.5,0.5,0.0) and end up at (0,1,0). The result would be a octahedron but would look like a sphere when rendered. Do the same for all the vertices ignoring results that are inside the volume or not connected to the volume
pmw1234
CC BY-SA 4.0
2018-06-21T15:32:40.737Z
Just as a last  comment I would recommend reading this: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch01.html
pmw1234
CC BY-SA 4.0
2018-06-20T00:42:37.507Z
2018-06-20T00:42:37.507Z
pmw1234
<p>I'm implementing the marching cubes, reference is <a href="http://academy.cba.mit.edu/classes/scanning_printing/MarchingCubes.pdf" rel="nofollow noreferrer">this</a>. I managed to get the geometric reconstruction (the mesh) however I do struggle with the normals.</p>

<p>In section 4 they explain the gradient can be firstly estimated using central difference using 8 cubes sharing the vertex $(i,j,k)$. However consider for example case 1 (figure 3) in the paper assume for example you have 8 cubes with one vertex "on" and all the other "off". All the central difference (assuming binary values) would give you 0, therefore I wouldn't be able to estimate the normal in the cube vertex, and later linear interpolate.</p>

<p>Is there some subtlety I'm missing? I wouldn't personally use central difference, but assuming I'm sweeping in a certain direction and then interpolate a point in a cube edge I would use for example forward difference, which to me make more sense, however I'm not 100% sure of the "sense" of this.</p>

<p>In their scheme they give a good explanation of why their approach make sense.
Not sure I can justify mine. </p>

<mesh>
Degenerate case of normal computation in marching cubes
user8469759
# Degenerate case of normal computation in marching cubes

(Asked by: username_0 on 2018-06-14)

I'm implementing the marching cubes, reference is [this](http://academy.cba.mit.edu/classes/scanning_printing/MarchingCubes.pdf). I managed to get the geometric reconstruction (the mesh) however I do struggle with the normals.

In section 4 they explain the gradient can be firstly estimated using central difference using 8 cubes sharing the vertex $(i,j,k)$. However consider for example case 1 (figure 3) in the paper assume for example you have 8 cubes with one vertex "on" and all the other "off". All the central difference (assuming binary values) would give you 0, therefore I wouldn't be able to estimate the normal in the cube vertex, and later linear interpolate.

Is there some subtlety I'm missing? I wouldn't personally use central difference, but assuming I'm sweeping in a certain direction and then interpolate a point in a cube edge I would use for example forward difference, which to me make more sense, however I'm not 100% sure of the "sense" of this.

In their scheme they give a good explanation of why their approach make sense.
Not sure I can justify mine.

**Tags:** mesh


---

## 1 answers

### Answer by username_1 on 2018-06-20. Score: 2

The paper doesn't say to compute the normals for the 8 "cubes" around the cube in question. It is saying to compute the normals for all the vertices of the cube you are testing. To create those normals the algorithm would need density values from the surrounding cubes but not the normals of the surrounding cubes.

The paper labels those vertices v1 to v8. So if v1 is the only vertex whose density value is 1 and the density value for all 7 other vertices is zero then v3,v6,v7 and v8 would have normals of zero (assuming the adjacent cubes were empty). But v1,v2,v4 and v5 would have non-zero normals since v1 is guaranteed to have a non-zero density and at least 1 of x,y or z would be non-zero. Interpolating those normals to the triangle with vertices at e1,e4 and e9 should give a normal pointing roughly at v7.

When reading a paper like this one (ie one that has been used around the world to visualize life saving data, and help countless people) if I think I have found an error I stop and take a long hard look for my mistake instead of looking for the mistake of the authors. Just saying.

> **Comments:**
> **username_0**: You compute the normal "for each vertex of a cube" not "for a cube", my example case was to compute the normal for a vertex shared by 8 cubes, where such vertex is for example "on" and all the others "off". If you read the paper and use their formula you would get $(0,0,0)^T$ which doesn't make sense as normal.  
> **username_1**: The paper specifically says that normals are only calculated for vertices that are "off", but which have a least 1 vertice in the cube that is "on". Calculating a normal for a vertice that is inside the volume doesn't make any sense. Put another way, if you follow the edges of every cube to all the connecting vertices and compute the normal that normal will be non-zero.  
> **username_1**: excuse me -- vertex (not vertice)  
> **username_0**: Say you have a point cloud consisting of only 1 point, and you want to estimate the normals that are on the mesh that surrounds that point, what would you do? (this is only applying case 1 given by the paper).  
> **username_1**: Using case 1 from the paper:Compute the normal at v2 results in (1,0,0) compute the normal at v4 results in (0,1,0) ...interpolate the normal between v2,v4 the normal would start at (1,0,0) pass through (0.5,0.5,0.0) and end up at (0,1,0). The result would be a octahedron but would look like a sphere when rendered. Do the same for all the vertices ignoring results that are inside the volume or not connected to the volume  
> **username_1**: Just as a last  comment I would recommend reading this: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch01.html  

---

