Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] minkowski_sum_3 segfault
- Date: Wed, 30 Sep 2020 08:41:44 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:Dy9siBy8ryhzS9nXCy+O+j09IxM/srCxBDY+r6Qd0usTLfad9pjvdHbS+e9qxAeQG9mCtLQf06GP6/CocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmTiwbal8IRmqogndq9UajIh/Iast1xXFpWdFdf5Lzm1yP1KTmBj85sa0/JF99ilbpuws+c1dX6jkZqo0VbNXAigoPGAz/83rqALMTRCT6XsGU2UZiQRHDg7Y5xznRJjxsy/6tu1g2CmGOMD9UL45VSi+46ptVRTljjoMOTwk/2HNksF+kbxVoByhqRJ8zYDbbo6aO/hica3SZt4aWWlMU9xNWyBdDI6xb40CBPcBM+ZCqIn9okMDoRWjCwayH+zg0CRIhmP33aIk1eQqDAfI3As6H9IPt3TUsMj+OKMTX++ry6nIyCvMb+9M2Tb96IbHaAwuoe2LXbJqccvdzEcjHB7Cg1WLrYzlOCmV1uUKs2iH9eZgUOavhnUoqwF0uDevx8MshpPViYISz1DJ7CN0y5s6KtOkUkB0e8KkEIdOuCGAMYt7Wt0vTmNntSonxbMLpJ+2ciYWxZg7xBPSdf+Kf5SK7x//VeucPCl0iWx4dL+wmhu//0utx+78WMWp3lhHryhInNnKu3sQ2RLT7c2HReF8/kenwTuP2AHT6v1EIUApjqXXMYIuwrk1lpYLrUvDETX5mEHsgK+RbEUk9fCk6+fmYrX6vJOTKZJ7ihzmPqQvnMy/G+U4PRIUU2iV4+Sx0qDo807hQLhSkPE6jq3UvIrZKMkbvKK1HhFZ34U55xuwDTqqyMoUkmMbIF5YfR+IkZTlNEvLLfzmEfuznlGhnTlxyPzYIrHsB4vBI3vAnbj9eLtw5FRTxxA3wN1a+p5ZBLIML+j2V0//ttHVDB00PgqpyOj9Etp9zJkRWWeXD6+ZLqzStViI6/oqI+aWZY8VvC/xKvYg5/LzlHM5l1AQcKuz0ZsYb3C4GftmI0GHbnb2ntgBFmIKshI/TOzsllKCTSZea2iuU684/D02C4KrAZ3eSoyzg7GNxii2E59OamBDEF+MEHPod4ueW/cLbSKfOtRhkjgDVbi7So8h0g2uuBX/y7pjNefU9SgYuoji1Nhx/eHciRYy9TlsA8SHz26NV310nn8PRzIuwK9/rlZyylOa3adlgvxYDsBc5+5SUgchLpPc1Ox7C9XqWg3bZNuJSVCmQs+nAT4rVN4xzcUOMA5AHc6/hEXDwzayGO1S0KeaAYQ9tKPaxXn4YchnjG3X0bEoyFggTMwIPmKvgutz9hPYGpXSwHifjLugSakMwHvN6Hub1jjJ+1pJVRZ5F6TDR3EWIEXM6s/o41vLCL6oB7NgOQRIzYuOK7BBd8by3mlBEfzsMdCbb2OqkHqrHj6JwKmNZczkYTYzxiLYXQI/ngoa5mqHOA52IiC7omXCRHxBGFXqbl/24Md3o2+8VF51hUnedElmzbuy5lgQgdSTTvoS2vQPvyJ3+GY8J0q0w9+DU4nInAFmZqgJOYpssmcC7nrQsklGBrLlKqljglAEdAEu5hHh0hx2DsNLls149Sp2njo3ErqR1RZ6Tx3dxYr5Y+SFJWz7/RTpYKnTiAmHjYSmv5wX4fF9kG3N+QGkEk14ridi2thRlmSZv9DEUFVUXpX2XUI6sRN9ouOCbw==
Note that depending on the CGAL version you are using, you might need
to manually call tree.accelerate_distance_queries() before doing any
distance queries (since CGAL 5.1 it should be ON by default).
If it is too slow, you will indeed need something approximating the inflated volume (if it makes sense you can use mesh_3 to generate it
like it is done in the demo here:
https://github.com/CGAL/cgal/blob/master/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Offset_meshing_plugin.cpp)
Sebastien.
On 9/29/20 5:29 PM, "Grimm, Raphael (IAR)" ( via cgal-discuss Mailing List) wrote:
Hi,
Thanks for the idea, but the problem with a distance query is:
* it is slow (since it extract more information, than the binary label I
need for my application)
* after the query, I do not know whether the point is inside or outside of
the mesh (so I need to perform the inside check anyways)
To check how much slower a distance query is, I wrote some test code (it is
attached).
If I run it with mesh (21965 vertices, 43926 faces, roughly a cube), then
the tree version takes much longer (x200+ times) than the check whether the
point is inside of the mesh.
This test has to be very fast, since I have a lot of query points.
Hence I need some way to inflate my mesh.
Maybe you or someone else has another idea.
Best regards,
Raphael.
-----Original Message-----
From: <> On
Behalf Of "Sebastien Loriot (GeometryFactory)"
Sent: Wednesday, 23 September, 2020 18:36
To:
Subject: Re: [cgal-discuss] minkowski_sum_3 segfault
Did you try the AABB-tree and the closest_point() method?
https://doc.cgal.org/latest/AABB_tree/#title6
Best regards,
Sebastien.
On 9/23/20 4:17 PM, "Grimm, Raphael (IAR)" ( via
cgal-discuss Mailing List) wrote:
Hello,minkowski_sum_3.
I have a non-convex mesh and want to check whether a point is within a
certain distance of it. Since distance queries are slow, I decided to
inflate the mesh and check whether the point is inside.
Scaling does not work, since my mesh is concave.
I did some looking around and came across minkowski_sum_3. I am
planning to use a sphere to inflate my original mesh by using
I wrote some simple test for minkowski_sum_3 that adds a tetrahedron
to a cube (code is attached).
This test crashes with a segfault. Here is the stack trace:
1 CGAL::SNC_FM_decorator<CGAL::SNC_structure<CGAL::Epick,
CGAL::SNC_indexed_items,
bool>>::determine_facet
stl_vector.h 805 0x55555559244a
2 CGAL::SNC_FM_decorator<CGAL::SNC_structure<CGAL::Epick,
CGAL::SNC_indexed_items,
bool>>::create_facet_objects
In_place_list.h 84 0x5555555a0dea
3 CGAL::SNC_external_structure<CGAL::SNC_indexed_items,
CGAL::SNC_structure<CGAL::Epick, CGAL::SNC_indexed_items,
bool>>::categorize_facet_cycles_and_create_facets
stl_list.h 953 0x5555555a16d7
4 CGAL::SNC_external_structure<CGAL::SNC_indexed_items,
CGAL::SNC_structure<CGAL::Epick, CGAL::SNC_indexed_items,
bool>>::build_external_structure
In_place_list.h 310 0x5555555c3417
5 CGAL::Nef_polyhedron_3<CGAL::Epick, CGAL::SNC_indexed_items,
bool>::build_external_structure
SNC_const_decorator.h 125 0x5555555f6188
6 CGAL::Nef_polyhedron_3<CGAL::Epick, CGAL::SNC_indexed_items,
bool>::delegate
Nef_polyhedron_3.h 1071 0x5555555f6188In_place_list.h
7
CGAL::bipartite_nary_union_sorted_combined<CGAL::Nef_polyhedron_3<CGAL
::Epick,
CGAL::SNC_indexed_items,
bool>>
bipartite_nary_union_sorted_combined.h 214 0x5555555f6188
8 CGAL::minkowski_sum_3<CGAL::Nef_polyhedron_3<CGAL::Epick,
CGAL::SNC_indexed_items, bool>>
309 0x5555555f7384
9
main
minkowski_sum_3.cpp 81 0x55555555d8df
10
__libc_start_main
libc-start.c 310 0x7ffff69ccb97
11 _start
I have two questions:
1.Is there a better (more efficient) way to do this?
2.If not, how can I fix the segfault / what am I doing wrong?
I appreciate any hints.
Best
Raphael
----
Karlsruhe Institute of Technology (KIT)
Institute for Anthropomatics and Robotics (IAR)
High Performance Humanoid Technologies (H2T)
Raphael Grimm (M.Sc.)
Research Scientist
Adenauerring 2
Building 50.20, Room 334
76131 Karlsruhe, Germany
Phone: +49 721 608-47133
Fax: +49 721 608-48270
Email:
Web: https://www.humanoids.kit.edu
KIT - The Research University in the Helmholtz Association
--
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] minkowski_sum_3 segfault, Grimm, Raphael (IAR), 09/23/2020
- Re: [cgal-discuss] minkowski_sum_3 segfault, Sebastien Loriot (GeometryFactory), 09/23/2020
- RE: [cgal-discuss] minkowski_sum_3 segfault, Grimm, Raphael (IAR), 09/29/2020
- Re: [cgal-discuss] minkowski_sum_3 segfault, Sebastien Loriot (GeometryFactory), 09/30/2020
- RE: [cgal-discuss] minkowski_sum_3 segfault, Grimm, Raphael (IAR), 09/29/2020
- Re: [cgal-discuss] minkowski_sum_3 segfault, Sebastien Loriot (GeometryFactory), 09/23/2020
Archive powered by MHonArc 2.6.19+.