sgsellan / gpytoolbox

A collection of utility functions to prototype geometry processing research in python
https://gpytoolbox.org
GNU General Public License v3.0
206 stars 15 forks source link

Upper envelope crashing (maybe only at low resolutions?) #143

Open sgsellan opened 3 months ago

sgsellan commented 3 months ago

This crashes, and it shouldn't. My current thinking is that the low resolution means there are labels that cause empty regions (e.g., labels with no associated tets). For example, I up-ed the resolution to 10, and that seems to run without issue.

import gpytoolbox, time
import numpy as np

labels = 4
resolution = 5
v, t = gpytoolbox.regular_cube_mesh(resolution)
w = np.zeros((v.shape[0],labels))
for i in range(labels):
    p = np.random.rand(3)
    print( "Center: ", p )
    for j in range(v.shape[0]):
        w[j,i] = -np.linalg.norm( v[j] - p )

print("Number of nodes: ", v.shape[0])
print("Number of labels: ", w.shape[1])
time_0 = time.time()
u, g, l = gpytoolbox.upper_envelope(v,t,w)
time_1 = time.time()
print("UE time: ", time_1-time_0)
print("Output tets: " , g.shape[0] )