Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Handling sharp features with multiple input polyhedra

Subject: CGAL users discussion list

List archive

[cgal-discuss] Handling sharp features with multiple input polyhedra


Chronological Thread 
  • From: Emmanuel <>
  • To:
  • Subject: [cgal-discuss] Handling sharp features with multiple input polyhedra
  • Date: Mon, 8 Aug 2011 11:46:35 +0200 (CEST)

Hi all,
I'm trying to use the sharp features to get 3D meshes keeping the sharp
features of multiple input polyhedra. So that all edges in the input polyhedra
will be in my final volumic mesh.
1) For a single polyhedron this can be achieved as in the example
mesh_polyhedral_with_features, calling:
domain.detect_features(0.); // with an angle of detection of zero
This gives me correct 3D meshes.

2) On the other hand, I could achieve using Labeled_mesh_domain_3, meshing
with
multiple polyhedra, and the subdomain were correctly meshed and indiced.
For this purpose I had to write the class
Polyhedral_vector_to_labeled_function_wrapper which is below. I wrote it on
the
same way as the provided class: Implicit_vector_to_labeled_function_wrapper

3) But, now I would like to use both features (sharp edges and multiple input
polyhedra with Labeled_mesh_domain) but I do not succeed ! Do you know a way
for doing this ? (e.g writting a class
Labeled_mesh_domain_with_sharp_features_3 and
polyhedral_with_sharp_features_vector_to_labeled_function_wrapper ?? )

Thank you
Emmanuel

code:---------------
2)
namespace CGAL {
namespace Mesh_3 {
template<class Function_, class BGT>
class Polyhedral_vector_to_labeled_function_wrapper
{
public:
// Types
typedef int return_type;
typedef std::vector<Function_*> Function_vector;
typedef typename BGT::Point_3 Point_3;
/// Constructor

Polyhedral_vector_to_labeled_function_wrapper(std::vector<Function_*>& v) :
function_vector_(v) {}
/// Destructor
~Polyhedral_vector_to_labeled_function_wrapper() {}

/// Operator ()
return_type operator()(const Point_3& p, const bool = true)
const
{
int nb_func = function_vector_.size();
if ( nb_func > 8 )
{
CGAL_error_msg("We support at most 8 functions !");
}

char bits = 0;
for ( int i = 0 ; i < nb_func ; ++i ) {
// Insert value into bits : we compute fi(p) and
insert
result at bit i of bits
bits |= ((
function_vector_[i]->is_in_domain_object()(p) > 0) << i );
}
return ( static_cast<return_type>(bits) );
}
private:
/// Functions to wrap
Function_vector function_vector_;
};
}
}
typedef
CGAL::Mesh_3::Polyhedral_vector_to_labeled_function_wrapper<Polyhedral_mesh_domain_3,
K> Function_wrapper;
typedef Function_wrapper::Function_vector
Function_vector;
typedef CGAL::Mesh_3::Labeled_mesh_domain_3<Function_wrapper, K>
Mesh_domain;


3)
I've tried writting the same for Polyhedral_mesh_domain_with_features_3, i.e:
typedef
CGAL::Mesh_3::Polyhedral_vector_to_labeled_function_wrapper<Polyhedral_mesh_domain_with_features_3,
K> Function_wrapper;
typedef Function_wrapper::Function_vector
Function_vector;
typedef CGAL::Mesh_3::Labeled_mesh_domain_3<Function_wrapper, K>
Mesh_domain;

but it does not work so easily, many functions are missing (detect_features,
get_corners, ...)



Archive powered by MHonArc 2.6.16.

Top of Page