Triangulate without hanging nodes on boundary

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

Triangulate without hanging nodes on boundary

Renato Poli
I need to refine only a selection of a coarse mesh, and I am using CGAL's CDT
(2D).
The boundary of the selection must be kept identical to the original one (no
hanging nodes allowed!).

I go through the following steps:
       (1) extract the submesh set from the original mesh
       (2) define the boundary of the submesh and add as a constrain Polygon
in CDT
       (3) refine the submesh using a sizing field with the reference point
in the center of the submesh (I don't want to refine in the boundaries to
avoid hanging nodes!).
       (4) reintegrate the submesh in the main mesh.

The problem is I am not able to avoid hanging nodes.
Please refer to the attached picture.

Is there an algorithm to ensure only the center of the submesh will be
refined, avoiding _completely_ the creation of hanging nodes on the
boundaries?

<http://cgal-discuss.949826.n4.nabble.com/file/t376144/delaunay_trriangulation.png>

Thanks for the help,
Renato



--
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: Triangulate without hanging nodes on boundary

Sebastien Loriot (GeometryFactory)
I think if you do the same approach but within the original mesh it
should be working. Let me explain:

You have your selection a faces within the input mesh. Then mark as
constrained edge any edge incident to a face on the boundary of your
selection (this reduce the selection by one layer of faces basically).
Then mark all the faces outside this sub-selection as exterior of the
mesh domain and run the refinement.

Sebastien.

On 9/6/19 12:18 AM, Renato Poli wrote:

> I need to refine only a selection of a coarse mesh, and I am using CGAL's CDT
> (2D).
> The boundary of the selection must be kept identical to the original one (no
> hanging nodes allowed!).
>
> I go through the following steps:
>         (1) extract the submesh set from the original mesh
>         (2) define the boundary of the submesh and add as a constrain Polygon
> in CDT
>         (3) refine the submesh using a sizing field with the reference point
> in the center of the submesh (I don't want to refine in the boundaries to
> avoid hanging nodes!).
>         (4) reintegrate the submesh in the main mesh.
>
> The problem is I am not able to avoid hanging nodes.
> Please refer to the attached picture.
>
> Is there an algorithm to ensure only the center of the submesh will be
> refined, avoiding _completely_ the creation of hanging nodes on the
> boundaries?
>
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/delaunay_trriangulation.png>
>
> Thanks for the help,
> Renato
>
>
>
> --
> 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: Triangulate without hanging nodes on boundary

Renato Poli
Hi Sebastien,

I worked the past days on simplifying my problem and trying to understand
what is going on.
I made a very raw code (below) as an example.

Please find attached three pictures:
(1) the mesh without refinement
<http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh1.png>

(2) the refined mesh after
/ typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
     CGAL::refine_Delaunay_mesh_2(cdt,seeds.begin(), seeds.end(),
Criteria(0, 100));/
<http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh2.png>

(3) the seed location (the extra point when compared to mesh1)
<http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh3.png>

I dont understand
     (i) why the refiner changes the mesh beyond the shape and size
criteria? ; and
     (ii) why the mesh refiner changes the area with a seed?

Is there any way to avoid those points and get more 'control' on the
meshing?

Thanks upfront,
Renato


==== Raw code for mesh creation
 40   typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
 41   typedef K::Point_2 CPoint;
 42   typedef CGAL::Polygon_2<K> CPolygon;
...
 44   typedef CGAL::Triangulation_vertex_base_2<K> Vb;
 45   typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo2,K>    Fbb;
 46   typedef CGAL::Delaunay_mesh_face_base_2<K,Fbb> Fbbb;
 47   typedef CGAL::Constrained_triangulation_face_base_2<K,Fbbb>        Fb;
 48   typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
 49   typedef CGAL::Exact_predicates_tag                              
Itag;
 50   typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds, Itag> CDT;
...
 56   typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
...
 83   CPolygon pgn;
 84   pgn.push_back( CPoint(5.88643, 2.60851));
 85   pgn.push_back( CPoint(5.81283, 2.89567));
 86   pgn.push_back( CPoint(5.625, 3.125));
 87   pgn.push_back( CPoint(5.58073, 3.40017));
 88   pgn.push_back( CPoint(5.53646, 3.67535));
 89   pgn.push_back( CPoint(5.18695, 3.80367));
 90   pgn.push_back( CPoint(4.82072, 4.10386));
 91   pgn.push_back( CPoint(4.78469, 3.81578));
 92   pgn.push_back( CPoint(4.53348, 4.14603));
 93   pgn.push_back( CPoint(4.375, 3.75));
 94   pgn.push_back( CPoint(3.98473, 3.96918));
 95   pgn.push_back( CPoint(3.96882, 3.53733));
 96   pgn.push_back( CPoint(3.76489, 3.76106));
 97   pgn.push_back( CPoint(3.60312, 3.3071));
 98   pgn.push_back( CPoint(3.38327, 3.09255));
 99   pgn.push_back( CPoint(3.64059, 2.897));
100   pgn.push_back( CPoint(3.23544, 2.82327));
101   pgn.push_back( CPoint(3.43546, 2.57049));
102   pgn.push_back( CPoint(3.47702, 2.25083));
103   pgn.push_back( CPoint(3.69296, 1.91734));
104   pgn.push_back( CPoint(3.93944, 1.62403));
105   pgn.push_back( CPoint(4.26672, 1.81009));
106   pgn.push_back( CPoint(4.21836, 1.51922));
107   pgn.push_back( CPoint(4.51268, 1.50128));
108   pgn.push_back( CPoint(4.81592, 1.47285));
109   pgn.push_back( CPoint(5.08929, 1.60714));
110   pgn.push_back( CPoint(5.46234, 1.783));
111   pgn.push_back( CPoint(5.44254, 2.08688));
112   pgn.push_back( CPoint(5.69193, 2.26163));
113
114   CPolygon ext_pgn;
115   ext_pgn.push_back( CPoint(1, 0) );
116   ext_pgn.push_back( CPoint(8, 0) );
117   ext_pgn.push_back( CPoint(8, 6) );
118   ext_pgn.push_back( CPoint(1, 6) );
119
120   std::list<CPoint> seeds;
121   seeds.push_back( CPoint(2.68962, 2.55613) );
122
123   CDT cdt;
124   cdt.insert_constraint(pgn.vertices_begin(), pgn.vertices_end(), true
);
125   cdt.insert_constraint(ext_pgn.vertices_begin(),
ext_pgn.vertices_end(), true );
126
127 //  CGAL::refine_Delaunay_mesh_2(cdt,seeds.begin(), seeds.end(),
Criteria(0, 100));




--
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: Triangulate without hanging nodes on boundary

Laurent Rineau (CGAL/GeometryFactory)
On Tuesday, September 10, 2019 8:39:37 PM CEST Renato Poli wrote:

> Hi Sebastien,
>
> I worked the past days on simplifying my problem and trying to understand
> what is going on.
> I made a very raw code (below) as an example.
>
> Please find attached three pictures:
> (1) the mesh without refinement
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh1.png>
>
> (2) the refined mesh after
> / typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
>      CGAL::refine_Delaunay_mesh_2(cdt,seeds.begin(), seeds.end(),
> Criteria(0, 100));/
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh2.png>
>
> (3) the seed location (the extra point when compared to mesh1)
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh3.png>
>
> I dont understand
>      (i) why the refiner changes the mesh beyond the shape and size
> criteria? ; and

Hi Renato,

Even without any mesh criteria on faces, the algorithm starts by inserting
points on constrained edges to ensures that all sub-edges have the Gabriel
property (empty circumscribed circle).

>      (ii) why the mesh refiner changes the area with a seed?
>
> Is there any way to avoid those points and get more 'control' on the
> meshing?

The seeds control insertion of points inside the regions, and not on the
border of it.

There is an undocumented header file in CGAL:

  <CGAL/Delaunay_mesher_no_edge_refinement_2.h>

It has a function `refine_Delaunay_mesh_2_without_edge_refinement` that you
could use to mesh the region without touching at all at the constrained edges.
That might suit your needs.


Best regards,

Laurent

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




--
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: Triangulate without hanging nodes on boundary

Renato Poli
Hi Laurent,

Thanks, it is exactly what I needed and it is working fine.

(But)
In the next step of my project, I need to refine freely "some" of the constrained edges, but not others.
Can you see a way to select which constrained edges to _lock_ the refinement?
Perhaps some tweaks in "refine_Delaunay_mesh_2_without_edge_refinement"?

rgds,
Renato



Em qua, 11 de set de 2019 às 03:35, Laurent Rineau (CGAL/GeometryFactory) <[hidden email]> escreveu:
On Tuesday, September 10, 2019 8:39:37 PM CEST Renato Poli wrote:
> Hi Sebastien,
>
> I worked the past days on simplifying my problem and trying to understand
> what is going on.
> I made a very raw code (below) as an example.
>
> Please find attached three pictures:
> (1) the mesh without refinement
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh1.png>
>
> (2) the refined mesh after
> / typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
>      CGAL::refine_Delaunay_mesh_2(cdt,seeds.begin(), seeds.end(),
> Criteria(0, 100));/
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh2.png>
>
> (3) the seed location (the extra point when compared to mesh1)
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh3.png>
>
> I dont understand
>      (i) why the refiner changes the mesh beyond the shape and size
> criteria? ; and

Hi Renato,

Even without any mesh criteria on faces, the algorithm starts by inserting
points on constrained edges to ensures that all sub-edges have the Gabriel
property (empty circumscribed circle).

>      (ii) why the mesh refiner changes the area with a seed?
>
> Is there any way to avoid those points and get more 'control' on the
> meshing?

The seeds control insertion of points inside the regions, and not on the
border of it.

There is an undocumented header file in CGAL:

  <CGAL/Delaunay_mesher_no_edge_refinement_2.h>

It has a function `refine_Delaunay_mesh_2_without_edge_refinement` that you
could use to mesh the region without touching at all at the constrained edges.
That might suit your needs.


Best regards,

Laurent

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




--
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: Triangulate without hanging nodes on boundary

Renato Poli
Hi Laurent,

I am still struggling on this one. 

Is it possible to avoid edge splitting of _some_ constrained edges only?

Thanks
Renato

Em sex, 20 de set de 2019 16:23, Renato Espírito Basso Poli <[hidden email]> escreveu:
Hi Laurent,

Thanks, it is exactly what I needed and it is working fine.

(But)
In the next step of my project, I need to refine freely "some" of the constrained edges, but not others.
Can you see a way to select which constrained edges to _lock_ the refinement?
Perhaps some tweaks in "refine_Delaunay_mesh_2_without_edge_refinement"?

rgds,
Renato



Em qua, 11 de set de 2019 às 03:35, Laurent Rineau (CGAL/GeometryFactory) <[hidden email]> escreveu:
On Tuesday, September 10, 2019 8:39:37 PM CEST Renato Poli wrote:
> Hi Sebastien,
>
> I worked the past days on simplifying my problem and trying to understand
> what is going on.
> I made a very raw code (below) as an example.
>
> Please find attached three pictures:
> (1) the mesh without refinement
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh1.png>
>
> (2) the refined mesh after
> / typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
>      CGAL::refine_Delaunay_mesh_2(cdt,seeds.begin(), seeds.end(),
> Criteria(0, 100));/
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh2.png>
>
> (3) the seed location (the extra point when compared to mesh1)
> <http://cgal-discuss.949826.n4.nabble.com/file/t376144/cgal-mesh3.png>
>
> I dont understand
>      (i) why the refiner changes the mesh beyond the shape and size
> criteria? ; and

Hi Renato,

Even without any mesh criteria on faces, the algorithm starts by inserting
points on constrained edges to ensures that all sub-edges have the Gabriel
property (empty circumscribed circle).

>      (ii) why the mesh refiner changes the area with a seed?
>
> Is there any way to avoid those points and get more 'control' on the
> meshing?

The seeds control insertion of points inside the regions, and not on the
border of it.

There is an undocumented header file in CGAL:

  <CGAL/Delaunay_mesher_no_edge_refinement_2.h>

It has a function `refine_Delaunay_mesh_2_without_edge_refinement` that you
could use to mesh the region without touching at all at the constrained edges.
That might suit your needs.


Best regards,

Laurent

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




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