Subject: CGAL users discussion list
List archive
- From: Manuel Caroli <>
- To:
- Subject: Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3.
- Date: Wed, 05 Aug 2009 15:11:58 +0200
Hi Juliano,
Juliano Costa wrote:
Hello Manuel,[...]
The *interior* of the (smallest) sphere passing through the two vertices of the diagonal of a cube (or cuboid) does not contain any other vertices of the cube (or cuboid). This is a degenerate case though. The CGAL::Triangulation_3 partitions the convex hull of the point set into tetrahedra even in degenerate cases. So the result you get is fine.
Well, I ignored this issue and proceed with my intend so I used the DelaunayTriangleHierarchy::Finite_facets_iterator like this:I don't actually get what you mean by "surface" in the code below. Are you talking about the convex hull?
//On inserting points I'm setting the Vertex_hanlde->info with an "unsigned long" value as index. //I need to get the triangles points indexes:Yes the surface mesher creates its own points so it does not seem adapted to your problem.
CPUInt64_t _indexA,_indexB,_indexC;
CPUInt64_t* _iPointsIndexes[3];
_iPointsIndexes[0] = &_indexA;
_iPointsIndexes[1] = &_indexB;
_iPointsIndexes[2] = &_indexC;
//having DelaunayTriangleHierarchy _delaunayTrianguleHierarchy;
DelaunayTriangleHierarchy::Finite_facets_iterator _fit = _delaunayTriangule.finite_facets_begin(); while(_fit != _delaunayTriangule.finite_facets_end())
{
//typedef CGAL::Delaunay_triangulation_3<K,Tds> DelaunayTriangle;
DelaunayTriangle::Facet _facet = *_fIt;
unsigned long _facetIndex = _facet.second;
//typedef DelaunayTriangle::Cell_handle CGALCellHandle;
CGALCellHandle facetCell = _facet.first;
char _isInfiniteCell = _delaunayTriangule->is_infinite(_facetCell);
//neighbor cell
CGALCellHandle neigborCell = _cell->neighbor(_facetIndex );
char _isInfiniteNeigbor = _delaunayTriangule.is_infinite(neigborCell);
if( (!_isInfiniteCell) && (!isInfiniteNeigbor) )
{
//I only want the surface right?!?!!
continue;
} char _iTriVrr=0;
for(char _iPointsLoop=0;_iPointsLoop<4;_iPointsLoop++)
{
if( _iPointsLoop != _facetIndex )
{
*_iPointsIndexes[_iTriVrr++] = (unsigned long)(_fIt->first->vertex(_iPointsLoop)->info());
}
}
//Here I got _indexA,_indexB,_indexC which I'm saving on the OBJ file.
_fit++;
} With this code, when I provide an ordinary box or even a sphere the result is just wonderful.
But when I try this with a small points cloud (10000 3d points of a tunnel for example) the result is a mess.
I got triangles coming from a side to the another and from the top to the ground.
I want just the surface.
I used this tunnel points cloud as example, but my intention is to use the same algorith providing points cloud of any
3d object or place (e.g.: an office room).
Now I was about to try to integrate the my current source code with the CGAL "alpha shape" example...
But you've come with a different "light": "use a surface mesher". But a surface mesher wouldn't interpolate "new created points"?
So, to make this "surface mesher" what I've be doing so far is useless?You might want to have a look at the new Surface reconstruction package: http://www.cgal.org/Manual/beta/doc_html/cgal_manual/Surface_reconstruction_points_3/Chapter_main.html
On the CGAL examples for surface mesher (like examples/Surface_mesher/mesh_an_implicit_function.cpp)
<http://www.cgal.org/Manual/3.3/examples/Surface_mesher/mesh_an_implicit_function.cpp>the input points comes from a generator surface function // defining the surface
// Surface_3 <http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Surface_mesher_ref/Concept_Surface_3.html#Cross_link_anchor_1083> surface
Can I insert points of an unknown shape?
Note that this is only a beta release. The final release will be available by mid September.
best
Manuel
I really appreciate your help!
Thanks once again!
Juliano Costa
Brazil.
2009/8/5 Manuel Caroli < <mailto:>>
Hi Juliano,
the Triangulation_3 package computes a triangulation of R^3 with the
input points as vertices. If you want to compute a triangular mesh
approximating a surface you should use a surface mesher. Maybe you
could be more specific about your problem.
best
Manuel
- [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/01/2009
- [cgal-discuss] Re: Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/02/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Mariette Yvinec, 08/03/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/03/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/07/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/10/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Manuel Caroli, 08/05/2009
- Re: [cgal-discuss] Newbie question about CGAL Hierarchy Triangulation 3., Juliano Costa, 08/03/2009
Archive powered by MHonArc 2.6.16.