mirror of https://github.com/CGAL/cgal
Add example files
This commit is contained in:
parent
9b55cf1108
commit
568a5c2060
|
|
@ -33,9 +33,9 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) {
|
|||
}
|
||||
|
||||
int main() {
|
||||
const std::string input_name = "../../../../data/bunny.off";
|
||||
const int n_voxels = 50;
|
||||
const FT offset_value = 0.02;
|
||||
const std::string input_name = "../data/bunny.off";
|
||||
const int n_voxels = 20;
|
||||
const FT offset_value = 0.01;
|
||||
|
||||
Mesh mesh_input;
|
||||
if (!CGAL::IO::read_OFF(input_name, mesh_input)) {
|
||||
|
|
@ -69,10 +69,10 @@ int main() {
|
|||
|
||||
grid.value(x, y, z) = distance_to_mesh(tree, p);
|
||||
|
||||
const bool is_inside = (sotm(p) == CGAL::ON_BOUNDED_SIDE);
|
||||
if (is_inside) {
|
||||
grid.value(x, y, z) *= -1;
|
||||
}
|
||||
// const bool is_inside = (sotm(p) == CGAL::ON_BOUNDED_SIDE);
|
||||
// if (is_inside) {
|
||||
// grid.value(x, y, z) *= -1;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,11 @@ struct Refine_one_eighth {
|
|||
int main() {
|
||||
Octree_wrapper_ octree_wrap({-1, -1, -1, 1, 1, 1});
|
||||
|
||||
Refine_one_eighth split_predicate(4, 8);
|
||||
Refine_one_eighth split_predicate(4, 6);
|
||||
octree_wrap.refine(split_predicate);
|
||||
|
||||
Octree_domain_ octree_domain(octree_wrap);
|
||||
|
||||
std::cout << "Init grid" << std::endl;
|
||||
|
||||
auto lam = [&](const Octree_domain_::Vertex_handle& v) {
|
||||
Point_3 p = octree_domain.position(v);
|
||||
const auto val = sphere_function(p);
|
||||
|
|
@ -89,7 +87,6 @@ int main() {
|
|||
Point_range points;
|
||||
Polygon_range polygons;
|
||||
|
||||
std::cout << "Run DC" << std::endl;
|
||||
CGAL::Isosurfacing::make_quad_mesh_using_dual_contouring(octree_domain, 0.8, points, polygons);
|
||||
|
||||
CGAL::IO::write_OFF("result.off", points, polygons);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ typedef std::vector<std::vector<std::size_t>> Polygon_range;
|
|||
|
||||
int main() {
|
||||
|
||||
const std::string fname = "../../../../data/skull_2.9.inr";
|
||||
const std::string fname = "../data/skull_2.9.inr";
|
||||
// Load image
|
||||
CGAL::Image_3 image;
|
||||
if (!image.read(fname)) {
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ inline Kernel::FT distance_to_mesh(const Tree& tree, const Point& p) {
|
|||
}
|
||||
|
||||
int main() {
|
||||
const std::string input_name = "../../../../data/bunny.off";
|
||||
const int n_voxels = 50;
|
||||
const FT offset_value = 0.02;
|
||||
const std::string input_name = "../data/bunny.off";
|
||||
const int n_voxels = 20;
|
||||
const FT offset_value = 0.01;
|
||||
|
||||
Mesh mesh_input;
|
||||
if (!CGAL::IO::read_OFF(input_name, mesh_input)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue