extract explicit mesh with topology information from implicit surfaces with boolean operations, and do surface/volume integrating on them.
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.
 
 
 

38 lines
1.7 KiB

#pragma once
#include <base/subface.hpp>
namespace internal
{
// local: a sphere with center at (0, 0, 0) and radius 1
struct sphere_face_t final : subface {
static constexpr uint64_t max_degree = 2;
static constexpr equation_system_type eq_sys_type = equation_system_type::implicit;
std::function<double(Eigen::Vector3d)> fetch_sdf_evaluator() const override;
std::function<Eigen::Vector3d(Eigen::Vector3d)> fetch_sdf_grad_evaluator() const override;
// u: planar angle from x-axis to z-axis
// v: polar angle from xz-plane to y-axis
std::function<Eigen::Vector4d(double, double)> fetch_point_by_param_evaluator() const override;
std::function<constraint_curve_intermediate(double)> fetch_curve_constraint_evaluator(parameter_u_t constraint_var_type,
double u) const override;
std::function<constraint_curve_intermediate(double)> fetch_curve_constraint_evaluator(parameter_v_t constraint_var_type,
double v) const override;
std::function<equation_intermediate_t(constraint_curve_intermediate &&)> fetch_solver_evaluator() const override;
};
} // namespace internal
namespace detail
{
template <>
struct default_elem_ctor<internal::paired_model_matrix *, internal::sphere_face_t> {
internal::sphere_face_t operator()(const internal::paired_model_matrix *k) const
{
internal::sphere_face_t res{};
res.model_matrices = const_cast<internal::paired_model_matrix *>(k);
return res;
}
};
} // namespace detail