Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Delaunay triangulation by contour

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Delaunay triangulation by contour


Chronological Thread 
  • From: Aurélien .... <>
  • To:
  • Subject: Re: [cgal-discuss] Delaunay triangulation by contour
  • Date: Thu, 29 Jul 2010 22:07:17 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=EuV0nxb6+v4v2al4Zl04zpjskdy3xvoti/HDmmGBvkR8bB3UZI5+8Yhhs5kKo8EviM rPb6DXe2zvdgs8OdayJb62MN68A8AM+km4cUBy1/HUfKI2PjP/8p3qe8TgeE5d7lu+t3 W6n7eXm7CpcOxE0zMa/iEJaVFybRdeFB263bU=

Ok I got it !

I don't know how because I tryed thousands of things, but it's done !

Thank you very much !

Aurélien

On Thu, Jul 29, 2010 at 1:52 PM, Manuel Caroli <> wrote:
Hi Aurélien,

I'm sorry I think I misread your first mail. It seems you aren't using Delaunay_Mesher_2 at all, are you?
The constrained Delaunay triangulation returns a triangulation of the convex hull of a set of points. Anyway, the constraints are not required to form a closed polygon, so the idea of an inside and an outside are not very clear at this stage. See also
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_2/Chapter_main.html#Section_35.8

You could use Delaunay_mesher_2, but this will refine the triangulation until it is Delaunay. If you don't want to refine the triangulation you have to find out manually which triangle is inside or outside of the polygon. You can see an algorithm doing this implemented in the demo Triangulation_2/Constrained_Delaunay_triangulation_2.
The basic idea is to start with one face inside the polygon and explore all its neighbors without crossing constraints.

hope this helps

Manuel



On 29/07/10 13:23, Manuel Caroli wrote:
Dear Aurélien,

Please send at least the part of the code you are talking about. In the
part you sent below there are only the typedefs and how you put the
constraints. I cannot guess how you are computing the mesh...

Manuel


On 29/07/10 11:23, Aurélien .... wrote:
Hello Manuel,

I tried with the is_in_domain() function, but it returns always false..

What does it mean ?

Thank you very much,

Aurélien

On Thu, Jul 29, 2010 at 10:41 AM, Manuel Caroli
< <mailto:>>
wrote:

Dear Aurélien,

I don't know the 2D mesher very well but there seems to be a member
function is_in_domain() for the faces:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Mesh_2_ref/Concept_DelaunayMeshFaceBase_2.html


If you use this function to filter your output you should get what
you want.

Hope this helps

Manuel



On 28/07/10 21:59, Aurélien .... wrote:

Hello everyone,

I have a polygon defined by a contour which is define by its points.

I tried to make a thing like a L :
__
| |
| |
| |___
|______|

But after drawing the faces, I have something like that
__
| \
| \
| \
|_____|

My code (approximative) :
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_2<K> Vbase;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned int,
K,Vbase> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds> CDT;
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher;
typedef CDT::Vertex_handle Vertex_handle;
typedef CDT::Point Point;
typedef CDT::Face_iterator Face_iterator;
typedef CDT::Vertex_iterator Vertex_iterator;

CDT cdt;
cdt.insert_constraint(Point(100, 100), Point(100, 200));
cdt.insert_constraint(Point(100, 200), Point(150, 200));
cdt.insert_constraint(Point(150, 200), Point(150, 150));
cdt.insert_constraint(Point(150, 150), Point(200, 150));
cdt.insert_constraint(Point(200, 150), Point(200, 100));
cdt.insert_constraint(Point(200, 100), Point(100, 100));

In fact, it's drawing all faces I need but also the face which
make the
geometry wrong. The only difference I saw is that the "wrong
face" was
in clockwise and others in counter clockwise...

Is there is a way to archieve what I want to make ?

Thank you very much,

Aurélien



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






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





Archive powered by MHonArc 2.6.16.

Top of Page