Handling sharp features with multiple input polyhedra

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Handling sharp features with multiple input polyhedra

Emmanuel Olivi
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, ...)

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Handling sharp features with multiple input polyhedra

Emmanuel Olivi
Hi all,
I could get what I wanted (meshing a domain defined by multiple nested
polyhedra), labelled correctly.
But most of the time (depending on the inputs poly and parameters), CGAL
crashes saying that:

> File: /user/eolivi/home/local/include/CGAL/Mesh_3/Refine_facets_3.h
> Line: 572
> Explanation: Mesh_3 ERROR: A facet is not in conflict with its
> refinement point!
> Debugging informations:
>   Facet: (0xd36dc60, 0) = (-0.835468 -0.459581 -0.290727 0, -0.835618
> -0.486215 -0.24857 0.000171194, -0.850522 -0.475736 -0.223066 0.000748189)
>   Dual: (-9.37514e+13 -5.22286e+13 -3.33291e+13 0, -8.12765e+13
> -4.52789e+13 -2.88942e+13 0)
>   Refinement point: -0.864832 -0.418624 -0.270791 0
>
(as already mentioned by another user), during the refinement process of
the surface.
This is pretty anoying since I do not know where exactely is the
problem, I've tried to jitter all parameters (distance_bound,
edge_size,  facet_size,...) without success.

Anyway sometimes it works, if someone need the few lines of code to
modify for having several domain meshed with sharp_features, ask me...

byebye



--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Handling sharp features with multiple input polyhedra

CloudCompute
This post has NOT been accepted by the mailing list yet.
Hi,
Thank you very much for your so valuable information.
I need your code to modify for having several domain meshed with sharp_features.
CloudCompute
Loading...