CGAL 6.0 - 3D Isosurfacing
Loading...
Searching...
No Matches
CGAL::Isosurfacing::Dichotomy_edge_intersection Struct Reference

#include <CGAL/Isosurfacing_3/edge_intersection_oracles_3.h>

Definition

The class Dichotomy_edge_intersection uses a dichotomy to find the intersection point between an edge and the isosurface.

Is model of
IsosurfacingEdgeIntersectionOracle_3

This class is for example suitable to be used as the EdgeIntersectionOracle template parameter of isosurfacing domain classes when values are computed using an implicit function.

Warning
It is not optimal to use this class when values are interpolated from discrete values since the intersection can be computed analytically in this case.
See also
CGAL::Isosurfacing::Linear_interpolation_edge_intersection
CGAL::Isosurfacing::Marching_cubes_domain_3
CGAL::Isosurfacing::Dual_contouring_domain_3

Public Member Functions

 Dichotomy_edge_intersection (unsigned int max_iterations=10, double relative_eps=1e-7)
 Constructor, enabling setting up the two criteria which can stop the dichotomy: either a threshold on the value (i.e., the difference between the isovalue and the value at the current point is smaller than relative_eps * isovalue), or a maximum number of iterations.
 
template<typename Domain >
bool operator() (const typename Domain::Geom_traits::Point_3 &p_0, const typename Domain::Geom_traits::Point_3 &p_1, const typename Domain::Geom_traits::FT val_0, const typename Domain::Geom_traits::FT val_1, const Domain &domain, const typename Domain::Geom_traits::FT isovalue, typename Domain::Geom_traits::Point_3 &p) const
 computes the intersection point between an edge and the isosurface.
 

Public Attributes

unsigned int m_max_iterations
 
double m_relative_eps
 

Member Function Documentation

◆ operator()()

template<typename Domain >
bool CGAL::Isosurfacing::Dichotomy_edge_intersection::operator() ( const typename Domain::Geom_traits::Point_3 &  p_0,
const typename Domain::Geom_traits::Point_3 &  p_1,
const typename Domain::Geom_traits::FT  val_0,
const typename Domain::Geom_traits::FT  val_1,
const Domain &  domain,
const typename Domain::Geom_traits::FT  isovalue,
typename Domain::Geom_traits::Point_3 &  p 
) const

computes the intersection point between an edge and the isosurface.

The result (if it exists) is stored in p.

Template Parameters
Domainmust be a model of IsosurfacingDomain_3
Parameters
p_0the location of the first vertex of the edge
p_1the location of the second vertex of the edge
val_0the value at the first vertex of the edge
val_1the value at the second vertex of the edge
domainthe isosurfacing domain
isovaluethe isovalue defining the isosurface with which we seek an intersection
pthe intersection point, if it exists
Returns
true if the intersection point exists, false otherwise