A Gauss mapping tool for Nurbs surfaces
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
1.4 KiB

#include <iostream>
#include "gauss_map.h"
int main() {
tinynurbs::RationalSurface<float> srf;
srf.degree_u = 3;
srf.degree_v = 3;
srf.knots_u = {0, 0, 0, 0, 1, 1, 1, 1};
srf.knots_v = {0, 0, 0, 0, 1, 1, 1, 1};
srf.control_points = {4, 4, {
glm::vec3(2, -2, -2), glm::vec3(-2.5, -2.2, -1.5), glm::vec3(-2, -2, -0.5), glm::vec3(-2, -2, 1.5),
glm::vec3(2, -1, -2), glm::vec3(-2.5, -1.2, -1.5), glm::vec3(-2, -1, -0.5), glm::vec3(-2, -1, 1.5),
glm::vec3(3, 1.2, -2), glm::vec3(-2.5, 1.2, -1.5), glm::vec3(-2, 1.5, -0.5), glm::vec3(-2, 1.5, 1.5),
glm::vec3(2, 2, -2), glm::vec3(-2.5, 2, -1.5), glm::vec3(-2, 2.5, -0.5), glm::vec3(-2, 2, 1.5)
}
};
srf.weights = {4, 4,
{
1, 3, 4, 2,
2, 1, 1, 1,
9, 1, 7, 4,
1, 1, 7, 1,
}
};
GaussMap gaussMap(2, srf);
gaussMap.build();
auto res = getOverlapLeafNodes(gaussMap, gaussMap);
printf("overlap leaf nodes size: %llu\n", res.size());
auto isRegionallyOverlapped = isGaussMapsOverlapped(gaussMap, gaussMap, {0.2, 0.3}, {0.2, 0.3}, {0.28, 0.38},
{0.28, 0.38}, {0, 1}, {0, 1}, {0, 1}, {0, 1});
printf("is guass map overlapped: %d\n", isRegionallyOverlapped);
return 0;
}