Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Delaunay Triangulation - number of edges

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Delaunay Triangulation - number of edges


Chronological Thread 
  • From: Monique Teillaud <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Delaunay Triangulation - number of edges
  • Date: Sun, 02 Nov 2008 16:23:51 +0100

I had already sent you some related advice on this list a few weeks ago.

Did you have a look? I attach that message here.

If you had followed my advice, since your points are _almost_ coplanar, you would have got a terrain that looks _almost_ like a 2d triangulation. And you would not have got tetrahedra, which you consider as 'wrong'.


Monique Teillaud wrote:
Dennis Endt wrote:
Hi,

this a quite ok Triangulation:

this looks like a 2d triagulation, it looks ok, but 2d.

In the other case I have overlapping edges and triangles.

Your input points don't look coplanar, do they? you just get 3d tetraedra, which is what you must get when you compute a 3d triangulation.
3d is ok, for a Delaunay_triangulation_3.

That`s a big problem.

This is the other fassade on the back side of the building.

Why is the result so different and how can I avoid this behaviour?

If you want a 2d triangulation, then take coplanar points a input, and compute a Delaunay_triangulation_2 in that plane.

Manuel Caroli schrieb:
Hi Dennis,

I don't actually understand what is wrong about that. The triangulation in your picture looks quite ok to me.
Also e.g. in your finite_edge_iterator loop you only get finite edges, so if your triangulation contains only 4 points it is a tetrahedron which consists of 6 edges.

best

Manuel



Dennis Endt wrote:
Here is a Screenshot of that waht CGAL returns.

And here are the points to that fassade:
2585709.716 5703009.266 3.0
2585710.5465 5703008.192 8.0
2585711.377 5703007.118 3.0
2585711.377 5703007.118 0.0
2585709.716 5703009.266 0.0

That not the only case where CGAL returns a wrong number of edges or facets.

What have I to do to get a clean triangulation?

Best,
Dennis

Dennis Endt schrieb:
Hi,

I`ve a problem with the 3D Delaunay Triangulation. I want to triangulate
buildings with multiple fassades. Ech fassade contains of a certain
number of vertices.

That`s my code:
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Filtered_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>

typedef CGAL::Simple_cartesian<double> SK;
typedef CGAL::Filtered_kernel<SK> FK;
struct K : public FK {};
typedef K::Point_3 Point_3;
typedef K::Triangle_3 Triangle_3;
typedef CGAL::Delaunay_triangulation_3<K> Triangulation;

.
.
.

Triangulation T..... // the Triangulation object of my current fassade

for(Triangulation::Finite_edges_iterator ie = T.finite_edges_begin(); ie
!= T.finite_edges_end(); ie++)
{
// The problem is, that the number of infinite_edges is too high.
For example the number of vertices is 5, he gives me 9 edges or 4 and he
gives me 6 edges.
}

Why does he gives me so a large number of edges? I would expect 7 or 5
so far. What can I do, about to get a clean and good triangulation of
each of my fassades?

Best,
Dennis


------------------------------------------------------------------------





--- Begin Message ---
  • From: Monique Teillaud <>
  • To:
  • Subject: Re: [cgal-discuss] Facets_iterator
  • Date: Thu, 09 Oct 2008 13:44:55 +0200
  • List-archive: <http://lists-sop.inria.fr/sympa/arc/cgal-discuss>
  • List-id: <cgal-discuss.lists-sop.inria.fr>
Hi,

I don't know what your question is about precisely: facet_iterators? z-coordinates? other?
I am afraid we are not going to solve here the specific questions raised by your buildings...

As you can see from the manual, the 3d triangulation computes 3d tetrahedra.

You should have a look at the 2D triangulation chapter in the manual, and maybe use CGAL::Triangulation_euclidean_traits_xy_3<K> for your z-question, and even CGAL::Triangulation_euclidean_traits_xz_3<K> and CGAL::Triangulation_euclidean_traits_yz_3<K> for the vertical walls.

best
Monique Teillaud

Dennis Endt wrote:
Hi,

I have to reply on this, because I didnt find a solution for this yet.

First I cannot use 2D Triangulation because I have Points with the same
x,y- but different z-Coordinates.

So I looked in the manual but I really don`t know what to use instead.

How can I triangulate my Points without to loose the structure of my
buildings? Can anyone give me an advice plz?

Best
Dennis

M. Hazegh schrieb:
Did you bother looking at the manual?
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Mesh_2/Chapter_main.html

On Sat, Oct 4, 2008 at 6:13 PM, Dennis Endt
<>
wrote:
Thanks for you help, I foudn a solution with

Triangulation T;

for(Triangulation::Finite_facets_iterator it = T.finite_facets_begin();
it != T.finite_facets_end(); it++)
{
T.triangle(*it).vertex(i)
}

Bu another Question. I integrated CGAL into my Project about to
triangulate faces of different buildings.

So I tried to use the 3D Delaunay Triangulation, but now I`ve the
problem, that he also triangulates *in* my Object and not only the surfaces.

For example I´ve an 3D Rectangle, what I have to do, to triangulate only
the surfaces, so that I will have two triangles for each side and no
triangles in my object?

I tried also to adding the faces step by step about to triangulate them
afterwards but it didn`t helped:

Triangulation T;

for(map<vector<QString>,QString>::iterator fListIter=fList.begin();
fListIter != fList.end(); fListIter++)
{
vector<Triangulation::Point> triFacePoints;
vector<QString> fPoints = fListIter->first;
for(vector<QString>::iterator fPointsIter = fPoints.begin();
fPointsIter != fPoints.end(); fPointsIter++)
{
map<QString,Triangulation::Point> ::iterator iter =
pList.find(*fPointsIter);
if(iter != pList.end())
{
triFacePoints.push_back(iter->second);
}
}
T.insert(triFacePoints.begin(),triFacePoints.end());
}

This is very important to me. I hope someone could help me.

Greets...

M. Hazegh schrieb:
Your code will iterate through all faces of the triangulation. since
"it" is pointing to the current face, then
CGAL::to_double(it->vertex(i).x())
will return the x coordinate of the i'th vertex. For a triangle i = 0, 1, 2

If you want to iterate through all vertices of the triangulation, you
can use a Vertex_iterator. See the manual for more info.

On Sat, Oct 4, 2008 at 2:41 PM, Dennis Endt
<>
wrote:

Can anyone plz tell me how to read the the points of a facet?

I tried to use this:

for(Triangulation::Finite_facets_iterator it = T.finite_facets_begin();
it != T.finite_facets_end(); it++)
{
}

But I didn`t find anything then to read the points with their coordinates.

And what is the difference between finite and not finite faces/edges ...?

I`m very thankful for every helpful information.



--
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



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

--- End Message ---



Archive powered by MHonArc 2.6.16.

Top of Page