mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/master' into CGAL-Prepare_CHANGES.md_5.6-GF
This commit is contained in:
commit
2b51f0a66e
|
|
@ -66,7 +66,7 @@ int descartes(Polynomial& p, const Field& low,const Field& high){
|
|||
}
|
||||
|
||||
/*! \ingroup \NiX_univariate_polynomial_utils
|
||||
* \brief refine isolating interval for \c p w.r.t \c q
|
||||
* \brief refine isolating interval for \c p w.r.t. \c q
|
||||
*
|
||||
* This function refines the interval ]<TT>low</TT>, <TT>high</TT>[
|
||||
* such that it does not contain any zero of \c q different from the
|
||||
|
|
|
|||
|
|
@ -213,16 +213,10 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_source_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base() == nullptr)) ?
|
||||
&Halfedge_around_source_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base() == nullptr));
|
||||
}
|
||||
|
||||
bool operator==( const Self& i) const {
|
||||
|
|
@ -313,16 +307,10 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_target_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base() == nullptr)) ?
|
||||
&Halfedge_around_target_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base() == nullptr));
|
||||
}
|
||||
|
||||
bool operator==( const Self& i) const {
|
||||
|
|
@ -412,16 +400,9 @@ public:
|
|||
pointer operator -> ( ) { return &pos; }
|
||||
const value_type* operator -> ( ) const { return &pos; }
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_face_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base() == nullptr)) ?
|
||||
&Halfedge_around_face_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base() == nullptr));
|
||||
}
|
||||
|
||||
bool operator==( const Self& i) const {
|
||||
|
|
@ -522,16 +503,10 @@ public:
|
|||
Halfedge_around_source_circulator(vertex_descriptor vd, const Graph& g)
|
||||
: Halfedge_around_source_circulator::iterator_adaptor_(Halfedge_around_target_circulator<Graph>(halfedge(vd,g),g)), opp(g)
|
||||
{}
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_source_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Halfedge_around_source_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
|
|
@ -539,6 +514,11 @@ public:
|
|||
return this->base_reference() == nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void*) const
|
||||
{
|
||||
return this->base_reference() != nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
typename boost::graph_traits<Graph>::halfedge_descriptor dereference() const { return opp(*this->base_reference()); }
|
||||
|
|
@ -580,16 +560,9 @@ public:
|
|||
#ifndef DOXYGEN_RUNNING
|
||||
typedef std::size_t size_type;
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Face_around_target_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Face_around_target_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
|
|
@ -597,6 +570,11 @@ public:
|
|||
return this->base_reference() == nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void*) const
|
||||
{
|
||||
return this->base_reference() != nullptr;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
|
@ -654,17 +632,9 @@ public:
|
|||
bool operator == ( const Self& other) const { return g == other.g && pos == other.pos; }
|
||||
bool operator != ( const Self& other) const { return g != other.g || pos != other.pos; }
|
||||
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_target_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (g == nullptr)) ?
|
||||
&Halfedge_around_target_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (g == nullptr));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -673,6 +643,11 @@ public:
|
|||
return g == nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void* ) const
|
||||
{
|
||||
return g != nullptr;
|
||||
}
|
||||
|
||||
|
||||
Self& operator++()
|
||||
{
|
||||
|
|
@ -751,17 +726,9 @@ public:
|
|||
bool operator == ( const Self& other) const { return g == other.g && pos == other.pos; }
|
||||
bool operator != ( const Self& other) const { return g != other.g || pos != other.pos; }
|
||||
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Halfedge_around_face_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (g == nullptr)) ?
|
||||
&Halfedge_around_face_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (g == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void* ) const
|
||||
|
|
@ -769,6 +736,11 @@ public:
|
|||
return g == nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void* ) const
|
||||
{
|
||||
return g != nullptr;
|
||||
}
|
||||
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(g != nullptr);
|
||||
|
|
@ -1014,22 +986,22 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Vertex_around_face_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Vertex_around_face_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
{
|
||||
return this->base_reference()== nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void*) const
|
||||
{
|
||||
return this->base_reference()!= nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
typename boost::graph_traits<Graph>::vertex_descriptor dereference() const { return fct(*this->base_reference()); }
|
||||
|
|
@ -1068,16 +1040,10 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Vertex_around_face_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Vertex_around_face_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
|
|
@ -1198,16 +1164,10 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Vertex_around_target_circulator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Vertex_around_target_circulator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
|
|
@ -1215,6 +1175,11 @@ public:
|
|||
return this->base_reference()== nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void*) const
|
||||
{
|
||||
return this->base_reference()!= nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
typename boost::graph_traits<Graph>::vertex_descriptor dereference() const { return fct(*this->base_reference()); }
|
||||
|
|
@ -1256,16 +1221,10 @@ public:
|
|||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Vertex_around_target_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Vertex_around_target_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
|
@ -1343,16 +1302,9 @@ public:
|
|||
Out_edge_iterator(halfedge_descriptor h, const Graph& g, int n = 0)
|
||||
: Out_edge_iterator::iterator_adaptor_(Halfedge_around_target_iterator<Graph>(h,g,(h==halfedge_descriptor())?1:n)), opp(g) {}
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (Out_edge_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&Out_edge_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1385,16 +1337,9 @@ public:
|
|||
: In_edge_iterator::iterator_adaptor_(Halfedge_around_target_iterator<Graph>(h,g,(h==halfedge_descriptor())?1:n)), fct(g)
|
||||
{}
|
||||
|
||||
// design pattern: "safe bool"
|
||||
// will be replaced by explicit operator bool with C++11
|
||||
typedef void (In_edge_iterator::*bool_type)() const;
|
||||
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
|
||||
operator bool_type() const
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr)) ?
|
||||
&In_edge_iterator::this_type_does_not_support_comparisons : 0;
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ why we highly recommend reading this section in order to learn what can be expec
|
|||
each coordinate function. If you want to get more mathematical details about each coordinate
|
||||
function as well as the complete history and theory behind barycentric coordinates, you should
|
||||
read \cgalCite{cgal:bc:hs-gbcicg-17}. You can also read an overview
|
||||
<a href="https://www.anisimovdmitry.com/assets/files/phd_thesis_anisimov.pdf">here</a>
|
||||
<a href="https://susi.usi.ch/usi/documents/318813">here</a>
|
||||
(chapters 1 and 2).
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ typedef CGAL::Ostream_iterator<Point,std::ostream> OIterator;
|
|||
int main()
|
||||
{
|
||||
int n = 10;
|
||||
int p = 2;
|
||||
int p = 3;
|
||||
OIterator cout_ip(std::cout);
|
||||
CGAL::IO::set_pretty_mode(std::cout);
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ int main()
|
|||
FT p_radius;
|
||||
std::cout << "\n\n" << p << "-centers:\n";
|
||||
CGAL::rectangular_p_center_2(
|
||||
points.begin(), points.end(), cout_ip, p_radius, 3);
|
||||
points.begin(), points.end(), cout_ip, p_radius, p);
|
||||
std::cout << "\n\n" << p << "-radius = " << p_radius << std::endl;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1371,9 +1371,8 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
|
||||
// try rho_min
|
||||
CGAL_assertion(rho_min <= rho_max);
|
||||
CGAL_assertion(rho_min >= 0);
|
||||
FT rad_2 = q_t_q_r_cover_at_rho_min;
|
||||
if (s_at_rho_min != e_at_rho_min) {
|
||||
if (rho_min >= 0 && s_at_rho_min != e_at_rho_min) {
|
||||
auto mydist = [&q_t_at_rho_min, &q_r_at_rho_min, &op](const Point& p)
|
||||
{ return Min<FT>()( op.distance()(q_t_at_rho_min, p),
|
||||
op.distance()(q_r_at_rho_min, p)); };
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/rectangular_p_center_2.h>
|
||||
#include <CGAL/IO/Ostream_iterator.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
typedef double FT;
|
||||
|
||||
typedef CGAL::Simple_cartesian<FT> Kernel;
|
||||
|
||||
typedef Kernel::Point_2 Point;
|
||||
typedef std::vector<Point> Cont;
|
||||
typedef CGAL::Random_points_in_square_2<Point> Generator;
|
||||
typedef CGAL::Ostream_iterator<Point,std::ostream> OIterator;
|
||||
|
||||
int main()
|
||||
{
|
||||
CGAL::get_default_random() = CGAL::Random(1518508913);
|
||||
int n = 10;
|
||||
int p = 3;
|
||||
OIterator cout_ip(std::cout);
|
||||
CGAL::IO::set_pretty_mode(std::cout);
|
||||
|
||||
Cont points;
|
||||
std::copy_n(Generator(1), n, std::back_inserter(points));
|
||||
std::cout << "Generated Point Set:\n";
|
||||
std::copy(points.begin(), points.end(), cout_ip);
|
||||
|
||||
FT p_radius;
|
||||
std::cout << "\n\n" << p << "-centers:\n";
|
||||
CGAL::rectangular_p_center_2(
|
||||
points.begin(), points.end(), cout_ip, p_radius, p);
|
||||
std::cout << "\n\n" << p << "-radius = " << p_radius << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,466 @@
|
|||
// Copyright (c) 2022 GeometryFactory Sarl (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Laurent Rineau
|
||||
|
||||
#ifndef CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H
|
||||
#define CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H
|
||||
|
||||
#include <CGAL/type_traits/is_iterator.h>
|
||||
#include <CGAL/Kernel/Return_base_tag.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/enum.h>
|
||||
#include <CGAL/type_traits.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace CartesianFunctors {
|
||||
|
||||
template <class Construction, typename ...Args>
|
||||
struct Is_trivial_construction_base
|
||||
{
|
||||
// If the return type of the construction, with the specified arguments, is a
|
||||
// reference or an iterator, them the construction is necessarily trivial.
|
||||
using return_type = decltype(std::declval<Construction>()(std::declval<Args>()...));
|
||||
enum {
|
||||
value = std::is_reference<return_type>::value || CGAL::is_iterator<return_type>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <class Construction, typename ...Args>
|
||||
struct Is_trivial_construction : public Is_trivial_construction_base<Construction, Args...>
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CommonKernelFunctors::Assign_2<K>, Args...>
|
||||
: public Tag_true
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CommonKernelFunctors::Assign_3<K>, Args...>
|
||||
: public Tag_true
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_point_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Origin);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT);
|
||||
static Tag_true trivial(Origin);
|
||||
static Tag_true trivial(RT, RT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_point_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_point_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Origin);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT);
|
||||
static Tag_true trivial(Origin);
|
||||
static Tag_true trivial(RT, RT, RT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_point_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_weighted_point_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Point_2 Point_2;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Origin);
|
||||
static Tag_true trivial(Return_base_tag, Point_2, FT);
|
||||
static Tag_true trivial(Return_base_tag, FT, FT);
|
||||
static Tag_true trivial(Point_2, FT);
|
||||
static Tag_true trivial(Origin);
|
||||
static Tag_true trivial(FT, FT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_weighted_point_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_weighted_point_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Point_3 Point_3;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Origin);
|
||||
static Tag_true trivial(Return_base_tag, Point_3, FT);
|
||||
static Tag_true trivial(Return_base_tag, FT, FT, FT);
|
||||
static Tag_true trivial(Point_3, FT);
|
||||
static Tag_true trivial(Origin);
|
||||
static Tag_true trivial(FT, FT, FT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_weighted_point_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_vector_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
typedef typename K::Point_2 Point_2;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Null_vector);
|
||||
static Tag_true trivial(Return_base_tag, Origin, Point_2);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT);
|
||||
static Tag_true trivial(Null_vector);
|
||||
static Tag_true trivial(Origin, Point_2);
|
||||
static Tag_true trivial(RT, RT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_vector_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_vector_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
typedef typename K::Point_3 Point;
|
||||
typedef typename K::Line_3 Line;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Null_vector);
|
||||
static Tag_true trivial(Return_base_tag, Origin, Point);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT);
|
||||
static Tag_true trivial(Return_base_tag, Line);
|
||||
static Tag_true trivial(Null_vector);
|
||||
static Tag_true trivial(Origin, Point);
|
||||
static Tag_true trivial(RT, RT, RT);
|
||||
static Tag_true trivial(Line);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_vector_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_direction_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
typedef typename K::Vector_2 Vector;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, RT, RT);
|
||||
static Tag_true trivial(Return_base_tag, Vector);
|
||||
static Tag_true trivial(RT, RT);
|
||||
static Tag_true trivial(Vector);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_direction_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_direction_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
typedef typename K::Vector_3 Vector;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT);
|
||||
static Tag_true trivial(Return_base_tag, Vector);
|
||||
static Tag_true trivial(RT, RT, RT);
|
||||
static Tag_true trivial(Vector);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_direction_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_line_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT);
|
||||
static Tag_true trivial(RT, RT, RT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_line_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_line_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
typedef typename K::Vector_3 Vector;
|
||||
typedef typename K::Direction_3 Direction;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Vector);
|
||||
static Tag_true trivial(Return_base_tag, Point, Direction);
|
||||
static Tag_true trivial(Point, Vector);
|
||||
static Tag_true trivial(Point, Direction);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_line_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_segment_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Point, Point);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CommonKernelFunctors::Construct_segment_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_segment_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Point, Point);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CommonKernelFunctors::Construct_segment_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_circle_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Point_2 Point;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, FT, Orientation);
|
||||
static Tag_true trivial(Return_base_tag, Point, Orientation);
|
||||
static Tag_true trivial(Point, FT, Orientation);
|
||||
static Tag_true trivial(Point, Orientation);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_circle_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Compute_squared_radius_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_2 Point_2;
|
||||
typedef typename K::Circle_2 Circle_2;
|
||||
|
||||
static Tag_true trivial(Point_2);
|
||||
static Tag_true trivial(Circle_2);
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Compute_squared_radius_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Compute_squared_radius_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_3 Point_3;
|
||||
typedef typename K::Circle_3 Circle_3;
|
||||
typedef typename K::Sphere_3 Sphere_3;
|
||||
|
||||
static Tag_true trivial(Point_3);
|
||||
static Tag_true trivial(Circle_3);
|
||||
static Tag_true trivial(Sphere_3);
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Compute_squared_radius_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_iso_rectangle_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
typedef typename K::RT RT;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Return_base_tag, Point, Point, int);
|
||||
static Tag_true trivial(Return_base_tag, Point, Point, Point, Point);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT, RT);
|
||||
static Tag_true trivial(Point, Point);
|
||||
static Tag_true trivial(Point, Point, int);
|
||||
static Tag_true trivial(Point, Point, Point, Point);
|
||||
static Tag_true trivial(RT, RT, RT, RT);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_iso_rectangle_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CartesianKernelFunctors::Construct_iso_cuboid_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
typedef typename K::RT RT;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Return_base_tag, Point, Point, int);
|
||||
static Tag_true trivial(Return_base_tag, Point, Point, Point, Point, Point, Point);
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT, RT, RT, RT);
|
||||
static Tag_true trivial(Point, Point);
|
||||
static Tag_true trivial(Point, Point, int);
|
||||
static Tag_true trivial(Point, Point, Point, Point, Point, Point);
|
||||
static Tag_true trivial(RT, RT, RT, RT, RT, RT);
|
||||
\
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_iso_cuboid_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_ray_2<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Point, Point);
|
||||
\
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CommonKernelFunctors::Construct_ray_2<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_ray_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point, Point);
|
||||
static Tag_true trivial(Point, Point);
|
||||
\
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CommonKernelFunctors::Construct_ray_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_triangle_2<K>, Args...> : public Tag_true
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_triangle_3<K>, Args...> : public Tag_true
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_plane_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::RT RT;
|
||||
typedef typename K::Circle_3 Circle;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, RT, RT, RT, RT);
|
||||
static Tag_true trivial(Return_base_tag, Circle);
|
||||
static Tag_true trivial(RT, RT, RT, RT);
|
||||
static Tag_true trivial(Circle);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CommonKernelFunctors::Construct_plane_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_sphere_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::FT FT;
|
||||
typedef typename K::Point_3 Point_3;
|
||||
typedef typename K::Circle_3 Circle_3;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Point_3, FT, Orientation);
|
||||
static Tag_true trivial(Return_base_tag, Point_3, Orientation);
|
||||
static Tag_true trivial(Return_base_tag, Circle_3);
|
||||
static Tag_true trivial(Point_3, FT, Orientation);
|
||||
static Tag_true trivial(Point_3, Orientation);
|
||||
static Tag_true trivial(Circle_3);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_sphere_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_circle_3<K>, Args...>
|
||||
{
|
||||
typedef typename K::Plane_3 Plane_3;
|
||||
typedef typename K::Sphere_3 Sphere_3;
|
||||
|
||||
static Tag_true trivial(Return_base_tag, Plane_3, Sphere_3, int);
|
||||
static Tag_true trivial(Plane_3, Sphere_3, int);
|
||||
static Tag_true trivial(Sphere_3, Plane_3, int);
|
||||
|
||||
static Tag_false trivial(...);
|
||||
|
||||
enum { value = decltype(trivial(std::declval<CGAL::cpp20::remove_cvref_t<Args>>()...))::value ||
|
||||
Is_trivial_construction_base<CGAL::CartesianKernelFunctors::Construct_circle_3<K>, Args...>::value
|
||||
};
|
||||
};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_second_point_3<K>, Args...> : public Tag_true
|
||||
{};
|
||||
|
||||
template <typename K, typename... Args>
|
||||
struct Is_trivial_construction<CGAL::CommonKernelFunctors::Construct_tetrahedron_3<K>, Args...> : public Tag_true
|
||||
{};
|
||||
|
||||
} // end namespace CartesianFunctors
|
||||
} // end namespace CGAL
|
||||
|
||||
#endif // CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Bbox_3.h>
|
||||
#include <CGAL/Origin.h>
|
||||
#include <CGAL/Kernel/Return_base_tag.h>
|
||||
#include <CGAL/Kernel/Type_mapper.h>
|
||||
#include <vector>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
|
|
@ -108,6 +109,12 @@ public:
|
|||
return n;
|
||||
}
|
||||
|
||||
Return_base_tag
|
||||
operator()(Return_base_tag o) const
|
||||
{
|
||||
return o;
|
||||
}
|
||||
|
||||
const Bbox_2&
|
||||
operator()(const Bbox_2& b) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -869,7 +869,7 @@ div.directory {
|
|||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('folderopen.png');
|
||||
background-image:url('folderopen.svg');
|
||||
background-position: 0px -4px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
|
|
@ -880,7 +880,7 @@ div.directory {
|
|||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('folderclosed.png');
|
||||
background-image:url('folderclosed.svg');
|
||||
background-position: 0px -4px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
|
|
@ -891,7 +891,7 @@ div.directory {
|
|||
width: 24px;
|
||||
height: 18px;
|
||||
margin-bottom: 4px;
|
||||
background-image:url('doc.png');
|
||||
background-image:url('doc.svg');
|
||||
background-position: 0px -4px;
|
||||
background-repeat: repeat-y;
|
||||
vertical-align:top;
|
||||
|
|
@ -1388,7 +1388,7 @@ div.toc {
|
|||
}
|
||||
|
||||
div.toc li {
|
||||
background: url("bdwn.png") no-repeat scroll 0 5px transparent;
|
||||
background: url("bdwn.svg") no-repeat scroll 0 5px transparent;
|
||||
font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
|
||||
margin-top: 5px;
|
||||
padding-left: 10px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
// Copyright (c) 2022 GeometryFactory Sarl (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Laurent Rineau
|
||||
|
||||
#ifndef CGAL_CONVERTING_CONSTRUCTION_H
|
||||
#define CGAL_CONVERTING_CONSTRUCTION_H
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/Cartesian_converter.h>
|
||||
#include <CGAL/Cartesian/Is_trivial_construction.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template <class Source_construction, class Target_construction,
|
||||
class Converter, class Backward_converter>
|
||||
struct Converting_construction
|
||||
{
|
||||
CGAL_NO_UNIQUE_ADDRESS Source_construction source_construction;
|
||||
CGAL_NO_UNIQUE_ADDRESS Target_construction construct;
|
||||
CGAL_NO_UNIQUE_ADDRESS Converter convert;
|
||||
CGAL_NO_UNIQUE_ADDRESS Backward_converter backward_convert;
|
||||
|
||||
template <typename... Args,
|
||||
std::enable_if_t<CartesianFunctors::Is_trivial_construction<Source_construction, Args...>::value>* = nullptr>
|
||||
decltype(auto) operator()(Args&&... args) const {
|
||||
return source_construction(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Args,
|
||||
std::enable_if_t<!CartesianFunctors::Is_trivial_construction<Source_construction, Args...>::value>* = nullptr>
|
||||
auto operator()(Args&&... args) const {
|
||||
return backward_convert(construct(convert(args)...));
|
||||
}
|
||||
};
|
||||
|
||||
template <class Kernel_A, class Kernel_B>
|
||||
struct Converting_constructions_kernel_adaptor : public Kernel_A
|
||||
{
|
||||
using A_to_B = Cartesian_converter<Kernel_A, Kernel_B>;
|
||||
using B_to_A = Cartesian_converter<Kernel_B, Kernel_A>;
|
||||
|
||||
#define CGAL_Kernel_cons(C,Cf) \
|
||||
using C = Converting_construction<typename Kernel_A::C, \
|
||||
typename Kernel_B::C, \
|
||||
A_to_B, \
|
||||
B_to_A>; \
|
||||
C Cf() const { return C(); }
|
||||
|
||||
#include <CGAL/Kernel/interface_macros.h>
|
||||
|
||||
};
|
||||
|
||||
} // end namespace CGAL
|
||||
|
||||
#endif // CGAL_CONVERTING_CONSTRUCTION_H
|
||||
|
|
@ -553,7 +553,6 @@ MainWindow::on_actionLoadConstraints_triggered()
|
|||
void
|
||||
MainWindow::loadWKT(QString filename)
|
||||
{
|
||||
//Polygons todo : make it multipolygons
|
||||
std::ifstream ifs(qPrintable(filename));
|
||||
|
||||
typedef CGAL::Polygon_with_holes_2<K> Polygon;
|
||||
|
|
|
|||
|
|
@ -12,13 +12,6 @@ Release date: June 2023
|
|||
`CGAL_triangulation_assertion`) have been removed. Corresponding CGAL-wide versions (such as
|
||||
`CGAL_assertion`) should be used instead.
|
||||
|
||||
### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/5.6/Manual/packages.html#PkgSMDS3) (new package)
|
||||
|
||||
- This new package wraps all the existing code that deals with a
|
||||
[`MeshComplex_3InTriangulation_3`](https://doc.cgal.org/5.6/SMDS_3/classMeshComplex__3InTriangulation__3.html)
|
||||
to describe 3D simplicial meshes, and makes the data structure independent
|
||||
from the [tetrahedral mesh generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3) package.
|
||||
|
||||
### [Shape Detection](https://doc.cgal.org/5.6/Manual/packages.html#PkgShapeDetection) (major changes)
|
||||
|
||||
- **Breaking change**: The region growing part of the package have been reworked to fix design
|
||||
|
|
@ -39,6 +32,16 @@ Release date: June 2023
|
|||
- Added new shapes to the Region Growing algorithm on a point set: circles in 2D, spheres in 3D,
|
||||
and cylinders in 3D.
|
||||
|
||||
### [2D Straight Skeleton and Polygon Offsetting (breaking change)](https://doc.cgal.org/5.6/Manual/packages.html#PkgStraightSkeleton2) (major changes)
|
||||
- Added weighted straight skeletons: weighted straight skeletons are a generalization of
|
||||
straight skeletons. Contour edges are assigned a positive weight, which can be understood
|
||||
as assigning a speed to the wavefront spawned from the contour edge.
|
||||
- Added straight skeleton extrusion: this CGAL package now implements the extrusion of weighted
|
||||
straight skeletons of polygons with holes. The output is a closed, combinatorially 2-manifold
|
||||
surface triangle mesh.
|
||||
|
||||
See also the [announcement page](https://www.cgal.org/TODO).
|
||||
|
||||
### [2D and 3D Linear Geometry Kernel](https://doc.cgal.org/5.6/Manual/packages.html#PkgKernel23)
|
||||
|
||||
- Added the functor
|
||||
|
|
@ -147,12 +150,22 @@ Release date: June 2023
|
|||
[`CGAL::Hyperbolic_triangulation_face_base_2`](https://doc.cgal.org/5.6/Hyperbolic_triangulation_2/classCGAL_1_1Hyperbolic__triangulation__face__base__2.html)
|
||||
has been adapted correspondingly.
|
||||
|
||||
### [3D Simplicial Mesh Data Structure](https://doc.cgal.org/5.6/Manual/packages.html#PkgSMDS3) (new package)
|
||||
|
||||
- This new package wraps all the existing code that deals with a
|
||||
[`MeshComplex_3InTriangulation_3`](https://doc.cgal.org/5.6/SMDS_3/classMeshComplex__3InTriangulation__3.html)
|
||||
to describe 3D simplicial meshes, and makes the data structure independent
|
||||
from the [tetrahedral mesh generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3) package.
|
||||
|
||||
### [3D Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3)
|
||||
|
||||
- Added two new named parameters to the named constructor
|
||||
[`CGAL::create_labeled_image_mesh_domain()`](https://doc.cgal.org/5.6/Mesh_3/classCGAL_1_1Labeled__mesh__domain__3.html#aec3f58e9883a8036a1b3e379df7d8fa9)
|
||||
for automatic detection and protection of 1D-curves that lie at the intersection of
|
||||
three or more subdomains extracted from labeled images.
|
||||
- Added
|
||||
[`CGAL::Sizing_field_with_aabb_tree`](TODO),
|
||||
a geometry-aware sizing field for feature edges in polyhedral domains.
|
||||
- Deprecated usage of boost parameters in favor of function named parameters.
|
||||
|
||||
### [3D Periodic Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgPeriodic3Mesh3)
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
# This file points to the CGALConfigVersion.cmake for header-only CGAL.
|
||||
#
|
||||
|
||||
include(@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfigVersion.cmake)
|
||||
include("@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfigVersion.cmake")
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
# This file points to the CGALConfig.cmake for header-only CGAL.
|
||||
#
|
||||
|
||||
include(@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfig.cmake)
|
||||
include("@CGAL_INSTALLATION_PACKAGE_DIR@/lib/cmake/CGAL/CGALConfig.cmake")
|
||||
|
|
|
|||
|
|
@ -346,7 +346,10 @@ using std::max;
|
|||
#define CGAL_NORETURN [[noreturn]]
|
||||
|
||||
// Macro to specify [[no_unique_address]] if supported
|
||||
#if __has_cpp_attribute(no_unique_address)
|
||||
#if _MSC_VER >= 1929 && _MSVC_LANG >= 202002L
|
||||
// see https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#c20-no_unique_address
|
||||
# define CGAL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
|
||||
#elif __has_cpp_attribute(no_unique_address)
|
||||
# define CGAL_NO_UNIQUE_ADDRESS [[no_unique_address]]
|
||||
#else
|
||||
# define CGAL_NO_UNIQUE_ADDRESS
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright (c) 2016 GeometryFactory SARL (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
//
|
||||
// Warning: this file is generated, see include/CGAL/license/README.md
|
||||
|
||||
#ifndef CGAL_LICENSE_STRAIGHT_SKELETON_EXTRUSION_2_H
|
||||
#define CGAL_LICENSE_STRAIGHT_SKELETON_EXTRUSION_2_H
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/license.h>
|
||||
|
||||
#ifdef CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE
|
||||
|
||||
# if CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
|
||||
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
|
||||
"this release of the 2D Straight Skeleton Extrusion package.")
|
||||
# endif
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "Your commercial license for CGAL does not cover this release \
|
||||
of the 2D Straight Skeleton Extrusion package. \
|
||||
You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
# endif // CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
#else // no CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
CGAL_pragma_warning("\nThe macro CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE is not defined."
|
||||
"\nYou use the CGAL 2D Straight Skeleton Extrusion package under "
|
||||
"the terms of the GPLv3+.")
|
||||
# endif // CGAL_LICENSE_WARNING
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "The macro CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE is not defined.\
|
||||
You use the CGAL 2D Straight Skeleton Extrusion package under the terms of \
|
||||
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
#endif // no CGAL_STRAIGHT_SKELETON_EXTRUSION_2_COMMERCIAL_LICENSE
|
||||
|
||||
#endif // CGAL_LICENSE_STRAIGHT_SKELETON_EXTRUSION_2_H
|
||||
|
|
@ -77,6 +77,7 @@ Skin_surface_3 3D Skin Surface Meshing
|
|||
Snap_rounding_2 2D Snap Rounding
|
||||
Spatial_searching dD Spatial Searching
|
||||
Straight_skeleton_2 2D Straight Skeleton and Polygon Offsetting
|
||||
Straight_skeleton_extrusion_2 2D Straight Skeleton Extrusion
|
||||
Stream_lines_2 2D Placement of Streamlines
|
||||
Surface_mesh_deformation Triangulated Surface Mesh Deformation
|
||||
Surface_mesher 3D Surface Mesh Generation
|
||||
|
|
|
|||
|
|
@ -5944,6 +5944,11 @@ public:
|
|||
Kernel::Point_3 operator()(const Kernel::Line_3& l,
|
||||
const Kernel::FT i);
|
||||
|
||||
/*!
|
||||
returns `point(0)` on `l`, identical to `operator()(l,0)`.
|
||||
*/
|
||||
Kernel::Point_3 operator()(const Kernel::Line_3& l);
|
||||
|
||||
/*!
|
||||
returns an arbitrary point on `h`.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,28 +19,67 @@
|
|||
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Filtered_kernel.h>
|
||||
#include <CGAL/Converting_construction.h>
|
||||
#include <CGAL/Triangulation_structural_filtering_traits.h>
|
||||
#include <CGAL/double.h>
|
||||
#include <CGAL/float.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
constexpr bool epick_use_static_filter =
|
||||
#ifdef CGAL_NO_STATIC_FILTERS
|
||||
false;
|
||||
#else
|
||||
true;
|
||||
#endif
|
||||
|
||||
// Here Epick is a class, and Double_precision_epick an alias to it.
|
||||
class Epick;
|
||||
class Single_precision_epick;
|
||||
using Double_precision_epick = Epick;
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Basic objects, constructions, and predicates, using the same base class as
|
||||
// Simple_cartesian<NT>: Cartesian_base without reference counting.
|
||||
template <typename NT, typename Kernel>
|
||||
using Epick_base =
|
||||
typename Simple_cartesian<NT>::template Base<Kernel>::Type;
|
||||
|
||||
// Add the type equality property, by changing the objects types
|
||||
template <typename NT, typename Kernel>
|
||||
using Epick_base_with_type_equality =
|
||||
Type_equality_wrapper<Epick_base<NT, Kernel>, Kernel>;
|
||||
|
||||
// Change the predicates to filtered predicates (with static filters or not)
|
||||
template <typename NT, typename Kernel>
|
||||
using Epick_with_filtered_predicates =
|
||||
Filtered_kernel_adaptor<Epick_base_with_type_equality<NT, Kernel>, epick_use_static_filter>;
|
||||
};
|
||||
|
||||
// The following is equivalent to Filtered_kernel< Simple_cartesian<double> >,
|
||||
// but it's shorter in terms of template name length (for error messages, mangling...).
|
||||
|
||||
class Epick
|
||||
: public Filtered_kernel_adaptor<
|
||||
Type_equality_wrapper< Simple_cartesian<double>::Base<Epick>::Type, Epick >,
|
||||
#ifdef CGAL_NO_STATIC_FILTERS
|
||||
false >
|
||||
#else
|
||||
true >
|
||||
#endif
|
||||
class Epick : public internal::Epick_with_filtered_predicates<double, Epick>
|
||||
{};
|
||||
|
||||
typedef Epick Exact_predicates_inexact_constructions_kernel;
|
||||
template <>
|
||||
struct Triangulation_structural_filtering_traits<Double_precision_epick> {
|
||||
using Use_structural_filtering_tag = Tag_true;
|
||||
};
|
||||
|
||||
using Exact_predicates_inexact_constructions_kernel = Epick;
|
||||
|
||||
|
||||
// This kernel is Epick with the difference that its `FT` is `float`.
|
||||
class Single_precision_epick
|
||||
: public Converting_constructions_kernel_adaptor<
|
||||
internal::Epick_with_filtered_predicates<float, Single_precision_epick>,
|
||||
Double_precision_epick>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct Triangulation_structural_filtering_traits<Epick> {
|
||||
typedef Tag_true Use_structural_filtering_tag;
|
||||
struct Triangulation_structural_filtering_traits<Single_precision_epick> {
|
||||
using Use_structural_filtering_tag = Tag_true;
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -1090,7 +1090,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Line_2& l) const
|
||||
{
|
||||
return l.rep().a();
|
||||
|
|
@ -1106,7 +1106,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Plane_3& l) const
|
||||
{
|
||||
return l.rep().a();
|
||||
|
|
@ -1123,7 +1123,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Line_2& l) const
|
||||
{
|
||||
return l.rep().b();
|
||||
|
|
@ -1139,7 +1139,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Plane_3& l) const
|
||||
{
|
||||
return l.rep().b();
|
||||
|
|
@ -1156,7 +1156,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Line_2& l) const
|
||||
{
|
||||
return l.rep().c();
|
||||
|
|
@ -1172,7 +1172,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Plane_3& l) const
|
||||
{
|
||||
return l.rep().c();
|
||||
|
|
@ -1188,7 +1188,7 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef RT result_type;
|
||||
|
||||
RT
|
||||
const RT&
|
||||
operator()(const Plane_3& l) const
|
||||
{
|
||||
return l.rep().d();
|
||||
|
|
@ -2228,6 +2228,10 @@ namespace CommonKernelFunctors {
|
|||
public:
|
||||
typedef Point_3 result_type;
|
||||
|
||||
const Point_3&
|
||||
operator()( const Line_3& l) const
|
||||
{ return l.rep().point(); }
|
||||
|
||||
Point_3
|
||||
operator()( const Line_3& l, const FT i) const
|
||||
{ return l.rep().point(i); }
|
||||
|
|
|
|||
|
|
@ -89,18 +89,17 @@ public:
|
|||
: RLine_2(typename R::Construct_line_2()(Return_base_tag(), p,v)) {}
|
||||
|
||||
|
||||
// FIXME : Use Qrt<> here.
|
||||
RT a() const
|
||||
decltype(auto) a() const
|
||||
{
|
||||
return R().compute_a_2_object()(*this);
|
||||
}
|
||||
|
||||
RT b() const
|
||||
decltype(auto) b() const
|
||||
{
|
||||
return R().compute_b_2_object()(*this);
|
||||
}
|
||||
|
||||
RT c() const
|
||||
decltype(auto) c() const
|
||||
{
|
||||
return R().compute_c_2_object()(*this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public:
|
|||
|
||||
Point_3 point() const
|
||||
{
|
||||
return R().construct_point_on_3_object()(*this, 0);
|
||||
return R().construct_point_on_3_object()(*this);
|
||||
}
|
||||
|
||||
Point_3 point(const FT i) const
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public:
|
|||
return R().construct_bbox_3_object()(*this);
|
||||
}
|
||||
|
||||
FT squared_area() const // TODO : use Qrt
|
||||
decltype(auto) squared_area() const
|
||||
{
|
||||
return R().compute_squared_area_3_object()(*this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,8 +74,18 @@ main()
|
|||
|
||||
std::cout << "Testing with Epeck:\n";
|
||||
test<Cls>();
|
||||
std::cout << "Testing with Epick:\n";
|
||||
test<CGAL::Epick>();
|
||||
std::cout << "Testing with Double_precision_epick:\n";
|
||||
test<CGAL::Double_precision_epick>();
|
||||
|
||||
# if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4244)
|
||||
# endif
|
||||
std::cout << "Testing with Simple_precision_epick:\n";
|
||||
test<CGAL::Single_precision_epick>();
|
||||
# if defined(BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
# endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ bool approx_equal(double a, double b) {
|
|||
return std::abs(boost::math::float_distance(a, b)) <= 1;
|
||||
}
|
||||
|
||||
bool approx_equal(float a, float b) {
|
||||
return std::abs(boost::math::float_distance(a, b)) <= 1;
|
||||
}
|
||||
|
||||
struct Xyz_tag {};
|
||||
struct Xy_tag {};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#define CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H
|
||||
|
||||
#include <CGAL/use.h>
|
||||
#include <CGAL/utils.h>
|
||||
|
||||
template <class R>
|
||||
bool
|
||||
|
|
@ -29,7 +30,7 @@ _test_cls_aff_transformation_2(const R& )
|
|||
typedef typename R::RT RT;
|
||||
typedef typename R::FT FT;
|
||||
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
|
||||
typename R::Aff_transformation_2 ia;
|
||||
CGAL::Aff_transformation_2<R> a1(ia);
|
||||
|
|
@ -280,10 +281,16 @@ _test_cls_aff_transformation_2(const R& )
|
|||
assert( pnt.transform(gat1) == pnt.transform(co1) );
|
||||
assert( lin.transform(gat1) == lin.transform(co1) );
|
||||
co1 = gat1 * gat1.inverse() ;
|
||||
assert( vec == vec.transform(co1) );
|
||||
assert( pnt == pnt.transform(co1) || nonexact);
|
||||
assert( dir == dir.transform(co1) );
|
||||
assert( lin == lin.transform(co1) );
|
||||
assert( vec == vec.transform(co1) || nonexact );
|
||||
assert( (vec - vec.transform(co1)).squared_length() < 1e-10);
|
||||
assert( pnt == pnt.transform(co1) || nonexact );
|
||||
assert( (pnt - pnt.transform(co1)).squared_length() < 1e-10);
|
||||
|
||||
auto unit = [](CGAL::Vector_2<R> v) { return v / CGAL::approximate_sqrt(v*v); };
|
||||
assert( dir == dir.transform(co1) || nonexact);
|
||||
assert( (unit(dir.to_vector()) - unit(dir.transform(co1).to_vector())).squared_length() < 1e-5);
|
||||
|
||||
assert( lin == lin.transform(co1) || nonexact );
|
||||
|
||||
// even
|
||||
assert( translate.is_even() );
|
||||
|
|
@ -340,10 +347,10 @@ _test_cls_aff_transformation_2(const R& )
|
|||
assert( pnt == pnt.transform(co1) );
|
||||
assert( lin == lin.transform(co1) );
|
||||
co1 = rot3 * rot3 * rot3.inverse();
|
||||
assert( vec.transform(rot3) == vec.transform(co1) );
|
||||
assert( dir.transform(rot3) == dir.transform(co1) );
|
||||
assert( pnt.transform(rot3) == pnt.transform(co1) );
|
||||
assert( lin.transform(rot3) == lin.transform(co1) );
|
||||
assert( vec.transform(rot3) == vec.transform(co1) || nonexact );
|
||||
assert( dir.transform(rot3) == dir.transform(co1) || nonexact );
|
||||
assert( pnt.transform(rot3) == pnt.transform(co1) || nonexact );
|
||||
assert( lin.transform(rot3) == lin.transform(co1) || nonexact );
|
||||
|
||||
//circle
|
||||
tp2 = p2.transform( translate );
|
||||
|
|
@ -628,11 +635,11 @@ _test_cls_aff_transformation_2(const R& )
|
|||
comp2(trans*refl);
|
||||
p1 = p.transform(trans);
|
||||
p1 = p1.transform(refl);
|
||||
assert(p1 == CGAL::Point_2<R>(1,-2));
|
||||
assert(p1 == CGAL::Point_2<R>(1,-2) || nonexact);
|
||||
assert(p1 == p.transform(comp1) || nonexact);
|
||||
p1 = p.transform(refl);
|
||||
p1 = p1.transform(trans);
|
||||
assert(p1 == p.transform(comp2));
|
||||
assert(p1 == p.transform(comp2) || nonexact);
|
||||
//with scaling
|
||||
CGAL::Aff_transformation_2<R> scal(CGAL::SCALING, 2);
|
||||
comp1 = refl*scal;
|
||||
|
|
@ -661,7 +668,7 @@ _test_cls_aff_transformation_2(const R& )
|
|||
comp2 = refl2*refl;
|
||||
p1 = p.transform(refl2);
|
||||
p1 = p1.transform(refl);
|
||||
assert(p1 == p.transform(comp1));
|
||||
assert(p1 == p.transform(comp1) || nonexact);
|
||||
p1 = p.transform(refl);
|
||||
p1 = p1.transform(refl2);
|
||||
assert(p1 == p.transform(comp2) || nonexact);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ _test_cls_aff_transformation_3(const R& )
|
|||
|
||||
typedef typename R::RT RT;
|
||||
typedef typename R::FT FT;
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
|
||||
typename R::Aff_transformation_3 ia;
|
||||
CGAL::Aff_transformation_3<R> a1(ia);
|
||||
|
|
@ -97,7 +97,7 @@ _test_cls_aff_transformation_3(const R& )
|
|||
n5, n11, n10, n4,
|
||||
n3, n6, n12, n2,
|
||||
n3 );
|
||||
assert( p1 == (p1.transform(gat1)).transform(gat1.inverse() ) );
|
||||
assert( p1 == (p1.transform(gat1)).transform(gat1.inverse() ) || nonexact );
|
||||
|
||||
CGAL::Aff_transformation_3<R> gat2( n7, n9, n8, n2,
|
||||
n5, n11, n10, n4,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ _test_cls_circle_2(const R& )
|
|||
typename R::Circle_2 ic;
|
||||
CGAL::Circle_2<R> c0;
|
||||
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
|
||||
RT n0 = 0;
|
||||
RT n1 = 16;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ _test_cls_line_3(const R& )
|
|||
typedef typename R::RT RT;
|
||||
typedef typename R::FT FT;
|
||||
|
||||
const bool nonexact = std::is_same<RT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<RT>::value;
|
||||
|
||||
typename R::Line_3 il;
|
||||
CGAL::Line_3<R> l0( il ); CGAL_USE(l0);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ _test_cls_sphere_3(const R& )
|
|||
typename R::Sphere_3 ic;
|
||||
CGAL::Sphere_3<R> c0;
|
||||
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
RT n0 = 0;
|
||||
RT n1 = 16;
|
||||
RT n2 = -4;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ _test_fct_points_implicit_sphere(const R&)
|
|||
typedef typename R::FT FT;
|
||||
typedef CGAL::Tetrahedron_3<R> Tetrahedron;
|
||||
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
|
||||
const RT RT0(0);
|
||||
const RT RT4(4);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ _test_fct_weighted_point_3(const R& )
|
|||
std::cout << "Testing functions Weighted_point_3" ;
|
||||
|
||||
typedef typename R::RT RT;
|
||||
const bool nonexact = std::is_same<RT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<RT>::value;
|
||||
|
||||
CGAL::Point_3<R> p1(RT(18), RT(15), RT(-21), RT(3) ); // 6, 5, -7
|
||||
CGAL::Point_3<R> p2(RT(18), RT(15), RT( 12), RT(3) ); // 6, 5, 4
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ _test_further_fct_point_2(const R& )
|
|||
using CGAL::testsuite::approx_equal;
|
||||
using CGAL::testsuite::Direction_2_tag;
|
||||
|
||||
const bool nonexact = std::is_same<FT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<FT>::value;
|
||||
|
||||
assert( approx_equal((p5 - CGAL::ORIGIN).direction(), dir5, Direction_2_tag()) );
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ _test_mf_plane_3_to_2d(const R& )
|
|||
typedef CGAL::Point_3< R> Point_3;
|
||||
typedef CGAL::Point_2< R> Point_2;
|
||||
|
||||
const bool nonexact = std::is_same<RT, double>::value;
|
||||
const bool nonexact = std::is_floating_point<RT>::value;
|
||||
|
||||
RT n0 = 0;
|
||||
RT n1 = 7;
|
||||
|
|
@ -68,11 +68,11 @@ _test_mf_plane_3_to_2d(const R& )
|
|||
Point_3 p6( n4, n5, n0, n8);
|
||||
Plane_3 pl3( p4, p5, p6);
|
||||
assert( p4 == pl3.to_3d( pl3.to_2d( p4)) || nonexact );
|
||||
assert( p5 == pl3.to_3d( pl3.to_2d( p5)) || nonexact);
|
||||
assert( p5 == pl3.to_3d( pl3.to_2d( p5)) || nonexact );
|
||||
assert( p6 == pl3.to_3d( pl3.to_2d( p6)) || nonexact );
|
||||
Plane_3 pl4( p4, p6, p5);
|
||||
assert( p4 == pl4.to_3d( pl4.to_2d( p4)) || nonexact );
|
||||
assert( p5 == pl4.to_3d( pl4.to_2d( p5)) || nonexact);
|
||||
assert( p5 == pl4.to_3d( pl4.to_2d( p5)) || nonexact );
|
||||
assert( p6 == pl4.to_3d( pl4.to_2d( p6)) || nonexact );
|
||||
|
||||
Point_3 p7 = CGAL::midpoint( p1, p2);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public:
|
|||
typedef Apollonius_graph_traits_2<Geom_traits> Apollonius_traits;
|
||||
typedef Apollonius_graph_2<Apollonius_traits> Apollonius_graph;
|
||||
typedef typename Apollonius_traits::Site_2 Site;
|
||||
typedef typename Sizing_field_2<Tr>::FT FT;
|
||||
|
||||
public:
|
||||
typedef std::list<Site> Site_set_2;
|
||||
|
|
@ -144,12 +145,12 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
double operator()(const Point& p) const
|
||||
FT operator()(const Point& p) const override
|
||||
{
|
||||
if(points.empty() || points.size() == 1)
|
||||
return K;
|
||||
return FT(K);
|
||||
Site ns = (*ag.nearest_neighbor(p)).site();
|
||||
return K * weighted_distance(p, ns);
|
||||
return FT(K * weighted_distance(p, ns));
|
||||
}
|
||||
|
||||
void set_K(double k)
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ private:
|
|||
|
||||
FT local_move_sq_ratio = (move * move) / local_sq_size;
|
||||
|
||||
// Move point only if displacement is big enough w.r.t local size
|
||||
// Move point only if displacement is big enough w.r.t. local size
|
||||
if ( local_move_sq_ratio < sq_freeze_ratio_ )
|
||||
return CGAL::NULL_VECTOR;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgMesh3Domains
|
||||
|
||||
The class `Mesh_constant_domain_field_3` is a model of concept `MeshDomainField_3`. It provides
|
||||
a constant field accessible using queries on 3D-points.
|
||||
|
||||
The class `Mesh_constant_domain_field_3` can also be customized through `set_size()` operations to become
|
||||
a piecewise constant field, i.e.\ a sizing field with a constant size on each subpart
|
||||
of the domain.
|
||||
|
||||
\tparam Gt is the geometric traits class. It must match the type `Triangulation::Geom_traits`,
|
||||
where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used
|
||||
in the meshing process.
|
||||
|
||||
\tparam Index is the type of index of the vertices of the triangulation.
|
||||
It must match the type `%Index` of the model of `MeshDomain_3` used in the meshing process.
|
||||
|
||||
\cgalModels `MeshDomainField_3`
|
||||
|
||||
\sa `MeshDomainField_3`
|
||||
|
||||
*/
|
||||
template< typename Gt, typename Index >
|
||||
class Mesh_constant_domain_field_3 {
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
Numerical type.
|
||||
*/
|
||||
typedef Gt::FT FT;
|
||||
|
||||
/*!
|
||||
Point type.
|
||||
*/
|
||||
typedef Gt::Point_3 Point_3;
|
||||
|
||||
/*!
|
||||
Type of index of the vertices of the triangulation.
|
||||
*/
|
||||
typedef Index Index;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
Builds a constant domain field with size `size`.
|
||||
*/
|
||||
Mesh_constant_domain_field_3(FT size);
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
Sets the size such as `operator()` will return size `size`
|
||||
at any query point of dimension `dimension` and index `index`.
|
||||
*/
|
||||
void set_size(FT size, int dimension, const Index& index);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end Mesh_constant_domain_field_3 */
|
||||
} /* end namespace CGAL */
|
||||
|
|
@ -46,10 +46,9 @@ on the input feature including the query point.
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
returns the value of the sizing field at the point `p`,
|
||||
assumed to be included in the input complex feature with dimension `dimension`
|
||||
and mesh vertex index `index`.
|
||||
and mesh subcomplex index `index`.
|
||||
*/
|
||||
FT operator()(const Point_3& p, int dimension, const Index& index) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ INPUT += \
|
|||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Polyhedral_complex_mesh_domain_3.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_domain_with_polyline_features_3.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_3/generate_label_weights.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Sizing_field_with_aabb_tree.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/Mesh_constant_domain_field_3.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/exude_mesh_3.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \
|
||||
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,24 @@ Right: the mesh with added 1D-features along sharp edges and edges shared
|
|||
by at least two of the input polyhedral surfaces forming the complex.
|
||||
\cgalFigureCaptionEnd
|
||||
|
||||
\subsubsection Mesh_3EdgesSizingField Sizing Field for Feature Edges
|
||||
|
||||
The following example shows how to generate a mesh from a polyhedral complex
|
||||
or a polyhedral surface with polyline features.
|
||||
Polyline features are covered by a set of so-called "protecting balls" which
|
||||
sizes are highly related to the edge length, and
|
||||
are driven by the size component of `Mesh_edge_criteria_3`
|
||||
(see Section \ref Mesh_3Protectionof0and1dimensionalExposed).
|
||||
The ideal size can be computed using
|
||||
`Sizing_field_with_aabb_tree` that helps start the feature protection
|
||||
and one-dimensional meshing process with a good initial guess.
|
||||
To fit the protecting balls requirements,
|
||||
no protecting ball can have its radius
|
||||
larger than half of the distance from the corresponding vertex (its center),
|
||||
to surface patches the
|
||||
current polyline feature does not belong to.
|
||||
|
||||
\cgalExample{Mesh_3/mesh_polyhedral_domain_with_features_sizing.cpp}
|
||||
|
||||
\subsection Mesh_3TuningMeshOptimization Tuning Mesh Optimization
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@
|
|||
/// \ingroup PkgMesh3Ref
|
||||
/// The functors in this group perform polyline features detection in input domains.
|
||||
|
||||
/// \defgroup PkgMesh3DomainFields Mesh Domain Fields
|
||||
/// \ingroup PkgMesh3Ref
|
||||
/// The classes in this group are models of `MeshDomainField_3`
|
||||
|
||||
/// \defgroup PkgMesh3Functions Mesh Generation Functions
|
||||
/// \ingroup PkgMesh3Ref
|
||||
/// The two main functions to generate a mesh are `make_mesh_3()` and `refine_mesh_3()`.
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
\example Mesh_3/mesh_polyhedral_complex.cpp
|
||||
\example Mesh_3/remesh_polyhedral_surface.cpp
|
||||
\example Mesh_3/mesh_polyhedral_domain_with_features.cpp
|
||||
\example Mesh_3/mesh_polyhedral_domain_with_features_sizing.cpp
|
||||
\example Mesh_3/mesh_polyhedral_domain_with_surface_inside.cpp
|
||||
\example Mesh_3/mesh_polyhedral_domain_with_lipschitz_sizing.cpp
|
||||
\example Mesh_3/mesh_two_implicit_spheres_with_balls.cpp
|
||||
|
|
|
|||
|
|
@ -96,6 +96,10 @@ create_single_source_cgal_program("mesh_polyhedral_domain_with_features.cpp")
|
|||
target_link_libraries(mesh_polyhedral_domain_with_features
|
||||
PUBLIC CGAL::Eigen3_support)
|
||||
|
||||
create_single_source_cgal_program("mesh_polyhedral_domain_with_features_sizing.cpp")
|
||||
target_link_libraries(mesh_polyhedral_domain_with_features_sizing
|
||||
PUBLIC CGAL::Eigen3_support)
|
||||
|
||||
create_single_source_cgal_program("mesh_polyhedral_domain_with_features_sm.cpp")
|
||||
target_link_libraries(mesh_polyhedral_domain_with_features_sm
|
||||
PUBLIC CGAL::Eigen3_support)
|
||||
|
|
@ -170,6 +174,10 @@ if(TARGET CGAL::CGAL_ImageIO)
|
|||
create_single_source_cgal_program("mesh_3D_weighted_image.cpp")
|
||||
target_link_libraries(mesh_3D_weighted_image
|
||||
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
||||
|
||||
create_single_source_cgal_program("mesh_3D_weighted_image_with_detection_of_features.cpp")
|
||||
target_link_libraries(mesh_3D_weighted_image_with_detection_of_features
|
||||
PUBLIC CGAL::Eigen3_support CGAL::ITK_support)
|
||||
else(ITK_FOUND)
|
||||
message(STATUS "NOTICE: The examples that need ITK will not be compiled.")
|
||||
endif(ITK_FOUND)
|
||||
|
|
@ -203,6 +211,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support)
|
|||
mesh_polyhedral_domain
|
||||
mesh_polyhedral_domain_sm
|
||||
mesh_polyhedral_domain_with_features
|
||||
mesh_polyhedral_domain_with_features_sizing
|
||||
mesh_polyhedral_domain_with_features_sm
|
||||
mesh_polyhedral_domain_with_lipschitz_sizing
|
||||
mesh_two_implicit_spheres_with_balls)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace params = CGAL::parameters;
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
/// [Loads image]
|
||||
const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("images/liver.inr.gz");
|
||||
const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("images/420.inr");// liver.inr.gz");
|
||||
CGAL::Image_3 image;
|
||||
if(!image.read(fname)){
|
||||
std::cerr << "Error: Cannot read file " << fname << std::endl;
|
||||
|
|
@ -48,12 +48,13 @@ int main(int argc, char* argv[])
|
|||
relative_error_bound(1e-6));
|
||||
/// [Domain creation]
|
||||
|
||||
// Mesh criteria
|
||||
/// [Mesh criteria]
|
||||
Mesh_criteria criteria(params::facet_angle(30).facet_size(6).facet_distance(0.5).
|
||||
cell_radius_edge_ratio(3).cell_size(8));
|
||||
/// [Mesh criteria]
|
||||
|
||||
/// [Meshing]
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude(), params::no_perturb());
|
||||
/// [Meshing]
|
||||
|
||||
// Output
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
#define CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG
|
||||
#define CGAL_MESH_3_VERBOSE 1
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <CGAL/Mesh_triangulation_3.h>
|
||||
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
|
||||
#include <CGAL/Mesh_criteria_3.h>
|
||||
|
||||
#include <CGAL/make_mesh_3.h>
|
||||
#include <CGAL/Image_3.h>
|
||||
|
||||
/// [Domain definition]
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
|
||||
#include <CGAL/Labeled_mesh_domain_3.h>
|
||||
#include <CGAL/Mesh_3/generate_label_weights.h>
|
||||
#include <CGAL/Mesh_3/Detect_features_in_image.h>
|
||||
|
||||
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
using Image_domain = CGAL::Labeled_mesh_domain_3<K>;
|
||||
using Mesh_domain = CGAL::Mesh_domain_with_polyline_features_3<Image_domain>;
|
||||
/// [Domain definition]
|
||||
|
||||
#ifdef CGAL_CONCURRENT_MESH_3
|
||||
typedef CGAL::Parallel_tag Concurrency_tag;
|
||||
#else
|
||||
typedef CGAL::Sequential_tag Concurrency_tag;
|
||||
#endif
|
||||
|
||||
// Triangulation
|
||||
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
|
||||
|
||||
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr> C3t3;
|
||||
|
||||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
// To avoid verbose function and named parameters call
|
||||
using namespace CGAL::parameters;
|
||||
|
||||
/// [Add 1D features]
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
const std::string fname = (argc > 1) ? argv[1] : CGAL::data_file_path("images/liver.inr.gz");
|
||||
// Loads image
|
||||
CGAL::Image_3 image;
|
||||
if(!image.read(fname)){
|
||||
std::cerr << "Error: Cannot read file " << fname << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/// [Domain creation]
|
||||
const float sigma = (std::max)(image.vx(), (std::max)(image.vy(), image.vz()));
|
||||
CGAL::Image_3 img_weights =
|
||||
CGAL::Mesh_3::generate_label_weights(image, sigma);
|
||||
|
||||
Mesh_domain domain
|
||||
= Mesh_domain::create_labeled_image_mesh_domain(image,
|
||||
weights = std::ref(img_weights),
|
||||
relative_error_bound = 1e-6,
|
||||
features_detector = CGAL::Mesh_3::Detect_features_in_image());
|
||||
/// [Domain creation]
|
||||
|
||||
CGAL::Bbox_3 bbox = domain.bbox();
|
||||
double diag = CGAL::sqrt((bbox.xmax() - bbox.xmin()) * (bbox.xmax() - bbox.xmin())
|
||||
+ (bbox.ymax() - bbox.ymin()) * (bbox.ymax() - bbox.ymin())
|
||||
+ (bbox.zmax() - bbox.zmin()) * (bbox.zmax() - bbox.zmin()));
|
||||
double sizing_default = diag * 0.05;
|
||||
|
||||
/// Note that `edge_size` is needed with 1D-features [Mesh criteria]
|
||||
Mesh_criteria criteria(edge_size = sizing_default,
|
||||
facet_angle = 30, facet_size = sizing_default, facet_distance = sizing_default / 10,
|
||||
//facet_topology = CGAL::FACET_VERTICES_ON_SAME_SURFACE_PATCH,
|
||||
cell_radius_edge_ratio = 0, cell_size = 0
|
||||
);
|
||||
/// [Mesh criteria]
|
||||
|
||||
// Meshing
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
|
||||
CGAL::parameters::no_exude(),
|
||||
CGAL::parameters::no_perturb());
|
||||
|
||||
// Output
|
||||
CGAL::dump_c3t3(c3t3, "out");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -24,8 +24,7 @@ namespace params = CGAL::parameters;
|
|||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef K::Point_3 Point;
|
||||
typedef K::FT FT;
|
||||
typedef FT (*Function)(const Point&);
|
||||
typedef double (*Function)(const Point&);
|
||||
typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper<Function>
|
||||
Function_wrapper;
|
||||
typedef Function_wrapper::Function_vector Function_vector;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ namespace params = CGAL::parameters;
|
|||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef K::Point_3 Point;
|
||||
typedef K::FT FT;
|
||||
typedef FT (*Function)(const Point&);
|
||||
typedef double (*Function)(const Point&);
|
||||
typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper<Function>
|
||||
Function_wrapper;
|
||||
typedef Function_wrapper::Function_vector Function_vector;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ typedef CGAL::Sequential_tag Concurrency_tag;
|
|||
|
||||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef FT_to_point_function_wrapper<K::FT, K::Point_3> Function;
|
||||
typedef FT_to_point_function_wrapper<double, K::Point_3> Function;
|
||||
typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper<Function>
|
||||
Function_wrapper;
|
||||
typedef Function_wrapper::Function_vector Function_vector;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// Domain
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
typedef FT_to_point_function_wrapper<K::FT, K::Point_3> Function;
|
||||
typedef FT_to_point_function_wrapper<double, K::Point_3> Function;
|
||||
typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper<Function>
|
||||
Function_wrapper;
|
||||
typedef Function_wrapper::Function_vector Function_vector;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/Mesh_triangulation_3.h>
|
||||
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
|
||||
#include <CGAL/Mesh_criteria_3.h>
|
||||
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Polyhedral_mesh_domain_with_features_3.h>
|
||||
#include <CGAL/make_mesh_3.h>
|
||||
#include <CGAL/Sizing_field_with_aabb_tree.h>
|
||||
|
||||
// Domain
|
||||
using K = CGAL::Exact_predicates_inexact_constructions_kernel;
|
||||
using Polyhedron = CGAL::Surface_mesh<K::Point_3>;
|
||||
using Mesh_domain = CGAL::Polyhedral_mesh_domain_with_features_3<K, Polyhedron>;
|
||||
using Features_sizing_field = CGAL::Sizing_field_with_aabb_tree<K, Mesh_domain>;
|
||||
|
||||
|
||||
#ifdef CGAL_CONCURRENT_MESH_3
|
||||
typedef CGAL::Parallel_tag Concurrency_tag;
|
||||
#else
|
||||
typedef CGAL::Sequential_tag Concurrency_tag;
|
||||
#endif
|
||||
|
||||
// Triangulation
|
||||
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
|
||||
|
||||
typedef CGAL::Mesh_complex_3_in_triangulation_3<
|
||||
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
|
||||
|
||||
// Criteria
|
||||
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
|
||||
|
||||
namespace params = CGAL::parameters;
|
||||
|
||||
int main(int argc, char*argv[])
|
||||
{
|
||||
const std::string fname = (argc>1)?argv[1]:CGAL::data_file_path("meshes/fandisk.off");
|
||||
std::ifstream input(fname);
|
||||
Polyhedron polyhedron;
|
||||
input >> polyhedron;
|
||||
if(input.fail()){
|
||||
std::cerr << "Error: Cannot read file " << fname << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// Create domain
|
||||
Mesh_domain domain(polyhedron);
|
||||
|
||||
// Get sharp features
|
||||
domain.detect_features();
|
||||
|
||||
// Mesh criteria
|
||||
Features_sizing_field edges_sizing_field(0.07, domain);
|
||||
Mesh_criteria criteria(params::edge_size(edges_sizing_field).
|
||||
facet_distance(0.0072).
|
||||
cell_radius_edge_ratio(3));
|
||||
|
||||
// Mesh generation
|
||||
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, params::no_exude().no_perturb());
|
||||
|
||||
// Output
|
||||
CGAL::dump_c3t3(c3t3, "out_sizing_field_with_aabb_tree");
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -126,12 +126,19 @@ namespace internal {
|
|||
// Detect_features_in_domain
|
||||
template<typename Point, typename DetectFunctor>
|
||||
struct Detect_features_in_domain {
|
||||
|
||||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3& image, DetectFunctor functor) const {
|
||||
operator()(const CGAL::Image_3& image, CGAL::Image_3& weights, DetectFunctor functor) const {
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1910) //before msvc2017
|
||||
return functor.operator()<Point>(image);
|
||||
if(weights.is_valid())
|
||||
return functor.operator()<Point>(image, weights);
|
||||
else
|
||||
return functor.operator()<Point>(image);
|
||||
#else
|
||||
return functor.template operator()<Point>(image);
|
||||
if(weights.is_valid())
|
||||
return functor.template operator()<Point>(image, weights);
|
||||
else
|
||||
return functor.template operator()<Point>(image);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
|
@ -139,23 +146,23 @@ namespace internal {
|
|||
template<typename Point>
|
||||
struct Detect_features_in_domain<Point, Null_functor> {
|
||||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3&, Null_functor) const {
|
||||
operator()(const CGAL::Image_3&, CGAL::Image_3&, Null_functor) const {
|
||||
return std::vector<std::vector<Point>>();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Point, typename DetectFunctor>
|
||||
std::vector<std::vector<Point>>
|
||||
detect_features(const CGAL::Image_3& image, DetectFunctor functor)
|
||||
detect_features(const CGAL::Image_3& image, CGAL::Image_3& weights, DetectFunctor functor)
|
||||
{
|
||||
Detect_features_in_domain<Point, DetectFunctor> detector;
|
||||
return detector(image, functor);
|
||||
return detector(image, weights, functor);
|
||||
}
|
||||
|
||||
template<bool WithFeatures>
|
||||
struct Add_features_in_domain {
|
||||
template<typename MeshDomain, typename InputFeatureRange, typename DetectFunctor>
|
||||
void operator()(const CGAL::Image_3&, MeshDomain&, const InputFeatureRange&, DetectFunctor)
|
||||
void operator()(const CGAL::Image_3&, CGAL::Image_3&, MeshDomain&, const InputFeatureRange&, DetectFunctor)
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
@ -164,13 +171,14 @@ namespace internal {
|
|||
{
|
||||
template<typename MeshDomain, typename InputFeatureRange, typename DetectFunctor>
|
||||
void operator()(const CGAL::Image_3& image,
|
||||
CGAL::Image_3& weights,
|
||||
MeshDomain& domain,
|
||||
const InputFeatureRange& input_features,
|
||||
DetectFunctor functor)
|
||||
{
|
||||
using P = typename MeshDomain::Point_3;
|
||||
auto detected_feature_range
|
||||
= CGAL::Mesh_3::internal::detect_features<P>(image, functor);
|
||||
= CGAL::Mesh_3::internal::detect_features<P>(image, weights, functor);
|
||||
|
||||
CGAL::merge_and_snap_polylines(image, detected_feature_range, input_features);
|
||||
|
||||
|
|
@ -608,13 +616,18 @@ public:
|
|||
*
|
||||
* \cgalNamedParamsBegin
|
||||
* \cgalParamNBegin{weights}
|
||||
* \cgalParamDescription{an input 3D image that provides
|
||||
* \cgalParamDescription{a reference to an input 3D image that provides
|
||||
* weights associated to each voxel (the word type is `unsigned char`,
|
||||
* and the voxels values are integers between 0 and 255).
|
||||
* The weights image can be generated with `CGAL::Mesh_3::generate_label_weights()`.
|
||||
* Its dimensions must be the same as the dimensions of `parameters::image`.}
|
||||
* \cgalParamDefault{CGAL::Image_3()}
|
||||
* \cgalParamExtra{A const reference will be taken to the parameter passed.}
|
||||
* \cgalParamType{CGAL::Image_3&}
|
||||
* \cgalParamExtra{if `features_detector` is provided, `weights` should be modified accordingly.
|
||||
* The available functors described in See \ref PkgMesh3FeatureDetection
|
||||
* implement the necessary modifications.}
|
||||
* \cgalParamExtra{if `input_features` is provided, `weights` should be modified accordingly
|
||||
* to keep consistency of the output `MeshDomainWithFeatures_3`}
|
||||
* \cgalParamNEnd
|
||||
* \cgalParamNBegin{value_outside}
|
||||
* \cgalParamDescription{the value attached to voxels
|
||||
|
|
@ -632,14 +645,20 @@ public:
|
|||
* \cgalParamNBegin{features_detector}
|
||||
* \cgalParamDescription{ a functor that implements
|
||||
* `std::vector<std::vector<Point>> operator()(const Image_3& img) const`,
|
||||
* where `%Point` matches the mesh domain point type.
|
||||
* It returns a range of detected polyline features, which are added
|
||||
* to the domain for feature protection.
|
||||
* See \ref PkgMesh3FeatureDetection for a list of available functors.}
|
||||
* and `std::vector<std::vector<Point>> operator()(const Image_3& img, Image_3& weights) const`,
|
||||
* where `%Point` matches the mesh domain point type,
|
||||
* that both return a range of detected polyline features for feature protection.
|
||||
* Only one implementation is used, depending on whether the named parameter `weights`
|
||||
* is provided or not.
|
||||
* Polyline features are added to the domain for further feature protection.
|
||||
* See \ref PkgMesh3FeatureDetection for available functors.}
|
||||
* \cgalParamDefault{CGAL::Null_functor()}
|
||||
* \cgalParamExtra{The return type of the function depends on whether this parameter
|
||||
or `input_features` are provided or not.}
|
||||
* \cgalParamExtra{If `weights` is provided, this parameter is ignored}
|
||||
* or `input_features` are provided or not.}
|
||||
* \cgalParamExtra{If `weights` is provided, it must either be adapted to the detected features,
|
||||
* or post-processed during feature detection to keep consistency
|
||||
* of the output `MeshDomainWithFeatures_3`.
|
||||
* Available functors implement the necessary modifications.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{input_features}
|
||||
|
|
@ -653,7 +672,8 @@ public:
|
|||
or `input_features` are provided or not.}
|
||||
* \cgalParamExtra{It is recommended to pass a const-reference for this parameter,
|
||||
* possibly using `std::cref(polylines_range)` to avoid useless copies.}
|
||||
* \cgalParamExtra{If `weights` is provided, this parameter is ignored}
|
||||
* \cgalParamExtra{If `weights` is provided, it must be adapted to the input features,
|
||||
* to keep consistency of the output `MeshDomainWithFeatures_3`}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalNamedParamsEnd
|
||||
|
|
@ -678,6 +698,7 @@ public:
|
|||
* where the features are provided by the user:
|
||||
*
|
||||
* \snippet Mesh_3/mesh_3D_image_with_input_features.cpp Domain creation
|
||||
*
|
||||
*/
|
||||
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
static auto
|
||||
|
|
@ -698,8 +719,8 @@ public:
|
|||
using Image_ref_type = typename internal_np::Lookup_named_param_def<internal_np::weights_param_t,
|
||||
CGAL_NP_CLASS,
|
||||
CGAL::Image_3>::reference;
|
||||
CGAL::Image_3 no_weights;
|
||||
const Image_ref_type weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), no_weights);
|
||||
CGAL::Image_3 no_weights_;
|
||||
Image_ref_type weights_ = choose_parameter(get_parameter_reference(np, internal_np::weights_param), no_weights_);
|
||||
auto features_detector_ = choose_parameter(get_parameter(np, internal_np::features_detector_param), Null_functor());
|
||||
|
||||
using Default_input_features = std::vector<std::vector<typename Labeled_mesh_domain_3::Point_3>>;
|
||||
|
|
@ -713,7 +734,8 @@ public:
|
|||
CGAL_USE(iso_value_);
|
||||
namespace p = CGAL::parameters;
|
||||
|
||||
auto image_wrapper = weights_.is_valid()
|
||||
const bool use_weights = weights_.is_valid();
|
||||
auto image_wrapper = use_weights
|
||||
? create_weighted_labeled_image_wrapper(image_,
|
||||
weights_,
|
||||
image_values_to_subdomain_indices_,
|
||||
|
|
@ -742,12 +764,9 @@ public:
|
|||
p::construct_surface_patch_index =
|
||||
create_construct_surface_patch_index(construct_surface_patch_index_));
|
||||
|
||||
if (weights_.is_valid())
|
||||
return domain;
|
||||
|
||||
// features
|
||||
Mesh_3::internal::Add_features_in_domain<!no_features>()
|
||||
(image_, domain, input_features_, features_detector_);
|
||||
(image_, weights_, domain, input_features_, features_detector_);
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3478,7 +3478,7 @@ get_least_square_surface_plane(const Vertex_handle& v,
|
|||
|
||||
// In some cases point is not a real surface point
|
||||
if ( triangles.empty() )
|
||||
return std::make_pair(boost::none, Bare_point());
|
||||
return std::make_pair(boost::none, Bare_point(ORIGIN));
|
||||
|
||||
// Compute least square fitting plane
|
||||
Plane_3 plane;
|
||||
|
|
@ -3490,7 +3490,7 @@ get_least_square_surface_plane(const Vertex_handle& v,
|
|||
point,
|
||||
Dimension_tag<2>(),
|
||||
tr_.geom_traits(),
|
||||
Default_diagonalize_traits<FT, 3>());
|
||||
Default_diagonalize_traits<double, 3>());
|
||||
|
||||
return std::make_pair(plane,
|
||||
ref_facet.first->get_facet_surface_center(ref_facet.second));
|
||||
|
|
@ -3759,7 +3759,7 @@ min_sliver_value(const Cell_vector& cells,
|
|||
it != cells.end();
|
||||
++it)
|
||||
{
|
||||
min_value = (std::min)(criterion(*it), min_value);
|
||||
min_value = (std::min<FT>)(criterion(*it), min_value);
|
||||
}
|
||||
return min_value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <CGAL/license/Mesh_3.h>
|
||||
|
||||
#include <CGAL/Image_3.h>
|
||||
#include <CGAL/ImageIO.h>
|
||||
|
||||
#include <CGAL/Delaunay_triangulation_3.h>
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
|
||||
#include <CGAL/Mesh_3/polylines_to_protect.h>
|
||||
#include <CGAL/Kernel_traits.h>
|
||||
#include <CGAL/Mesh_3/features_detection/postprocess_weights.h>
|
||||
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
|
@ -52,7 +54,8 @@ namespace internal
|
|||
// not documented.
|
||||
template<typename Word_type, typename P>
|
||||
std::vector<std::vector<P>>
|
||||
detect_features_in_image_with_know_word_type(const CGAL::Image_3& image)
|
||||
detect_features_in_image_with_know_word_type(const CGAL::Image_3& image,
|
||||
CGAL::Image_3& weights)
|
||||
{
|
||||
using Gt = typename CGAL::Kernel_traits<P>::Kernel;
|
||||
using Point_3 = P;
|
||||
|
|
@ -78,6 +81,9 @@ detect_features_in_image_with_know_word_type(const CGAL::Image_3& image)
|
|||
const float ty = image.ty();
|
||||
const float tz = image.tz();
|
||||
|
||||
const bool postprocess_weights = weights.is_valid();
|
||||
std::vector<std::array<std::size_t, 3>> black_voxels;
|
||||
|
||||
using CGAL::IMAGEIO::static_evaluate;
|
||||
|
||||
using Del = CGAL::Delaunay_triangulation_3<Gt>;
|
||||
|
|
@ -159,6 +165,9 @@ detect_features_in_image_with_know_word_type(const CGAL::Image_3& image)
|
|||
CGAL::Mesh_3::internal::debug_cerr("Using the function of", Cube(fct_it->first));
|
||||
#endif // CGAL_DEBUG_TRIPLE_LINES
|
||||
|
||||
if (postprocess_weights)
|
||||
black_voxels.push_back({ i, j, k });
|
||||
|
||||
Polylines cube_features = (fct_it->second)(10);
|
||||
if (case_found)
|
||||
{
|
||||
|
|
@ -215,7 +224,7 @@ detect_features_in_image_with_know_word_type(const CGAL::Image_3& image)
|
|||
features_inside.end());
|
||||
|
||||
Polylines polylines_on_bbox;
|
||||
CGAL::polylines_to_protect<Point_3, Word_type>(image, polylines_on_bbox,
|
||||
CGAL::polylines_to_protect_on_bbox<Point_3, Word_type>(image, polylines_on_bbox,
|
||||
polylines_inside.begin(),
|
||||
polylines_inside.end());
|
||||
|
||||
|
|
@ -223,6 +232,12 @@ detect_features_in_image_with_know_word_type(const CGAL::Image_3& image)
|
|||
polylines_on_bbox.begin(),
|
||||
polylines_on_bbox.end());
|
||||
|
||||
if (postprocess_weights)
|
||||
{
|
||||
internal::feature_voxels_on_image_bbox<Word>(image, black_voxels);
|
||||
internal::set_voxels<unsigned char/*Weights_type*/>(weights, black_voxels, 0/*black*/);
|
||||
}
|
||||
|
||||
#ifdef CGAL_DEBUG_TRIPLE_LINES
|
||||
std::ofstream output_polylines("out-generated.polylines.txt");
|
||||
output_polylines.precision(17);
|
||||
|
|
@ -271,8 +286,30 @@ public:
|
|||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3& image) const
|
||||
{
|
||||
CGAL::Image_3 no_weights;
|
||||
CGAL_IMAGE_IO_CASE(image.image(),
|
||||
return (internal::detect_features_in_image_with_know_word_type<Word, Point>(image));
|
||||
return (internal::detect_features_in_image_with_know_word_type<Word, Point>(image, no_weights));
|
||||
);
|
||||
CGAL_error_msg("This place should never be reached, because it would mean "
|
||||
"the image word type is a type that is not handled by "
|
||||
"CGAL_ImageIO.");
|
||||
|
||||
return std::vector<std::vector<Point>>();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Similar to the above function,
|
||||
* but modifies `weights` to set the voxels that are
|
||||
* part of a polyline feature to 0.
|
||||
*/
|
||||
template<typename Point>
|
||||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3& image, CGAL::Image_3& weights) const
|
||||
{
|
||||
CGAL_assertion(weights.is_valid());
|
||||
|
||||
CGAL_IMAGE_IO_CASE(image.image(),
|
||||
return (internal::detect_features_in_image_with_know_word_type<Word, Point>(image, weights));
|
||||
);
|
||||
CGAL_error_msg("This place should never be reached, because it would mean "
|
||||
"the image word type is a type that is not handled by "
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@
|
|||
|
||||
#include <CGAL/license/Mesh_3.h>
|
||||
|
||||
#include <CGAL/Image_3.h>
|
||||
|
||||
#include <CGAL/Mesh_3/polylines_to_protect.h>
|
||||
#include <CGAL/Mesh_3/features_detection/postprocess_weights.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
@ -33,16 +36,25 @@ namespace internal
|
|||
|
||||
template<typename Point>
|
||||
std::vector<std::vector<Point>>
|
||||
detect_features_on_bbox(const CGAL::Image_3& image)
|
||||
detect_features_on_bbox(const CGAL::Image_3& image, CGAL::Image_3& weights)
|
||||
{
|
||||
using Point_3 = Point;
|
||||
using Polyline_type = std::vector<Point_3>;
|
||||
using Polylines = std::vector<Polyline_type>;
|
||||
|
||||
const bool postprocess_weights = weights.is_valid();
|
||||
std::vector<std::array<std::size_t, 3>> black_voxels;
|
||||
|
||||
Polylines polylines_on_bbox;
|
||||
|
||||
CGAL_IMAGE_IO_CASE(image.image(),
|
||||
{
|
||||
if (postprocess_weights)
|
||||
{
|
||||
internal::feature_voxels_on_image_bbox<Word>(image, black_voxels);
|
||||
internal::set_voxels<unsigned char/*weights type*/>(weights, black_voxels, 0/*black*/);
|
||||
}
|
||||
|
||||
(CGAL::polylines_to_protect<Point_3, Word>(image, polylines_on_bbox));
|
||||
return polylines_on_bbox;
|
||||
}
|
||||
|
|
@ -89,8 +101,24 @@ public:
|
|||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3& image) const
|
||||
{
|
||||
return internal::detect_features_on_bbox<Point>(image);
|
||||
CGAL::Image_3 no_weights;
|
||||
return internal::detect_features_on_bbox<Point>(image, no_weights);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Similar to the above function,
|
||||
* but modifies `weights` to set the voxels that are
|
||||
* part of a polyline feature to 0.
|
||||
*/
|
||||
template<typename Point>
|
||||
std::vector<std::vector<Point>>
|
||||
operator()(const CGAL::Image_3& image, CGAL::Image_3& weights) const
|
||||
{
|
||||
CGAL_assertion(weights.is_valid());
|
||||
|
||||
return internal::detect_features_on_bbox<Point>(image, weights);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}//end namespace Mesh_3
|
||||
|
|
|
|||
|
|
@ -1366,8 +1366,8 @@ refine_balls()
|
|||
|
||||
FT ra = get_radius(va);
|
||||
FT rb = get_radius(vb);
|
||||
FT sa_new = (std::min)(ab/distance_divisor, ra);
|
||||
FT sb_new = (std::min)(ab/distance_divisor, rb);
|
||||
FT sa_new = (std::min)(FT(ab/distance_divisor), ra);
|
||||
FT sb_new = (std::min)(FT(ab/distance_divisor), rb);
|
||||
|
||||
// In case of va or vb have already been in conflict, keep minimal size
|
||||
if ( new_sizes.find(va) != new_sizes.end() )
|
||||
|
|
|
|||
|
|
@ -563,7 +563,7 @@ private:
|
|||
|
||||
|
||||
/**
|
||||
* Initialize cells_queue w.r.t sliver_bound_
|
||||
* Initialize cells_queue w.r.t. sliver_bound_
|
||||
*/
|
||||
void initialize_cells_priority_queue()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ namespace CGAL
|
|||
namespace Mesh_3
|
||||
{
|
||||
|
||||
#define CGAL_SQRT65 8.06225774829854965236661323030
|
||||
#define CGAL_SQRT17 4.12310562561766054982140985597
|
||||
|
||||
template<typename P, typename Functor>
|
||||
std::vector<P> create_polyline(const double start,
|
||||
const double end,
|
||||
|
|
@ -335,14 +338,10 @@ std::vector<std::vector<P>> poly00122101(const int prec = 10)
|
|||
auto sq_exp = [](double x) {
|
||||
return std::sqrt(24 * x * x * x - 35 * x * x + 18 * x - 3);
|
||||
};
|
||||
auto y1 = [sq_exp](double x)
|
||||
{ return (-sq_exp(x) - 5 * x + 3) / (6 * (x - 1) * (x - 1)); };
|
||||
auto z1 = [sq_exp](double x)
|
||||
{ return (-sq_exp(x) - 7 * x + 3) / (6 * (x * x - 3 * x + 1)); };
|
||||
auto y2 = [sq_exp](double x)
|
||||
{ return (sq_exp(x) - 5 * x + 3) / (6 * (x - 1) * (x - 1)); };
|
||||
auto z2 = [sq_exp](double x)
|
||||
{ return (sq_exp(x) - 7 * x + 3) / (6 * (x * x - 3 * x + 1)); };
|
||||
auto y1 = [sq_exp](double x) { return (-sq_exp(x) - 5*x + 3)/(6 * CGAL::square(x-1)); };
|
||||
auto z1 = [sq_exp](double x) { return (-sq_exp(x) - 7*x + 3)/(6 * (x*x - 3*x+1)); };
|
||||
auto y2 = [sq_exp](double x) { return ( sq_exp(x) - 5*x + 3)/(6 * CGAL::square(x-1)); };
|
||||
auto z2 = [sq_exp](double x) { return ( sq_exp(x) - 7*x + 3)/(6 * (x*x - 3*x+1)); };
|
||||
P corner{ 1., .5, 1. / 3 };
|
||||
return {
|
||||
create_polyline<P>(1. / 3, 1. / 2,
|
||||
|
|
@ -412,7 +411,7 @@ std::vector<std::vector<P>> poly00001122(const int prec = 10)
|
|||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00010121(const int prec = 10)
|
||||
{
|
||||
auto y = [](double z) { return ((3 * z * z - 1) - std::sqrt((1. - 3 * z * z)*(1. - 3 * z * z) - 12 * (z - 1) * z * z)) / (6 * (z - 1) * z); };
|
||||
auto y = [](double z){ return ((3 * z * z - 1) - std::sqrt(CGAL::square(1 - 3 * z * z) - 12 * (z - 1) * z * z))/(6 * (z - 1) * z); };
|
||||
auto x = [](double y, double z) { return y * z / (z + y); };
|
||||
P corner(1. / 3, 1. / 2, 1);
|
||||
return { create_polyline<P>(1, 1. / 2, corner,
|
||||
|
|
@ -967,16 +966,19 @@ create_polyline(2./3,limit_value(1.,-1.), P(0., 1./2,2./3), P(1./2, 1./3,1.),
|
|||
}
|
||||
|
||||
//00012113
|
||||
// curve 1 : x = -(-8*z*z + 7*z + (4*z*z - 3*z)*(-(z - 1.)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)), y = -(z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)), z = [(3.+ 2.23606)/8, 2./3]
|
||||
// curve 2 : x = -(-8*z*z + 7*z + (4*z*z - 3*z)*((z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)), y = (z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)), z = [(3.+ 2.23606)/8, 2./3]
|
||||
// curve 1 : x = -(-8*z*z + 7*z + (4*z*z - 3*z)*(-(z - 1.)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)), y = -(z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)), z = [(3.+ std::sqrt(5))/8, 2./3]
|
||||
// curve 2 : x = -(-8*z*z + 7*z + (4*z*z - 3*z)*((z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)), y = (z - 1)*sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)), z = [(3.+ std::sqrt(5))/8, 2./3]
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00012113(const int prec = 10)
|
||||
{
|
||||
//split point is the same for both curves
|
||||
//computed from x(z) and y(z) formulas at z = (3.+ std::sqrt(5))/8
|
||||
const P split_point(0.30901699437494742, 0.30901699437494742, (3. + CGAL_SQRT5) / 8);
|
||||
return {
|
||||
create_polyline((3.+ 2.23606)/8, 2./3,P(0.30902,0.30902,(3.+ 2.23606)/8),
|
||||
create_polyline((3.+ CGAL_SQRT5)/8, 2./3, split_point,
|
||||
[](double z) { return P(-(-8*z*z + 7*z + (4*z*z - 3*z)*(-(z - 1.)*std::sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)), -(z - 1)*std::sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)),z); },
|
||||
prec),
|
||||
create_polyline((3.+ 2.23606)/8, 2./3,P(0.30902,0.30902,(3.+ 2.23606)/8),
|
||||
create_polyline((3.+ CGAL_SQRT5)/8, 2./3, split_point,
|
||||
[](double z) { return P( -(-8*z*z + 7*z + (4*z*z - 3*z)*((z - 1)*std::sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3))) - 1)/(z*(4*z - 3)),(z - 1)*std::sqrt(16*z*z - 12*z + 1)/(2*z*(4*z - 3)) + (8*z*z - 7*z + 1)/(2*z*(4*z - 3)),z); },
|
||||
prec),
|
||||
|
||||
|
|
@ -1024,16 +1026,16 @@ template<typename P>
|
|||
std::vector<std::vector<P>> poly00012131(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline(0., (2. - 1.4142)/2, P(0., 1./2,2./3),P((2. - 1.4142)/2,1./2,1./1.4142),
|
||||
create_polyline(0., (2. - CGAL_SQRT2)/2, P(0., 1./2,2./3),P((2. - CGAL_SQRT2)/2,1./2,1./CGAL_SQRT2),
|
||||
[](double x) { return P(x,1./2,(-2 + x)/(-3 + 2*x)); },
|
||||
prec),
|
||||
create_polyline((2. - 1.4142)/2.,1./3,P((2. - 1.4142)/2,1./2,1./1.4142), P(1./3, 1./2,1.),
|
||||
create_polyline((2. - CGAL_SQRT2)/2.,1./3,P((2. - CGAL_SQRT2)/2,1./2,1./CGAL_SQRT2), P(1./3, 1./2,1.),
|
||||
[](double x) { return P(x,1./2,-x/(-1 + 2*x) ); },
|
||||
prec),
|
||||
create_polyline(1./2, 1./1.4142, P(1./3, 1.,1./2),P((2. - 1.4142)/2,1./2,1./1.4142),
|
||||
create_polyline(1./2, 1./CGAL_SQRT2, P(1./3, 1.,1./2),P((2. - CGAL_SQRT2)/2,1./2,1./CGAL_SQRT2),
|
||||
[](double z) { return P((z - 1)*(2*z*((z*z + z - 1)/(4*z*(z - 1)) - std::sqrt(9*z*z*z*z - 14*z*z*z + 7*z*z - 2*z + 1)/(4*z*(z - 1))) - 1)/(z*(2*z - 1)),(z*z + z - 1)/(4*z*(z - 1)) - std::sqrt(9*z*z*z*z - 14*z*z*z + 7*z*z - 2*z + 1)/(4*z*(z - 1)) ,z); },
|
||||
prec),
|
||||
create_polyline((2. - 1.4142)/2,limit_value(1./2,-1.),P((2. - 1.4142)/2,1./2,1./1.4142), P(1./2,0. ,2./3),
|
||||
create_polyline((2. - CGAL_SQRT2)/2,limit_value(1./2,-1.),P((2. - CGAL_SQRT2)/2,1./2,1./CGAL_SQRT2), P(1./2,0. ,2./3),
|
||||
[](double x) { return P(x,(-1 - x + 3*x*x + std::sqrt(1 - 6*x + 19*x*x - 22*x*x*x + 9*x*x*x*x))/(4*(-1 + x)*x),(1. - 5*x + 3*x*x + std::sqrt(1 - 6*x + 19*x*x - 22*x*x*x + 9*x*x*x*x))/(2*(1 - 3*x + 2*x*x))); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -1217,10 +1219,10 @@ return {
|
|||
create_polyline(3./5,2./3, P(1./2,1./2,3./5),
|
||||
[](double z) { return P(-(-7*z + 5 + (2*z - 2)*(3*z - 2)/(z - 1))/(2*(z - 1)),(3*z - 2)/(z - 1),z); },
|
||||
prec),
|
||||
create_polyline(1./2, 2.*1.4142/17 + 5./17, P(1.,1./2.,1./2),
|
||||
create_polyline(1./2, 2.*CGAL_SQRT2/17 + 5./17, P(1.,1./2.,1./2),
|
||||
[](double z) { return P( -(2*z*((5*z - 1)/(4*z) - std::sqrt(17*z*z - 10*z + 1)/(4*z)) - 5*z + 1)/(2*z),(5*z - 1)/(4*z) - std::sqrt(17*z*z - 10*z + 1)/(4*z),z); },
|
||||
prec),
|
||||
create_polyline(1./2,2.*1.4142/17 + 5./17, P(1./2,1.,1./2),
|
||||
create_polyline(1./2,2.* CGAL_SQRT2 /17 + 5./17, P(1./2,1.,1./2),
|
||||
[](double z) { return P( -(2*z*((5*z - 1)/(4*z) + std::sqrt(17*z*z - 10*z + 1)/(4*z)) - 5*z + 1)/(2*z),(5*z - 1)/(4*z) + std::sqrt(17*z*z - 10*z + 1)/(4*z),z); },
|
||||
prec),
|
||||
create_polyline(3./5,1., P(1./2.,1./2,3./5),P(1./2,1./2.,1.),
|
||||
|
|
@ -1547,10 +1549,10 @@ return {
|
|||
create_polyline(0.,1., P(1./2,2./3,0.),P(1./2,1./2,1.),
|
||||
[](double z) { return P(-(-7*z*z + 7*z + ((7*z*z - 8*z + 2)/(2*(9*z*z - 10*z + 3)) + std::sqrt(13*z*z*z*z - 36*z*z*z + 40*z*z - 20*z + 4)/(2*(9*z*z - 10*z + 3)))*(9*z*z - 10*z + 3) - 2)/(z*(3*z - 1)),(7*z*z - 8*z + 2)/(2*(9*z*z - 10*z + 3)) + std::sqrt(13*z*z*z*z - 36*z*z*z + 40*z*z - 20*z + 4)/(2*(9*z*z - 10*z + 3)),z); },
|
||||
prec),
|
||||
create_polyline(1./2,(8.06225-7.)/2, P(1./2,0.,2./3),P((8.06225-7.)/2,1./3,(3.+8.06225)/14),
|
||||
create_polyline(1./2,(CGAL_SQRT65-7.)/2, P(1./2,0.,2./3),P((CGAL_SQRT65-7.)/2,1./3,(3.+CGAL_SQRT65)/14),
|
||||
[](double x) { return P(x,(2 - 5*x + x*x + std::sqrt(x)*std::sqrt(4 - 11*x + 6*x*x + x*x*x))/(2*(1 - 4*x + 2*x*x)),(2 - x - x*x - std::sqrt(x)*std::sqrt(4 - 11*x + 6*x*x + x*x*x))/(2*(1 - x + x*x))); },
|
||||
prec),
|
||||
create_polyline(1./2,(8.06225-7.)/2, P(1./2,1./2,1.),P((8.06225-7.)/2,1./3,(3.+8.06225)/14),
|
||||
create_polyline(1./2,(CGAL_SQRT65-7.)/2, P(1./2,1./2,1.),P((CGAL_SQRT65-7.)/2,1./3,(3.+CGAL_SQRT65)/14),
|
||||
[](double x) { return P(x,(2 - 5*x + x*x - std::sqrt(x)*std::sqrt(4 - 11*x + 6*x*x + x*x*x))/(2*(1 - 4*x + 2*x*x)),(2 - x - x*x + std::sqrt(x)*std::sqrt(4 - 11*x + 6*x*x + x*x*x))/(2*(1 - x + x*x))); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2027,16 +2029,16 @@ return {
|
|||
create_polyline(1./2,2./3,P(1./2,0.,2./3),P(2./3,1./2,2./3),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(x*(-1 + 3*x)),x/(1 - 2*x + 3*x*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1)/2,P(1./2,1.,1./2),P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2,P(1./2,1.,1./2),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,(1 - x)/x,x); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2,2./3,P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),P(2./3,1./2,2./3),
|
||||
create_polyline((CGAL_SQRT5-1)/2,2./3,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),P(2./3,1./2,2./3),
|
||||
[](double x) { return P(x,(1 - x)/x,x); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1)/2,P(1./2,2./3,2./3),P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2,P(1./2,2./3,2./3),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,1/(1+x),1/(1+x)); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2,1.,P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1)/2,1.,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1/(1+x),1/(1+x)); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2074,10 +2076,10 @@ template<typename P>
|
|||
std::vector<std::vector<P>> poly00012134(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline(1-1./1.73205,1./2, P(1-1./1.73205,1./2,1.73205-1.),P(1./2,0.,2./3),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2, P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1.),P(1./2,0.,2./3),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(x*(-2 + 3*x)),-x/(1 - 5*x + 3*x*x)); },
|
||||
prec),
|
||||
create_polyline(0.,1-1./1.73205, P(0.,1./2,2./3),P(1-1./1.73205,1./2,1.73205-1.),
|
||||
create_polyline(0.,1-1./CGAL_SQRT3, P(0.,1./2,2./3),P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1.),
|
||||
[](double x) { return P(x,1./2,(-2 + x)/(-3 + 2*x)); },
|
||||
prec),
|
||||
create_polyline(2./3,1., P(1./2,2./3,2./3),P(1./2,1.,1./2),
|
||||
|
|
@ -2086,13 +2088,13 @@ return {
|
|||
create_polyline(1./2,2./3, P(1./2,1.,1./2),P(1./2,2./3,2./3),
|
||||
[](double z) { return P( -(z - 1)*(3*z - 1)/z,z/(3*z - 1),z); },
|
||||
prec),
|
||||
create_polyline(1-1./1.73205,1./2,P(1-1./1.73205,1./2,1.73205-1.),P(1./2,2./3,2./3),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2,P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1.),P(1./2,2./3,2./3),
|
||||
[](double x) { return P(x,(-1 - x*x + std::sqrt(1 - 6*x*x + 4*x*x*x + x*x*x*x))/(2*(-2 + x)*x),(-1 - 2*x + x*x - std::sqrt(1 - 6*x*x + 4*x*x*x + x*x*x*x))/(2*(-1 - 2*x + 2*x*x)) ); },
|
||||
prec),
|
||||
create_polyline(1./2,2./3, P(1./2,1./2,1.),P(1./2,2./3,2./3),
|
||||
[](double y) { return P( 1./2,y,y/(-1 + 3*y)); },
|
||||
prec),
|
||||
create_polyline(1-1./1.73205,1./2, P(1-1./1.73205,1./2,1.73205-1.),P(1./2,1./2,1.),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2, P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1.),P(1./2,1./2,1.),
|
||||
[](double x) { return P(x ,1./2,x/(1-x)); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2175,25 +2177,25 @@ template<typename P>
|
|||
std::vector<std::vector<P>> poly00012341(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline(0.,1-1./1.73205, P(1./2,0.,2./3),P(1./2,1-1./1.73205,1.73205-1),
|
||||
create_polyline(0.,1-1./CGAL_SQRT3, P(1./2,0.,2./3),P(1./2,1-1./CGAL_SQRT3,CGAL_SQRT3-1),
|
||||
[](double y) { return P(1./2,y,(-2 + y)/(-3 + 2*y)); },
|
||||
prec),
|
||||
create_polyline(0.,1-1./1.73205, P(0.,1./2,2./3),P(1-1./1.73205,1./2,1.73205-1),
|
||||
create_polyline(0.,1-1./CGAL_SQRT3, P(0.,1./2,2./3),P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1),
|
||||
[](double x) { return P(x,1./2,(-2 + x)/(-3 + 2*x)); },
|
||||
prec),
|
||||
create_polyline(1-1./1.73205,1./2,P(1./2,1-1./1.73205,1.73205-1), P(1./2,1./2,1.),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2,P(1./2,1-1./CGAL_SQRT3,CGAL_SQRT3-1), P(1./2,1./2,1.),
|
||||
[](double y) { return P(1./2,y,-y/(-1 + y)); },
|
||||
prec),
|
||||
create_polyline(1-1./1.73205,1./2,P(1-1./1.73205,1./2,1.73205-1), P(1./2,1./2,1.),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2,P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1), P(1./2,1./2,1.),
|
||||
[](double x) { return P(x,1./2,-x/(-1 + x)); },
|
||||
prec),
|
||||
create_polyline(1-1./1.73205,1./2,P(1-1./1.73205,1./2,1.73205-1),P(1./2,1-1./1.73205,1.73205-1),
|
||||
create_polyline(1-1./CGAL_SQRT3,1./2,P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1),P(1./2,1-1./CGAL_SQRT3,CGAL_SQRT3-1),
|
||||
[](double x) { return P(x,(-1 - 2*x + 2*x*x + std::sqrt(1 - 4*x + 12*x*x - 12*x*x*x + 4*x*x*x*x))/(2*(-2 + x)*x),(1 - 4*x + 2*x*x + std::sqrt(1 - 4*x + 12*x*x - 12*x*x*x + 4*x*x*x*x))/(2*(-1 + x)*(-1+x))); },
|
||||
prec),
|
||||
create_polyline(1./2,1., P(1./2,1-1./1.73205,1.73205-1), P(1.,1./3,1./2) ,
|
||||
create_polyline(1./2,1., P(1./2,1-1./CGAL_SQRT3,CGAL_SQRT3-1), P(1.,1./3,1./2) ,
|
||||
[](double x) { return P(x,(1 + x - std::sqrt(1 - x + x*x))/(3*x),(x - std::sqrt(1 - x + x*x))/(-1 + x)); },
|
||||
prec),
|
||||
create_polyline(1./2,1.,P(1-1./1.73205,1./2,1.73205-1),P(1./3,1.,1./2),
|
||||
create_polyline(1./2,1.,P(1-1./CGAL_SQRT3,1./2,CGAL_SQRT3-1),P(1./3,1.,1./2),
|
||||
[](double y) { return P((1 + y - std::sqrt(1 - y + y*y))/(3*y),y,(y - std::sqrt(1 - y + y*y))/(-1 + y)); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2372,16 +2374,16 @@ template<typename P>
|
|||
std::vector<std::vector<P>> poly00121304(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline(1./2,4.-2*1.73205, P(1./2,2./3,0.),P(4.-2*1.73205,(1.+1/1.73205)/2,(1.73205-1)/2.),
|
||||
create_polyline(1./2,4.-2*CGAL_SQRT3, P(1./2,2./3,0.),P(4.-2*CGAL_SQRT3,(1.+1/CGAL_SQRT3)/2,(CGAL_SQRT3-1)/2.),
|
||||
[](double x) { return P(x,(2 + x - std::sqrt(4 - 8*x + x*x))/(6*x),(-2 + 5*x - x*x - std::sqrt(4 - 8*x + x*x) + x*std::sqrt(4 - 8*x + x*x))/(2*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,4.-2*1.73205, P(1./2,1.,1./2),P(4.-2*1.73205,(1.+1/1.73205)/2,(1.73205-1)/2.),
|
||||
create_polyline(1./2,4.-2*CGAL_SQRT3, P(1./2,1.,1./2),P(4.-2*CGAL_SQRT3,(1.+1/CGAL_SQRT3)/2,(CGAL_SQRT3-1)/2.),
|
||||
[](double x) { return P(x,(2 + x + std::sqrt(4 - 8*x + x*x))/(6*x),(-2 + 5*x - x*x + std::sqrt(4 - 8*x + x*x) - x*std::sqrt(4 - 8*x + x*x))/(2*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,4.-2*1.73205, P(1./2,1./2,1.),P(4.-2*1.73205,(1.73205-1)/2.,(1.+1/1.73205)/2),
|
||||
create_polyline(1./2,4.-2*CGAL_SQRT3, P(1./2,1./2,1.),P(4.-2*CGAL_SQRT3,(CGAL_SQRT3-1)/2.,(1.+1/CGAL_SQRT3)/2),
|
||||
[](double x) { return P(x,(-2 + 5*x - x*x + std::sqrt(4 - 8*x + x*x) - x*std::sqrt(4 - 8*x + x*x))/(2*x),(2 + x + std::sqrt(4 - 8*x + x*x))/(6*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,4.-2*1.73205, P(1./2,0.,2./3),P(4.-2*1.73205,(1.73205-1)/2.,(1.+1/1.73205)/2),
|
||||
create_polyline(1./2,4.-2*CGAL_SQRT3, P(1./2,0.,2./3),P(4.-2*CGAL_SQRT3,(CGAL_SQRT3-1)/2.,(1.+1/CGAL_SQRT3)/2),
|
||||
[](double x) { return P(x,(-2 + 5*x - x*x - std::sqrt(4 - 8*x + x*x) + x*std::sqrt(4 - 8*x + x*x))/(2*x),(2 + x - std::sqrt(4 - 8*x + x*x))/(6*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,1., P(1./2,1.,1./2),P(1.,1./2,1./2),
|
||||
|
|
@ -2478,16 +2480,16 @@ return {
|
|||
create_polyline(1./3,1./2,P(1./3,1.,1./2),P(1./2,1./2,1.),
|
||||
[](double x) { return P(x,x/(-1 + 4*x),-x/(-1 + x)); },
|
||||
prec),
|
||||
create_polyline(1./2,1/1.73205,P(1./2,0.,2./3),P(1/1.73205,(6-1.73205)/11,(3-1.73205)/2),
|
||||
create_polyline(1./2,1/CGAL_SQRT3,P(1./2,0.,2./3),P(1/CGAL_SQRT3,(6-CGAL_SQRT3)/11,(3-CGAL_SQRT3)/2),
|
||||
[](double x) { return P(x,(1 - 2*x)/(1 - 3*x + x*x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline(1./1.73205,1.,P(1/1.73205,(6-1.73205)/11,(3-1.73205)/2),P(1.,1./3,1./2),
|
||||
create_polyline(1./CGAL_SQRT3,1.,P(1/CGAL_SQRT3,(6-CGAL_SQRT3)/11,(3-CGAL_SQRT3)/2),P(1.,1./3,1./2),
|
||||
[](double x) { return P(x,1/(2 + x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline(1./2,1/1.73205,P(1./2,1./2,1.),P(1/1.73205,(6-1.73205)/11,(3-1.73205)/2),
|
||||
create_polyline(1./2,1/CGAL_SQRT3,P(1./2,1./2,1.),P(1/CGAL_SQRT3,(6-CGAL_SQRT3)/11,(3-CGAL_SQRT3)/2),
|
||||
[](double x) { return P(x,(-2 + 3*x)/(-3 + 4*x),(-2 + 3*x)/(-1 + x)); },
|
||||
prec),
|
||||
create_polyline(limit_value(0.,1),(3-1.73205)/2,P(1./2,2./3,0.),P(1/1.73205,(6-1.73205)/11,(3-1.73205)/2),
|
||||
create_polyline(limit_value(0.,1),(3-CGAL_SQRT3)/2,P(1./2,2./3,0.),P(1/CGAL_SQRT3,(6-CGAL_SQRT3)/11,(3-CGAL_SQRT3)/2),
|
||||
[](double z) { return P((-2*z*z + 5*z + ((3*z*z - 6*z + 2)/(2*(2*z*z - 6*z + 3)) + std::sqrt(z*z*z*z - 4*z*z*z + 12*z*z - 12*z + 4)/(2*(2*z*z - 6*z + 3)))*(2*z*z - 6*z + 3) - 2)/z,(3*z*z - 6*z + 2)/(2*(2*z*z - 6*z + 3)) + std::sqrt(z*z*z*z - 4*z*z*z + 12*z*z - 12*z + 4)/(2*(2*z*z - 6*z + 3)),z); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2609,10 +2611,10 @@ return {
|
|||
create_polyline(1./2,1.,P(1./2,0.,2./3),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + 2*x + x*x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline(0.,4.-2*1.73205,P(0.,1./3,1./2),P(4.-2*1.73205,1/1.73205,(1.73205-1)/2.),
|
||||
create_polyline(0.,4.-2*CGAL_SQRT3,P(0.,1./3,1./2),P(4.-2*CGAL_SQRT3,1/CGAL_SQRT3,(CGAL_SQRT3-1)/2.),
|
||||
[](double x) { return P(x,(4 - x - std::sqrt(4 - 8*x + x*x))/6,(-2 + 5*x - x*x + std::sqrt(4 - 8*x + x*x) - x*std::sqrt(4 - 8*x + x*x))/(2*x) ); },
|
||||
prec),
|
||||
create_polyline(1./2,4.-2*1.73205,P(1./2,2./3,0.),P(4.-2*1.73205,1/1.73205,(1.73205-1)/2.),
|
||||
create_polyline(1./2,4.-2*CGAL_SQRT3,P(1./2,2./3,0.),P(4.-2*CGAL_SQRT3,1/CGAL_SQRT3,(CGAL_SQRT3-1)/2.),
|
||||
[](double x) { return P(x,(4 - x + std::sqrt(4 - 8*x + x*x))/6,(-2 + 5*x - x*x - std::sqrt(4 - 8*x + x*x) + x*std::sqrt(4 - 8*x + x*x))/(2*x) ); },
|
||||
prec),
|
||||
create_polyline(1./2,1.,P(1./2,1./2,1.),P(1.,1./2,1./2),
|
||||
|
|
@ -2668,50 +2670,50 @@ return {
|
|||
create_polyline(0.,1./3,P(0.,1./2,1./2),P(1./3,3./5,3./7),
|
||||
[](double x) { return P(x,1/(2 - x),1/(2 + x)); },
|
||||
prec),
|
||||
create_polyline(1./3,(3.-2.23606)/2,P(1./3,3./5,3./7),P((3.-2.23606)/2,1./2,1./2),
|
||||
create_polyline(1./3,(3.-CGAL_SQRT5)/2,P(1./3,3./5,3./7),P((3.-CGAL_SQRT5)/2,1./2,1./2),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + x + x*x),x/(1 - x + x*x)); },
|
||||
prec),
|
||||
create_polyline((3.-2.23606)/2,1./2,P((3.-2.23606)/2,1./2,1./2),P(1./2,0.,2./3),
|
||||
create_polyline((3.-CGAL_SQRT5)/2,1./2,P((3.-CGAL_SQRT5)/2,1./2,1./2),P(1./2,0.,2./3),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + x + x*x),x/(1 - x + x*x)); },
|
||||
prec),
|
||||
create_polyline(0.,(3.-2.23606)/2,P(0.,1./2,1./2),P((3.-2.23606)/2,1./2,1./2),
|
||||
create_polyline(0.,(3.-CGAL_SQRT5)/2,P(0.,1./2,1./2),P((3.-CGAL_SQRT5)/2,1./2,1./2),
|
||||
[](double x) { return P(x,1./2,1./2); },
|
||||
prec),
|
||||
create_polyline((3.-2.23606)/2,1.,P((3.-2.23606)/2,1./2,1./2),P(1.,1./2,1./2),
|
||||
create_polyline((3.-CGAL_SQRT5)/2,1.,P((3.-CGAL_SQRT5)/2,1./2,1./2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1./2,1./2); },
|
||||
prec),
|
||||
};
|
||||
}
|
||||
|
||||
//00122344
|
||||
// curve 1 : x = [1./2,(2.23606-1.)/2], y = x/(1 + x), z = (x*x)/(-1 + 2*x + x*x)
|
||||
// curve 2 : x = [(3.-2.23606)/2,1./2], y = (-1 + x)*(-1+x)/(2 - 4*x + x*x), z = (-1 + x)/(-2 + x)
|
||||
// curve 3 : x = [1./2,(2.23606-1.)/2], y = (-1 + 2*x)/(-1 + 2*x + x*x), z = 1/(1 + x)
|
||||
// curve 4 : x = [(2.23606-1.)/2,1], y = x/(1 + x), z = 1/(1 + x)
|
||||
// curve 5 : x = [0.,(3.-2.23606)/2], y = 1/(2 - x), z = (-1 + x)/(-2 + x)
|
||||
// curve 6 : x = [3.-2.23606)/2,1./2], y = 1/(2 - x), z = (1 - 2*x)/(2 - 4*x + x*x)
|
||||
// curve 1 : x = [1./2,(std::sqrt(5)-1.)/2], y = x/(1 + x), z = (x*x)/(-1 + 2*x + x*x)
|
||||
// curve 2 : x = [(3.-std::sqrt(5))/2,1./2], y = (-1 + x)*(-1+x)/(2 - 4*x + x*x), z = (-1 + x)/(-2 + x)
|
||||
// curve 3 : x = [1./2,(std::sqrt(5)-1.)/2], y = (-1 + 2*x)/(-1 + 2*x + x*x), z = 1/(1 + x)
|
||||
// curve 4 : x = [(std::sqrt(5)-1.)/2,1], y = x/(1 + x), z = 1/(1 + x)
|
||||
// curve 5 : x = [0.,(3.-std::sqrt(5))/2], y = 1/(2 - x), z = (-1 + x)/(-2 + x)
|
||||
// curve 6 : x = [3.-std::sqrt(5))/2,1./2], y = 1/(2 - x), z = (1 - 2*x)/(2 - 4*x + x*x)
|
||||
// curve 7 : x = [0,1], y = z = 1/2
|
||||
// curve 8 : x = z, y = 1-z, z = [(3.-2.23606)/2,(2.23606-1.)/2]
|
||||
// curve 8 : x = z, y = 1-z, z = [(3.-std::sqrt(5))/2,(std::sqrt(5)-1.)/2]
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00122344(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline(1./2,(2.23606-1.)/2,P(1./2,1./3,1.),P((2.23606-1.)/2,(3.-2.23606)/2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2,P(1./2,1./3,1.),P((CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2),
|
||||
[](double x) { return P(x,x/(1 + x),(x*x)/(-1 + 2*x + x*x)); },
|
||||
prec),
|
||||
create_polyline((3.-2.23606)/2,1./2,P((3.-2.23606)/2,(2.23606-1.)/2,(3.-2.23606)/2),P(1./2,1.,1./3),
|
||||
create_polyline((3.-CGAL_SQRT5)/2,1./2,P((3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2),P(1./2,1.,1./3),
|
||||
[](double x) { return P(x,(-1 + x)*(-1+x)/(2 - 4*x + x*x),(-1 + x)/(-2 + x)); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2,P(1./2,0.,2./3),P((2.23606-1.)/2,(3.-2.23606)/2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2,P(1./2,0.,2./3),P((CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + 2*x + x*x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline((2.23606-1.)/2,1.,P((2.23606-1.)/2,(3.-2.23606)/2,(2.23606-1.)/2),P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1.)/2,1.,P((CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,x/(1 + x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline(0.,(3.-2.23606)/2,P(0.,1./2,1./2),P((3.-2.23606)/2,(2.23606-1.)/2,(3.-2.23606)/2),
|
||||
create_polyline(0.,(3.-CGAL_SQRT5)/2,P(0.,1./2,1./2),P((3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2),
|
||||
[](double x) { return P(x,1/(2 - x),(-1 + x)/(-2 + x)); },
|
||||
prec),
|
||||
create_polyline((3.-2.23606)/2,1./2,P((3.-2.23606)/2,(2.23606-1.)/2,(3.-2.23606)/2),P(1./2,2./3,0.),
|
||||
create_polyline((3.-CGAL_SQRT5)/2,1./2,P((3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2),P(1./2,2./3,0.),
|
||||
[](double x) { return P(x,1/(2 - x),(1 - 2*x)/(2 - 4*x + x*x)); },
|
||||
prec),
|
||||
create_polyline(0.,1./2,P(0.,1./2,1./2),P(1./2,1./2,1./2),
|
||||
|
|
@ -2720,10 +2722,10 @@ return {
|
|||
create_polyline(1./2,1.,P(1./2,1./2,1./2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1./2,1./2); },
|
||||
prec),
|
||||
create_polyline((3.-2.23606)/2,1./2,P((3.-2.23606)/2,(2.23606-1.)/2,(3.-2.23606)/2),P(1./2,1./2,1./2),
|
||||
create_polyline((3.-CGAL_SQRT5)/2,1./2,P((3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2),P(1./2,1./2,1./2),
|
||||
[](double z) { return P(z,1-z,z); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2,P(1./2,1./2,1./2),P((2.23606-1.)/2,(3.-2.23606)/2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2,P(1./2,1./2,1./2),P((CGAL_SQRT5-1.)/2,(3.-CGAL_SQRT5)/2,(CGAL_SQRT5-1.)/2),
|
||||
[](double z) { return P(z,1-z,z); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -2766,36 +2768,36 @@ return {
|
|||
}
|
||||
|
||||
//00123414
|
||||
// curve 1 : x = [(2.23606-1)/2,2./3], y = (1 - 2*x)/(-1 + x), z = (-1 + 2*x)/x
|
||||
// curve 2 : x = [1/2,(2.23606-1)/2], y = 1/(1 + x), z = (-1 + 2*x)/x
|
||||
// curve 3 : x = [(2.23606-1)/2,1], y = 1/(1+x), z = 1/(2+x)
|
||||
// curve 4 : x = [(3-2.23606)/2,1./2], y = (-1 + 2*x)/(-1 + x), z = 1/(2 - x)
|
||||
// curve 5 : x = [0.,(3-2.23606)/2], y = 1/(3-x), z = 1/(2 - x)
|
||||
// curve 6 : x = y = 1-z, z = [(3-2.23606)/2,(2.23606-1)/2]
|
||||
// curve 7 : x = [1./3,(3-2.23606)/2], y = (-1 + 2*x)/(-1 + x), z = (1 - 2*x)/x
|
||||
// curve 1 : x = [(std::sqrt(5)-1)/2,2./3], y = (1 - 2*x)/(-1 + x), z = (-1 + 2*x)/x
|
||||
// curve 2 : x = [1/2,(std::sqrt(5)-1)/2], y = 1/(1 + x), z = (-1 + 2*x)/x
|
||||
// curve 3 : x = [(std::sqrt(5)-1)/2,1], y = 1/(1+x), z = 1/(2+x)
|
||||
// curve 4 : x = [(3-std::sqrt(5))/2,1./2], y = (-1 + 2*x)/(-1 + x), z = 1/(2 - x)
|
||||
// curve 5 : x = [0.,(3-std::sqrt(5))/2], y = 1/(3-x), z = 1/(2 - x)
|
||||
// curve 6 : x = y = 1-z, z = [(3-std::sqrt(5))/2,(std::sqrt(5)-1)/2]
|
||||
// curve 7 : x = [1./3,(3-std::sqrt(5))/2], y = (-1 + 2*x)/(-1 + x), z = (1 - 2*x)/x
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00123414(const int prec = 10)
|
||||
{
|
||||
return {
|
||||
create_polyline((2.23606-1)/2,2./3,P((2.23606-1)/2,(2.23606-1)/2,(3-2.23606)/2),P(2./3,1.,1./2),
|
||||
create_polyline((CGAL_SQRT5-1)/2,2./3,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(3-CGAL_SQRT5)/2),P(2./3,1.,1./2),
|
||||
[](double x) { return P(x,(1 - 2*x)/(-1 + x),(-1 + 2*x)/x); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1)/2,P(1./2,2./3,0.),P((2.23606-1)/2,(2.23606-1)/2,(3-2.23606)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2,P(1./2,2./3,0.),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(3-CGAL_SQRT5)/2),
|
||||
[](double x) { return P(x,1/(1 + x),(-1 + 2*x)/x); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2,1.,P((2.23606-1)/2,(2.23606-1)/2,(3-2.23606)/2),P(1.,1./2,1./3),
|
||||
create_polyline((CGAL_SQRT5-1)/2,1.,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(3-CGAL_SQRT5)/2),P(1.,1./2,1./3),
|
||||
[](double x) { return P(x,1/(1+x),1/(2+x)); },
|
||||
prec),
|
||||
create_polyline((3-2.23606)/2,1./2,P((3-2.23606)/2,(3-2.23606)/2,(2.23606-1)/2),P(1./2,0.,2./3),
|
||||
create_polyline((3-CGAL_SQRT5)/2,1./2,P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(CGAL_SQRT5-1)/2),P(1./2,0.,2./3),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + x),1/(2 - x)); },
|
||||
prec),
|
||||
create_polyline(0.,(3-2.23606)/2,P(0.,1./3,1./2),P((3-2.23606)/2,(3-2.23606)/2,(2.23606-1)/2),
|
||||
create_polyline(0.,(3-CGAL_SQRT5)/2,P(0.,1./3,1./2),P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,1/(3-x),1/(2 - x)); },
|
||||
prec),
|
||||
create_polyline((3-2.23606)/2,(2.23606-1)/2,P((2.23606-1)/2,(2.23606-1)/2,(3-2.23606)/2),P((3-2.23606)/2,(3-2.23606)/2,(2.23606-1)/2),
|
||||
create_polyline((3-CGAL_SQRT5)/2,(CGAL_SQRT5-1)/2,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(3-CGAL_SQRT5)/2),P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double z) { return P(1-z,1-z,z); },
|
||||
prec),
|
||||
create_polyline(1./3,(3-2.23606)/2,P(1./3,1./2,1.),P((3-2.23606)/2,(3-2.23606)/2,(2.23606-1)/2),
|
||||
create_polyline(1./3,(3-CGAL_SQRT5)/2,P(1./3,1./2,1.),P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + x),(1 - 2*x)/x); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -3109,13 +3111,13 @@ return {
|
|||
// curve 1 : x = [0,1], y = z = 1/2
|
||||
// curve 2 : x = 1/2, y = [0,1], z = 1/2
|
||||
// curve 3 : x = y = 1/2, z = [0,1]
|
||||
// curve 4 : x = [(2.23606-1)/2,1], y = z = 1/(1 + x)
|
||||
// curve 5 : x = [1./2,(2.23606-1)/2], y = (1 - x)/x, z = x
|
||||
// curve 6 : x = [0.,(3-2.23606)/2], y = z = (-1 + x)/(-2 + x)
|
||||
// curve 7 : x = [(3-2.23606)/2,1./2], y = (-1 + 2*x)/(-1 + x), z = x
|
||||
// curve 8 : x = y = z = [(3-2.23606)/2,(2.23606-1)/2]
|
||||
// curve 9 : x = y = [(3-2.23606)/2,1./2], z = (-1 + 2*x)/(-1 + x)
|
||||
// curve 10 : x = y = [1./2,(2.23606-1)/2], z = (1-x)/x
|
||||
// curve 4 : x = [(std::sqrt(5)-1)/2,1], y = z = 1/(1 + x)
|
||||
// curve 5 : x = [1./2,(std::sqrt(5)-1)/2], y = (1 - x)/x, z = x
|
||||
// curve 6 : x = [0.,(3-std::sqrt(5))/2], y = z = (-1 + x)/(-2 + x)
|
||||
// curve 7 : x = [(3-std::sqrt(5))/2,1./2], y = (-1 + 2*x)/(-1 + x), z = x
|
||||
// curve 8 : x = y = z = [(3-std::sqrt(5))/2,(std::sqrt(5)-1)/2]
|
||||
// curve 9 : x = y = [(3-std::sqrt(5))/2,1./2], z = (-1 + 2*x)/(-1 + x)
|
||||
// curve 10 : x = y = [1./2,(std::sqrt(5)-1)/2], z = (1-x)/x
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly01233214(const int prec = 10)
|
||||
{
|
||||
|
|
@ -3138,28 +3140,28 @@ return {
|
|||
create_polyline(1./2,1.,P(1./2,1./2.,1./2),P(1./2,1./2,1.),
|
||||
[](double z) { return P(1./2,1./2,z); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2,1.,P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1)/2,1.,P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1/(1 + x),1/(1 + x)); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1)/2,P(1./2.,1.,1./2),P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2,P(1./2.,1.,1./2),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,(1 - x)/x,x); },
|
||||
prec),
|
||||
create_polyline(0.,(3-2.23606)/2,P(0.,1./2,1./2),P((3-2.23606)/2,(3-2.23606)/2,(3-2.23606)/2),
|
||||
create_polyline(0.,(3-CGAL_SQRT5)/2,P(0.,1./2,1./2),P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2),
|
||||
[](double x) { return P(x,(-1 + x)/(-2 + x),(-1 + x)/(-2 + x)); },
|
||||
prec),
|
||||
create_polyline((3-2.23606)/2,1./2,P((3-2.23606)/2,(3-2.23606)/2,(3-2.23606)/2),P(1./2.,0.,1./2),
|
||||
create_polyline((3-CGAL_SQRT5)/2,1./2,P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2),P(1./2.,0.,1./2),
|
||||
[](double x) { return P(x,(-1 + 2*x)/(-1 + x),x); },
|
||||
prec),
|
||||
create_polyline((3-2.23606)/2,1./2,P((3-2.23606)/2,(3-2.23606)/2,(3-2.23606)/2),P(1./2,1./2,1./2),
|
||||
create_polyline((3-CGAL_SQRT5)/2,1./2,P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2),P(1./2,1./2,1./2),
|
||||
[](double x) { return P(x,x,x); },
|
||||
prec),
|
||||
create_polyline (1./2,(2.23606-1)/2,P(1./2.,1./2,1./2),P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),
|
||||
create_polyline<P> (1./2,(CGAL_SQRT5-1)/2,P(1./2.,1./2,1./2),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,x,x); },
|
||||
prec),
|
||||
create_polyline((3-2.23606)/2,1./2,P((3-2.23606)/2,(3-2.23606)/2,(3-2.23606)/2),P(1./2,1./2,0.),
|
||||
create_polyline((3-CGAL_SQRT5)/2,1./2,P((3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2,(3-CGAL_SQRT5)/2),P(1./2,1./2,0.),
|
||||
[](double x) { return P(x,x,(-1 + 2*x)/(-1 + x)); },
|
||||
prec),
|
||||
create_polyline (1./2,(2.23606-1)/2,P(1./2.,1./2,1.),P((2.23606-1)/2,(2.23606-1)/2,(2.23606-1)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2,P(1./2.,1./2,1.),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,x,(1 - x)/x); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -3226,14 +3228,14 @@ return {
|
|||
|
||||
//00121345
|
||||
// curve 1 : x = 1/2, y = [1/2,1], z = y/(-1 + 3*y)
|
||||
// curve 2 : x = [1/2,(2.23606-1.)/2], y = 1./2, z = (1 - x)/x
|
||||
// curve 3 : x = [1/2,(2.23606-1.)/2], y = (1 - 2*x)/(1 - 3*x + x*x), z = 1./(x+1)
|
||||
// curve 4 : x = [(2.23606-1.)/2,1], y = 1./2, z = 1./(x+1)
|
||||
// curve 5 : x = [(2.23606-1.)/2,1], y = 1./(x+1), z = 1./2
|
||||
// curve 6 : x = [1./2,(2.23606-1.)/2], y = 1./(x+1), z = (1 - 2*x)/(1 - 3*x + x*x
|
||||
// curve 7 : x = [1./2,(2.23606-1.)/2], y = (1 - x)/x, z = 1./2
|
||||
// curve 8 : x = [(9-4.12310)/8,(2.23606-1.)/2[, y = -sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)), z = -(-x + (-sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)
|
||||
// curve 8 : x = [(9-4.12310)/8,(2.23606-1.)/2[, y = sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)), z = -(-x + (sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)
|
||||
// curve 2 : x = [1/2,(std::sqrt(5)-1.)/2], y = 1./2, z = (1 - x)/x
|
||||
// curve 3 : x = [1/2,(std::sqrt(5)-1.)/2], y = (1 - 2*x)/(1 - 3*x + x*x), z = 1./(x+1)
|
||||
// curve 4 : x = [(std::sqrt(5)-1.)/2,1], y = 1./2, z = 1./(x+1)
|
||||
// curve 5 : x = [(std::sqrt(5)-1.)/2,1], y = 1./(x+1), z = 1./2
|
||||
// curve 6 : x = [1./2,(std::sqrt(5)-1.)/2], y = 1./(x+1), z = (1 - 2*x)/(1 - 3*x + x*x
|
||||
// curve 7 : x = [1./2,(std::sqrt(5)-1.)/2], y = (1 - x)/x, z = 1./2
|
||||
// curve 8 : x = [(9-4.12310)/8,(std::sqrt(5)-1.)/2[, y = -sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)), z = -(-x + (-sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)
|
||||
// curve 8 : x = [(9-4.12310)/8,(std::sqrt(5)-1.)/2[, y = sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)), z = -(-x + (sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00121345(const int prec = 10)
|
||||
{
|
||||
|
|
@ -3241,28 +3243,28 @@ return {
|
|||
create_polyline(1./2,1., P(1./2,1./2,1.),P(1./2,1.,1./2),
|
||||
[](double y) { return P(1./2,y,y/(-1 + 3*y) ); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(1./2,1./2,1.),P((2.23606-1.)/2,1./2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(1./2,1./2,1.),P((CGAL_SQRT5-1.)/2,1./2,(CGAL_SQRT5-1.)/2),
|
||||
[](double x) { return P(x,1./2,(1 - x)/x) ; },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(1./2,0.,2./3),P((2.23606-1)/2,1./2,(2.23606-1)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(1./2,0.,2./3),P((CGAL_SQRT5-1)/2,1./2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,(1 - 2*x)/(1 - 3*x + x*x),1./(x+1)) ; },
|
||||
prec),
|
||||
create_polyline((2.23606-1.)/2,1.,P((2.23606-1.)/2,1./2,(2.23606-1.)/2), P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1.)/2,1.,P((CGAL_SQRT5-1.)/2,1./2,(CGAL_SQRT5-1.)/2), P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1./2,1./(x+1)) ; },
|
||||
prec),
|
||||
create_polyline((2.23606-1.)/2,1.,P((2.23606-1.)/2,(2.23606-1.)/2,1./2), P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1.)/2,1.,P((CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1.)/2,1./2), P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1./(x+1),1./2) ; },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(1./2,2./3,0.),P((2.23606-1)/2,(2.23606-1)/2,1./2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(1./2,2./3,0.),P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,1./2),
|
||||
[](double x) { return P(x,1./(x+1),(1 - 2*x)/(1 - 3*x + x*x)) ; },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(1./2,1.,1./2),P((2.23606-1.)/2,(2.23606-1)/2,1./2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(1./2,1.,1./2),P((CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1)/2,1./2),
|
||||
[](double x) { return P(x,(1 - x)/x,1./2) ; },
|
||||
prec),
|
||||
create_polyline((9-4.12310)/8.,limit_value((2.23606-1.)/2,-1),P((9-4.12310)/8.,(4.12310-3)/2.,(4.12310-3)/2.), P((2.23606-1)/2,(2.23606-1)/2,1./2),
|
||||
create_polyline((9-CGAL_SQRT17)/8.,limit_value((CGAL_SQRT5-1.)/2,-1),P((9-CGAL_SQRT17)/8.,(CGAL_SQRT17-3)/2.,(CGAL_SQRT17-3)/2.), P((CGAL_SQRT5-1)/2,(CGAL_SQRT5-1)/2,1./2),
|
||||
[](double x) { return P(x,-std::sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)),-(-x + (-std::sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)) ; },
|
||||
prec),
|
||||
create_polyline((9-4.12310)/8.,limit_value((2.23606-1.)/2,-1),P((9-4.12310)/8.,(4.12310-3)/2.,(4.12310-3)/2.), P((2.23606-1)/2,1./2,(2.23606-1)/2),
|
||||
create_polyline((9-CGAL_SQRT17)/8.,limit_value((CGAL_SQRT5-1.)/2,-1),P((9-CGAL_SQRT17)/8.,(CGAL_SQRT17-3)/2.,(CGAL_SQRT17-3)/2.), P((CGAL_SQRT5-1)/2,1./2,(CGAL_SQRT5-1)/2),
|
||||
[](double x) { return P(x,std::sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)),-(-x + (std::sqrt(-x*(4*x*x - 9*x + 4))/(2*(x*x - x - 1)) + (x - 2)/(2*(x*x - x - 1)))*(x*x - x - 1) + 2)/(x*x - x - 1)) ; },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -3324,13 +3326,13 @@ return {
|
|||
//00123415
|
||||
// curve 1 : x = 1/2, y = [0,2/5], z = 2/3
|
||||
// curve 2 : x = [0,1/2], y = 1./(3-x), z = 1./(2-x)
|
||||
// curve 3 : x = [1./2,(2.23606-1)/2], y = -x/(-1 - x + x*x), z = 1./(x+1)
|
||||
// curve 4 : x = [(2.23606-1)/2.,1], y = 1./2, z = 1./(x+1)
|
||||
// curve 5 : x = [(2.23606-1)/2.,2./3], y = (1 - 2*x)/(1. - 3*x + x*x), z = (1. - x)/x
|
||||
// curve 3 : x = [1./2,(std::sqrt(5)-1)/2], y = -x/(-1 - x + x*x), z = 1./(x+1)
|
||||
// curve 4 : x = [(std::sqrt(5)-1)/2.,1], y = 1./2, z = 1./(x+1)
|
||||
// curve 5 : x = [(std::sqrt(5)-1)/2.,2./3], y = (1 - 2*x)/(1. - 3*x + x*x), z = (1. - x)/x
|
||||
// curve 6 : x = [2/3,1], y = 1./(x+1), z = 1./2
|
||||
// curve 7 : x = [1/2,2/3], y = 1./(x+1), z = (2*x-1.)/x
|
||||
// curve 8 : x = 2/3, y = [3/5,1], z = 1/2
|
||||
// curve 9 : x = [1/2,(2.23606-1)/2], y = 1/2, z = (1. - x)/x
|
||||
// curve 9 : x = [1/2,(std::sqrt(5)-1)/2], y = 1/2, z = (1. - x)/x
|
||||
// curve 10 : x = 1/2, y = [2/5,1/2], z = y/(1.-y)
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly00123415(const int prec = 10)
|
||||
|
|
@ -3342,13 +3344,13 @@ return {
|
|||
create_polyline(0.,1./2, P(0.,1./3,1./2),P(1./2,2./5,2./3),
|
||||
[](double x) { return P(x,1./(3-x),1./(2-x)); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1)/2., P(1./2,2./5,2./3),P((2.23606-1)/2.,1./2,(2.23606-1)/2.),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1)/2., P(1./2,2./5,2./3),P((CGAL_SQRT5-1)/2.,1./2,(CGAL_SQRT5-1)/2.),
|
||||
[](double x) { return P(x,-x/(-1 - x + x*x),1./(x+1)); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2.,1., P((2.23606-1)/2.,1./2,(2.23606-1)/2.),P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1)/2.,1., P((CGAL_SQRT5-1)/2.,1./2,(CGAL_SQRT5-1)/2.),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,1./2,1./(x+1)); },
|
||||
prec),
|
||||
create_polyline((2.23606-1)/2.,2./3, P((2.23606-1)/2.,1./2,(2.23606-1)/2.),P(2./3,3./5,1./2),
|
||||
create_polyline((CGAL_SQRT5-1)/2.,2./3, P((CGAL_SQRT5-1)/2.,1./2,(CGAL_SQRT5-1)/2.),P(2./3,3./5,1./2),
|
||||
[](double x) { return P(x,(1 - 2*x)/(1. - 3*x + x*x),(1. - x)/x); },
|
||||
prec),
|
||||
create_polyline(2./3,1., P(2./3,3./5,1./2),P(1.,1./2,1./2),
|
||||
|
|
@ -3360,7 +3362,7 @@ return {
|
|||
create_polyline(3./5,1., P(2./3,3./5,1./2),P(2./3,1.,1./2),
|
||||
[](double y) { return P(2./3,y,1./2); },
|
||||
prec),
|
||||
create_polyline(1./2.,(2.23606-1)/2., P(1./2,1./2,1.), P((2.23606-1)/2.,1./2,(2.23606-1)/2.),
|
||||
create_polyline(1./2.,(CGAL_SQRT5-1)/2., P(1./2,1./2,1.), P((CGAL_SQRT5-1)/2.,1./2,(CGAL_SQRT5-1)/2.),
|
||||
[](double x) { return P(x,1./2,(1. - x)/x); },
|
||||
prec),
|
||||
create_polyline(2./5,1./2, P(1./2,2./5,2./3),P(1./2,1./2,1.),
|
||||
|
|
@ -3525,11 +3527,11 @@ return {
|
|||
|
||||
//01123045
|
||||
// curve 1 : x = [0,1/2], y = 1/2, z = (-1 + x)/(-2 + 3*x)
|
||||
// curve 2 : x = 1/2, y = [1/2,(2.23606-1.)/2], z = (1 - y)/y
|
||||
// curve 3 : x = (2*z*z - 3*z + 1)/(5*z*z - 5*z + 1), y = (-z*z + 2*z - 1)/(2*z*z - 1), z = [1/2,(2.23606-1.)/2]
|
||||
// curve 4 : x = [(2.23606-1.)/2,1], y = (-2 + 5*x - sqrt(4 - 8*x + 5*x*x))/(2*(-3 + 5*x)), z = (-2 + 4*x - x*x + x*sqrt(4 - 8*x + 5*x*x))/(2*(-1 + 2*x + x*x))
|
||||
// curve 2 : x = 1/2, y = [1/2,(std::sqrt(5)-1.)/2], z = (1 - y)/y
|
||||
// curve 3 : x = (2*z*z - 3*z + 1)/(5*z*z - 5*z + 1), y = (-z*z + 2*z - 1)/(2*z*z - 1), z = [1/2,(std::sqrt(5)-1.)/2]
|
||||
// curve 4 : x = [(std::sqrt(5)-1.)/2,1], y = (-2 + 5*x - sqrt(4 - 8*x + 5*x*x))/(2*(-3 + 5*x)), z = (-2 + 4*x - x*x + x*sqrt(4 - 8*x + 5*x*x))/(2*(-1 + 2*x + x*x))
|
||||
// curve 5 : x =[1/2,1], y = x/(-1 + 3*x), z = 1./2
|
||||
// curve 6 : x = 1/2, y = [(2.23606-1.)/2,1], z = 1./(y+1)
|
||||
// curve 6 : x = 1/2, y = [(std::sqrt(5)-1.)/2,1], z = 1./(y+1)
|
||||
// problem with close polylines, there is an over refinement
|
||||
template<typename P>
|
||||
std::vector<std::vector<P>> poly01123045(const int prec = 10)
|
||||
|
|
@ -3538,19 +3540,19 @@ return {
|
|||
create_polyline(0.,1./2, P(0.,1./2,1./2),P(1./2,1./2,1.),
|
||||
[](double x) { return P(x,1./2,(-1 + x)/(-2 + 3*x)); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(1./2,1./2,1.),P(1./2,(2.23606-1.)/2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(1./2,1./2,1.),P(1./2,(CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1.)/2),
|
||||
[](double y) { return P(1./2,y,(1 - y)/y); },
|
||||
prec),
|
||||
create_polyline(1./2,(2.23606-1.)/2, P(0.,1./2,1./2),P(1./2,(2.23606-1.)/2,(2.23606-1.)/2),
|
||||
create_polyline(1./2,(CGAL_SQRT5-1.)/2, P(0.,1./2,1./2),P(1./2,(CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1.)/2),
|
||||
[](double z) { return P((2*z*z - 3*z + 1)/(5*z*z - 5*z + 1),(-z*z + 2*z - 1)/(2*z*z - 1),z); },
|
||||
prec),
|
||||
create_polyline((2.23606-1.)/2,1.,P(1./2,(2.23606-1.)/2,(2.23606-1.)/2), P(1.,1./2,1./2),
|
||||
create_polyline((CGAL_SQRT5-1.)/2,1.,P(1./2,(CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1.)/2), P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,(-2 + 5*x - std::sqrt(4 - 8*x + 5*x*x))/(2*(-3 + 5*x)),(-2 + 4*x - x*x + x*std::sqrt(4 - 8*x + 5*x*x))/(2*(-1 + 2*x + x*x)) ); },
|
||||
prec),
|
||||
create_polyline(1./2,1., P(1./2,1.,1./2),P(1.,1./2,1./2),
|
||||
[](double x) { return P(x,x/(-1 + 3*x),1./2); },
|
||||
prec),
|
||||
create_polyline((2.23606-1.)/2,1., P(1./2,(2.23606-1.)/2,(2.23606-1.)/2),P(1./2,1.,1./2),
|
||||
create_polyline((CGAL_SQRT5-1.)/2,1., P(1./2,(CGAL_SQRT5-1.)/2,(CGAL_SQRT5-1.)/2),P(1./2,1.,1./2),
|
||||
[](double y) { return P(1./2,y,1./(y+1)); },
|
||||
prec),
|
||||
};
|
||||
|
|
@ -4005,6 +4007,10 @@ public:
|
|||
{ 01234567_c, CGAL::Mesh_3::poly01234567 }
|
||||
};
|
||||
};// end triple_lines_extractor
|
||||
|
||||
#undef CGAL_SQRT65
|
||||
#undef CGAL_SQRT17
|
||||
|
||||
}// end namespace Mesh 3
|
||||
}// end namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,165 @@
|
|||
// Copyright (c) 2023 GeometryFactory
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Jane Tournois
|
||||
|
||||
#ifndef CGAL_MESH_3_POSTPROCESS_LABEL_WEIGHTS_H
|
||||
#define CGAL_MESH_3_POSTPROCESS_LABEL_WEIGHTS_H
|
||||
|
||||
#include <CGAL/license/Mesh_3.h>
|
||||
|
||||
#include <CGAL/Image_3.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Mesh_3 {
|
||||
namespace internal {
|
||||
|
||||
template<typename Word_type>
|
||||
void set_voxel(CGAL::Image_3& img,
|
||||
const std::size_t& i,
|
||||
const std::size_t& j,
|
||||
const std::size_t& k,
|
||||
const Word_type& w)
|
||||
{
|
||||
using CGAL::IMAGEIO::static_evaluate;
|
||||
|
||||
if (i == std::size_t(-1) || j == std::size_t(-1) || k == std::size_t(-1))
|
||||
return;
|
||||
else if (i > img.xdim() - 1 || j > img.ydim() - 1 || k > img.zdim() - 1)
|
||||
return;
|
||||
else
|
||||
static_evaluate<Word_type>(img.image(), i, j, k) = w;
|
||||
}
|
||||
|
||||
template<typename Word_type>
|
||||
void set_voxels(CGAL::Image_3& weights,
|
||||
const std::vector<std::array<std::size_t, 3>>& black_voxels,
|
||||
const Word_type& wblack)
|
||||
{
|
||||
for (auto v : black_voxels)
|
||||
{
|
||||
const std::size_t& i = v[0];
|
||||
const std::size_t& j = v[1];
|
||||
const std::size_t& k = v[2];
|
||||
|
||||
// i - 1 : 9 voxels
|
||||
internal::set_voxel(weights, i - 1, j - 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i - 1, j - 1, k, wblack);
|
||||
internal::set_voxel(weights, i - 1, j - 1, k + 1, wblack);
|
||||
internal::set_voxel(weights, i - 1, j, k - 1, wblack);
|
||||
internal::set_voxel(weights, i - 1, j, k, wblack);
|
||||
internal::set_voxel(weights, i - 1, j, k + 1, wblack);
|
||||
internal::set_voxel(weights, i - 1, j + 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i - 1, j + 1, k, wblack);
|
||||
internal::set_voxel(weights, i - 1, j + 1, k + 1, wblack);
|
||||
|
||||
// i : 9 voxels
|
||||
internal::set_voxel(weights, i, j - 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i, j - 1, k, wblack);
|
||||
internal::set_voxel(weights, i, j - 1, k + 1, wblack);
|
||||
internal::set_voxel(weights, i, j, k - 1, wblack);
|
||||
internal::set_voxel(weights, i, j, k, wblack);
|
||||
internal::set_voxel(weights, i, j, k + 1, wblack);
|
||||
internal::set_voxel(weights, i, j + 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i, j + 1, k, wblack);
|
||||
internal::set_voxel(weights, i, j + 1, k + 1, wblack);
|
||||
|
||||
// i + 1 : 9 voxels
|
||||
internal::set_voxel(weights, i + 1, j - 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i + 1, j - 1, k, wblack);
|
||||
internal::set_voxel(weights, i + 1, j - 1, k + 1, wblack);
|
||||
internal::set_voxel(weights, i + 1, j, k - 1, wblack);
|
||||
internal::set_voxel(weights, i + 1, j, k, wblack);
|
||||
internal::set_voxel(weights, i + 1, j, k + 1, wblack);
|
||||
internal::set_voxel(weights, i + 1, j + 1, k - 1, wblack);
|
||||
internal::set_voxel(weights, i + 1, j + 1, k, wblack);
|
||||
internal::set_voxel(weights, i + 1, j + 1, k + 1, wblack);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG
|
||||
_writeImage(weights.image(), "weights-image_postprocessed.inr.gz");
|
||||
#endif
|
||||
}
|
||||
|
||||
// POLYLINES ON CUBE BOUNDARY
|
||||
template<typename Image_word_type>
|
||||
void feature_voxels_on_image_bbox(const CGAL::Image_3& image,
|
||||
std::vector<std::array<std::size_t, 3>>& black_voxels)
|
||||
{
|
||||
const std::size_t& xdim = image.xdim();
|
||||
const std::size_t& ydim = image.ydim();
|
||||
const std::size_t& zdim = image.zdim();
|
||||
|
||||
const std::size_t wx = (std::max)(xdim - 1, std::size_t(1));
|
||||
const std::size_t wy = (std::max)(ydim - 1, std::size_t(1));
|
||||
const std::size_t wz = (std::max)(zdim - 1, std::size_t(1));
|
||||
|
||||
for (int axis = 0; axis < 3; ++axis)
|
||||
{
|
||||
for (std::size_t i = 0; i < xdim; i += (axis == 0 ? wx : 1))
|
||||
for (std::size_t j = 0; j < ydim; j += (axis == 1 ? wy : 1))
|
||||
for (std::size_t k = 0; k < zdim; k += (axis == 2 ? wz : 1))
|
||||
{
|
||||
typedef std::array<std::size_t, 3> Pixel;
|
||||
|
||||
Pixel pix00 = { {i , j , k } },
|
||||
pix10 = pix00, pix01 = pix00, pix11 = pix00;
|
||||
|
||||
const int axis_xx = (axis + 1) % 3;
|
||||
const int axis_yy = (axis + 2) % 3;
|
||||
|
||||
++pix10[axis_xx];
|
||||
++pix11[axis_xx]; ++pix11[axis_yy];
|
||||
++pix01[axis_yy];
|
||||
if (pix11[0] >= xdim || pix11[1] >= ydim || pix11[2] >= zdim) {
|
||||
// we have gone too far
|
||||
continue;
|
||||
}
|
||||
|
||||
struct Enriched_pixel {
|
||||
Pixel pixel;
|
||||
Image_word_type word;
|
||||
};
|
||||
|
||||
std::array<std::array<Enriched_pixel, 2>, 2> square =
|
||||
{ { {{ { pix00, Image_word_type() },
|
||||
{ pix01, Image_word_type() } }},
|
||||
{{ { pix10, Image_word_type() },
|
||||
{ pix11, Image_word_type() } }} } };
|
||||
|
||||
std::map<Image_word_type, int> pixel_values_set;
|
||||
for (int ii = 0; ii < 2; ++ii) {
|
||||
for (int jj = 0; jj < 2; ++jj) {
|
||||
const Pixel& pixel = square[ii][jj].pixel;
|
||||
short sum_faces =
|
||||
((0 == pixel[0] || (xdim - 1) == pixel[0]) ? 1 : 0)
|
||||
+ ((0 == pixel[1] || (ydim - 1) == pixel[1]) ? 1 : 0)
|
||||
+ ((0 == pixel[2] || (zdim - 1) == pixel[2]) ? 1 : 0);
|
||||
|
||||
square[ii][jj].word = CGAL::IMAGEIO::static_evaluate<Image_word_type>
|
||||
(image.image(), pixel[0], pixel[1], pixel[2]);
|
||||
++pixel_values_set[square[ii][jj].word];
|
||||
|
||||
if (pixel_values_set.size() > 1 || sum_faces > 1/*on edge of bbox*/)
|
||||
black_voxels.push_back({ i, j, k });
|
||||
}
|
||||
}//end for loops on ii, jj
|
||||
}//end for loops on i,j,k
|
||||
}//end for loop on axis
|
||||
}
|
||||
|
||||
}//end namespace internal
|
||||
}//namespace Mesh_3
|
||||
}//namespace CGAL
|
||||
|
||||
#endif // CGAL_MESH_3_POSTPROCESS_LABEL_WEIGHTS_H
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
#include <vector>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <algorithm>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Mesh_3 {
|
||||
|
|
@ -111,7 +112,7 @@ SIGN get_sign()
|
|||
#ifdef CGAL_MESH_3_WEIGHTED_IMAGES_DEBUG
|
||||
template<typename Image_word_type>
|
||||
void convert_itk_to_image_3(itk::Image<Image_word_type, 3>* const itk_img,
|
||||
const char* filename)
|
||||
const char* filename = "")
|
||||
{
|
||||
auto t = itk_img->GetOrigin();
|
||||
auto v = itk_img->GetSpacing();
|
||||
|
|
@ -138,7 +139,8 @@ void convert_itk_to_image_3(itk::Image<Image_word_type, 3>* const itk_img,
|
|||
itk_img->GetBufferPointer() + size,
|
||||
img_ptr);
|
||||
|
||||
_writeImage(img, filename);
|
||||
if(!std::string(filename).empty())
|
||||
_writeImage(img, filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -147,7 +149,7 @@ void convert_itk_to_image_3(itk::Image<Image_word_type, 3>* const itk_img,
|
|||
/// @cond INTERNAL
|
||||
template<typename Image_word_type>
|
||||
CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& image,
|
||||
const float& sigma)
|
||||
const float& sigma)
|
||||
{
|
||||
typedef unsigned char Weights_type; //from 0 t 255
|
||||
const std::size_t img_size = image.size();
|
||||
|
|
@ -309,9 +311,8 @@ CGAL::Image_3 generate_label_weights_with_known_word_type(const CGAL::Image_3& i
|
|||
* @returns a `CGAL::Image_3` of weights used to build a quality `Labeled_mesh_domain_3`,
|
||||
* with the same dimensions as `image`
|
||||
*/
|
||||
inline
|
||||
CGAL::Image_3 generate_label_weights(const CGAL::Image_3& image,
|
||||
const float& sigma)
|
||||
template<typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL::Image_3 generate_label_weights(const CGAL::Image_3& image, const float& sigma)
|
||||
{
|
||||
CGAL_IMAGE_IO_CASE(image.image(),
|
||||
return generate_label_weights_with_known_word_type<Word>(image, sigma);
|
||||
|
|
|
|||
|
|
@ -593,6 +593,7 @@ polylines_to_protect
|
|||
(*scalar_interpolation_value));
|
||||
}
|
||||
++pixel_values_set[square[ii][jj].domain];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1133,6 +1134,22 @@ polylines_to_protect(const CGAL::Image_3& cgal_image,
|
|||
existing_polylines_end);
|
||||
}
|
||||
|
||||
template <typename P,
|
||||
typename Image_word_type,
|
||||
typename PolylineInputIterator>
|
||||
void
|
||||
polylines_to_protect_on_bbox(const CGAL::Image_3& cgal_image,
|
||||
std::vector<std::vector<P> >& polylines,
|
||||
PolylineInputIterator existing_polylines_begin,
|
||||
PolylineInputIterator existing_polylines_end)
|
||||
{
|
||||
polylines_to_protect<P, Image_word_type>(cgal_image,
|
||||
polylines,
|
||||
existing_polylines_begin,
|
||||
existing_polylines_end);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename PolylineRange1, typename PolylineRange2>
|
||||
void
|
||||
|
|
|
|||
|
|
@ -28,27 +28,77 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
* @ingroup PkgMesh3DomainFields
|
||||
* The class `Mesh_constant_domain_field_3` is a model of concept `MeshDomainField_3`. It provides
|
||||
* a constant field accessible using queries on 3D-points.
|
||||
*
|
||||
* The class `Mesh_constant_domain_field_3` can also be customized through `set_size()` operations to become
|
||||
* a piecewise constant field, i.e. a sizing field with a constant size on each subpart
|
||||
* of the domain.
|
||||
*
|
||||
* @tparam Gt is the geometric traits class. It must match the type `Triangulation::Geom_traits`,
|
||||
* where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used
|
||||
* in the meshing process.
|
||||
*
|
||||
* @tparam Index_ is the type of index of the vertices of the triangulation.
|
||||
* It must match the type `%Index` of the model of `MeshDomain_3` used in the meshing process.
|
||||
*
|
||||
* @cgalModels `MeshDomainField_3`
|
||||
*/
|
||||
template <typename Gt, typename Index_>
|
||||
class Mesh_constant_domain_field_3
|
||||
{
|
||||
public:
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
* Numerical type.
|
||||
*/
|
||||
typedef typename Gt::FT FT;
|
||||
typedef typename boost::mpl::eval_if_c<
|
||||
|
||||
/*!
|
||||
* Point type.
|
||||
*/
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
typedef Gt::Point_3 Point_3;
|
||||
#else
|
||||
typedef typename boost::mpl::eval_if_c<
|
||||
internal::Has_nested_type_Bare_point<Gt>::value,
|
||||
typename internal::Bare_point_type<Gt>,
|
||||
boost::mpl::identity<typename Gt::Point_3>
|
||||
>::type Point_3;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* Type of index of the vertices of the triangulation.
|
||||
*/
|
||||
typedef Index_ Index;
|
||||
|
||||
/// @}
|
||||
|
||||
private:
|
||||
// Map to store field values
|
||||
typedef std::map<std::pair<int,Index>,FT> Values;
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
Mesh_constant_domain_field_3(const FT& d) : d_(d) {}
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/// Returns size
|
||||
/*!
|
||||
* Builds a constant domain field with size `size`.
|
||||
*/
|
||||
Mesh_constant_domain_field_3(const FT& size) : d_(size) {}
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
* Returns the size of query points of dimension `dim` and index `index`.
|
||||
*/
|
||||
FT operator()(const Point_3&, const int dim, const Index& index) const
|
||||
{
|
||||
typename Values::const_iterator it = values_.find(std::make_pair(dim,index));
|
||||
|
|
@ -57,11 +107,15 @@ public:
|
|||
return d_;
|
||||
}
|
||||
|
||||
/// Sets size at any point of dimension `dim` and index `index`.
|
||||
/*!
|
||||
* Sets the size such that `operator()` for any query point
|
||||
* of dimension `dim` and index `index` returns `size`.
|
||||
*/
|
||||
void set_size(const FT& size, const int dim, const Index& index)
|
||||
{
|
||||
values_.insert(std::make_pair(std::make_pair(dim,index),size));
|
||||
}
|
||||
/// @}
|
||||
|
||||
private:
|
||||
// default value
|
||||
|
|
|
|||
|
|
@ -17,34 +17,65 @@
|
|||
|
||||
#include <CGAL/Profile_counter.h>
|
||||
#include <CGAL/Delaunay_triangulation_3.h>
|
||||
#include "Facet_patch_id_map.h"
|
||||
#include "Get_curve_index.h"
|
||||
#include <CGAL/Mesh_3/Protect_edges_sizing_field.h> // for weight_modifier
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <limits>
|
||||
|
||||
#include <CGAL/Mesh_3/experimental/Facet_patch_id_map.h>
|
||||
#include <CGAL/Mesh_3/experimental/Get_curve_index.h>
|
||||
#include <CGAL/Mesh_3/experimental/AABB_filtered_projection_traits.h>
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#if defined(CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY) || defined(CGAL_NO_ASSERTIONS) == 0
|
||||
# include <sstream>
|
||||
# include <boost/format.hpp>
|
||||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY || (! CGAL_NO_ASSERTIONS)
|
||||
|
||||
#include "AABB_filtered_projection_traits.h"
|
||||
namespace CGAL {
|
||||
/*!
|
||||
* @ingroup PkgMesh3DomainFields
|
||||
*
|
||||
* The class `Sizing_field_with_aabb_tree` is a model of concept `MeshDomainField_3`.
|
||||
* It provides a sizing field to be used in the meshing process of a polyhedral surface with features.
|
||||
*
|
||||
* At each query point `p`, the field value is the minimum of the distances to
|
||||
* - the surface patches `p` does not belong to, and
|
||||
* - for each curve `C` it does belong to, the intersection points of `C` with
|
||||
* the plane orthogonal to `C` and passing through `p`.
|
||||
*
|
||||
* This sizing field is designed to be used for the edges of the mesh complex,
|
||||
* in `Mesh_edge_criteria_3` or as `edge_size` in `Mesh_criteria_3`.
|
||||
* Using this sizing field for complex edges provides a high-quality hint
|
||||
* to the protecting balls placement algorithm, since it ensures that no
|
||||
* protecting ball will intersect a surface patch to which the
|
||||
* corresponding vertex does not belong.
|
||||
*
|
||||
* @tparam GeomTraits is the geometric traits class. It must match the type `Triangulation::Geom_traits`,
|
||||
* where `Triangulation` is the nested type of the model of `MeshComplex_3InTriangulation_3` used
|
||||
* in the meshing process.
|
||||
* @tparam MeshDomain is the type of the domain. It must be a model of `MeshDomainWithFeatures_3`,
|
||||
* and derive from `CGAL::Polyhedral_mesh_domain_with_features_3`
|
||||
|
||||
template <typename GeomTraits, typename MeshDomain,
|
||||
typename Input_facets_AABB_tree = typename MeshDomain::AABB_tree,
|
||||
typename Get_curve_index_ = CGAL::Default,
|
||||
typename Facet_patch_id_map_ = CGAL::Default
|
||||
|
||||
* @cgalModels `MeshDomainField_3`
|
||||
*/
|
||||
template <typename GeomTraits,
|
||||
typename MeshDomain
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename Input_facets_AABB_tree_ = CGAL::Default
|
||||
, typename Get_curve_index_ = CGAL::Default
|
||||
, typename Facet_patch_id_map_ = CGAL::Default
|
||||
#endif
|
||||
>
|
||||
struct Sizing_field_with_aabb_tree
|
||||
{
|
||||
typedef GeomTraits Kernel_;
|
||||
typedef typename Kernel_::FT FT;
|
||||
typedef typename Kernel_::Point_3 Point_3;
|
||||
using FT = typename GeomTraits::FT;
|
||||
using Point_3 = typename GeomTraits::Point_3;
|
||||
using Index = typename MeshDomain::Index;
|
||||
|
||||
typedef typename MeshDomain::Index Index;
|
||||
private:
|
||||
typedef typename MeshDomain::Corner_index Corner_index;
|
||||
typedef typename MeshDomain::Curve_index Curve_index;
|
||||
typedef typename MeshDomain::Surface_patch_index Patch_index;
|
||||
|
|
@ -58,28 +89,52 @@ struct Sizing_field_with_aabb_tree
|
|||
typedef std::vector<Patches_ids> Corners_incident_patches;
|
||||
typedef std::vector<Patches_ids> Curves_incident_patches;
|
||||
|
||||
typedef GeomTraits Kernel_;
|
||||
typedef CGAL::Delaunay_triangulation_3<Kernel_> Dt;
|
||||
|
||||
typedef Input_facets_AABB_tree Input_facets_AABB_tree_;
|
||||
typedef typename Input_facets_AABB_tree_::AABB_traits AABB_traits;
|
||||
using Point_and_primitive_id = typename AABB_traits::Point_and_primitive_id;
|
||||
typedef typename Input_facets_AABB_tree_::Primitive Input_facets_AABB_tree_primitive_;
|
||||
typedef typename MeshDomain::Curves_AABB_tree Input_curves_AABB_tree_;
|
||||
using Input_facets_AABB_tree = typename CGAL::Default::Get<
|
||||
Input_facets_AABB_tree_,
|
||||
typename MeshDomain::AABB_tree
|
||||
>::type;
|
||||
using AABB_traits = typename Input_facets_AABB_tree::AABB_traits;
|
||||
using Point_and_primitive_id = typename AABB_traits::Point_and_primitive_id;
|
||||
typedef typename Input_facets_AABB_tree::Primitive Input_facets_AABB_tree_primitive_;
|
||||
typedef typename MeshDomain::Curves_AABB_tree Input_curves_AABB_tree_;
|
||||
typedef typename Input_curves_AABB_tree_::Primitive Input_curves_AABB_tree_primitive_;
|
||||
|
||||
typedef typename CGAL::Default::Get<
|
||||
using Get_curve_index = typename CGAL::Default::Get<
|
||||
Get_curve_index_,
|
||||
CGAL::Mesh_3::Get_curve_index<typename MeshDomain::Curves_AABB_tree::Primitive>
|
||||
>::type Get_curve_index;
|
||||
typedef typename CGAL::Default::Get<
|
||||
>::type;
|
||||
using Facet_patch_id_map = typename CGAL::Default::Get<
|
||||
Facet_patch_id_map_,
|
||||
CGAL::Mesh_3::Facet_patch_id_map<MeshDomain,
|
||||
typename Input_facets_AABB_tree::Primitive>
|
||||
>::type Facet_patch_id_map;
|
||||
>::type;
|
||||
|
||||
public:
|
||||
/// \name Creation
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
* Constructor for the sizing field.
|
||||
* @param d the maximal value returned by `operator()`, corresponding
|
||||
* to an upper bound on feature edge lengths in the output mesh.
|
||||
* @param domain the mesh domain to be meshed
|
||||
*/
|
||||
Sizing_field_with_aabb_tree(const FT& d, const MeshDomain& domain)
|
||||
: Sizing_field_with_aabb_tree(d,
|
||||
domain,
|
||||
domain.aabb_tree(),
|
||||
Get_curve_index(),
|
||||
Facet_patch_id_map())
|
||||
{}
|
||||
|
||||
/// @}
|
||||
|
||||
struct Face_ids_traversal_traits {
|
||||
using Limits = std::numeric_limits<Patch_index>;
|
||||
Patch_index min{Limits::max()};
|
||||
Patch_index min{(Limits::max)()};
|
||||
Patch_index max{Limits::lowest()};
|
||||
Facet_patch_id_map index_map{};
|
||||
|
||||
|
|
@ -93,16 +148,17 @@ struct Sizing_field_with_aabb_tree
|
|||
}
|
||||
};
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
Sizing_field_with_aabb_tree
|
||||
(typename Kernel_::FT d,
|
||||
const Input_facets_AABB_tree_& aabb_tree,
|
||||
(const typename Kernel_::FT d,
|
||||
const MeshDomain& domain,
|
||||
const Input_facets_AABB_tree& aabb_tree,
|
||||
Get_curve_index get_curve_index = Get_curve_index(),
|
||||
Facet_patch_id_map facet_patch_id_map = Facet_patch_id_map()
|
||||
)
|
||||
: d_ptr{std::make_shared<Private_data>(d,
|
||||
aabb_tree,
|
||||
domain,
|
||||
aabb_tree,
|
||||
get_curve_index,
|
||||
facet_patch_id_map)}
|
||||
{
|
||||
|
|
@ -258,7 +314,17 @@ struct Sizing_field_with_aabb_tree
|
|||
result = projection_traits.closest_point_and_primitive();
|
||||
return result;
|
||||
}
|
||||
#endif // DOXYGEN_RUNNING
|
||||
|
||||
public:
|
||||
/// \name Operations
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
* returns the value of the sizing field at the point `p`,
|
||||
* assumed to be included in the input complex feature with dimension `dimension`
|
||||
* and mesh subcomplex index `id`.
|
||||
*/
|
||||
double operator()(const Point_3& p,
|
||||
const int dim,
|
||||
const Index& id) const
|
||||
|
|
@ -270,7 +336,7 @@ struct Sizing_field_with_aabb_tree
|
|||
<< ", index=#" << CGAL::IO::oformat(id) << "): ";
|
||||
}
|
||||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
double result = d_ptr->d_;
|
||||
FT result = d_ptr->d_;
|
||||
if(dim == 0) {
|
||||
if(d_ptr->dt.dimension() < 1) {
|
||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
|
|
@ -311,7 +377,7 @@ struct Sizing_field_with_aabb_tree
|
|||
}
|
||||
const FT dist = CGAL_NTS sqrt(CGAL::squared_distance( nearest, p));
|
||||
// std::cerr << (std::min)(dist / FT(1.5), d_) << "\n";
|
||||
result = (std::min)(dist / FT(2), result);
|
||||
result = (std::min)(dist * FT(0.5), result);
|
||||
|
||||
// now search in the AABB tree
|
||||
typename Corners_indices::const_iterator ids_it =
|
||||
|
|
@ -327,10 +393,10 @@ struct Sizing_field_with_aabb_tree
|
|||
|
||||
if(closest_point_and_primitive != boost::none) {
|
||||
result =
|
||||
(std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
(std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
CGAL_NTS
|
||||
sqrt(CGAL::squared_distance(p,
|
||||
closest_point_and_primitive->first)),
|
||||
closest_point_and_primitive->first))),
|
||||
result);
|
||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
{
|
||||
|
|
@ -395,10 +461,10 @@ struct Sizing_field_with_aabb_tree
|
|||
closest_point_and_primitive->second)) == 0);
|
||||
|
||||
result =
|
||||
(std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
(std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
CGAL_NTS
|
||||
sqrt(CGAL::squared_distance(p,
|
||||
closest_point_and_primitive->first)),
|
||||
closest_point_and_primitive->first))),
|
||||
result);
|
||||
|
||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
|
|
@ -562,9 +628,9 @@ struct Sizing_field_with_aabb_tree
|
|||
std::cerr << " closest_point: " << closest_intersection << "\n"
|
||||
<< " distance = " << CGAL_NTS sqrt(sqd_intersection) << std::endl;
|
||||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
double new_result =
|
||||
(std::min)(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
CGAL_NTS sqrt(sqd_intersection),
|
||||
FT new_result =
|
||||
(std::min)(FT(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) *
|
||||
CGAL_NTS sqrt(sqd_intersection)),
|
||||
d_ptr->d_);
|
||||
|
||||
#ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
|
|
@ -597,23 +663,27 @@ struct Sizing_field_with_aabb_tree
|
|||
#endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY
|
||||
return result;
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
||||
private:
|
||||
using Kd_tree = CGAL::AABB_search_tree<AABB_traits>;
|
||||
struct Private_data {
|
||||
using FT = typename Kernel_::FT;
|
||||
Private_data(FT d, const Input_facets_AABB_tree_& aabb_tree,
|
||||
Private_data(FT d,
|
||||
const MeshDomain& domain,
|
||||
const Input_facets_AABB_tree& aabb_tree,
|
||||
Get_curve_index get_curve_index,
|
||||
Facet_patch_id_map facet_patch_id_map)
|
||||
: d_(d)
|
||||
, aabb_tree(aabb_tree)
|
||||
, domain(domain)
|
||||
, aabb_tree(aabb_tree)
|
||||
, get_curve_index(get_curve_index)
|
||||
, facet_patch_id_map(facet_patch_id_map)
|
||||
{}
|
||||
FT d_;
|
||||
const Input_facets_AABB_tree_& aabb_tree;
|
||||
const MeshDomain& domain;
|
||||
const Input_facets_AABB_tree& aabb_tree;
|
||||
Get_curve_index get_curve_index;
|
||||
Facet_patch_id_map facet_patch_id_map;
|
||||
Dt dt{};
|
||||
|
|
@ -628,4 +698,6 @@ private:
|
|||
std::shared_ptr<Private_data> d_ptr;
|
||||
};
|
||||
|
||||
}//end namespace CGAL
|
||||
|
||||
#endif // CGAL_MESH_3_SIZING_FIELD_WITH_AABB_TREE_H
|
||||
|
|
@ -81,20 +81,20 @@ int main()
|
|||
Mc ec3(edge_sizing_field = 3.);
|
||||
assert( ec3.edge_criteria_object().sizing_field(bp1,1,index) == 3 );
|
||||
|
||||
Mc ec4(edge_size = 4.1,
|
||||
edge_sizing_field = Esf(4.2));
|
||||
assert( ec4.edge_criteria_object().sizing_field(bp1,1,index) == 4.1 );
|
||||
Mc ec4(edge_size = 4.,
|
||||
edge_sizing_field = Esf(5.));
|
||||
assert( ec4.edge_criteria_object().sizing_field(bp1,1,index) == 4. );
|
||||
|
||||
Mc ec5(sizing_field = 5.);
|
||||
assert( ec5.edge_criteria_object().sizing_field(bp1,1,index) == 5 );
|
||||
|
||||
Mc ec6(sizing_field = 6.1,
|
||||
edge_sizing_field = 6.2);
|
||||
assert( ec6.edge_criteria_object().sizing_field(bp1,1,index) == 6.2 );
|
||||
Mc ec6(sizing_field = 6.,
|
||||
edge_sizing_field = 7.);
|
||||
assert( ec6.edge_criteria_object().sizing_field(bp1,1,index) == 7. );
|
||||
|
||||
Mc ec7(sizing_field = 7.1,
|
||||
edge_size = 7.2);
|
||||
assert( ec7.edge_criteria_object().sizing_field(bp1,1,index) == 7.2 );
|
||||
Mc ec7(sizing_field = 7.,
|
||||
edge_size = 8.);
|
||||
assert( ec7.edge_criteria_object().sizing_field(bp1,1,index) == 8. );
|
||||
|
||||
|
||||
// -----------------------------------
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#define CGAL_MESH_3_VERBOSE 1
|
||||
// Copyright (c) 2009 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
|
|
@ -48,7 +49,7 @@ public:
|
|||
<< CGAL::get_default_random().get_seed() << std::endl;
|
||||
Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain
|
||||
(image,
|
||||
CGAL::parameters::relative_error_bound = 1e-9,
|
||||
CGAL::parameters::relative_error_bound = 1e-6,
|
||||
CGAL::parameters::p_rng = &CGAL::get_default_random());
|
||||
|
||||
// Set mesh criteria
|
||||
|
|
@ -78,6 +79,7 @@ public:
|
|||
|
||||
int main()
|
||||
{
|
||||
std::cerr.precision(17);
|
||||
Image_tester<> test_epic;
|
||||
std::cerr << "Mesh generation from a 3D image:\n";
|
||||
test_epic.image();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#define CGAL_MESH_3_VERBOSE 1
|
||||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
|
||||
#include "test_meshing_utilities.h"
|
||||
|
|
@ -33,7 +34,7 @@ public:
|
|||
|
||||
std::cout << "\tSeed is\t"
|
||||
<< CGAL::get_default_random().get_seed() << std::endl;
|
||||
Mesh_domain domain(image, 1e-9, &CGAL::get_default_random());
|
||||
Mesh_domain domain(image, 1e-6, &CGAL::get_default_random());
|
||||
|
||||
// Set mesh criteria
|
||||
Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx());
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ struct Tester
|
|||
continue;
|
||||
|
||||
max_sqd = (std::max)(max_sqd,
|
||||
aabb_tree.squared_distance(CGAL::centroid(tr.triangle(f))));
|
||||
CGAL::to_double(aabb_tree.squared_distance(CGAL::centroid(tr.triangle(f)))));
|
||||
}
|
||||
double hdist = std::sqrt(max_sqd);
|
||||
std::cout << "\tHausdorff distance to polyhedron is " << hdist << std::endl;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,11 @@ template <> class Real_embeddable_traits< CORE::Expr >
|
|||
};
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
inline const CORE::Expr& approx(const CORE::Expr& d) { return d; }
|
||||
inline const CORE::Expr& exact(const CORE::Expr& d) { return d; }
|
||||
inline int depth(const CORE::Expr&){ return -1; }
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
//since types are included by CORE_coercion_traits.h:
|
||||
#include <CGAL/CORE_BigInt.h>
|
||||
|
|
|
|||
|
|
@ -204,6 +204,10 @@ public:
|
|||
};
|
||||
|
||||
|
||||
inline const leda_real& approx(const leda_real& d) { return d; }
|
||||
inline const leda_real& exact(const leda_real& d) { return d; }
|
||||
inline int depth(const leda_real&){ return -1; }
|
||||
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@
|
|||
|
||||
#include <CGAL/config.h>
|
||||
|
||||
#define CGAL_PI 3.14159265358979323846
|
||||
#define CGAL_PI 3.141592653589793238462643383279502884
|
||||
#define CGAL_SQRT2 1.414213562373095048801688724209698078
|
||||
#define CGAL_SQRT3 1.732050807568877293527446341505872366
|
||||
#define CGAL_SQRT5 2.236067977499789696409173668731276235
|
||||
|
||||
|
||||
#ifdef CGAL_USE_NTS_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public:
|
|||
Simplex offspring;
|
||||
for(int j=0; j<4; ++j)
|
||||
{
|
||||
const FT r{m_rng.get_double()};
|
||||
const FT r{m_rng.uniform_01<FT>()};
|
||||
const FT fitnessA = m_population[group1[i]][j].fitness();
|
||||
const FT fitnessB = m_population[group2[i]][j].fitness();
|
||||
const FT threshold = (fitnessA < fitnessB) ? uweight : lweight;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,10 @@ compute_fitness(const typename Traits::Matrix& R, // rotation matrix
|
|||
CGAL_assertion(points.size() >= 3);
|
||||
|
||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||
//cast from double to float looses data, so cast with {} is not allowed
|
||||
//cast from double to exact types also works
|
||||
xmin = ymin = zmin = FT((std::numeric_limits<double>::max)());
|
||||
xmax = ymax = zmax = FT(std::numeric_limits<double>::lowest());
|
||||
|
||||
for(const Point& pt : points)
|
||||
{
|
||||
|
|
@ -81,8 +83,10 @@ compute_fitness_if_smaller(const typename Traits::Matrix& R, // rotation matrix
|
|||
CGAL_assertion(points.size() >= 3);
|
||||
|
||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||
//cast from double to float looses data, so cast with {} is not allowed
|
||||
//cast from double to exact types also works
|
||||
xmin = ymin = zmin = FT((std::numeric_limits<double>::max)());
|
||||
xmax = ymax = zmax = FT(std::numeric_limits<double>::lowest());
|
||||
|
||||
// compute every 1%, with a minimum of 1000 iterations
|
||||
const std::size_t pn = points.size();
|
||||
|
|
|
|||
|
|
@ -104,7 +104,9 @@ compute_2D_deviation(const PointRange& points,
|
|||
if(theta > 0.25 * CGAL_PI) // @todo is there a point to this
|
||||
theta = 0.5 * CGAL_PI - theta;
|
||||
|
||||
return std::make_pair(pol.area(), FT{theta});
|
||||
//cast from double to float looses data, so cast with {} is not allowed
|
||||
//cast from double to exact types also works
|
||||
return std::make_pair(pol.area(), FT(theta));
|
||||
}
|
||||
|
||||
template <typename PointRange, typename Traits>
|
||||
|
|
@ -123,8 +125,10 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot,
|
|||
rotated_points.reserve(points.size());
|
||||
|
||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||
//cast from double to float looses data, so cast with {} is not allowed
|
||||
//cast from double to exact types also works
|
||||
xmin = ymin = zmin = FT((std::numeric_limits<double>::max)());
|
||||
xmax = ymax = zmax = FT(std::numeric_limits<double>::lowest());
|
||||
|
||||
for(const Point& pt : points)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -121,7 +121,9 @@ public:
|
|||
Vertex& get_best_vertex()
|
||||
{
|
||||
std::size_t simplex_id = static_cast<std::size_t>(-1), vertex_id = static_cast<std::size_t>(-1);
|
||||
FT best_fitness = FT{(std::numeric_limits<double>::max)()};
|
||||
//cast from double to float looses data, so cast with {} is not allowed
|
||||
//cast from double to exact types also works
|
||||
FT best_fitness = FT((std::numeric_limits<double>::max)());
|
||||
for(std::size_t i=0, ps=m_simplices.size(); i<ps; ++i)
|
||||
{
|
||||
for(std::size_t j=0; j<4; ++j)
|
||||
|
|
|
|||
|
|
@ -3859,7 +3859,7 @@ Periodic_3_triangulation_3<GT,TDS>::get_cell(const Vertex_handle* vh) const
|
|||
}
|
||||
|
||||
/*! \brief gets the offset of tester.point() such that
|
||||
* this point is in conflict with c w.r.t tester.get_offset().
|
||||
* this point is in conflict with c w.r.t. tester.get_offset().
|
||||
*
|
||||
* Implementation: Just try all eight possibilities.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -84,10 +84,11 @@ namespace CGAL {
|
|||
const Point &b,
|
||||
const Point &c)
|
||||
{
|
||||
internal::covariance_matrix_tetrahedron (a[0], a[1], a[2],
|
||||
b[0], b[1], b[2],
|
||||
c[0], c[1], c[2],
|
||||
_result);
|
||||
internal::covariance_matrix_tetrahedron(
|
||||
FT(a[0]), FT(a[1]), FT(a[2]),
|
||||
FT(b[0]), FT(b[1]), FT(b[2]),
|
||||
FT(c[0]), FT(c[1]), FT(c[2]),
|
||||
_result);
|
||||
}
|
||||
|
||||
const Result_type &result() const
|
||||
|
|
@ -192,31 +193,29 @@ namespace CGAL {
|
|||
const Sphere &sphere,
|
||||
FT covariance[6])
|
||||
{
|
||||
typename internal::Covariance_accumulator_3<FT> ca;
|
||||
typename internal::Covariance_accumulator_3<double> ca;
|
||||
internal::tessellate_and_intersect(dt, v, sphere, ca);
|
||||
std::copy (ca.result().begin(), ca.result().end(), covariance);
|
||||
}
|
||||
|
||||
template <class DT, class Sphere>
|
||||
std::array<typename DT::Geom_traits::FT, 6>
|
||||
std::array<double, 6>
|
||||
voronoi_covariance_3 (const DT &dt,
|
||||
typename DT::Vertex_handle v,
|
||||
const Sphere &sphere)
|
||||
{
|
||||
typedef typename DT::Geom_traits::FT FT;
|
||||
typename internal::Covariance_accumulator_3<FT> ca;
|
||||
typename internal::Covariance_accumulator_3<double> ca;
|
||||
|
||||
return internal::tessellate_and_intersect(dt, v, sphere, ca).result();
|
||||
}
|
||||
|
||||
template <class DT, class Sphere>
|
||||
typename DT::Geom_traits::FT
|
||||
double
|
||||
voronoi_volume_3 (const DT &dt,
|
||||
typename DT::Vertex_handle v,
|
||||
const Sphere &sphere)
|
||||
{
|
||||
typedef typename DT::Geom_traits::FT FT;
|
||||
typename internal::Volume_accumulator_3<FT> va;
|
||||
typename internal::Volume_accumulator_3<double> va;
|
||||
|
||||
return internal::tessellate_and_intersect(dt, v, sphere, va).result();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ compute_denoise_projection(
|
|||
FT project_weight_sum = FT(0.0);
|
||||
Vector normal_sum = CGAL::NULL_VECTOR;
|
||||
|
||||
FT cos_sigma = cos(sharpness_angle * CGAL_PI / 180.0);
|
||||
FT sharpness_bandwidth = CGAL::square((CGAL::max)(1e-8, 1 - cos_sigma));
|
||||
FT cos_sigma = cos(FT(sharpness_angle * CGAL_PI / 180.0));
|
||||
FT sharpness_bandwidth = CGAL::square((CGAL::max)(FT(1e-8), FT(1.) - cos_sigma));
|
||||
|
||||
for (typename PointRange::iterator it : neighbor_pwns)
|
||||
{
|
||||
|
|
@ -150,7 +150,7 @@ compute_max_spacing(
|
|||
boost::make_function_output_iterator
|
||||
([&](const typename NeighborQuery::input_iterator& it)
|
||||
{
|
||||
double dist2 = CGAL::squared_distance (get(point_map, vt), get(point_map, *it));
|
||||
FT dist2 = CGAL::squared_distance (get(point_map, vt), get(point_map, *it));
|
||||
max_distance = (CGAL::max)(dist2, max_distance);
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
// Compute the covariance matrix of the set
|
||||
std::array<FT, 6> covariance = {{ 0., 0., 0., 0., 0., 0. }};
|
||||
std::array<double, 6> covariance = {{ 0., 0., 0., 0., 0., 0. }};
|
||||
|
||||
for (typename std::list<Input_type>::iterator it = current_cluster->first.begin ();
|
||||
it != current_cluster->first.end (); ++ it)
|
||||
|
|
@ -257,8 +257,8 @@ namespace CGAL {
|
|||
covariance[5] += d.z () * d.z ();
|
||||
}
|
||||
|
||||
std::array<FT, 3> eigenvalues = {{ 0., 0., 0. }};
|
||||
std::array<FT, 9> eigenvectors = {{ 0., 0., 0.,
|
||||
std::array<double, 3> eigenvalues = {{ 0., 0., 0. }};
|
||||
std::array<double, 9> eigenvectors = {{ 0., 0., 0.,
|
||||
0., 0., 0.,
|
||||
0., 0., 0. }};
|
||||
// Linear algebra = get eigenvalues and eigenvectors for
|
||||
|
|
@ -279,7 +279,7 @@ namespace CGAL {
|
|||
// The plane which splits the point set into 2 point sets:
|
||||
// * Normal to the eigenvector with highest eigenvalue
|
||||
// * Passes through the centroid of the set
|
||||
Vector v (eigenvectors[6], eigenvectors[7], eigenvectors[8]);
|
||||
Vector v (FT(eigenvectors.at(6)), FT(eigenvectors.at(7)), FT(eigenvectors.at(8)));
|
||||
|
||||
std::size_t current_cluster_size = 0;
|
||||
typename std::list<Input_type>::iterator it = current_cluster->first.begin ();
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ void orient_scanline (Iterator begin, Iterator end,
|
|||
const Point_3& p = get (point_map, *it);
|
||||
mean_x += p.x();
|
||||
mean_y += p.y();
|
||||
max_z = (std::max)(max_z, p.z());
|
||||
max_z = (std::max)(max_z, CGAL::to_double(p.z()));
|
||||
++ nb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -502,13 +502,17 @@ Bounded_side bounded_side_2(ForwardIterator first,
|
|||
// uses Traits::Less_xy_2 (used by left_vertex_2)
|
||||
// Traits::orientation_2_object()
|
||||
|
||||
template <class ForwardIterator, class Traits>
|
||||
Orientation orientation_2(ForwardIterator first,
|
||||
ForwardIterator last,
|
||||
const Traits& traits)
|
||||
{
|
||||
CGAL_precondition(is_simple_2(first, last, traits));
|
||||
namespace Polygon {
|
||||
namespace internal {
|
||||
|
||||
// This exists because the "is_simple_2" precondition in the orientation_2() function is in fact
|
||||
// stronger than necessary: it also works for strictly simple polygons, which matters for
|
||||
// Straight line skeletons, as the offset polygons might have non-manifoldness.
|
||||
template <class ForwardIterator, class Traits>
|
||||
Orientation orientation_2_no_precondition(ForwardIterator first,
|
||||
ForwardIterator last,
|
||||
const Traits& traits)
|
||||
{
|
||||
ForwardIterator i = left_vertex_2(first, last, traits);
|
||||
|
||||
ForwardIterator prev = (i == first) ? last : i;
|
||||
|
|
@ -527,6 +531,18 @@ Orientation orientation_2(ForwardIterator first,
|
|||
return traits.orientation_2_object()(Point(*prev), Point(*i), Point(*next));
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Polygon
|
||||
|
||||
template <class ForwardIterator, class Traits>
|
||||
Orientation orientation_2(ForwardIterator first,
|
||||
ForwardIterator last,
|
||||
const Traits& traits)
|
||||
{
|
||||
CGAL_precondition(is_simple_2(first, last, traits));
|
||||
return Polygon::internal::orientation_2_no_precondition(first, last, traits);
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
/// \endcond
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ double max_coordinate(const Polyhedron& poly)
|
|||
for(Polyhedron::Vertex_handle v : vertices(poly))
|
||||
{
|
||||
Point p = v->point();
|
||||
max_coord = (std::max)(max_coord, p.x());
|
||||
max_coord = (std::max)(max_coord, p.y());
|
||||
max_coord = (std::max)(max_coord, p.z());
|
||||
max_coord = (std::max)(max_coord, CGAL::to_double(p.x()));
|
||||
max_coord = (std::max)(max_coord, CGAL::to_double(p.y()));
|
||||
max_coord = (std::max)(max_coord, CGAL::to_double(p.z()));
|
||||
}
|
||||
return max_coord;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ std::size_t border_size(typename boost::graph_traits<PolygonMesh>::halfedge_desc
|
|||
/// @todo It could make sense to also return the length of each cycle.
|
||||
/// @todo It should probably go into BGL package (like the rest of this file).
|
||||
template <typename PolygonMesh, typename OutputIterator>
|
||||
OutputIterator extract_boundary_cycles(PolygonMesh& pm,
|
||||
OutputIterator extract_boundary_cycles(const PolygonMesh& pm,
|
||||
OutputIterator out)
|
||||
{
|
||||
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public:
|
|||
const Eigen_vector& bx, const Eigen_vector& by, const Eigen_vector& bz,
|
||||
SparseLinearSolver& solver)
|
||||
{
|
||||
FT D;
|
||||
double D;
|
||||
|
||||
// calls compute once to factorize with the preconditioner
|
||||
if(!solver.factor(A, D))
|
||||
|
|
|
|||
|
|
@ -428,10 +428,10 @@ public:
|
|||
|
||||
const FT S_av = compute_average_area_around(v);
|
||||
|
||||
const FT initial_x = vp.x();
|
||||
const FT initial_y = vp.y();
|
||||
const FT initial_z = vp.z();
|
||||
FT x = initial_x, y = initial_y, z = initial_z;
|
||||
const double initial_x = CGAL::to_double(vp.x());
|
||||
const double initial_y = CGAL::to_double(vp.y());
|
||||
const double initial_z = CGAL::to_double(vp.z());
|
||||
double x = initial_x, y = initial_y, z = initial_z;
|
||||
|
||||
ceres::Problem problem;
|
||||
|
||||
|
|
@ -468,7 +468,7 @@ public:
|
|||
// std::cout << "y : " << initial_y << " -> " << y << "\n";
|
||||
// std::cout << "z : " << initial_z << " -> " << z << "\n";
|
||||
|
||||
return Vector(x - initial_x, y - initial_y, z - initial_z);
|
||||
return Vector(FT(x - initial_x), FT(y - initial_y), FT(z - initial_z))l;
|
||||
#else
|
||||
CGAL_USE(v);
|
||||
return CGAL::NULL_VECTOR;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct Face_map
|
|||
friend
|
||||
void put(Face_map m, key_type k, value_type v)
|
||||
{
|
||||
put(m.pm, v, m.face_ids[k]);
|
||||
put(m.pm, v, static_cast<key_type>(m.face_ids[k]));
|
||||
}
|
||||
|
||||
PM pm;
|
||||
|
|
@ -604,6 +604,7 @@ bool decimate_impl(const TriangleMesh& tm,
|
|||
typedef typename graph_traits::vertex_descriptor vertex_descriptor;
|
||||
typedef typename graph_traits::face_descriptor face_descriptor;
|
||||
typedef std::pair<std::size_t, std::size_t> Id_pair;
|
||||
typedef typename boost::property_traits<FaceCCIdMap>::value_type PID;
|
||||
|
||||
// compute the new mesh
|
||||
std::vector< std::vector< boost::container::small_vector<std::size_t,3> > > faces_per_cc(nb_corners_and_nb_cc.second);
|
||||
|
|
@ -699,7 +700,7 @@ bool decimate_impl(const TriangleMesh& tm,
|
|||
// we could work on the graph on constraint and recover only the orientation
|
||||
// of the edge. To be done if someone find it too slow.
|
||||
std::vector<halfedge_descriptor> hborders;
|
||||
CGAL::Face_filtered_graph<TriangleMesh> ffg(tm, cc_id, face_cc_ids);
|
||||
CGAL::Face_filtered_graph<TriangleMesh> ffg(tm, static_cast<PID>(cc_id), face_cc_ids);
|
||||
extract_boundary_cycles(ffg, std::back_inserter(hborders));
|
||||
|
||||
if (hborders.size()==1)
|
||||
|
|
@ -738,7 +739,7 @@ bool decimate_impl(const TriangleMesh& tm,
|
|||
#endif
|
||||
all_patches_successfully_remeshed = false;
|
||||
// make all vertices of the patch a corner
|
||||
CGAL::Face_filtered_graph<TriangleMesh> ffg(tm, cc_id, face_cc_ids);
|
||||
CGAL::Face_filtered_graph<TriangleMesh> ffg(tm, static_cast<PID>(cc_id), face_cc_ids);
|
||||
std::vector<vertex_descriptor> new_corners;
|
||||
for (vertex_descriptor v : vertices(ffg))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2446,7 +2446,6 @@ bool remove_self_intersections(const FaceRange& face_range,
|
|||
std::set<face_descriptor> working_face_range(face_range.begin(), face_range.end());
|
||||
|
||||
visitor.start_main_loop();
|
||||
bool self_intersects=false;
|
||||
while(++step < max_steps)
|
||||
{
|
||||
#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG
|
||||
|
|
@ -2485,8 +2484,6 @@ bool remove_self_intersections(const FaceRange& face_range,
|
|||
#endif
|
||||
break;
|
||||
}
|
||||
else
|
||||
self_intersects=true;
|
||||
|
||||
visitor.status_update(faces_to_treat);
|
||||
|
||||
|
|
@ -2517,8 +2514,7 @@ bool remove_self_intersections(const FaceRange& face_range,
|
|||
std::ofstream("results/final.off") << std::setprecision(17) << tmesh;
|
||||
#endif
|
||||
|
||||
if (self_intersects)
|
||||
self_intersects = does_self_intersect(working_face_range, tmesh, parameters::vertex_point_map(vpm).geom_traits(gt));
|
||||
bool self_intersects = does_self_intersect(working_face_range, tmesh, parameters::vertex_point_map(vpm).geom_traits(gt));
|
||||
|
||||
#ifdef CGAL_PMP_REMOVE_SELF_INTERSECTION_DEBUG
|
||||
if(self_intersects)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ const QColor default_mesh_color(45,169,70);
|
|||
#include "split_polylines.h"
|
||||
#include <CGAL/Mesh_facet_topology.h>
|
||||
|
||||
enum Protection { BORDERS = 1, FEATURES = 2 };
|
||||
using Protection_flags = QFlags<Protection>;
|
||||
Q_DECLARE_METATYPE(Protection_flags)
|
||||
|
||||
class Mesh_3_plugin :
|
||||
public QObject,
|
||||
protected Polyhedron_demo_plugin_interface
|
||||
|
|
@ -597,28 +601,32 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
|
|||
ui.edgeLabel->setEnabled(ui.noEdgeSizing->isChecked());
|
||||
ui.edgeSizing->setEnabled(ui.noEdgeSizing->isChecked());
|
||||
|
||||
const QString sharp_and_boundary("Sharp and Boundary edges");
|
||||
const QString boundary_only("Boundary edges only");
|
||||
const QString sharp_edges("Sharp edges");
|
||||
const QString input_polylines("Input polylines");
|
||||
const QString on_cube("Polylines on cube");
|
||||
const QString triple_lines("Triple+ lines");
|
||||
using Item = std::pair<QString, Protection_flags>;
|
||||
const Item sharp_and_boundary{"Sharp and Boundary edges", FEATURES};
|
||||
const Item boundary_only{"Boundary edges only", BORDERS};
|
||||
const Item sharp_edges{"Sharp edges", FEATURES};
|
||||
const Item input_polylines{"Input polylines only", Protection_flags{}};
|
||||
const Item on_cube{"Polylines on cube", BORDERS};
|
||||
const Item triple_lines{"Triple+ lines", FEATURES};
|
||||
if (features_protection_available) {
|
||||
if (items->which() == POLYHEDRAL_MESH_ITEMS) {
|
||||
auto v = [](Protection_flags f) { return QVariant::fromValue(f); };
|
||||
if (mesh_type == Mesh_type::SURFACE_ONLY) {
|
||||
ui.protectEdges->addItem(sharp_and_boundary);
|
||||
ui.protectEdges->addItem(boundary_only);
|
||||
ui.protectEdges->addItem(sharp_and_boundary.first, v(sharp_and_boundary.second));
|
||||
ui.protectEdges->addItem(boundary_only.first, v(boundary_only.second));
|
||||
} else
|
||||
ui.protectEdges->addItem(sharp_edges);
|
||||
ui.protectEdges->addItem(sharp_edges.first, v(sharp_edges.second));
|
||||
} else if (items->which() == IMAGE_MESH_ITEMS) {
|
||||
if (polylines_item != nullptr) {
|
||||
ui.protectEdges->addItem(QString(input_polylines).append(" only"));
|
||||
ui.protectEdges->addItem(QString(on_cube).append(" and input polylines"));
|
||||
ui.protectEdges->addItem(QString(triple_lines).append(" and input polylines"));
|
||||
ui.protectEdges->addItem(input_polylines.first, QVariant::fromValue(input_polylines.second));
|
||||
ui.protectEdges->addItem(QString(on_cube.first).append(" and input polylines"),
|
||||
QVariant::fromValue(on_cube.second));
|
||||
ui.protectEdges->addItem(QString(triple_lines.first).append(" and input polylines"),
|
||||
QVariant::fromValue(triple_lines.second));
|
||||
}
|
||||
else {
|
||||
ui.protectEdges->addItem(on_cube);
|
||||
ui.protectEdges->addItem(triple_lines);
|
||||
ui.protectEdges->addItem(on_cube.first, QVariant::fromValue(on_cube.second));
|
||||
ui.protectEdges->addItem(triple_lines.first, QVariant::fromValue(triple_lines.second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -628,8 +636,10 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
|
|||
ui.weightsSigma, SLOT(setEnabled(bool)));
|
||||
connect(ui.useWeights_checkbox, SIGNAL(toggled(bool)),
|
||||
ui.weightsSigma_label, SLOT(setEnabled(bool)));
|
||||
ui.weightsSigma->setValue(1.);
|
||||
ui.labeledImgGroup->setVisible(input_is_labeled_img);
|
||||
ui.weightsSigma->setValue((std::max)(image_item->image()->vx(),
|
||||
(std::max)(image_item->image()->vy(),
|
||||
image_item->image()->vz())));
|
||||
|
||||
#ifndef CGAL_USE_ITK
|
||||
if (input_is_labeled_img)
|
||||
|
|
@ -666,13 +676,9 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
|
|||
tets_shape = !ui.noTetShape->isChecked() ? 0 : ui.tetShape->value();
|
||||
tets_sizing = !ui.noTetSizing->isChecked() ? 0 : ui.tetSizing->value();
|
||||
|
||||
const int pe_ci = ui.protectEdges->currentIndex();
|
||||
protect_borders = ui.protect->isChecked()
|
||||
&& ( pe_ci == ui.protectEdges->findText(on_cube, Qt::MatchContains)
|
||||
|| pe_ci == ui.protectEdges->findText(boundary_only, Qt::MatchContains));
|
||||
protect_features = ui.protect->isChecked()
|
||||
&& ( pe_ci == ui.protectEdges->findText(triple_lines, Qt::MatchContains)
|
||||
|| pe_ci == ui.protectEdges->findText(sharp_and_boundary, Qt::MatchContains));
|
||||
const auto pe_flags = ui.protectEdges->currentData().value<Protection_flags>();
|
||||
protect_borders = ui.protect->isChecked() && pe_flags.testFlag(BORDERS);
|
||||
protect_features = ui.protect->isChecked() && pe_flags.testFlag(FEATURES);
|
||||
|
||||
const bool detect_connected_components = ui.detectComponents->isChecked();
|
||||
const int manifold = (ui.manifoldCheckBox->isChecked() ? 1 : 0) +
|
||||
|
|
@ -805,12 +811,11 @@ void Mesh_3_plugin::mesh_3(const Mesh_type mesh_type,
|
|||
if ( sigma_weights > 0
|
||||
&& sigma_weights != image_item->sigma_weights())
|
||||
{
|
||||
image_item->set_image_weights(
|
||||
CGAL::Mesh_3::generate_label_weights(*pImage, sigma_weights),
|
||||
sigma_weights);
|
||||
CGAL::Image_3 weights = CGAL::Mesh_3::generate_label_weights(*pImage, sigma_weights);
|
||||
image_item->set_image_weights(weights, sigma_weights);
|
||||
}
|
||||
#endif
|
||||
const Image* pWeights = sigma_weights > 0
|
||||
Image* pWeights = sigma_weights > 0
|
||||
? image_item->image_weights()
|
||||
: nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage,
|
|||
float iso_value,
|
||||
float value_outside,
|
||||
bool inside_is_less,
|
||||
const Image* pWeights)
|
||||
Image* pWeights)
|
||||
{
|
||||
if (nullptr == pImage) { return nullptr; }
|
||||
|
||||
|
|
@ -345,71 +345,62 @@ Meshing_thread* cgal_code_mesh_3(const Image* pImage,
|
|||
namespace p = CGAL::parameters;
|
||||
|
||||
Image_mesh_domain* p_domain = nullptr;
|
||||
#ifdef CGAL_USE_ITK
|
||||
if(nullptr != pWeights)
|
||||
CGAL::Image_3 null_weights;
|
||||
CGAL::Image_3& weights = (pWeights == nullptr) ? null_weights : *pWeights;
|
||||
|
||||
if (protect_features)
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::weights = *pWeights,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); }
|
||||
)
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::weights = std::ref(weights), //used only if valid
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::features_detector = CGAL::Mesh_3::Detect_features_in_image(),
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (protect_borders)//protect polylines on image Bbox
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::weights = std::ref(weights), //used only if valid
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::features_detector = CGAL::Mesh_3::Detect_features_on_image_bbox(),
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (!polylines.empty())
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (protect_features)
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::features_detector = CGAL::Mesh_3::Detect_features_in_image(),
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (protect_borders)//protect polylines on image Bbox
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::features_detector = CGAL::Mesh_3::Detect_features_on_image_bbox(),
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (!polylines.empty())
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); },
|
||||
p::input_features = std::cref(polylines)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (p_domain == nullptr)
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); }
|
||||
)
|
||||
);
|
||||
}
|
||||
if (p_domain == nullptr)
|
||||
{
|
||||
p_domain = new Image_mesh_domain
|
||||
(Image_mesh_domain::create_labeled_image_mesh_domain
|
||||
(p::image = *pImage,
|
||||
p::weights = std::ref(weights), //used only if valid
|
||||
p::relative_error_bound = 1e-6,
|
||||
p::construct_surface_patch_index =
|
||||
[](int i, int j) { return (i * 1000 + j); }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
typedef ::Mesh_function<Image_mesh_domain,
|
||||
Mesh_fnt::Labeled_image_domain_tag> Mesh_function;
|
||||
|
|
|
|||
|
|
@ -81,5 +81,5 @@ Meshing_thread* cgal_code_mesh_3(const CGAL::Image_3* pImage,
|
|||
float iso_value = 3.f,
|
||||
float value_outside = 0.f,
|
||||
bool inside_is_less = true,
|
||||
const CGAL::Image_3* pWeights = nullptr);
|
||||
CGAL::Image_3* pWeights = nullptr);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ log() const
|
|||
<< QString("tet max size: %1").arg(tet_sizing)
|
||||
<< QString("detect connected components: %1")
|
||||
.arg(detect_connected_components)
|
||||
<< QString("use weights: %1").arg(weights_ptr != nullptr)
|
||||
<< QString("protect features: %1").arg(protect_features);
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +244,7 @@ edge_criteria(double b, Mesh_fnt::Domain_tag)
|
|||
return Edge_criteria(b);
|
||||
}
|
||||
|
||||
#include <CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h>
|
||||
#include <CGAL/Sizing_field_with_aabb_tree.h>
|
||||
#include <CGAL/Mesh_3/experimental/Facet_topological_criterion_with_adjacency.h>
|
||||
|
||||
template < typename D_, typename Tag >
|
||||
|
|
@ -253,7 +254,7 @@ edge_criteria(double edge_size, Mesh_fnt::Polyhedral_domain_tag)
|
|||
{
|
||||
if(p_.use_sizing_field_with_aabb_tree) {
|
||||
typedef typename Domain::Surface_patch_index_set Set_of_patch_ids;
|
||||
typedef Sizing_field_with_aabb_tree<Kernel, Domain> Mesh_sizing_field; // type of sizing field for 0D and 1D features
|
||||
typedef CGAL::Sizing_field_with_aabb_tree<Kernel, Domain> Mesh_sizing_field; // type of sizing field for 0D and 1D features
|
||||
typedef std::vector<Set_of_patch_ids> Patches_ids_vector;
|
||||
typedef typename Domain::Curve_index Curve_index;
|
||||
const Curve_index max_index = domain_->maximal_curve_index();
|
||||
|
|
@ -264,9 +265,7 @@ edge_criteria(double edge_size, Mesh_fnt::Polyhedral_domain_tag)
|
|||
(*patches_ids_vector_p)[curve_id] = domain_->get_incidences(curve_id);
|
||||
}
|
||||
Mesh_sizing_field* sizing_field_ptr =
|
||||
new Mesh_sizing_field(edge_size,
|
||||
domain_->aabb_tree(),
|
||||
*domain_);
|
||||
new Mesh_sizing_field(edge_size, *domain_, domain_->aabb_tree());
|
||||
// The sizing field object, as well as the `patch_ids_vector` are
|
||||
// allocated on the heap, and the following `boost::any` object,
|
||||
// containing two shared pointers, is used to make the allocated
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ Scene_image_item::compute_bbox() const
|
|||
m_image->image()->tz+(m_image->zdim()-1) * m_image->vz()));
|
||||
}
|
||||
|
||||
const Image*
|
||||
Image*
|
||||
Scene_image_item::image_weights() const
|
||||
{
|
||||
return &d->m_image_weights;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
bool isGray();
|
||||
Image* m_image;
|
||||
|
||||
const Image* image_weights() const;
|
||||
Image* image_weights() const;
|
||||
void set_image_weights(const Image& img, const float sigma);
|
||||
float sigma_weights() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ bool build_triangulation_from_file(std::istream& is,
|
|||
is >> nv;
|
||||
for(int i=0; i<nv; ++i)
|
||||
{
|
||||
double x,y,z;
|
||||
typename Tr::Geom_traits::FT x,y,z;
|
||||
is >> x >> y >> z >> ref;
|
||||
points.push_back(Point_3(x,y,z));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,12 +51,15 @@ enum all_default_t { all_default };
|
|||
enum X { Y };
|
||||
#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \
|
||||
enum X { Y };
|
||||
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
|
||||
enum X { Y };
|
||||
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
|
||||
enum X { Y };
|
||||
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z)
|
||||
#include <CGAL/STL_Extension/internal/parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
#undef CGAL_add_named_parameter_with_compatibility
|
||||
#undef CGAL_add_named_parameter_with_compatibility_cref_only
|
||||
#undef CGAL_add_named_parameter_with_compatibility_ref_only
|
||||
#undef CGAL_add_extra_named_parameter_with_compatibility
|
||||
|
||||
|
|
@ -359,7 +362,7 @@ struct Named_function_parameters
|
|||
typedef Named_function_parameters<K, internal_np::X, self> Params;\
|
||||
return Params(k, *this); \
|
||||
}
|
||||
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
|
||||
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
|
||||
template<typename K> \
|
||||
Named_function_parameters<std::reference_wrapper<const K>, \
|
||||
internal_np::X, self> \
|
||||
|
|
@ -369,6 +372,16 @@ struct Named_function_parameters
|
|||
internal_np::X, self> Params; \
|
||||
return Params(std::cref(k), *this); \
|
||||
}
|
||||
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
|
||||
template<typename K> \
|
||||
Named_function_parameters<std::reference_wrapper<K>, \
|
||||
internal_np::X, self> \
|
||||
Z(K& k) const \
|
||||
{ \
|
||||
typedef Named_function_parameters<std::reference_wrapper<K>, \
|
||||
internal_np::X, self> Params; \
|
||||
return Params(std::ref(k), *this); \
|
||||
}
|
||||
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \
|
||||
template<typename K> \
|
||||
Named_function_parameters<K, internal_np::X, self> \
|
||||
|
|
@ -380,6 +393,7 @@ struct Named_function_parameters
|
|||
#include <CGAL/STL_Extension/internal/parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
#undef CGAL_add_named_parameter_with_compatibility
|
||||
#undef CGAL_add_named_parameter_with_compatibility_cref_only
|
||||
#undef CGAL_add_named_parameter_with_compatibility_ref_only
|
||||
#undef CGAL_add_extra_named_parameter_with_compatibility
|
||||
|
||||
|
|
@ -426,7 +440,7 @@ inline all_default()
|
|||
}
|
||||
#endif
|
||||
|
||||
template <class Tag, bool ref_only = false>
|
||||
template <class Tag, bool ref_only = false, bool ref_is_const = false>
|
||||
struct Boost_parameter_compatibility_wrapper
|
||||
{
|
||||
template <typename K>
|
||||
|
|
@ -447,7 +461,7 @@ struct Boost_parameter_compatibility_wrapper
|
|||
};
|
||||
|
||||
template <class Tag>
|
||||
struct Boost_parameter_compatibility_wrapper<Tag, true>
|
||||
struct Boost_parameter_compatibility_wrapper<Tag, true, true>
|
||||
{
|
||||
template <typename K>
|
||||
Named_function_parameters<std::reference_wrapper<const K>, Tag>
|
||||
|
|
@ -466,6 +480,26 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
|
|||
}
|
||||
};
|
||||
|
||||
template <class Tag>
|
||||
struct Boost_parameter_compatibility_wrapper<Tag, true, false>
|
||||
{
|
||||
template <typename K>
|
||||
Named_function_parameters<std::reference_wrapper<K>, Tag>
|
||||
operator()(K& p) const
|
||||
{
|
||||
typedef Named_function_parameters<std::reference_wrapper<K>, Tag> Params;
|
||||
return Params(std::ref(p));
|
||||
}
|
||||
|
||||
template <typename K>
|
||||
Named_function_parameters<std::reference_wrapper<K>, Tag>
|
||||
operator=(std::reference_wrapper<K> p) const
|
||||
{
|
||||
typedef Named_function_parameters<std::reference_wrapper<K>, Tag> Params;
|
||||
return Params(std::ref(p));
|
||||
}
|
||||
};
|
||||
|
||||
// define free functions and Boost_parameter_compatibility_wrapper for named parameters
|
||||
#define CGAL_add_named_parameter(X, Y, Z) \
|
||||
template <typename K> \
|
||||
|
|
@ -478,14 +512,17 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
|
|||
|
||||
#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \
|
||||
const Boost_parameter_compatibility_wrapper<internal_np::X> Z;
|
||||
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
|
||||
const Boost_parameter_compatibility_wrapper<internal_np::X, true, true> Z;
|
||||
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
|
||||
const Boost_parameter_compatibility_wrapper<internal_np::X, true> Z;
|
||||
const Boost_parameter_compatibility_wrapper<internal_np::X, true, false> Z;
|
||||
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \
|
||||
const Boost_parameter_compatibility_wrapper<internal_np::X> Z;
|
||||
#include <CGAL/STL_Extension/internal/parameters_interface.h>
|
||||
#undef CGAL_add_named_parameter
|
||||
#undef CGAL_add_extra_named_parameter_with_compatibility
|
||||
#undef CGAL_add_named_parameter_with_compatibility
|
||||
#undef CGAL_add_named_parameter_with_compatibility_cref_only
|
||||
#undef CGAL_add_named_parameter_with_compatibility_ref_only
|
||||
|
||||
// Version with three parameters for dynamic property maps
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ class Object
|
|||
template<class T>
|
||||
friend T object_cast(const Object & o);
|
||||
|
||||
typedef void (Object::*bool_type)() const;
|
||||
void this_type_does_not_support_comparisons() const {}
|
||||
public:
|
||||
|
||||
struct private_tag{};
|
||||
|
|
@ -97,8 +95,8 @@ class Object
|
|||
}
|
||||
|
||||
// safe-bool conversion
|
||||
operator bool_type() const {
|
||||
return empty() == false ? &Object::this_type_does_not_support_comparisons : 0;
|
||||
explicit operator bool() const {
|
||||
return !empty();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_optio
|
|||
CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option)
|
||||
CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options)
|
||||
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(image_3_param_t, image_3_param, image)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image)
|
||||
CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value)
|
||||
CGAL_add_named_parameter_with_compatibility(image_subdomain_index_t, image_subdomain_index, image_values_to_subdomain_indices)
|
||||
CGAL_add_named_parameter_with_compatibility(voxel_value_t, voxel_value, value_outside)
|
||||
|
|
@ -337,17 +337,21 @@ CGAL_add_named_parameter_with_compatibility(features_detector_param_t, features_
|
|||
CGAL_add_named_parameter_with_compatibility(input_features_param_t, input_features_param, input_features)
|
||||
|
||||
CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size)
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle)
|
||||
CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size)
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(facet_distance_param_t, facet_distance_param, facet_distance)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(facet_distance_param_t, facet_distance_param, facet_distance)
|
||||
CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology)
|
||||
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge)
|
||||
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio)
|
||||
CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size)
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(sizing_field_param_t, sizing_field_param, sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field)
|
||||
CGAL_add_named_parameter_with_compatibility_cref_only(sizing_field_param_t, sizing_field_param, sizing_field)
|
||||
|
||||
CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function)
|
||||
CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object)
|
||||
|
||||
//List of named parameters used in Straight_skeleton_2
|
||||
CGAL_add_named_parameter_with_compatibility_ref_only(angles_param_t, angles_param, angles)
|
||||
CGAL_add_named_parameter(maximum_height_t, maximum_height, maximum_height)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,18 @@ struct is_same_or_derived :
|
|||
>::type
|
||||
{};
|
||||
|
||||
}
|
||||
namespace cpp20 {
|
||||
|
||||
template< class T >
|
||||
struct remove_cvref {
|
||||
typedef std::remove_cv_t<std::remove_reference_t<T>> type;
|
||||
};
|
||||
|
||||
template< class T >
|
||||
using remove_cvref_t = typename remove_cvref<T>::type;
|
||||
|
||||
} // end namespace cpp20
|
||||
|
||||
} // end namespace CGAL
|
||||
|
||||
#endif // CGAL_TYPE_TRAITS_H
|
||||
|
|
|
|||
|
|
@ -220,9 +220,9 @@ git_dir=`pwd`
|
|||
tmp_dir=`mktemp -d`
|
||||
cd $tmp_dir
|
||||
echo $tmp_dir
|
||||
echo "#include <CGAL/Named_function_parameters.h>\nstruct A{};\nint main(){" > main.cpp
|
||||
echo "#include <CGAL/Named_function_parameters.h>\nstruct A{};\nint main(){\nA a;\n" > main.cpp
|
||||
for i in `echo $nps`; do
|
||||
echo " CGAL::parameters::${i}(A()).${i}(A());" >> main.cpp
|
||||
echo " CGAL::parameters::${i}(a).${i}(a);" >> main.cpp
|
||||
done
|
||||
echo "}" >> main.cpp
|
||||
if ! g++ -DCGAL_NO_STATIC_ASSERTION_TESTS -I$git_dir/STL_Extension/include -I$git_dir/Stream_support/include -I$git_dir/Installation/include main.cpp; then
|
||||
|
|
|
|||
|
|
@ -33,14 +33,16 @@ namespace internal
|
|||
template <class GT, class Pair, class RegionMap>
|
||||
void fill_plane_or_vector_map(const std::vector<Pair>& normals, RegionMap region_map, typename GT::Vector_3)
|
||||
{
|
||||
for (std::size_t i = 0 ; i<normals.size(); ++i)
|
||||
typedef typename boost::property_traits<RegionMap>::key_type KT;
|
||||
for (KT i = 0 ; i<static_cast<KT>(normals.size()); ++i)
|
||||
put(region_map, i, normals[i].first.orthogonal_vector());
|
||||
}
|
||||
|
||||
template <class GT, class Pair, class RegionMap>
|
||||
void fill_plane_or_vector_map(const std::vector<Pair>& normals, RegionMap region_map, typename GT::Plane_3)
|
||||
{
|
||||
for (std::size_t i = 0 ; i<normals.size(); ++i)
|
||||
typedef typename boost::property_traits<RegionMap>::key_type KT;
|
||||
for (KT i = 0; i < static_cast<KT>(normals.size()); ++i)
|
||||
put(region_map, i, normals[i].first);
|
||||
}
|
||||
|
||||
|
|
@ -195,7 +197,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh,
|
|||
if (candidates.size() == 1)
|
||||
{
|
||||
Id new_id = *candidates.begin();
|
||||
put(region_map, f0, new_id);
|
||||
put(region_map, f0, static_cast<Id>(new_id));
|
||||
tmp[new_id].second.push_back(f0);
|
||||
tmp[i].second.clear();
|
||||
}
|
||||
|
|
@ -207,7 +209,7 @@ region_growing_of_planes_on_faces(const PolygonMesh& mesh,
|
|||
tmp.erase(last, tmp.end());
|
||||
|
||||
//update region map
|
||||
for (std::size_t i=0; i<tmp.size(); ++i)
|
||||
for (Id i=0; i<static_cast<Id>(tmp.size()); ++i)
|
||||
{
|
||||
for (face_descriptor f : tmp[i].second)
|
||||
put(region_map, f, i);
|
||||
|
|
|
|||
|
|
@ -451,9 +451,10 @@ namespace internal {
|
|||
Item_map item_map_ = Item_helper::get(item_map);
|
||||
|
||||
m_nb_regions = 0;
|
||||
typename boost::property_traits<Region_map>::value_type init_value(-1);
|
||||
for (auto it = input_range.begin(); it != input_range.end(); it++) {
|
||||
Item item = get(item_map_, it);
|
||||
put(m_region_map, item, std::size_t(-1));
|
||||
put(m_region_map, item, init_value);
|
||||
}
|
||||
// TODO if we want to allow subranges while NeighborQuery operates on the full range
|
||||
// (like for faces in a PolygonMesh) we should fill a non-visited map rather than a visited map
|
||||
|
|
@ -479,8 +480,9 @@ namespace internal {
|
|||
Boolean_property_map<VisitedMap> m_visited;
|
||||
|
||||
void fill_region_map(std::size_t idx, const Region& region) {
|
||||
typedef typename boost::property_traits<Region_map>::value_type Id;
|
||||
for (auto item : region) {
|
||||
put(m_region_map, item, idx);
|
||||
put(m_region_map, item, static_cast<Id>(idx));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace CGAL {
|
|||
operator()(P p)
|
||||
{
|
||||
T h;
|
||||
typename Construct_cartesian_const_iterator_d::result_type pit = construct_it(*p);
|
||||
auto pit = construct_it(*p);
|
||||
for (int i = 0; i < dim; ++i, ++pit) {
|
||||
h=(*pit);
|
||||
if (h < lower[i]) lower[i] = h;
|
||||
|
|
@ -126,7 +126,7 @@ namespace CGAL {
|
|||
if (begin ==end)
|
||||
return;
|
||||
// initialize with values of first point
|
||||
typename Construct_cartesian_const_iterator_d::result_type bit = construct_it(**begin);
|
||||
auto bit = construct_it(**begin);
|
||||
|
||||
for (int i=0; i < D::value; ++i, ++bit) {
|
||||
lower_[i]= *bit; upper_[i]=lower_[i];
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue