1

I have a regular square grid wherein all my data points are stored at the centroid. I have a scalar field(range : 0->1) that indicates the amount of substance inside a cell. I am interested in identifying the interface of this substance inside the cell (for further processing and not for visualization).

I came across the Marching cube algorithm(http://paulbourke.net/geometry/polygonise/). Here I need the values at the corners of the cell. So I averaged the centroid values of the neighbouring cell. This averaging coupled with further linearization to find the points of intersection during "Polygonization" in MC is resulting in non-realistic interfaces such as this..

enter image description here

Here the gray cell is full of substance while its neighbours have minimal amount of substance. Ideally this should be very close to the boundary of the celtre cell. I feel this happens due to linear interpolation between 0.25 and 0 which leads it far off from its intended position.

Can something be done to sort out this issue ?

Some_Guy
  • 169
  • 11

1 Answers1

1

The Marching-Cubes-algorithm has one parameter that can be adjusted, namely the isolevel. In your example you seem to have chosen a value around 0.05 for the isolevel. When choosing a value just below 0.25 (e.g. something like 0.24) the interfaces will be much closer to the center cell. But then you will have still unsatisfactory results when two cells with value 1 touch each other s.t. the corners will have an average value of 0.5.

What you still can try: instead of averaging the cell values for computing corner values you can take the maximum cell value for the corner value and raise the isolevel to a value just below 1 (e.g. 0.9).

coproc
  • 6,027
  • 2
  • 20
  • 31
  • Thanks for the answer... I take my isovalue as the cell centre value. For example the cell to the right of the centre cell has a isovalue of 0.01 because I want to know the interface the substance makes inside the cell when it occupies a volume of 0.01... Am I doing it wrong somewhere ? – Some_Guy Mar 14 '19 at 19:14
  • 1
    The isolevel determines, where exactly the grid lines are intersected by the generated polyon. Usually you have one isolevel for the whole algorithm/polygon. (btw: if you had passed 0.01 as isolevel to the marching cubes algorithm or also only to single cells, I would expect that the resulting polygon (dashed line) is even bigger, almost running through the corners.) – coproc Mar 15 '19 at 08:53