Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file
Chronological Thread
- From: sindhu r <>
- To:
- Subject: Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file
- Date: Tue, 1 Sep 2020 17:16:13 -0400
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:RHZWuRNIy82KGuIQrt0l6mtUPXoX/o7sNwtQ0KIMzox0K/z/pcbcNUDSrc9gkEXOFd2Cra4d1ayP6fyrCTVIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfLJ/IA+roQnPucQajohvJrsswRbVv3VEfPhby3l1LlyJhRb84cmw/J9n8ytOvv8q6tBNX6bncakmVLJUFDspPXw7683trhnDUBCA5mAAXWUMkxpHGBbK4RfnVZrsqCT6t+592C6HPc3qSL0/RDqv47t3RBLulSwKMSMy/mPKhcxqlK9UrxyhqB5/zYDaY4+bKeRwcb/GcNMfWWZMRNxcWzBdDo6+aYYEEuoPPfxfr4n4v1YOthq+BQ+xC+Pv1z9Dm2X21rA93uQ6EAHG2hYsEM4Uv3TOqNX6KrsSUeezzKTTwjXDaulZ2Tb56ITSbh8hpvSMUKt2fMHMxkYhCxnLgU+MqYz5ITyVzOINvnCF4uZ+SO+jlWAppgB+rzWuxsoglpXFip4Ux13G8Sh3zps5KMC4RkNnYNOpH5hduiCVOoZrQs0vQWBltSU4x7MGv5OwYSYEyJMixxHFavyHdZCF4h3iVOaNITd4mWlqdKijiBa19Eis0uPxW8u03VpQqSpFnNfMumgM1xzV8MiHS+Fy8l2v2TaV0Q3Y9+JKIVgsmKbFN5IsxqQ8m5kTvEjZAyP7mUT7gLWXe0gk/OWj9v7pba/8ppCGMo95kgH+Pboqmsy4Gek4NxIBX2mf+eil1b3j+lD1TKxEjvA3kqTVqp/aJcMcpq62Bw9azJwv5Aq4DzejyNgYnH8HI0xZeB+fkYTlJ1XDLOr7APq/mVigjTZmyvHcMrDgApjBNn3Dn63gfbZ55U5c0g0zzdVH6pJPC7EBJuj/VVPru9zCCh82LRC0w+HhCNhm2YMeXHiAAq6dMK/IrVCI4ecvL/GWZIAJoDb9N+Ql5/n2gHAlll8SZ62p0YIKZ3C5BfRpP1iZYWH3gtoaCmcLvg8+TPTwh1GYUD5TYWyyX6Mm6T0hBoKmF9SLe4a2nbbU3DunBoYEISddG1WUGDHpcZ+FUrECcmWJM8p5m3sFU7amDIQu3BXruA7hwKd8Nbnp/DYFv7L/0dwg5/HPjQpgsntvHsGF2ieMSXt1lyUGXXgtzaVnqAt8zFmElqN3ivgdGd1I7O5SSVQHM4XBxdB3G8ynWh7dZszbDxG9U9C+CHcwSMgwypkAeQFmCtC6h1fC2SStRLQanrjOCJ0v+b/HxCvNIJN2xH/CkaUglFI7WdBnNGu8h6c5+RKAKZTOlhCClqCmdblUxmaZ72aFi2GHpkVVTAl2earAVHEbIEDRqIKqtQv5U7ayBOF/YUN6wsmYJ/4SM4y7vRB9XP7mfe/mTSe0kma0CwyPw+rVPoXvcmQZmi7aDRpdyl1BzTO9LQE7QxyZjSfeAThpTw+9Zkrt9ax/ryr+QBFpiQ6NaEJl2vy+/RtH3aXAGcNW5aoNvWIakxsxBEy0houEBN+Jpg4nd6JZM4sw
Hi Maxime,
Thank you for your reply and my apologies, I attached the wrong .off file.
I do have faces in my .off file (this time correctly attached!); this .off file was generated using the points and normals from a .xyz file (also attached). The xyz file represents points that span the x-y plane 0 <= (x,y) <= 6, and 0 <= rand(z) <= 0.2. It does not have any holes or islands; it looks like a blanket. My final test case will involve holes and/or islands, but for the moment even this simple example shows something strange about the .off file that I generate using the Poisson reconstruction method.
While the .xyz file contains points respecting the 0 <= (x,y) <= 6, and 0 <= rand(z) <= 0.2 condition, my .off file seems (lines 7, 9, 12 etc..) to have vertices with x,y,z locations that are way off my points specified in the .xyz file. I think I'm using the Poisson reconstruction incorrectly (minimal working code attached).
Thank you for your time!
Regards,
Sindhu R
On Tue, Sep 1, 2020 at 2:41 AM Maxime Gimeno <> wrote:
Could you provide the poisson reconstructed version of your custom file ? I suspect problems due to small islands and different components.Le mar. 1 sept. 2020 à 08:25, Maxime Gimeno <> a écrit :Hi,Your custom .off file does not contain any face. That must be what's wrong.Regards,Maxime GimenoLe lun. 31 août 2020 à 22:33, sindhu r <> a écrit :Hello,I'm very new to the vastness of CGAL and have a question about the Surface Mesh Shortest Path (SMSP) package. I am also new to a discussion forum, so please let me know if I'm not following any convention on posting questions/code etc.What I want to do: Using an .off file of the desired shape, find the shortest path on the shape. I provide the coordinates of the source and target locations and use the "locate" function to determine the face locations (face descriptor and barycentric coordinates). These are then fed to the "shortest_path_points_to_source_points" function. The final output path is written to a file.What I have done: All of the above (minimal working code is provided here). I have tested my code with success on .off files from the web (elephant.off at https://github.com/CGAL/cgal/blob/master/Mesh_3/examples/Mesh_3/data/elephant.off, kitten_poisson-20-30-0.375.off (attached)). But I'm unable to get it to work on my custom .off file (generated using Polyhedron and Poisson reconstruction, also attached). The following error is what I get with my custom .off file:terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: _idx < data_.size()
File: /home/sin/lib/libigl/external/cgal/install/include/CGAL/Surface_mesh/Properties.h
Line: 195I don't understand what the difference is between my .off file and the ones that are used as part of examples. Any help is dearly appreciated!Regards,Sindhu R
--
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
Attachment:
cgal_custom_poisson_points_with_normals.off
Description: Binary data
Attachment:
cgal_custom_points_with_normals.xyz
Description: Binary data
#include <stdio.h> #include <iostream> #include <utility> // defines std::pair #include <vector> #include <fstream> #include <CGAL/Polyhedron_3.h> #include <CGAL/poisson_surface_reconstruction.h> #include <CGAL/IO/read_xyz_points.h> typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; typedef std::pair<Point, Vector> Pwn; typedef CGAL::Polyhedron_3<Kernel> Polyhedron; int main() { const char* xyz_normal_filename = "/home/sin/cpp_eclipsew/CGAL_test_1/data/cgal_custom_points_with_normals.xyz"; Polyhedron output_mesh; std::vector<Pwn> obstacle_free_room_points_normals; std::ifstream stream(xyz_normal_filename); if (!stream || !CGAL::read_xyz_points( stream, std::back_inserter(obstacle_free_room_points_normals), CGAL::parameters::point_map(CGAL::First_of_pair_property_map<Pwn>()). normal_map(CGAL::Second_of_pair_property_map<Pwn>()))) { std::cerr << "Error: cannot read file " << xyz_normal_filename << std::endl; } const char* poisson_fname = "/home/sin/cpp_eclipsew/CGAL_test_1/data/test_cgal_custom_poisson_points_with_normals.off"; double average_spacing = CGAL::compute_average_spacing<CGAL::Sequential_tag> (obstacle_free_room_points_normals, 6, CGAL::parameters::point_map(CGAL::First_of_pair_property_map<Pwn>())); if (CGAL::poisson_surface_reconstruction_delaunay (obstacle_free_room_points_normals.begin(), obstacle_free_room_points_normals.end(), CGAL::First_of_pair_property_map<Pwn>(), CGAL::Second_of_pair_property_map<Pwn>(), output_mesh, average_spacing)) { std::ofstream out(poisson_fname); out << output_mesh; } else std::cout << "Failure :( \n"; std::cout << "Success \n"; return 1; }
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, Maxime Gimeno, 09/01/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, Maxime Gimeno, 09/01/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, sindhu r, 09/01/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, Maxime Gimeno, 09/02/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, sindhu r, 09/05/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, Maxime Gimeno, 09/02/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, sindhu r, 09/01/2020
- Re: [cgal-discuss] Surface Mesh Shortest Path: Assertion error with custom .off file, Maxime Gimeno, 09/01/2020
Archive powered by MHonArc 2.6.19+.