Commit 2d701625 authored by Sabrina Templeton's avatar Sabrina Templeton
Browse files

is this actually working for a million points- seems too good to be true

parent c9e39a0c
......@@ -64,7 +64,7 @@ void main() {
#else
//get_color(idx, color);
get_color(idx, color);
#endif
......
......@@ -244,19 +244,6 @@ void calc_poly(vec3 zi, vec3 zj, inout vec3[MAX_VERTS] curr_poly, inout int cspa
}
int counter = 0;
for (int i = 0; i < nspace; i++) {
bool ok = true;
for (int k = 0; k < i; k++) {
if (distance(new_poly[i],new_poly[k]) < 1e-12) {
ok = false;
break;
}
}
if (!ok) continue;
curr_poly[counter++] = new_poly[i];
}
nspace = counter;
// note to self: this is definitely outside of the loop ( and should remain to be)
curr_poly = new_poly; // does this need to be a deep copy? I don't think so.
cspace = nspace; // setting the current space to be the new space so that it is updated for the new polygon.
......
......@@ -84,7 +84,7 @@ UT_TEST_CASE( test1 )
int DEBUG = 0;
///*// uncomment this to restore to random
std::vector<graphics::gl_float> seeds;
srand (time(NULL));
......@@ -106,7 +106,7 @@ if (DEBUG == 0){
// //std::cout << "Test Print!!!!!!!!!!!!!";
}
else{
float dx = 1 / (sqrt(num_points) + 1); //delta y is the same if we're going for a grid
float dx = 1 / (sqrt(num_points) + 1); //delta y is the same if we're going for a grid
std::cout << dx << std::endl;
for (int i = 1; i < sqrt(num_points) +1; i ++ ){
for (int j = 1; j < sqrt(num_points) +1; j ++ ){
......@@ -122,21 +122,6 @@ else{
}
// //here is the non random way to generate points
// float dx = 1 / (sqrt(num_points) + 1); //delta y is the same if we're going for a grid
// std::cout << dx << std::endl;
// for (int i = 1; i < sqrt(num_points) +1; i ++ ){
// for (int j = 1; j < sqrt(num_points) +1; j ++ ){
// float x = j * dx;
// float y = i * dx;
// seeds.push_back(x);
// seeds.push_back(y);
// seeds.push_back(0.0);
// }
// }
//cout << seeds;
......@@ -182,9 +167,9 @@ else{
nns->set_points( num_points , seeds_d.data() );
index_t nb_neighbors = 30;//index_t(num_points); // since there are only seven points right now, this number will probably be more like 50 later
index_t nb_neighbors = 30; // should be 50 or 30
std::vector<index_t> neighbors(nb_neighbors);
std::vector<index_t> total_neighbors(nb_neighbors * num_points); // i don't know if this is the correct number if, for example, nb points and nb neighbors are not the same (which they usually will not be)
std::vector<index_t> total_neighbors(nb_neighbors * num_points);
std::vector<double> neighbors_sq_dist(nb_neighbors);
......@@ -192,8 +177,7 @@ else{
for (index_t k=0;k<num_points;k++)
{
nns->get_nearest_neighbors( nb_neighbors , k , neighbors.data() , neighbors_sq_dist.data() );
//nns->get_nearest_neighbors( nb_neighbors , &seeds_d[k*3] , neighbors.data() , neighbors_sq_dist.data() , GEO::NearestNeighborSearch::KeepInitialValues() );
//nns->get_nearest_neighbors( nb_neighbors , &seeds[k*3] , neighbors.data() , neighbors_sq_dist.data() , GEO::NearestNeighborSearch::KeepInitialValues() );
//UT_ASSERT_EQUALS( neighbors[0] , k );
//print_inline(neighbors);
......@@ -341,7 +325,7 @@ else{
int points_remaining = num_points;
int first_point_to_draw = 0;
int call_size = 1e4;
int call_size = 1e6;
while (points_remaining > 0){
//std::cout << "one iteration" << std::endl;
std::cout << points_remaining << std::endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment