Closed asyniakov closed 4 years ago
Hi @asyniakov
The cube you are trying to build is centered at (0, 0, 0) and has a side of 2 units. Since you are running marching cubes between 0 and 99, you are just building one corner of the entire cube. It is missing 3 sides because those sides are not there.
Change your bounds to something like
vertices2, triangles2 = mcubes.marching_cubes_func(
(-2, -2, -2),
(2, 2, 2),
5, 5, 5,
func, 0.0
)
and it will build the entire cube.
sorry, you are 100% correct.
Hello,
I found out that if I use box function as sdf, it creates only 3 sides of cube.
def box(): x, y, z = np.mgrid[:100, :100, :100]
sdf function is taken from here https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm (I've translated to python code, though I did it on C++ side)