Subject: CGAL users discussion list
List archive
- From: Mael Rouxel-Labbé <>
- To:
- Subject: Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces
- Date: Wed, 15 Jul 2020 11:57:34 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:WFYfSByszJm0bezXCy+O+j09IxM/srCxBDY+r6Qd0ukSKfad9pjvdHbS+e9qxAeQG9mCtbQf0aGM6OjJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhTexe71/IAu5oQnPuMQdnJdvJLs2xhbVuHVDZv5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnMURGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1iikIKiQ5/XnKhMJugqJVoBGvqRJxzIHbYo6aKOFzcbnBcd4AX2dNQshcWi5HD4ihb4UPFe0BPeNAoof6vVQBsx++ChGwCuPo1z9JiWH53akj3+onCw7JxxcvGMgTu3nTqdX6LrkdUeSvwKnSyjXDcvxX1in56ITSdhAuu+qDUqlufsfKxkkgCQTFjlCOpoz5JTOU1uoNvHKH4Op8UuKvkW4mpxttrTiow8chk4/EjZ8axV7Y7yt22po1JcGmR05hZ96pCIVduz2aOYZ0XM4vTXxltDskxrAFpJO2fTYHxZA7yhLCafGKcoaG7xDtWeqNPDp1mHxoday8ihqs8kWs1/HwW82y3V1XoCRFldzMuWoM1xzV8sWHS/19/l2g2TmVzQzT5PtELEYpnqTYM54s2rE9m5sJvUjeAiP7mF/6ga+Ye0k+5+Sl5frrbq37qpOAM4J4kB/yPrkylsClDuk1PRICUmiD9eigzrHv4Vf1TKlQgvEqlKTSrY7XJcAGpq6iHw9azJwj5Qu+DzanztsVhWULIVRYcxydlYfpIUvBIPXgAPe/nVu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Wn1+8qnbAAOYDcZS2RliFrwO5m6htsGW1K5KQMukUn96A==
In addition to what Maxime said :
You should use Euler::remove_face() and not Surface_mesh::remove_face() because the former function will take care of removing elements that should not exist anymore (edges whose two incident faces have been removed, vertices whose star has been removed, ...).
Once that is done, your problem is indeed the presence of non manifold vertices, which violates a precondition of smooth_mesh(). You can remove non-manifold vertices using Polygon_mesh_processing::duplicate_non_manifold_vertices(), and your code will then run fine.
Best,
Mael
On 15/07/2020 10:17, Maxime Gimeno
( via cgal-discuss Mailing List) wrote:
Hello,
From what I see, removing faces creates some non-manifold
vertices. It usually means that Polygon Mesh Processing
algorithms won't work.
For some reason I could not repair the mesh after the faces
removal, but replacing your function with
`experimental::remove_self_intersections()` worked fine.
Le mar. 14 juil. 2020 à 03:36,
Yaoyu Hu <> a
écrit :
Hi Everyone,
I am new to CGAL and I am running into an issue when I
am trying to smooth a surface mesh which I just performed
a face removal.
The surface mesh is loaded from a file as a
CGAL::Surface_mesh object. The original mesh has some
defects such as small dangling faces and self-intersected
faces. I decided to deal with the self-interactions first.
I collected all the self-intersections by
using CGAL::Polygon_mesh_processing::self_intersections()
function. And I insert the face descriptors into an
std::set. Then I loop over all the face descriptors saved
in the std::set and do a remove_face(). After that, a call
to collect_garbage() is issued on the Surface_mesh
object.
So far so good. However, when I try to continue
performing other operations on the Surface_mesh object, I
get an exception from CGAL. The operation I'd like to do
is a smoothing
by CGAL::Polygon_mesh_processing::smooth_mesh(). The
exception I got is as follows:
=== Terminal output begins. ===
terminate called after throwing an instance of
'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: _idx < data_.size()
what(): CGAL ERROR: assertion violation!
Expr: _idx < data_.size()
File:
/path/to/cgal/Surface_mesh/include/CGAL/Surface_mesh/Properties.h
Line: 195
=== Terminal output ends. ===
I am using Ubuntu 18.04 and CGAL 5.0.2 cloned from the
Github repo.
You could find the sample code and the original mesh as
the attachments.
My questions are
(1) What is the correct procedure to remove faces from
a Surface_mesh object and make the downstream process
works correctly? I also tried Euler operations but got no
luck. There will be the same exception.
(2) In the original mesh, there are som small faces
dangling around the top and bottom borders. How can I
robustly remove those dangling faces? I tried to use face
area to do thresholding on all the faces. It sort of works
but later I still get the above exceptions in the
smoothing section.
Regards and 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
- [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Yaoyu Hu, 07/14/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Maxime Gimeno, 07/15/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Mael Rouxel-Labbé, 07/15/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Yaoyu Hu, 07/15/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Mael Rouxel-Labbé, 07/16/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Yaoyu Hu, 07/15/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Mael Rouxel-Labbé, 07/15/2020
- Re: [cgal-discuss] Surface mesh cannot be smoothed after removing faces, Maxime Gimeno, 07/15/2020
Archive powered by MHonArc 2.6.19+.