Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh()
- Date: Tue, 8 Sep 2020 06:51:36 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:ARCzJxRWApEb22Zc/pobpFYn3tpsv+yvbD5Q0YIujvd0So/mwa67ZRyHt8tkgFKBZ4jH8fUM07OQ7/m+HzVavd3R6TgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrrAjdrNQajZVtJ6o+yRbFv2ZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+27Ql8JwkblboAq/qBNj347aboaVNP9kcaPce9MRWG5NU8lVWiBEBI63cokBAPcbPetAsofzuVUOoxu9CweiCuzgxT1HiWP506Ahz+QsEhvL0BA8E98AsnnZqsj+OqcIUeCyyanF1TvPYe5I1jjm8ofIaQwhofCSUrJ2bMHfz04vFxnEjlWXtYzuIjeZ2OUTvGic6upvS/6vi3Qnqg9xuDeg2tssio7ThoMVz1zI+zhyzYEuJd28T057e9+kEJxMty2AMot2RtgvQ25tuCkgy70GvYS3czQNyJQi3hPSbeGMfIeU7Bz5TumRPSt4i2x/eLK5nxu/7Ueux+7hW8So0ltHoCpIn9jIu30Q1hHe5MmKR/p580mh1juC1R7f5+BEL001lafXNYItz74+m5YOsEnOES77lUPrh6GYcUUk//Kn6+XhYrj+upCcOJV7igXkPqQpgMy/Dvw0MgcJX2ic9uS80KPs8VflT7VNi/06iqjZsJbAJcQavKG1GQFV0pwl5h2iDDmmyMwVkWcbIF9BYh6KjIjkN0vQLPzmEPuzmVShnTlzy/zYJLLtHojBI33dn7v9Z7lw7lBQxBYuwd1a6Z9bEK8NLO72V0Pvt9HVDQM2Pgm7zun9Etpw0oYTVX+BD6KaKqzftFGI6+AtLuSOYoIepSzzJOI/5/H0iH80gV8dcret3ZsQcH24G+5pI0SdYXb1jNYBC3oGshMwTOHqhlCOSzFTZ3G1X6Iz4jE0FpiqApvERoComLCB3SG7EYNKZm1eFFyADXPle5+HVvoMci6ePNFtniEeWbWhRYItzRSuuxX7y7pjIOrU4CoYtZf72dhu4+3Tkgsy9T1zD8SByW2NSmV0k3gHRz8zxq9/oEh9xk2f3qh/hvxUDcZT6O9RUgcmKZ7cyPR3BMz9Wg3beteFUUupQtS9AT4tU9Ix2MQObl1mG9SiixDDxzClD6UUl7yNHpw087jT02L/J8ZnmD770rI8hQwmXtdXLj/hwbVu8hDaQY/PiUSQ0aiwMr8N2TbEs2aFw23Jt05RVEt8UL7OQGsENXbQtsnz2k7SU+quFag/KVkGjtWTL7NDLNzvl1RPAvn5f8/PZnq43Ga2CxHPzbyFaM/men4WwT7GW3QDxgsc9HLDOQklDTq6uErfCiZvHBTheRDC6+57/TmAQ0U91B2LYksp872v+xkJzbyzRvQW064eqQkooClzBkf8lZqCEN6HvQtmYONZZfsy5V5G0STSsAkrbc/oFLxrmlNLK1c/hEjpzRgiVtQZwJoa6UgyxQ83Epq2lVZIdjeWx5f1Y+SFJWz7/RTpYKnTiAiHjISmv5wX4fF9kG3N+RmzHxN7oXpi2thRlXCb48eSVVdAYdfKSk8ysiNCifTaby06vd6G0HRtNeyrqGaH1Y9yQuQizRmkcpFUN6bWTAI=
I opened your file in the demo and did not see any issue.
The issue you mentioned that is detected by the code indicates that you
have isolated vertices (i.e. vertices with no edge/face attached).
If you have such an error for a mesh that is the output of the CGAL
advancing front algorithm, then this is a bug. If this is the case,
could you please try to come up with an example and a point cloud
showing the issue so that we can reproduce it and fix it?
In the meantime you can also try the function remove_isolated_vertices()
https://doc.cgal.org/latest/Polygon_mesh_processing/group__PMP__repairing__grp.html#ga91c02ef57e638faf2622eae93e7a25e2
Thanks,
Sebastien.
On 9/7/20 6:54 PM, Yaoyu Hu ( via cgal-discuss Mailing List) wrote:
Hi Sebastien,
Thank you for your reply. I tried to use CGAL::is_valid_polygon_mesh(), it indeed returns false. However, I do not know how to visualize the content in the CGAL::Verbose_ostream, then I manually stepped into the source code. I found that the check fails inside is_valid_halfedge_graph() which is defined in cgal/BGL/include/CGAL/boost/graph/helpers.h . The actual place that triggers the failure is the following code section
========== Code section begins. ==========
for(vertex_descriptor vbegin : vertices(g))
{
// Pointer integrity.
if(halfedge(vbegin, g) != boost::graph_traits<Graph>::null_halfedge())
valid = (target(halfedge(vbegin, g), g) == vbegin);
else
valid = false;
if(!valid)
{
verr << "vertex " << v << " halfedge incident to vertex is the null halfedge." << std::endl;
verr << "Halfedge Graph Structure is NOT VALID." << std::endl;
return false;
}
.....other codes..........
}
========== Code section ends. ==========
The v value is 12718 for this particular mesh. (mesh link: https://drive.google.com/file/d/1Z9AMfRnbkJGmDuUOc7ZAdMAvbhhhx_Vn/view?usp=sharing )
The input mesh, as I provided in the previous email and as the above link, is a resulting mesh from the advancing front surface reconstruction of CGAL (I wrote another separate piece of code to do that). The reconstructed mesh was saved to the file system with CGAL::write_ply() function. This mesh can be processed by the Polyhedron Demo program which performs isotropic remeshing without any warnings or errors.
What should I do to make the mesh a valid polygon mesh? Is there a way to fix this situation? I tried to remove the self-intersection facets by first using CGAL::Polygon_mesh_processing::self_intersections() and then CGAL::Euler::remove_face(). Additionally, I tried CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices(). No intersections and no non-manifold vertices are found. But the mesh is still not valid.
I may try to look into the vertex 12718 ( if using 0-based indexing, it is 12717 I suppose ) and try to figure out what makes this vertex so special.
Hoping to get more insights into the problem from your help.
Regards,
Yaoyu
On Mon, Sep 7, 2020 at 12:50 AM "Sebastien Loriot (GeometryFactory)" < <>> wrote:
Could you check the value returned by
CGAL::is_valid_polygon_mesh(my_mesh) called on your mesh before calling
the CGAL function? It might be that the input is not a valid polygon
mesh (non-manifold vertices for example).
Thanks,
Sebastien.
On 9/6/20 6:47 AM, Yaoyu Hu (
<> via cgal-discuss
Mailing List) wrote:
> Hi,
>
> I was trying to
use CGAL::Polygon_mesh_processing::isotropic_remeshing()
> to remesh a CGAL::Surface_mesh. However, I got the following
error message:
>
> ========== Error message begins. ==========
>
> terminate called after throwing an instance of
'CGAL::Assertion_exception'
> what(): CGAL ERROR: assertion violation!
> Expr: is_valid_polygon_mesh(mesh_)
> File:
>
/home/yaoyu/Libraries/cgal/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h
> Line: 1037
>
> ========== Error message ends. ==========
>
> I was trying the code listed at
>
https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2isotropic_remeshing_example_8cpp-example.html
> and I enclosed the source file. I am not sure about the reason
why CGAL
> thinks the Surface_mesh is not a valid polygon mesh.
>
> The input mesh is in PLY format and you could find the file at
>
https://drive.google.com/file/d/1Z9AMfRnbkJGmDuUOc7ZAdMAvbhhhx_Vn/view?usp=sharing
>
> One thing that might be interesting is that if I use the CGAL
Polyhedron
> Demo program to load and do the isotropic remeshing, no errors are
> encountered.
>
> Any comments are appreciated.
>
> Thank you!
>
> Yaoyu
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/06/2020
- [cgal-discuss] Fwd: Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/06/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Sebastien Loriot (GeometryFactory), 09/07/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/07/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Sebastien Loriot (GeometryFactory), 09/08/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/08/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Andreas Fabri, 09/09/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/09/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Andreas Fabri, 09/09/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/08/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Sebastien Loriot (GeometryFactory), 09/08/2020
- Re: [cgal-discuss] Isotropic remeshing failed with is_valid_polygon_mesh(), Yaoyu Hu, 09/07/2020
Archive powered by MHonArc 2.6.19+.