0

I am implementing a naive surface net algorithm and have a question related to creating triangles. I think I am unable to understand how triangulation works in surface nets.

So I have voxels where the surface intersects. I also have a center of a surface node (for now its just a center of the cube). Now I am ready to create triangles between 6 possible neighbor for each surface net cube. I created 12 possible triangles for each node but am looking for ways to reduce the number of triangles since there are duplicates.

In the figure below, I am considering building triangles only for a single quadrant. In this case cubes A,B,C and D which is also left, center, back and bottom. If all 4 surface nodes have intersection I currently create face 1,2 and 3 and also the remaining faces 4,5,6 of the box. Something doesn't seem right. I am wondering if I am in the right direction or if there is another way to do create triangles in surface nets.

enter image description here

Image source.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Danish Shrestha
  • 487
  • 5
  • 16

1 Answers1

0

There is another way of doing this, and a bit of code is shown here: Basic Dual Contouring Theory (under the line #construct faces) you can also negate the "dirs" (then it would be (-1,0,0),(0,-1,0),(0,0,-1)) variable and do it in the same loop as you are doing your sampling, this increases performance a little bit

I hope this helped

Community
  • 1
  • 1