#include <iostream>
#include <gudhi/Coxeter_triangulation.h>
#include <gudhi/Functions/Function_Sm_in_Rd.h>
#include <gudhi/Implicit_manifold_intersection_oracle.h>
#include <gudhi/Manifold_tracing.h>
#include <gudhi/Coxeter_triangulation/Cell_complex/Cell_complex.h>
#include <gudhi/Functions/Linear_transformation.h>
#include <gudhi/IO/build_mesh_from_cell_complex.h>
#include <gudhi/IO/output_meshes_to_medit.h>
using namespace Gudhi::coxeter_triangulation;
struct Function_surface_on_CP2_in_R4 {
Eigen::VectorXd operator()(const Eigen::VectorXd& p) const {
double xr = p(0), xi = p(1), yr = p(2), yi = p(3);
Eigen::VectorXd result(cod_d());
double xr2 = xr * xr, xi2 = xi * xi, yr2 = yr * yr, yi2 = yi * yi, xr3 = xr2 * xr, xi3 = xi2 * xi, yr3 = yr2 * yr,
yi3 = yi2 * yi;
result(0) = xr3 * yr - 3 * xr * xi2 * yr - 3 * xr2 * xi * yi + xi3 * yi + yr3 - 3 * yr * yi2 + xr;
result(1) = 3 * xr2 * xi * yr + xr3 * yi - 3 * xr * xi2 * yi - xi3 * yr + 3 * yr2 * yi - yi3 + xi;
return result;
}
std::size_t amb_d() const { return 4; };
std::size_t cod_d() const { return 2; };
Eigen::VectorXd seed() const {
Eigen::VectorXd result = Eigen::VectorXd::Zero(4);
return result;
}
Function_surface_on_CP2_in_R4() {}
};
int main(int argc, char** argv) {
Function_surface_on_CP2_in_R4 fun;
Eigen::VectorXd seed = fun.seed();
double radius = 3.0;
Function_Sm_in_Rd fun_sph(radius, 3, seed);
double lambda = 0.2;
Coxeter_triangulation<> cox_tr(oracle.amb_d());
cox_tr.change_offset(Eigen::VectorXd::Random(oracle.amb_d()));
cox_tr.change_matrix(lambda * cox_tr.matrix());
using MT = Manifold_tracing<Coxeter_triangulation<> >;
using Out_simplex_map = typename MT::Out_simplex_map;
std::vector<Eigen::VectorXd> seed_points(1, seed);
Out_simplex_map interior_simplex_map, boundary_simplex_map;
std::size_t intr_d = oracle.amb_d() - oracle.cod_d();
Cell_complex<Out_simplex_map> cell_complex(intr_d);
cell_complex.construct_complex(interior_simplex_map, boundary_simplex_map);
Configuration(true, true, true, 2, 13, 14)));
return 0;
}
void manifold_tracing_algorithm(const Point_range &seed_points, const Triangulation &triangulation, const Intersection_oracle &oracle, Out_simplex_map &out_simplex_map)
Static method for Manifold_tracing<Triangulation_>::manifold_tracing_algorithm that computes the set ...
Definition: Manifold_tracing.h:223
Implicit_manifold_intersection_oracle< Function_, Domain_function_ > make_oracle(const Function_ &function, const Domain_function_ &domain_function)
Static constructor of an intersection oracle from a function with a domain.
Definition: Implicit_manifold_intersection_oracle.h:240
void output_meshes_to_medit(std::size_t amb_d, std::string file_name, const Meshes &... meshes)
Outputs a text file with specified meshes that can be visualized in Medit.
Definition: output_meshes_to_medit.h:81
Mesh_medit build_mesh_from_cell_complex(const Cell_complex &cell_complex, Configuration i_configuration=Configuration(), Configuration b_configuration=Configuration())
Builds a Gudhi::coxeter_triangulation::Mesh_medit from a Gudhi::coxeter_triangulation::Cell_complex.
Definition: build_mesh_from_cell_complex.h:122