clean a polyhedron

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

clean a polyhedron

antoineL
Hi,

After some boolean operations, a triangulated polyhedron may have small triangles. 

I'd like to know if there is an easy way to clean it, by merging closed vertex by exemple ?

Thanks,
Antoine

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

Re: clean a polyhedron

Sebastien Loriot (GeometryFactory)
You can either directly isotropically remesh the modified region like in
this example:
https://doc.cgal.org/latest/Polygon_mesh_processing/#title21

or you can use the non-documented function:
remove_almost_degenerate_faces() defined in
CGAL/Polygon_mesh_processing/repair_degeneracies.h

also on the set of selected faces.

The first option is better is you want to keep the shape of the
intersection polyline but is not really atomic. The second option
is atomic but it would require a first pass on the intersection edges
if you want to preserve the intersection curve shape.

Best,

Sebastien.


On 8/18/20 1:06 PM, Antoine Lavenant wrote:

> Hi,
>
> After some boolean operations, a triangulated polyhedron may have small
> triangles.
>
> I'd like to know if there is an easy way to clean it, by merging closed
> vertex by exemple ?
>
> Thanks,
> Antoine
>
> --
> 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


Reply | Threaded
Open this post in threaded view
|

RE: clean a polyhedron

antoineL
Thanks for answer me.

I'm using the remove_almost_degenerate_faces() function.

First of all, i needed to add a few times CGAL::to_double( ... ) in CGAL code in order to compile my code. Maybe because i'm using an exact kernel ?

I'm moving the cap_threshold and collapse_length_threshold parameters. And the number of almost degenerate triangles decreases. that's great ! Thanks for that.

When i move the needle_threshold from 1., the global shape of my polyhedron changes too much. Is it normal ? For now, i will not use it.

Thanks again,
Antoine

Antoine LAVENANT
IGN / SD
+33 1 43 98 80 00 - Poste : 76 69
E-mail : [hidden email]

________________________________________
De : [hidden email] [[hidden email]] de la part de "Sebastien Loriot (GeometryFactory)" [[hidden email]]
Envoyé : mardi 18 août 2020 18:10
À : [hidden email]
Objet : Re: [cgal-discuss] clean a polyhedron

You can either directly isotropically remesh the modified region like in
this example:
https://doc.cgal.org/latest/Polygon_mesh_processing/#title21

or you can use the non-documented function:
remove_almost_degenerate_faces() defined in
CGAL/Polygon_mesh_processing/repair_degeneracies.h

also on the set of selected faces.

The first option is better is you want to keep the shape of the
intersection polyline but is not really atomic. The second option
is atomic but it would require a first pass on the intersection edges
if you want to preserve the intersection curve shape.

Best,

Sebastien.


On 8/18/20 1:06 PM, Antoine Lavenant wrote:

> Hi,
>
> After some boolean operations, a triangulated polyhedron may have small
> triangles.
>
> I'd like to know if there is an easy way to clean it, by merging closed
> vertex by exemple ?
>
> Thanks,
> Antoine
>
> --
> 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


Reply | Threaded
Open this post in threaded view
|

Re: clean a polyhedron

Sebastien Loriot (GeometryFactory)


On 8/20/20 8:53 AM, Antoine Lavenant wrote:
> Thanks for answer me.
>
> I'm using the remove_almost_degenerate_faces() function.
>
> First of all, i needed to add a few times CGAL::to_double( ... ) in CGAL code in order to compile my code. Maybe because i'm using an exact kernel ?
>
Indeed, I guess this non-documented function was not tested with an
exact kernel. Feel free to open a PR to submit your patch.

> I'm moving the cap_threshold and collapse_length_threshold parameters. And the number of almost degenerate triangles decreases. that's great ! Thanks for that.
>
> When i move the needle_threshold from 1., the global shape of my polyhedron changes too much. Is it normal ? For now, i will not use it.
>

the threshold is a bound on the largest angle in the triangle, expressed
as a cosinus. If you lower too must the bounds, many triangles will be
detected as to be removed.

Best,

Sebastien.


> Thanks again,
> Antoine
>
> Antoine LAVENANT
> IGN / SD
> +33 1 43 98 80 00 - Poste : 76 69
> E-mail : [hidden email]
>
> ________________________________________
> De : [hidden email] [[hidden email]] de la part de "Sebastien Loriot (GeometryFactory)" [[hidden email]]
> Envoyé : mardi 18 août 2020 18:10
> À : [hidden email]
> Objet : Re: [cgal-discuss] clean a polyhedron
>
> You can either directly isotropically remesh the modified region like in
> this example:
> https://doc.cgal.org/latest/Polygon_mesh_processing/#title21
>
> or you can use the non-documented function:
> remove_almost_degenerate_faces() defined in
> CGAL/Polygon_mesh_processing/repair_degeneracies.h
>
> also on the set of selected faces.
>
> The first option is better is you want to keep the shape of the
> intersection polyline but is not really atomic. The second option
> is atomic but it would require a first pass on the intersection edges
> if you want to preserve the intersection curve shape.
>
> Best,
>
> Sebastien.
>
>
> On 8/18/20 1:06 PM, Antoine Lavenant wrote:
>> Hi,
>>
>> After some boolean operations, a triangulated polyhedron may have small
>> triangles.
>>
>> I'd like to know if there is an easy way to clean it, by merging closed
>> vertex by exemple ?
>>
>> Thanks,
>> Antoine
>>
>> --
>> 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


Reply | Threaded
Open this post in threaded view
|

RE: clean a polyhedron

antoineL
Hello,

I don't think I can add a PR.

I had an issue : https://github.com/CGAL/cgal/issues/4952. Hope it will help.

Antoine

________________________________________
De : [hidden email] [[hidden email]] de la part de "Sebastien Loriot (GeometryFactory)" [[hidden email]]
Envoyé : lundi 24 août 2020 08:50
À : [hidden email]
Objet : Re: [cgal-discuss] clean a polyhedron

On 8/20/20 8:53 AM, Antoine Lavenant wrote:
> Thanks for answer me.
>
> I'm using the remove_almost_degenerate_faces() function.
>
> First of all, i needed to add a few times CGAL::to_double( ... ) in CGAL code in order to compile my code. Maybe because i'm using an exact kernel ?
>
Indeed, I guess this non-documented function was not tested with an
exact kernel. Feel free to open a PR to submit your patch.

> I'm moving the cap_threshold and collapse_length_threshold parameters. And the number of almost degenerate triangles decreases. that's great ! Thanks for that.
>
> When i move the needle_threshold from 1., the global shape of my polyhedron changes too much. Is it normal ? For now, i will not use it.
>

the threshold is a bound on the largest angle in the triangle, expressed
as a cosinus. If you lower too must the bounds, many triangles will be
detected as to be removed.

Best,

Sebastien.


> Thanks again,
> Antoine
>
> Antoine LAVENANT
> IGN / SD
> +33 1 43 98 80 00 - Poste : 76 69
> E-mail : [hidden email]
>
> ________________________________________
> De : [hidden email] [[hidden email]] de la part de "Sebastien Loriot (GeometryFactory)" [[hidden email]]
> Envoyé : mardi 18 août 2020 18:10
> À : [hidden email]
> Objet : Re: [cgal-discuss] clean a polyhedron
>
> You can either directly isotropically remesh the modified region like in
> this example:
> https://doc.cgal.org/latest/Polygon_mesh_processing/#title21
>
> or you can use the non-documented function:
> remove_almost_degenerate_faces() defined in
> CGAL/Polygon_mesh_processing/repair_degeneracies.h
>
> also on the set of selected faces.
>
> The first option is better is you want to keep the shape of the
> intersection polyline but is not really atomic. The second option
> is atomic but it would require a first pass on the intersection edges
> if you want to preserve the intersection curve shape.
>
> Best,
>
> Sebastien.
>
>
> On 8/18/20 1:06 PM, Antoine Lavenant wrote:
>> Hi,
>>
>> After some boolean operations, a triangulated polyhedron may have small
>> triangles.
>>
>> I'd like to know if there is an easy way to clean it, by merging closed
>> vertex by exemple ?
>>
>> Thanks,
>> Antoine
>>
>> --
>> 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



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