Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL::Polygon_mesh_processing::clip returns self itersecting mesh

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL::Polygon_mesh_processing::clip returns self itersecting mesh


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL::Polygon_mesh_processing::clip returns self itersecting mesh
  • Date: Fri, 24 Jan 2020 10:43:07 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:Nk9BmBKMd5Ixi88QrdmcpTZWNBhigK39O0sv0rFitYgfLvzxwZ3uMQTl6Ol3ixeRBMOHsq4C0bad6/+oGTRZp8rY6zZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJ6KevvB4Hdkdm82fys9J3PeQVIgye2ba9vIBmsogjdq8YbjZF8Jqs+xRfFvnlFcPlSyW90OF6fhRnx6tq+8ZJ57yhcp/ct/NNcXKvneKg1UaZWByk8PWAv483ruxjDTQ+R6XYZT24bjBlGDRXb4R/jRpv+vTf0ueR72CmBIM35Vqs0Vii476dqUxDnliEKPCMk/W7Ni8xwiKVboA+9pxF63oXZbp2ZOOZ4c6jAe94RWGhPUdtLVyFZH42ycYUPAeoCM+hWoYbyqFkBogexCwS3GOPiyCVFimPq0aA00eksFxzN0gw6H9IJtXTZtNv5OroMXu+u1qbI1inDb/JI1jf79YPGdBchoeuNXbJ3bcra1E0jGQLbgVWXrIzqIS+V1v4Nsmab9eVvSf6vi2k9qwBxpzSjyNonh47ShoIRzVDE7yR5wIEpJdGiTU57ZcWpEJRVty6ANot2RtkuTH1vuCY/07ALv4OwciYNyJQi3RHfavqHfpCO4h35T+meOjN4i2x/dL2jgBay9E6twfD/WMmsyFtGsDZJn93Wun0O1xHf8NaLRuVg8ku71juC2Rjf5v9eLkwoiKbWLoAuzqIqmZcWr0jPAjL6lUD5gaOIaEoo5u2l6+rnb7r8upORMoB5hwD6P6syn8GyAOA1PwkAX2We++m82qDs8EL/Tb5XlPM5iLPZv4rfJckDpq62HQtV0oE75ha6FTim0dAYkWAJLVJfZR6LlobpNl7ALfziAve/hFOskDhvx//YJLHuHpLNLn3bnLfge7Zy9VJcxRItwdxD459YELIMLfLpVkPvqtDUEwU1PgO6zur/DdVyzIIeWWaBAq+DN6PStEeF5vkrI+mLfo8VuTH9K+Q/6/7riX80glAdfayz0psWbHC0BOhpI0KcYXb0mNcODX8KvhYiTOztkFCNTTFTaGy2X64l+z47CZmmApveRoC2m7yMxzy7H51TZmBeEF+AC3bod4OeW/cNci2eOMFhkiZXHYSmHoQu3BXruA7hwKd8NcLV/DcZvNTtzotb/erWwFsJ+DZ9FNic3mfFa2Zun2QUD38Z0ad6rFBn23mK2rR/me0ZX5QH/PdOSAY9KdjZy8R1DtnzXkTKedLfGwXuecmvHTxkFoF5+NQJeUsoQ4z/3CCG5DKjBvour5LOBJEw9fiBjX34JsI41Gyfkad91B8pRcxAMWDgjal6pVCKVtz51n6BnqPvTpwymSvE9WON122L5RgKXwt5UKGDVncaNBKP8YbJo3jaRrrrMowJdxNbwJfbeKRPY9zty15BQaW7NQ==

As of today, there is no guarantee that the output of the algorithm will be free from self-intersection. The algorithm returns a mesh with a
valid graph topology but since points are rounded from an exact
rational representation to a floating point one, it might happen
that some self-intersections are created during the rounding.

The first thing to do it to make sure that if you write the mesh,
you use the highest precision (to avoid another rounding) using
std::setprecision(17) in your stream.

An option to increase the precision of the rounding is to use
an exact vertex point map, and call CGAL::exact() on each
vertex point before doing the rounding (it will increase
the precision but you are still left without guarantees).

We are currently working to avoid the rounding issue but nothing
is ready to be distributed for now.

Sebastien.

On 1/23/20 5:10 PM, slidertom wrote:
Hello,
I use
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Surface_mesh<K::Point_3> Surface_mesh;
from file:
mesh1.off <http://cgal-discuss.949826.n4.nabble.com/file/t376129/mesh1.off>
mesh1.off is clipped with plane:
K::Point_3 plane_pt(0., 2., 0.);
K::Vector_3 plane_norm(-0.09, 0.09, 0.);
CGAL::Plane_3<K> plane(plane_pt, plane_norm);
CGAL::Polygon_mesh_processing::clip(mesh, plane,
CGAL::Polygon_mesh_processing::parameters::clip_volume(true).use_compact_clipper(true));
result is:
mesh2.off <http://cgal-discuss.949826.n4.nabble.com/file/t376129/mesh2.off>
and
CGAL::Polygon_mesh_processing::does_self_intersect(mesh);
-> returns true.

I can not understand, why do I get self intersecting mesh.
If mesh2.off is exported to the polygon soup and converted back into the
Surface_mesh -> does_self_intersect returns false in this case -> situation
is fixed.

Expectation: Polygon_mesh_processing::clip should returned closed, non-self
intersecting surface.

Maybe I'm doing something wrong?

Tomas



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/




Archive powered by MHonArc 2.6.18.

Top of Page