refine_mesh_3 compile error after successful compilation and run with make_mesh_3

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

refine_mesh_3 compile error after successful compilation and run with make_mesh_3

rdzhao
Hi everyone,

I'm facing a strange problem. my laptop is a macbook. I installed CGAL 4.14
from homebrew.

I'm using .off file as polyhedron domain to generate Mesh_triangulation_3
(tet mesh). Using make_mesh_3 works fine:
// mesh.C3T3() is a reference of the c3t3 object.
mesh.C3T3() = CGAL::make_mesh_3<C3t3>(domain, criteria);


But when I add refine_mesh_3 call:
CGAL::refine_mesh_3<C3t3>(mesh.C3T3(), domain, criteria);


I got the following compile error which makes no sense at all:
error: no
      matching function for call to 'refine_mesh_3'
    CGAL::refine_mesh_3<C3t3>(mesh.C3T3(), domain, criteria);
    ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/CGAL/refine_mesh_3.h:470:3: note: candidate function
template
      not viable: no known conversion from 'C3t3' (aka
     
'Mesh_complex_3_in_triangulation_3<Mesh_3_regular_triangulation_3_wrapper&lt;Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >,
     
Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
      CGAL::Polyhedron_items_3, HalfedgeDS_default,
std::__1::allocator&lt;int> >,
      CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >,
     
CGAL::Regular_triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
     
CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
      CGAL::Polyhedron_items_3, HalfedgeDS_default,
std::__1::allocator&lt;int> >,
      CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >, void> > >
>')
      to
     
'CGAL::Mesh_complex_3_in_triangulation_3<CGAL::Mesh_3_regular_triangulation_3_wrapper&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >,
     
CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
      CGAL::Polyhedron_items_3, HalfedgeDS_default,
std::__1::allocator&lt;int> >,
      CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >,
     
CGAL::Regular_triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
     
CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
      >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
      CGAL::Polyhedron_items_3, HalfedgeDS_default,
std::__1::allocator&lt;int> >,
      CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >, void>,
      CGAL::Sequential_tag> >, int, int> &&' for 1st argument
  refine_mesh_3,
  ^

To save your time, this error tells an c3t3 object cannot be converted to
another c3t3 object with "CGAL::Sequential_tag" (at the end).

Can anyone help with that?

Thanks so much!!!!








--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: refine_mesh_3 compile error after successful compilation and run with make_mesh_3

Sebastien Loriot (GeometryFactory)
 From what I understand, you try to compile something close to this example:

https://doc.cgal.org/latest/Mesh_3/Mesh_3_2mesh_polyhedral_domain_8cpp-example.html

If yes, could you try to compile it?

Sebastien.

On 9/26/19 3:48 AM, rdzhao wrote:

> Hi everyone,
>
> I'm facing a strange problem. my laptop is a macbook. I installed CGAL 4.14
> from homebrew.
>
> I'm using .off file as polyhedron domain to generate Mesh_triangulation_3
> (tet mesh). Using make_mesh_3 works fine:
> // mesh.C3T3() is a reference of the c3t3 object.
> mesh.C3T3() = CGAL::make_mesh_3<C3t3>(domain, criteria);
>
>
> But when I add refine_mesh_3 call:
> CGAL::refine_mesh_3<C3t3>(mesh.C3T3(), domain, criteria);
>
>
> I got the following compile error which makes no sense at all:
> error: no
>        matching function for call to 'refine_mesh_3'
>      CGAL::refine_mesh_3<C3t3>(mesh.C3T3(), domain, criteria);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/local/include/CGAL/refine_mesh_3.h:470:3: note: candidate function
> template
>        not viable: no known conversion from 'C3t3' (aka
>      
> 'Mesh_complex_3_in_triangulation_3<Mesh_3_regular_triangulation_3_wrapper&lt;Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >,
>      
> Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
>        CGAL::Polyhedron_items_3, HalfedgeDS_default,
> std::__1::allocator&lt;int> >,
>        CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >,
>      
> CGAL::Regular_triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
>      
> CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
>        CGAL::Polyhedron_items_3, HalfedgeDS_default,
> std::__1::allocator&lt;int> >,
>        CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >, void> > >
>> ')
>        to
>      
> 'CGAL::Mesh_complex_3_in_triangulation_3<CGAL::Mesh_3_regular_triangulation_3_wrapper&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >,
>      
> CGAL::Triangulation_data_structure_3<CGAL::Mesh_vertex_base_3&lt;CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
>        CGAL::Polyhedron_items_3, HalfedgeDS_default,
> std::__1::allocator&lt;int> >,
>        CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >,
>      
> CGAL::Regular_triangulation_vertex_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Triangulation_ds_vertex_base_3<void> > >,
>      
> CGAL::Compact_mesh_cell_base_3<CGAL::Robust_weighted_circumcenter_filtered_traits_3&lt;CGAL::Mesh_3::Robust_intersection_traits_3_new&lt;CGAL::Epick>
>        >, CGAL::Polyhedral_mesh_domain_3<CGAL::Polyhedron_3&lt;CGAL::Epick,
>        CGAL::Polyhedron_items_3, HalfedgeDS_default,
> std::__1::allocator&lt;int> >,
>        CGAL::Epick, CGAL::Default, void, CGAL::Boolean_tag<true> >, void>,
>        CGAL::Sequential_tag> >, int, int> &&' for 1st argument
>    refine_mesh_3,
>    ^
>
> To save your time, this error tells an c3t3 object cannot be converted to
> another c3t3 object with "CGAL::Sequential_tag" (at the end).
>
> Can anyone help with that?
>
> Thanks so much!!!!
>
>
>
>
>
>
>
>
> --
> Sent from: http://cgal-discuss.949826.n4.nabble.com/
>

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


Reply | Threaded
Open this post in threaded view
|

Re: refine_mesh_3 compile error after successful compilation and run with make_mesh_3

rdzhao
Thank you so much! Sebastien!

I wrote the code myself, and created this error.

The example code compiles fine. So I made a word by word comparison and
finally found that my function call is wrong:
CGAL::refine_mesh_3<C3t3>(mesh.C3T3(), domain, criteria);
                                ^^^^^
The "<C3t3>" should not be there!

Thanks again for the help!!!
Rundong




--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: refine_mesh_3 compile error after successful compilation and run with make_mesh_3

rdzhao
In reply to this post by Sebastien Loriot (GeometryFactory)
Hi Sebastien!

I'm facing another problem.

I would like to create a tetrahedral mesh from a polyhedral surface with
make_mesh_3 and refine_mesh_3. The model is a benzene with 6 C atoms and 6 H
atoms. Those atoms are disconnected balls in the input polyhedral surface
mesh (benzene.off).

However, by directly calling make_mesh_3, there will be missing components.
So I resort to another post:
http://cgal-discuss.949826.n4.nabble.com/make-mesh-3-with-features-initial-points-for-C3T3-td4661118.html
This pose tells that we need to set initial points as features to guide the
meshing process. So I modified the code with:

C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, features(domain),
no_lloyd(), no_odt(), no_perturb(), no_exude());
       
typedef C3t3::Triangulation::Point Weighted_point;
   for(int i=0; i<atoms.size(); i+=3){
        Weighted_point p(Weighted_point::Point(atoms[i], atoms[i+1], atoms[i+2]));
    Tr::Vertex_handle vh = c3t3.triangulation().insert(p);
    c3t3.set_dimension(vh, 3);
}
CGAL::refine_mesh_3(c3t3, domain, criteria);

The idea is adding atom positions as initial points. But the code still
misses one component.

A minimal code is attached here with model file (benzene.off) and atoms file
(benzene.xyz). It should be easy to directly compile and execute.
Can you help dig out the problem?
Thank you so much!
Rundong

&lt;nabble_a href=&quot;Archive.zip&quot;>Archive.zip





--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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


Reply | Threaded
Open this post in threaded view
|

Re: refine_mesh_3 compile error after successful compilation and run with make_mesh_3

rdzhao
In reply to this post by Sebastien Loriot (GeometryFactory)
Archive.zip
<http://cgal-discuss.949826.n4.nabble.com/file/t376150/Archive.zip>  

Sorry, the attachment is missing in the previous post.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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