Error in: faces_around_face() with CGAL::Surface_Mesh

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

Error in: faces_around_face() with CGAL::Surface_Mesh

hossan.nazmul
Hello Everyone,

I am getting an error in CGAL::faces_around_face. for example, I have five points(p0,p1,p2,p3,p4)I have four faces (f0,f1,f2,f3). I used CGAL::Surface_Mesh to store these vertices and faces.  (See the attached example code). I can query on the Surface_Mesh. for example, vertices_around_faces, vertices_around_vertex.
Here is my code: main.cpp
Problem:
1. Now I would like to find the adjacent faces(?) (faces around face) of a specific face but I get some wired faces. If I try to see the vertices_around_face() that the program throws an error? (CGAL Error: Assertion Violation!).  did I miss something? or it's a CGAL error? (if you run my example code you will see it)
2. How to calculate the intersection of three faces?

Thanks in advance!

Best,
Nazmul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in: faces_around_face() with CGAL::Surface_Mesh

Sebastien Loriot (GeometryFactory)
The iterator also goes over border halfedges so you might get some
invalid faces for those. You can filter them using is_border(f,mesh).

Sebastien.

On 06/01/2017 08:37 PM, hossan.nazmul wrote:

> Hello Everyone,
>
> I am getting an error in CGAL::faces_around_face. for example, I have five
> points(p0,p1,p2,p3,p4)I have four faces (f0,f1,f2,f3). I used
> CGAL::Surface_Mesh to store these vertices and faces.  (See the attached
> example code). I can query on the Surface_Mesh. for example,
> vertices_around_faces, vertices_around_vertex.
> Here is my code:  main.cpp
> <http://cgal-discuss.949826.n4.nabble.com/file/n4662744/main.cpp>
> Problem:
> 1. Now I would like to find the adjacent faces(?) (faces around face) of a
> specific face but I get some wired faces. If I try to see the
> vertices_around_face() that the program throws an error? (CGAL Error:
> Assertion Violation!).  did I miss something? or it's a CGAL error? (if you
> run my example code you will see it)
> 2. How to calculate the intersection of three faces?
>
> Thanks in advance!
>
> Best,
> Nazmul
>
>
>
> --
> View this message in context: http://cgal-discuss.949826.n4.nabble.com/Error-in-faces-around-face-with-CGAL-Surface-Mesh-tp4662744.html
> Sent from the cgal-discuss mailing list archive at 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
|  
Report Content as Inappropriate

Re: Error in: faces_around_face() with CGAL::Surface_Mesh

hossan.nazmul
Hello Sebastien,

I couldn't find the way to filter faces_around_faces using is_border(f,mesh) function? Could you please give an example? Thanks in Advance!

Nazmul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in: faces_around_face() with CGAL::Surface_Mesh

Sebastien Loriot (GeometryFactory)
On 06/06/2017 12:56 PM, hossan.nazmul wrote:
> Hello Sebastien,
>
> I couldn't find the way to filter faces_around_faces using is_border(f,mesh)
> function? Could you please give an example? Thanks in Advance!
>
> Nazmul
>
>

Graph g;
typedef boost::graph_traits<Graph>::face_descriptor face_descriptor;
face_descriptor f = ...

BOOST_FOREACH(face_descriptor faf, faces_around_face(f,g))
{
   if ( faf == boost::graph_traits<Graph>::null_face())
     continue;
   /// process faf
}

>
> --
> View this message in context: http://cgal-discuss.949826.n4.nabble.com/Error-in-faces-around-face-with-CGAL-Surface-Mesh-tp4662744p4662746.html
> Sent from the cgal-discuss mailing list archive at 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
|  
Report Content as Inappropriate

Re: Error in: faces_around_face() with CGAL::Surface_Mesh

hossan.nazmul
Hello Sebastien,

Thanks for your help. It worked for me. As I am new to CGAL and have no extensive knowledge in C++, I don't understand a lot of concept.

I am now trying to find the intersection of three or more faces. I couldn't find any function in Surface_Mesh to do so. Could you please help me to find the way to compute the intersection of three or more faces. Is it possible to do with Surface_Mesh?

Thanks,
Nazmul

NOTE: I would like to find the point of intersection (corner point) where three or more faces meet. (an example if possible) [please see my program: main.txt]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in: faces_around_face() with CGAL::Surface_Mesh

Sebastien Loriot (GeometryFactory)
See this example:
http://doc.cgal.org/latest/AABB_tree/AABB_tree_2AABB_face_graph_triangle_example_8cpp-example.html

You can replace Polyhedron_3 by Surface_mesh in the example.

Sebastien.

On 06/08/2017 10:59 AM, hossan.nazmul wrote:

> Hello Sebastien,
>
> Thanks for your help. It worked for me. As I am new to CGAL and have no
> extensive knowledge in C++, I don't understand a lot of concept.
>
> I am now trying to find the intersection of three or more faces. I couldn't
> find any function in Surface_Mesh to do so. Could you please help me to find
> the way to compute the intersection of three or more faces. Is it possible
> to do with Surface_Mesh?
>
> Thanks,
> Nazmul
>
> NOTE: I would like to find the point of intersection (corner point) where
> three or more faces meet. (an example if possible) [please see my program:
> main.txt <http://cgal-discuss.949826.n4.nabble.com/file/n4662753/main.txt>
> ]
>
>
>
> --
> View this message in context: http://cgal-discuss.949826.n4.nabble.com/Error-in-faces-around-face-with-CGAL-Surface-Mesh-tp4662744p4662753.html
> Sent from the cgal-discuss mailing list archive at 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


Loading...